Ask your own question, for FREE!
Mathematics 22 Online
Parth (parthkohli):

May I learn the Chinese Remainder Theorem? I want to solve the congruences.

OpenStudy (anonymous):

The Chinese remainder theorem is a result about congruences in number theory and its generalizations in abstract algebra. In its basic form, the Chinese remainder theorem will determine a number n that when divided by some given divisors leaves given remainders. For example, what is the lowest number n that when divided by 3 leaves a remainder of 2, when divided by 5 leaves a remainder of 3, and when divided by 7 leaves a remainder of 2? A common introductory example is a woman who tells a policeman that she lost her basket of eggs, and that if she took three at a time out of it, she was left with 2, if she took five at a time out of it she was left with 3, and if she took seven at a time out of it she was left with 2. She then asks the policeman what is the minimum number of eggs she must have had. The answer to both problems is 23. see here http://en.wikipedia.org/wiki/Chinese_remainder_theorem

Parth (parthkohli):

Please help.

Parth (parthkohli):

@UnkleRhaukus Sorry for tagging.

OpenStudy (anonymous):

@ParthKohli does this help u???

Parth (parthkohli):

No.

OpenStudy (kinggeorge):

CRT! It's amazing how much you can do with this. Here's my shortest explanation of how to use (no why it works yet, that's more complicated). Suppose you're given the following two equations.\[x\equiv a\pmod{c}\]\[x\equiv b\pmod{d}\]and \(\gcd(c,d)=1\). First thing to do, is solve the equation \[ec+fd=1\]Now there's just one more thing to do. \[x\equiv bec+afd\pmod{c\cdot d}\]

Parth (parthkohli):

\(\text{gcf(c,d)}=1\) just means that the numbers are co-prime, right?

OpenStudy (kinggeorge):

Correct.

OpenStudy (kinggeorge):

For example, suppose you want to solve \[x\equiv6\pmod{13}\]\[x\equiv12\pmod{23}\]Then, we first need to solve \(13a+23b=1\). Using the Euclidean algorithm,\[23=13\cdot1+10\]\[13=10\cdot1+3\]\[10=3\cdot3+1\]Using backsubstitution (or magic box) we get \(a=16\) and \(b=-9\). So we have \(13\cdot16-23\cdot9=1\)

OpenStudy (kinggeorge):

That means our solution will be \[x\equiv12\cdot 13\cdot16-6\cdot23\cdot9\pmod{13\cdot23}\]Simplify this a bit, and we get \[x\equiv58\pmod{299}\]

Parth (parthkohli):

Hm. Can we please go slow?

Parth (parthkohli):

If you have the time, please do :)

Parth (parthkohli):

I don't understand what \(e,f\) are in \(ec + fd = 1\).

OpenStudy (kinggeorge):

Look back at the original equations we had \[x\equiv a\pmod{\color{red}{c}}\]\[x\equiv b\pmod{\color{green}d}\]We need to solve \(e\color{red}{c}+f\color{green}{d}=1\). Here, \(e,f\) are merely two integers that give a solution to this equation. Remember that \(\color{red}c\) and \(\color{green}d\) are fixed by the problem.

Parth (parthkohli):

I see. What is the Euclidean Algorithm?

Parth (parthkohli):

Wait. I'd make another question, then we'd return back to this :)

OpenStudy (kinggeorge):

It's a method to find the \(\gcd\) of two numbers. As an added bonus, with a little backsubstitution, it also solves that integral equation I gave above.

OpenStudy (kinggeorge):

Feel free to make another question if you want.

Parth (parthkohli):

Okay - one on the Euclidean Algorithm.

Parth (parthkohli):

I'm thinking about it.

Parth (parthkohli):

I don't get why we are using the Euclidean Algorithm here. :/

OpenStudy (kinggeorge):

It's an efficient way to solve the equation \(e\color{red}{c}+f\color{green}{d}=1\). It's not the only method, but it's very efficient, and you can do it by hand.

Parth (parthkohli):

How does the \(\gcd\) help?

OpenStudy (kinggeorge):

Basically, it boils down to the fact: \(e\color{red}{c}+f\color{green}{d}=1\) has a solution if and only if \(\gcd(c,d)=1\). That's the only reason we need the gcd to be 1.

Parth (parthkohli):

Oh yes! I see what you meant there.

Parth (parthkohli):

And how did you get \(a = 16\) and \(b = -9\)?

OpenStudy (anonymous):

Sorry for interrupting but I have two doubts. Why do we need to solve \(ec+fd=1\)? How do I know \(x \equiv bec + afd \pmod{c\cdot d}\) is true?

OpenStudy (kinggeorge):

Look back up to \[23=13⋅1+10\]\[13=10⋅1+3\]\[10=3⋅3+1\]Now, I just do a bunch of substitutions.\[1=10-3\cdot3\]\[3=13-10\cdot1\]\[10=23-13\cdot1\]So we have\[1=(23-13)-3(13-10)\]\[1=23-4(13)+3(10)\]\[1=23-4(13)+3(23-13)\]\[1=4(23)-7(13)\]So doing it this way, you really should have gotten \(a=-7\) and \(b=4\). However, it doesn't really matter since you will get the same solution for \(x\). For the solution I got before, I cheated and used wolfram to make it quicker.

Parth (parthkohli):

Okay. Wolfram FTW! :P

OpenStudy (kinggeorge):

@Ishaan94 Look at the congruences mod c and d respectively. \[ec+fd=1\equiv fd\pmod{c}\qquad\text{(do you see why this is true)}\]\[bec+afd\equiv 0+a\cdot1\pmod{c}\]From this, we can see that if \(x=bec+afd\), then \(x\equiv a\pmod{c}\). From a similar argument we see that \(x\equiv b\pmod{d}\) as well.

Parth (parthkohli):

Seems like I really need to grip a bit of my current Mathematics. I am not completely able to understand the whole thing. I'd tag you in this question when I need in the future, I promise you. Thanks for the assistance, your majesty!\[\Huge \ddot \smile \]\[\Huge \color{yellow}{\star} \]

Parth (parthkohli):

You guys may keep up with the discussion. Please do.

OpenStudy (anonymous):

ec + fd (mod c) = fd or ec + fd =1 (mod c) = fd? i am unable to red the latter one.

OpenStudy (anonymous):

read*

OpenStudy (kinggeorge):

Note the following\[ec+fd\equiv fd\pmod{c}\]\[ec+fd=1\implies ec+fd\equiv1\pmod{c}\]Hence, \[fd\equiv1\pmod{c}\]

OpenStudy (anonymous):

Ohh I see now :/

OpenStudy (kinggeorge):

Then we can make a substitution to get\[bec+afd\equiv 0+a\cdot1\pmod{c}\]

OpenStudy (anonymous):

okay. I think I understand why it's true.

OpenStudy (anonymous):

thanks. i will try solving your problem now.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!