You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/algebra/chinese-remainder-theorem.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -10,36 +10,36 @@ The Chinese Remainder Theorem (which will be referred to as CRT in the rest of t
10
10
11
11
## Formulation
12
12
13
-
Let $p = p_1 \cdot p_2 \cdots p_k$, where $p_i$ are pairwise relatively prime. In addition to $p_i$, we are also given a set of congruence equations
13
+
Let $m = m_1 \cdot m_2 \cdots m_k$, where $m_i$ are pairwise relatively prime. In addition to $m_i$, we are also given a set of congruence equations
14
14
15
15
$$\begin{align}
16
-
a &\equiv a_1 \pmod{p_1} \\\\
17
-
a &\equiv a_2 \pmod{p_2} \\\\
16
+
a &\equiv a_1 \pmod{m_1} \\\\
17
+
a &\equiv a_2 \pmod{m_2} \\\\
18
18
&\ldots \\\\
19
-
a &\equiv a_k \pmod{p_k}
19
+
a &\equiv a_k \pmod{m_k}
20
20
\end{align}$$
21
21
22
-
where $a_i$ are some given constants. The original form of CRT then states that the given set of congruence equations always has *one and exactly one* solution modulo $p$.
22
+
where $a_i$ are some given constants. The original form of CRT then states that the given set of congruence equations always has *one and exactly one* solution modulo $m$.
23
23
24
24
### Corollary
25
25
26
26
A consequence of the CRT is that the equation
27
27
28
-
$$x \equiv a \pmod{p}$$
28
+
$$x \equiv a \pmod{m}$$
29
29
30
30
is equivalent to the system of equations
31
31
32
32
$$\begin{align}
33
-
x &\equiv a_1 \pmod{p_1} \\\\
33
+
x &\equiv a_1 \pmod{m_1} \\\\
34
34
&\ldots \\\\
35
-
x &\equiv a_k \pmod{p_k}
35
+
x &\equiv a_k \pmod{m_k}
36
36
\end{align}$$
37
37
38
-
(As above, assume that $p = p_1 p_2 \cdots p_k$ and $p_i$ are pairwise relatively prime).
38
+
(As above, assume that $m = m_1 m_2 \cdots m_k$ and $m_i$ are pairwise relatively prime).
39
39
40
40
## Garner's Algorithm
41
41
42
-
Another consequence of the CRT is that we can represent big numbers using an array of small integers. For example, let $p$ be the product of the first $1000$ primes. From calculations we can see that $p$ has around $3000$ digits.
42
+
Another consequence of the CRT is that we can represent big numbers using an array of small integers. For example, let $p$ be the product of the first $1000$ primes. From calculations we can see that $P$ has around $3000$ digits.
43
43
44
44
Any number $a$ less than $p$ can be represented as an array $a_1, \ldots, a_k$, where $a_i \equiv a \pmod{p_i}$. But to do this we obviously need to know how to get back the number $a$ from its representation. In this section, we discuss Garner's Algorithm, which can be used for this purpose. We seek a representation on the form
0 commit comments