Solving simultaneous congruences

  • Thread starter Quadrat
  • Start date
In summary, to find the integers that satisfy n= 13 (mod 7) and n= 2 (mod 5), we can use the Chinese remainder theorem to reduce the problem to a Diophantine equation. By applying Euclid's algorithm, we can find the solution to this equation and use it to find the possible values of n.
  • #1
Quadrat
62
1

Homework Statement


[/B]
Find all integers ##n## which satisfies ##n\equiv_7 13## and ##n \equiv_5 2##

Homework Equations


-

The Attempt at a Solution


[/B]
I get that ##n\equiv_7 13## is the same thing as ##n\equiv_7 -1## and more generally ##n={-1}+7x##, {##x\cup \mathbb{Z}##} for any multiple of 7.

The other congruence could be written as ##n=2+5y##, {##y\cup \mathbb{Z}##}.

I can input different integers for ##x## and ##y## and by doing that I can see that ##27## solves both congruences. Since ##5## and ##7## is relative prime the solution should be ##n=27+(5*7)## and more generally ##n=27+(5*7)z##, {##z\cup \mathbb{Z}##}.

But I believe this is just a cheap way of finding the solution. How can one go about to make a better solution? It would prolly involve diophantine equations? It feels like I just got lucky this time. Anyone got a tips on how to attack these types of problems in a better way? Thanks
 
Physics news on Phys.org
  • #2
You may want to look into the Chinese remainder theorem.
 
  • Like
Likes Quadrat
  • #3
n= 13 (mod 7) is the same as n= 6 (mod 7) or n= 6+ 7k for some integer k. Similarly, n= 2 (mod 5) is the same as n= 2+ 5i for some integer i. Then 6+ 7k= 2+ 5i which gives 5i- 7k= 4, a Diophantine equation.
 
  • Like
Likes Quadrat
  • #4
HallsofIvy said:
n= 13 (mod 7) is the same as n= 6 (mod 7) or n= 6+ 7k for some integer k. Similarly, n= 2 (mod 5) is the same as n= 2+ 5i for some integer i. Then 6+ 7k= 2+ 5i which gives 5i- 7k= 4, a Diophantine equation.

Oh, of course! So when I use Euclid's algorithm I end up with ##7=1*5+2## and ##5=2*2+1##. How can I make any sense of this in my case? I've seen examples where you do the extended Euclid's algorithm and you get all these terms which you substitute to end up with something that solves the linear relation but I only get two lines with a remainder ##\neq0##.
 
  • #5
Quadrat said:
Oh, of course! So when I use Euclid's algorithm I end up with ##7=1*5+2## and ##5=2*2+1##. How can I make any sense of this in my case? I've seen examples where you do the extended Euclid's algorithm and you get all these terms which you substitute to end up with something that solves the linear relation but I only get two lines with a remainder ##\neq0##.
I would write those as 7- 5= 2 and 5- 2(2)= 1. So 5- 2(7- 5)= 3(5)- 2(7)= 1. Can you finish that? What do you need to do to get "= 4"?
 
  • #6
HallsofIvy said:
I would write those as 7- 5= 2 and 5- 2(2)= 1. So 5- 2(7- 5)= 3(5)- 2(7)= 1. Can you finish that? What do you need to do to get "= 4"?

Thanks HallsofIvy. Right! So I just multiply both sides by 4 (and keep the coefficiants unchanged) and end up with ##12(5)-8(7)=4##. So all the solutions for the variables as you named them ##i## and ##k## would be ##i=12-8*m## and ##k=(-8)+12*m##, {m∪ℤ}, right?

But how do I get from this to finding n via this method?
 
  • #7
The initial problem was to find n such that n= 13 (mod 7)= 6 (mod 7) which is the same as n= 6+ 7k for some k, and n= 2 (mod 5) which is the same as n= 2+ 5i for some integer i. That led to the Diophantine equation 5i- 7k= 4. You are correct that 12(5)- 8(7)= 4 but from that point you have several errors: i= 12 and k= 8 (NOT -8) satisfy the equation, the "-" was already in the equation. Also if we add any multiple of the coefficient, 5 (NOT the solution, 12), to k, k= 8+ 5m, and any multiple of the coefficient, 7, (NOT the solution, 8) to i, i= 12+ 7m will satisfy that equation: 5(12+ 7m)- 7(8+ 5m)= 60+ 35m- 56- 35m= 4 for all m.

The original problem was to find n such that n= 13= 6 (mod 7) and n= 2 (mod 5). The first is the same as saying n= 6+ 7k and the second is the same as n= 2+ 5i for integers k and i. Now that we have found that k= 8+ 5m and i= 12+ 7m, we can find n: if k= 8+ 5m then n= 6+ 7(8+ 5m)= 6+ 56+ 35m= 62+ 35m for any integer, m. If i= 12+ 7m, then n= 2+ 5(12+ 7m)= 2+ 60+ 35m= 62+ 35m for any integer m. Use that to find n in terms of the general integer, m.
 

FAQ: Solving simultaneous congruences

1. What is the definition of simultaneous congruences?

Simultaneous congruences refer to a system of multiple congruence equations that must all be satisfied at the same time in order to find a solution.

2. How do you solve simultaneous congruences?

To solve simultaneous congruences, you can use the Chinese Remainder Theorem or the method of substitution. The Chinese Remainder Theorem involves finding the least common multiple of the moduli and using it to simplify the equations, while the method of substitution involves substituting one equation into another and solving for the variable.

3. Can simultaneous congruences have multiple solutions?

Yes, simultaneous congruences can have multiple solutions. The number of solutions is determined by the number of equations in the system and the moduli used. In some cases, there may be no solutions or an infinite number of solutions.

4. What are some real-life applications of solving simultaneous congruences?

Solving simultaneous congruences is used in cryptography, specifically in the RSA algorithm for secure communication. It is also used in finding patterns in numbers and predicting future values in financial markets.

5. What are some common challenges in solving simultaneous congruences?

Some common challenges in solving simultaneous congruences include finding the correct modulus and determining the number of equations needed to find a unique solution. It can also be challenging to solve for the variables when dealing with large numbers or when the equations are not easily simplified.

Back
Top