Solving a System of Congruences Using Chinese Remainder Theorem

  • Thread starter Hernaner28
  • Start date
  • Tags
    System
In summary, the given system can be solved using the Chinese remainder theorem and the extended Euclidean algorithm. The final solution is equivalent to x ≡ -1 (mod 2520). The number 2520 is the least common multiple of 2, 3, 4, 5, 6, 7, 8, and 9.
  • #1
Hernaner28
263
0

Homework Statement


Solve the following system:

[tex] \displaystyle \left\{ \begin{array}{*{35}{l}}
x\equiv 1\left( \bmod 2 \right) \\
x\equiv 2\left( \bmod 3 \right) \\
x\equiv 3\left( \bmod 4 \right) \\
x\equiv 4\left( \bmod 5 \right) \\
x\equiv 5\left( \bmod 6 \right) \\
x\equiv 6\left( \bmod 7 \right) \\
x\equiv 7\left( \bmod 8 \right) \\
x\equiv 8\left( \bmod 9 \right) \\
\end{array} \right.[/tex]


Homework Equations


Chinese remainder theorem.


The Attempt at a Solution



Well, what I did was to substract the module in each equation, so now I have:

[tex] \displaystyle \left\{ \begin{array}{*{35}{l}}
x\equiv -1\left( \bmod 2 \right) \\
x\equiv -1\left( \bmod 3 \right) \\
x\equiv -1\left( \bmod 4 \right) \\
x\equiv -1\left( \bmod 5 \right) \\
x\equiv -1\left( \bmod 6 \right) \\
x\equiv -1\left( \bmod 7 \right) \\
x\equiv -1\left( \bmod 8 \right) \\
x\equiv -1\left( \bmod 9 \right) \\
\end{array} \right.[/tex]

Now, if I try to solve one equation and then replace in the next it would be a tedious work to do. I've seen chinese remainder theorem but it doesn't help me, or at least I don't realize. What can I do next to simplify this system?

Thanks!
 
Physics news on Phys.org
  • #2
Are you familiar with the linear congruence theorem?

Suppose ##a,b,n \in \mathbb{Z}, \space n>0##

Then ##ax \equiv bmodn \space## has a solution for x ##⇔ gcd(a,n)|b##.
 
  • #3
Yes. That follows from the solutions for the linear diophantine equations.

What do you suggest? THanks!
 
  • #4
Hernaner28 said:
Yes. That follows from the solutions for the linear diophantine equations.

What do you suggest? THanks!

With multiple applications of the theorem, you will be able to solve your system. Are you also familiar with the Extended Euclidean algorithm? It is also very important for solving linear congruences.
 
  • #5
Yes. I know how to solve this kind of systems. To do that I always use the extended euclidean algorithm to compute the inverse of a (in the equation you wrote). But in this particular problem I have 8 equations and it would be tedious to solve one, and then replace it in the next, and then again same thing until I get to the solution.
I wonder if there's something I can do to simplify the system (e.g. remove redundant equations or change something).

Thanks
 
  • #6
Hernaner28 said:
Yes. I know how to solve this kind of systems. To do that I always use the extended euclidean algorithm to compute the inverse of a (in the equation you wrote). But in this particular problem I have 8 equations and it would be tedious to solve one, and then replace it in the next, and then again same thing until I get to the solution.
I wonder if there's something I can do to simplify the system (e.g. remove redundant equations or change somthing).

Thanks

Hmm I wouldn't be familiar with any methods beyond the theorem and the algorithm. Sure it's cumbersome, but if it's for a homework assignment or something, I'm sure it's intended to get you used to calculating quickly and to hammer the concepts in ( So I can understand why it's so long ).

EDIT : You could write out each relation as a set and then take the intersection of your set to be the solution x as well? Otherwise I think multiple substitutions is the only way.
 
  • #7
I've looked at the solution and the next step was to say that system is equivalent to:

[tex] \displaystyle x\equiv -1\left( \bmod {{3}^{2}}\cdot {{2}^{3}}\cdot 7\cdot 5 \right)[/tex]

which is a piece of cake. Even so, I do not understand what was done there. It's not the factorization of 9x8x7x6x5x2 . What is it then?

Thanks!
 
  • #8
Hernaner28 said:
I've looked at the solution and the next step was to say that system is equivalent to:

[tex] \displaystyle x\equiv -1\left( \bmod {{3}^{2}}\cdot {{2}^{3}}\cdot 7\cdot 5 \right)[/tex]

which is a piece of cake. Even so, I do not understand what was done there. It's not the factorization of 9x8x7x6x5x2 . What is it then?

Thanks!

Yes that is the case. x = 2519 is the solution to your system.

The way it was obtained more than likely was multiple applications of the E.E.A. The set intersecton idea I wrote out in my last post works, but is probably better for smaller systems of equations unless you can see the pattern ahead of time.
 
Last edited:
  • #9
Hernaner28 said:
I've looked at the solution and the next step was to say that system is equivalent to:

[tex] \displaystyle x\equiv -1\left( \bmod {{3}^{2}}\cdot {{2}^{3}}\cdot 7\cdot 5 \right)[/tex]

which is a piece of cake. Even so, I do not understand what was done there. It's not the factorization of 9x8x7x6x5x2 . What is it then?

Thanks!

It's the least common multiple of 2,3,4,5,6,7,8,9. Any common multiple would work, but the least one will give you the smallest solution.
 
  • #10
Ahh I see, that's it, the least common multiple. Thanks both!
 

1. What is a system of congruences?

A system of congruences is a set of equations with multiple variables, where each equation is in the form of "x ≡ a (mod n)". This means that the variable x has a remainder of a when divided by n. The goal is to find a solution for x that satisfies all of the equations in the system.

2. How is a system of congruences solved?

A system of congruences is solved by using the Chinese Remainder Theorem, which states that if the moduli (n values) in the equations are relatively prime, then there exists a unique solution for x. This solution can be found by using the Extended Euclidean Algorithm to find the modular inverses of each modulus, and then combining them to find the solution for x.

3. What are the applications of a system of congruences?

A system of congruences has many practical applications, such as in cryptography, number theory, and computer science. For example, it can be used in public key cryptography to securely transmit information, and in error-correcting codes to detect and correct errors in data transmission.

4. Can a system of congruences have multiple solutions?

Yes, a system of congruences can have multiple solutions, especially if the moduli are not relatively prime. In this case, there may be multiple values of x that satisfy the equations in the system. However, if the moduli are relatively prime, then there will be a unique solution for x.

5. What is the difference between a system of congruences and a system of equations?

A system of congruences is different from a system of equations in that the equations in a system of congruences are in the form of "x ≡ a (mod n)", while the equations in a system of equations are in the form of "x = y". This means that the solutions for x in a system of congruences must satisfy a certain remainder when divided by n, while the solutions for x in a system of equations can be any real number.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
716
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Precalculus Mathematics Homework Help
Replies
3
Views
854
  • Precalculus Mathematics Homework Help
Replies
4
Views
944
  • Precalculus Mathematics Homework Help
Replies
7
Views
2K
  • Precalculus Mathematics Homework Help
Replies
1
Views
855
  • Precalculus Mathematics Homework Help
Replies
2
Views
806
  • Precalculus Mathematics Homework Help
Replies
2
Views
923
  • Precalculus Mathematics Homework Help
Replies
1
Views
895
  • Precalculus Mathematics Homework Help
Replies
14
Views
1K
Back
Top