Home Back

Chinese Remainder Theorem Calculator

Chinese Remainder Theorem:

\[ x \equiv a_1 \ (\text{mod} \ m_1) \] \[ x \equiv a_2 \ (\text{mod} \ m_2) \] \[ \vdots \] \[ x \equiv a_n \ (\text{mod} \ m_n) \]

Unit Converter ▲

Unit Converter ▼

From: To:

1. What is the Chinese Remainder Theorem?

The Chinese Remainder Theorem (CRT) is a theorem that gives a unique solution to simultaneous congruences with pairwise coprime moduli. It states that if one knows the remainders of the division of an integer by several pairwise coprime integers, then one can determine uniquely the remainder of the division of that integer by the product of these integers.

2. How Does the Calculator Work?

The calculator solves a system of congruences:

\[ x \equiv a_1 \ (\text{mod} \ m_1) \] \[ x \equiv a_2 \ (\text{mod} \ m_2) \] \[ \vdots \] \[ x \equiv a_n \ (\text{mod} \ m_n) \]

Where:

Explanation: The theorem finds a number \( x \) that leaves remainder \( a_i \) when divided by \( m_i \) for each \( i \). The solution is unique modulo the product of all the \( m_i \).

3. Importance of CRT

Details: The Chinese Remainder Theorem has applications in computing, cryptography, and coding theory. It's particularly useful for solving problems involving modular arithmetic and for speeding up computations modulo large numbers.

4. Using the Calculator

Tips: Enter comma-separated lists of moduli and remainders. All moduli must be pairwise coprime positive integers. The number of moduli and remainders must match.

5. Frequently Asked Questions (FAQ)

Q1: What does pairwise coprime mean?
A: It means that every pair of numbers in the moduli list must have a greatest common divisor (GCD) of 1.

Q2: What if my moduli aren't pairwise coprime?
A: The Chinese Remainder Theorem doesn't apply directly. You may need to break the problem into smaller parts or use alternative methods.

Q3: How many congruences can I solve at once?
A: The calculator can handle any number of congruences as long as the moduli are pairwise coprime.

Q4: What's the largest modulus I can use?
A: The calculator uses PHP integers, so the practical limit is about 2^63-1 on 64-bit systems.

Q5: Can I use this for negative numbers?
A: The remainders can be negative, but moduli must be positive integers.

Chinese Remainder Theorem Calculator© - All Rights Reserved 2025