Chinese Remainder Theorem:
From: | To: |
The Chinese Remainder Theorem (CRT) is a theorem that gives a unique solution to simultaneous congruences with pairwise coprime moduli. It has applications in computing, cryptography, and number theory.
The calculator uses the CRT formula:
Where:
Explanation: The theorem finds a number that leaves specified remainders when divided by each modulus.
Details: CRT is fundamental in computer algebra systems, cryptographic algorithms (like RSA), and solving systems of congruences efficiently.
Tips: Enter pairs of remainders and moduli (one pair per line, comma separated). All moduli must be pairwise coprime (gcd = 1 for each pair).
Q1: What if moduli aren't coprime?
A: The system may have no solution or multiple solutions. The calculator checks for pairwise coprimality.
Q2: How large can the numbers be?
A: The calculator handles reasonably large integers, but extremely large numbers may cause performance issues.
Q3: What's the time complexity?
A: For n congruences, it's O(n²) due to pairwise coprimality checks and inverse calculations.
Q4: Are there alternatives to CRT?
A: For non-coprime moduli, you can use successive substitution or solve via prime factorization.
Q5: What are practical applications?
A: Used in RSA decryption, fast multi-precision arithmetic, calendar calculations, and solving linear congruences.