SLIDE 1 Linear congruences:
- ax ≡ b (mod n) for x ∈ Z
- a ⊙ x = b in Zn (in particular x ∈ {0, 1, . . . , n − 1})
- [a]n ⊙ [x]n = [b]n in Zn
SLIDE 2
x ∈ Z satisfies ax ≡ b (mod n) if and only if there is y ∈ Z such that ax + yn = b.
SLIDE 3 Theorem. Let n ∈ N, let a, b ∈ Z. Assume that gcd(a, n) = Aa + Bn. (i) If b is not a multiple of gcd(a, n), then the equation ax ≡ b (mod n) does not have a solution. (ii) If gcd(a, n) | b, then the equation ax ≡ b (mod n) does have a soltuion and the set of all its solutions is
b gcd(a, n) + k n gcd(a, n); k ∈ Z
SLIDE 4 Theorem. Let n ∈ N, let [a]n, [b]n ∈ Zn. Assume that gcd(a, n) = Aa + Bn. (i) If b is not a multiple of gcd(a, n), then the equation [a]n ⊙ [x]n = [b]n does not have a solution. (ii) If gcd(a, n) | b, then the equation [a]n ⊙ [x]n = [b]n has gcd(a, n) distinct solutions in Zn and the set of all these solutions is
b gcd(a, n) + k n gcd(a, n)
- n; k = 0, 1, . . . , gcd(a, n) − 1
- .
SLIDE 5
Theorem. Let n ∈ N, let a, b ∈ Z. Consider some solution xp of the congruence ax ≡ b (mod n). Then x ∈ Z is a solution of this congruence if and only if x = xp +xh for some xh ∈ Z that solves the congruence ax ≡ 0 (mod n).
SLIDE 6 Fact. Let n ∈ N, consider a ∈ Zn. The set of all solutions of the congruence a ⊙ x = 0 (mod n) is
n gcd(a, n); k ∈ Z
SLIDE 7 Algorithm for solving the equation ax ≡ b (mod n) in Z, or the equation [a]n ⊙ [x]n = [b]n in Zn, or the equation ax = b in Zn for a, b ∈ Zn.
- 0. Rewrite the equation as ax + ny = b. Using the extended Eu-
clidean algorithm find gcd(a, n) = Aa + Bn (or guess it).
- 1. If gcd(a, n) divides b, then the equation has a solution.
- 2. If gcd(a, n) dl b, rovnice m een.
a) Multiply gcd(a, n) = Aa+Bn by the number b gcd(a, n), changing it into a Ab gcd(a, n) + n Bb gcd(a, n) = b, which has the same form as the equation in step 0. We see a particular solution xp = Ab gcd(a, n). b) Cancel the associated homogeneous equation ax + ny = 0 by the number gcd(a, n), creating a′x + n′y = 0, this has a general solution xh = kn′, k ∈ Z. c) A general solution of the given equation is then xp + xh. Depending on how the question was given you get the following:
- The set of all integer solutions of the congruence ax ≡ b (mod n)
is {xp + kn′; k ∈ Z}, that is, x = xp + kn′, k ∈ Z.
- The set of all solutions in Zn of the equation [a]n[x]n = [b]n is
{[xp + kn′]n; k = 0, 1, 2, . . . , gcd(a, n) − 1}.
- The set of solutions in Zn of the equation ax = b can be obtained
by choosing a suitable representative of the class [xp + kn′]n for all k = 0, 1, . . . , gcd(a, n) − 1. Formally, let k0 be the least integer such that xp + kn′ ≥ 0. Then the set of all solutions in Zn of the equation ax = b is {xp + kn′; k = k0, k0 + 1, . . . , k0 + gcd(a, n) − 1}.
SLIDE 8
Systems of linear congruences: Assume that moduli n1, . . . , nm ∈ N and right-hand sides b1, . . . , bm ∈ Z are given. We are looking for integers x such that x ≡ b1 (mod n1), x ≡ b2 (mod n2), . . . x ≡ bm (mod nm).
SLIDE 9
Theorem. (Chinese remainder theorem) Let n1, n2, . . . , nm ∈ N, b1, b2, . . . , bm ∈ Z. Consider the system of equations x ≡ b1 (mod n1), x ≡ b2 (mod n2), . . . x ≡ bm (mod nm). If the numbers ni are all pairwise coprime, then this system has a solution. This solution is unique up to modulo n = n1n2 · · · nm, conversely, all elements from this congruence class modulo n are also solutions.
SLIDE 10 Algorithm for solving systems of congruences x ≡ b1 (mod n1), x ≡ b2 (mod n2), . . . , x ≡ bm (mod nm) in case that all numbers ni are pairwise coprime.
- 1. Denote n = n1n2 · · · nm and Ni = n
ni for all i.
- 2. For every i find the inverse of Ni with respect to multiplication
modulo ni.
m
- i=1
- bixiNi. The set of all solutions of the given system is
{x + kn; k ∈ Z}.