Verify that ## x\equiv a^{p-2}b\pmod {p} ## is a solution

  • Thread starter Math100
  • Start date
In summary: I loved maths, so I had to get good grades. But I still didn't pursue perfection, I just wanted to understand the material and be able to solve the problems. Perfection came as a result of studying and practicing. In summary, the conversation discusses using Fermat's theorem to verify that ## x\equiv a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##, where ## p ## is a prime and ## gcd(a, p)=1 ##. It is shown that this solution is valid by using Fermat's theorem and observing that ## x:= a^{p-2}b\pmod
  • #1
Math100
756
201
Homework Statement
Let ## p ## be a prime and ## gcd(a, p)=1 ##. Use Fermat's theorem to verify that ## x\equiv a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
Relevant Equations
None.
Proof:

Suppose ## gcd(a, p)=1 ## where ## p ## is a prime.
Consider the linear congruence ## ax\equiv b\pmod {p} ##.
By Fermat's theorem, we have that ## a^{p-1}\equiv 1\pmod {p} ##.
Observe that ## a^{p-1}\equiv 1\pmod {p}\implies a^{p-1}b\equiv b\pmod {p}\implies a(a^{p-2}b)\equiv b\pmod {p} ##.
Thus ## ax\equiv b\pmod {p}\implies x\equiv a^{p-2}b\pmod {p} ##.
Therefore, ## x\equiv a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
 
Physics news on Phys.org
  • #2
Math100 said:
Homework Statement:: Let ## p ## be a prime and ## gcd(a, p)=1 ##. Use Fermat's theorem to verify that ## x\equiv a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
Relevant Equations:: None.

Proof:

Suppose ## gcd(a, p)=1 ## where ## p ## is a prime.
Consider the linear congruence ## ax\equiv b\pmod {p} ##.
By Fermat's theorem, we have that ## a^{p-1}\equiv 1\pmod {p} ##.
Observe that ## a^{p-1}\equiv 1\pmod {p}\implies a^{p-1}b\equiv b\pmod {p}\implies a(a^{p-2}b)\equiv b\pmod {p} ##.
Nice and correct so far.
Math100 said:
Thus ## ax\equiv b\pmod {p}\implies x\equiv a^{p-2}b\pmod {p} ##.
This line is a bit confusing. You can simply remove this line.
You haven't solved for ##x##. You have shown what you wrote next:

Math100 said:
Therefore, ## x\equiv a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
##x## set as ##x:=a^{p-2}b## solves the congruence, and this was all that had to be shown.
There are other numbers that solve it as well, namely all ##x\in a^{p-2}b+p\mathbb{Z}.##
 
  • Like
Likes Math100
  • #3
Observe that
\begin{align*}
&ax\equiv b\pmod {p}\implies ax\cdot a^{p-2}\equiv b\cdot a^{p-2}\pmod {p}\\
&\implies a^{p-1}x\equiv a^{p-2}b\pmod {p}.\\
\end{align*}
By Fermat's theorem, we have ## a^{p-1}x\equiv x\pmod {p} ##.
Thus ## x\equiv xa^{p-1}\equiv a^{p-2}b\pmod {p} ##.
 
  • #4
Should I insert that above in my proof and delete what I wrote in my previous proof?
 
  • #5
Math100 said:
Should I insert that above in my proof and delete what I wrote in my previous proof?
Your first proof was perfect, just one line too many. You should remove the line before last. And if you want to be perfect then write:

...
Observe that ## a^{p-1}\equiv 1\pmod {p}\implies a^{p-1}b\equiv b\pmod {p}\implies a(a^{p-2}b)\equiv b\pmod {p} ##.

Therefore, ## x:= a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
 
  • Haha
Likes Math100
  • #6
fresh_42 said:
Your first proof was perfect, just one line too many. You should remove the line before last. And if you want to be perfect then write:

...
Observe that ## a^{p-1}\equiv 1\pmod {p}\implies a^{p-1}b\equiv b\pmod {p}\implies a(a^{p-2}b)\equiv b\pmod {p} ##.

Therefore, ## x:= a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
When you were in college, did you pursue perfection as well?
 
  • #7
Math100 said:
When you were in college, did you pursue perfection as well?
Not really. I was more a student than a studier. That changed after the first exams.
 
  • Wow
Likes Math100

1. What does the notation "x≡a^{p-2}b (mod p)" mean?

The notation "x≡a^{p-2}b (mod p)" means that x is congruent to the product of a^{p-2} and b, modulo p. In other words, when x is divided by p, the remainder will be equal to the remainder when a^{p-2}b is divided by p.

2. How do you verify that x≡a^{p-2}b (mod p) is a solution?

To verify that x≡a^{p-2}b (mod p) is a solution, you can substitute the value of x into the original equation and simplify it using modular arithmetic. If the resulting equation is true, then x≡a^{p-2}b (mod p) is a solution.

3. What is the significance of the exponent p-2 in the equation x≡a^{p-2}b (mod p)?

The exponent p-2 is significant because it is the inverse of p modulo p. This means that when p is a prime number, a^{p-2} will always be congruent to 1 (mod p). This makes it easier to solve equations involving modular arithmetic.

4. Can you provide an example of using x≡a^{p-2}b (mod p) to solve a problem?

Sure, let's say we have the equation 5x≡2 (mod 7). We can rewrite this as x≡2*5^{-1} (mod 7), where 5^{-1} is the inverse of 5 modulo 7. Since 7 is a prime number, we can use Fermat's Little Theorem to find the inverse: 5^{7-2}≡5^{-1} (mod 7). Therefore, 5^{-1}≡5^5 (mod 7). Plugging this into our equation, we get x≡2*5^5 (mod 7). Simplifying, we get x≡2*3125≡625 (mod 7). Therefore, x=625 is a solution to the original equation.

5. How is the equation x≡a^{p-2}b (mod p) used in cryptography?

The equation x≡a^{p-2}b (mod p) is used in cryptography to solve for the private key in the Diffie-Hellman key exchange algorithm. In this algorithm, two parties agree on a public prime number p and a primitive root a modulo p. Each party chooses a secret number b and calculates a^{b} (mod p). They then exchange these values and use the equation x≡a^{p-2}b (mod p) to calculate the same shared secret key. This shared secret key can then be used for secure communication between the two parties.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
8
Views
807
  • Precalculus Mathematics Homework Help
Replies
14
Views
1K
  • Precalculus Mathematics Homework Help
Replies
1
Views
822
  • Precalculus Mathematics Homework Help
Replies
1
Views
1K
  • Precalculus Mathematics Homework Help
Replies
5
Views
984
  • Precalculus Mathematics Homework Help
Replies
14
Views
1K
  • Precalculus Mathematics Homework Help
Replies
2
Views
883
  • Precalculus Mathematics Homework Help
Replies
1
Views
874
  • Precalculus Mathematics Homework Help
Replies
6
Views
709
  • Precalculus Mathematics Homework Help
Replies
1
Views
739
Back
Top