Chinese Remainder Theorem is used to solve problems like these:
What is the smallest whole number that has a remainder of 1 when divided by 4, a remainder of 1 when divided by 3, and a remainder of 2 when divided by 5
So it becomes:
x = 1 mod(4)
x = 1 mod(3)
x = 2 mod(5)
How would I solve for x using CRT?
It is very confusing, so can someone just explain to me a straight-forward method that I can memorize? This will help me understand how to do it, then later, I can understand why it works.
I tried learning it on AOPS, but their lesson costs money as I have to buy the book. And they don't explain it well in their question solutions on Alcumus.
I also tried watching a video, I copied their exact method to solve a problem, but got a wrong answer, and it was WAYYY off.
This computer code incorporates the "Chinese Remainde Theorem + Modular multiplicative Inverse"
i=0;j=0;m=0;t=0;a=(4, 3, 5);r= (1, 1, 2);c=lcm(a); d=c / a[i];n=d % a[i] ;loop1:m++; if(n*m % a[i] ==1, goto loop, goto loop1);loop:s=(c/a[i]*r[j]*m);i++;j++;t=t+s;m=0;if(i< count a, goto4,m=m);printc,"m + ",t % c;return
ANSWER =60 m + 37, where m=0, 1, 2, 3......etc.
Look under this link for detailed explanation of CRT:
https://web2.0calc.com/questions/congruences
OMG THANK YOU SO MUCH! I just realized that the numbers are required to be relatively prime!
Thats why I got the problem wrong when I followed the video, because the Question had no relatively prime numbers! The question was making you guess and check.
I can solve system of modulos now! Thanks!
Also, what program do you use to run the code? I would like to use your codes to help me solve these questions in the future quickly!
Thanks, probs during the summer (which is far far away lol) I am going to take some computing classes so I can be cool like you
Probably I will start with Java, because it is the most common and easy one.
THank you Guest and Nirvana!