Discrete StructureTU Board 2023
Apply Chinese remainder theorem in computer arithmetic with large integers to find the sum of 123684 and 413456.
5Answer
Solution Using Chinese Remainder Theorem (CRT)
The Chinese Remainder Theorem (CRT) is a method to solve systems of congruences with pairwise coprime moduli. Here, we use it to compute the sum of two large integers efficiently by breaking them into smaller congruences.
Step 1: Choose Moduli
Select two coprime integers (moduli) and . These are small primes that simplify computation.
Step 2: Compute Congruences
Find and :
- , remainder . So, .
- , remainder . So, .
Similarly, for :
- , remainder . So, .
- , remainder . So, .
Step 3: Sum Congruences
Add the congruences:
- .
- .
Now, solve for such that:
Step 4: Apply CRT
Let . Substitute into the second congruence: Multiply both sides by the modular inverse of . Since , the inverse is : Thus, for some integer . Substitute back: The smallest positive solution is .
Step 5: Verify
Check and . Correct.
Step 6: Final Sum
The sum modulo (since ) is . To find the actual sum, compute: Now, , confirming our result.
Final Answer: The sum of and modulo is 30. The actual sum is 537140.
Discussion
Loading…