Week 6 Congruence Relation Modulo n Discrete Math Marie Demlov - - PowerPoint PPT Presentation

week 6 congruence relation modulo n
SMART_READER_LITE
LIVE PREVIEW

Week 6 Congruence Relation Modulo n Discrete Math Marie Demlov - - PowerPoint PPT Presentation

Congruence Relation Modulo n Residue Classes Modulo n Exercises Week 6 Congruence Relation Modulo n Discrete Math Marie Demlov http://math.feld.cvut.cz/demlova April 2, 2020 M. Demlova: Discrete Math Congruence Relation Modulo n Residue


slide-1
SLIDE 1

Congruence Relation Modulo n Residue Classes Modulo n Exercises

Week 6 Congruence Relation Modulo n

Discrete Math Marie Demlová http://math.feld.cvut.cz/demlova April 2, 2020

  • M. Demlova: Discrete Math
slide-2
SLIDE 2

Congruence Relation Modulo n Residue Classes Modulo n Exercises

Congruence Relation Modulo n

Given two integers a, b and a natural number n > 1. We say that a is congruent to b modulo n and write a ≡ b (mod n) if a − b is divisible by n. Equivalent Characterizations of Modulo n. Let a and b be two integers. Then the following is equivalent: ◮ a ≡ b (mod n), ◮ a = b + k n for some integer k, ◮ a and b have the same remainders when divided by n.

  • M. Demlova: Discrete Math
slide-3
SLIDE 3

Congruence Relation Modulo n Residue Classes Modulo n Exercises

Congruence Relation Modulo n

Proposition. Let a, b, and c be integers. Then ◮ a ≡ a (mod n) (modulo n is reflexive); ◮ if a ≡ b (mod n), then also b ≡ a (mod n) (modulo n is symmetric); ◮ if a ≡ b (mod n) and b ≡ c (mod n), then a ≡ c (mod n) (modulo n is transitive). Properties of modulo n. Assume that for integers a, b, c, and d it holds that a ≡ b (mod n) and c ≡ d (mod n). Then (a + c) ≡ (b + d) (mod n) a (a · c) ≡ (b · d) (mod n).

  • M. Demlova: Discrete Math
slide-4
SLIDE 4

Congruence Relation Modulo n Residue Classes Modulo n Exercises

Congruence Relation Modulo n

  • Corollary. Given two integers a, b such that a ≡ b (mod n). Then

◮ ra ≡ rb (mod n) for every integer r; ◮ ak ≡ bk (mod n) for every natural number k. ◮ Moreover, if ai ≡ bi (mod n) for every i = 0, . . . , k, a r0, . . . , rk are arbitrary integers, then (r0 a0 + . . . + rk ak) ≡ (r0 b0 + . . . + rk bk) (mod n).

  • Proposition. Let r, a, b be integers and n a natural number n > 1

such that ra ≡ rb (mod n). Then a ≡ b

  • mod

n gcd(n, r)

  • .
  • M. Demlova: Discrete Math
slide-5
SLIDE 5

Congruence Relation Modulo n Residue Classes Modulo n Exercises

Congruence Relation Modulo n

Solving (a + x) ≡ b (mod n). Given integers a, b and a natural number n > 1. Find all integers x for which (a + x) ≡ b (mod n). This problem has got always a solution which is any x ∈ Z for which x ≡ (b − a) (mod n). Solving (a · x) ≡ b (mod n). Given two integers a, b and a natural number n > 1. Find all integers x for which a x ≡ b (mod n). The equation above has a solution iff the number b is a multiple of gcd(a, n), and all integers x are solutions of the following Diophantic equation a x + n y = b.

  • M. Demlova: Discrete Math
slide-6
SLIDE 6

Congruence Relation Modulo n Residue Classes Modulo n Exercises

Congruence Relation Modulo n

  • Proposition. Let n > 1, m > 1 be two relatively prime natural
  • number. And let for some a, b ∈ Z it holds that a ≡ b (mod n) and

a ≡ b (mod m) Then also a ≡ b (mod nm). A stronger version holds: Assume that a ≡ b (mod n) and a ≡ b (mod m). Let n1 =

n gcd(n,m) and m1 = m gcd(n,m). Then

a ≡ b (mod n1m1). Small Fermat Theorem. Let p be a prime and a an integer relatively prime to p. Then ap−1 ≡ 1 (mod p).

  • M. Demlova: Discrete Math
slide-7
SLIDE 7

Congruence Relation Modulo n Residue Classes Modulo n Exercises Operations in Zn

Residue Classes Modulo n

An equivalence class of the equivalence modulo n containing a number i ∈ Z is the residue class containing i and is denoted by [i]n. We have [i]n = {j | j = i + kn for some k ∈ Z}. The Set Zn. There are n distinct residue classes modulo n; indeed, they are the residue classes corresponding to the numbers (remainders) 0, 1, . . . , n − 1. The set of all residue classes is denoted by Zn, so Zn = {[0]n, [1]n, . . . , [n − 1]n}.

  • M. Demlova: Discrete Math
slide-8
SLIDE 8

Congruence Relation Modulo n Residue Classes Modulo n Exercises Operations in Zn

Operations in Zn

Addition ⊕ and multiplication ⊙. For [i]n, [j]n ∈ Zn we have [i]n ⊕ [j]n = [i + j]n, [i]n ⊙ [j]n = [i · j]n.

  • Example. Let n = 6, then there are 6 distinct residue classes, i.e.

Z6 = {[0]6, [1]6, . . . , [5]6}. Moreover, [3]6 ⊕ [5]6 = [2]6, [3]6 ⊙ [4]6 = [0]6.

  • M. Demlova: Discrete Math
slide-9
SLIDE 9

Congruence Relation Modulo n Residue Classes Modulo n Exercises Operations in Zn

Operations in Zn

Properties of ⊕. ◮ ⊕ is associative, i.e. for any three integers i, j, k we have: ([i]n ⊕ [j]n) ⊕ [k]n = [i]n ⊕ ([j]n ⊕ [k]n). ◮ ⊕ is commutative, i.e. for any two integers i, j we have: [i]n ⊕ [j]n = [j]n ⊕ [i]n. ◮ The class [0]n plays the role of “zero”, more precisely, for any integer i we have: [0]n ⊕ [i]n = [i]n. ◮ We can ”subtract”, more precisely for any integer [i]n there exists class −[i]n such that [i]n ⊕ (−[i]n) = [0]n.

  • M. Demlova: Discrete Math
slide-10
SLIDE 10

Congruence Relation Modulo n Residue Classes Modulo n Exercises Operations in Zn

Residue Classes Modulo n

Properties of the Operation ⊙. ◮ ⊙ is associative, i.e for any three integers i, j, k we have: ([i]n ⊙ [j]n) ⊙ [k]n = [i]n ⊙ ([j]n ⊙ [k]n). ◮ ⊙ is commutative, i.e. for any two integers i, j we have: [i]n ⊙ [j]n = [j]n ⊙ [i]n. ◮ The class [1]n plays the role of “identity”, More precisely, for any integer i we have: [1]n ⊙ [i]n = [i]n. For a residue class [i]n there is a residue class [x]n such that [i]n ⊙ [x]n = [1]n iff the numbers i and n are relatively prime.

  • M. Demlova: Discrete Math
slide-11
SLIDE 11

Congruence Relation Modulo n Residue Classes Modulo n Exercises Operations in Zn

Residue Classes Modulo n

Convention. Later on we will write Zn = {0, 1, . . . , n − 1} instead of Zn = {[0]n, [1]n, . . . , [n − 1]n} and the operations ⊕, ⊙ will be denoted by an “ordinary signs”, i.e. simply by + and ·. Note that we can write that in Zn for every i, j ∈ Zn i + j = k, where k is the remainder when i + j is divided by n; i · j = l, where l is the remainder when i j is divided by n.

  • M. Demlova: Discrete Math
slide-12
SLIDE 12

Congruence Relation Modulo n Residue Classes Modulo n Exercises

Exercises

Exercies 1. Find all natural numbers x, 0 ≤ x < 555 for which 233 x ≡ 5 (mod 555). Exercies 2. In Z414 find all x for which 152 x = 6.

  • M. Demlova: Discrete Math
slide-13
SLIDE 13

Congruence Relation Modulo n Residue Classes Modulo n Exercises

Exercises

Exercise 3. Find the remainder when you divide 13742 − 10 · 14521 + 22102. by 7. Exercise 4. Derive and prove criteria for divisibility by 7 and 11. Exercise 5. Write down the multiplication table for (Z10, ⊙).

  • M. Demlova: Discrete Math
slide-14
SLIDE 14

Congruence Relation Modulo n Residue Classes Modulo n Exercises

Exercises

Exercise 6. Find all invertible elements in (Z11, ⊙) and their inverses. Exercise 7. Find all invertible elements in (Z12, ⊙) and their inverses.

  • M. Demlova: Discrete Math