Discrete Mathematics with Applications MATH236 Dr. Hung P. Tong-Viet School of Mathematics, Statistics and Computer Science University of KwaZulu-Natal Pietermaritzburg Campus Semester 1, 2013 Tong-Viet (UKZN) MATH236 Semester 1, 2013 1 / 28
Table of contents 1 Fermat and Euler Theorems 2 Groups Tong-Viet (UKZN) MATH236 Semester 1, 2013 2 / 28
Fermat and Euler Theorems Fermat Theorem Theorem (Fermat) If a is a positive integer and p is a prime number, then a p a (mod p) Tong-Viet (UKZN) MATH236 Semester 1, 2013 3 / 28
Fermat and Euler Theorems Euler Theorem Theorem (Euler) Let a, m be integers with m 2 and gcd(a, m) = 1. Then a φ(m) 1 (mod m). Tong-Viet (UKZN) MATH236 Semester 1, 2013 4 / 28
Fermat and Euler Theorems Euler Theorem Proof. 1 Let s 1, s 2,, s φ(m) be the φ(m) integers in {1, 2,, m 1} that are relatively prime to m 2 For each i with 1 i φ(m), let as i = q i m + r i where 0 r i m. 3 We claim that {s 1, s 2,, s φ(m) } = {r 1, r 2,, r φ(m) } 4 Since each r i {0, 1,, m 1} and there are exactly φ(m) integers in {0, 1,, m 1} that are relatively prime to m, we need to prove two things: 5 (1) all the numbers r 1, r 2,, r φ(m) are pairwise distinct 6 (2) for each i, we have gcd(m, r i ) = 1. Tong-Viet (UKZN) MATH236 Semester 1, 2013 5 / 28
Fermat and Euler Theorems Euler Theorem Proof. 1 We first prove (1). 2 Suppose that there exist i j such that r i = r j where 1 i, j φ(m) 3 WLOG, we assume that s i > s j. 4 Then a(s i s j ) = as i as j = (q i q j )m. 5 Since gcd(a, m) = 1, a has a multiplicative inverse a 1 in Z m. 6 Hence s i s j = a 1 (q i q j )m. 7 Thus m s i s j 8 But 0 < s j < s i < m, so 1 s i s j < m, so m cannot divide s i s j, a contradiction. 9 Thus if i j, then r i r j. Tong-Viet (UKZN) MATH236 Semester 1, 2013 6 / 28
Fermat and Euler Theorems Euler Theorem Proof. 1 We now prove (2) 2 Suppose that gcd(r i, m) > 1 for some i 3 Then p r i and p m for some prime p 4 Hence p divides q i m + r i and so p as i 5 It follows that p a or p s i 6 Hence gcd(a, m) > 1 or gcd(s i, m) > 1 which contradicts our assumption Tong-Viet (UKZN) MATH236 Semester 1, 2013 7 / 28
Euler Theorem Fermat and Euler Theorems Proof. 1 Thus we have proved that {s 1, s 2,, s φ(m) } = {r 1, r 2,, r φ(m) } 2 We have a φ(m) s 1 s 2 s φ(m) = (as 1 )(as 2 ) (as φ(m) ) r 1 r 2 r φ(m) (mod m) s 1 s 2 s φ(m) (mod m) 3 Since each s i is relatively prime to m, each s i has a multiplicative inverse s 1 i. 4 Multiplying both sides of the last equation by s 1 φ(m) s 1 2 s 1 1, we have a φ(m) 1 (mod m) Tong-Viet (UKZN) MATH236 Semester 1, 2013 8 / 28
Fermat and Euler Theorems Fermat s Little Theorem Corollary Let a be a positive integer and p be a prime number such that gcd(a, p) = 1. Then a p 1 1 (mod p). Example Find 100 25 mod 7. Proof. Since gcd(100, 7) = 1, by Fermat theorem, we have 100 7 1 = 100 6 1 (mod 7). We see that 25 = 6 4 + 1 so 100 25 = 100 6 4+1 = (100 6 ) 4 100 100 2 (mod 7) Tong-Viet (UKZN) MATH236 Semester 1, 2013 9 / 28
Fermat and Euler Theorems Example Example Solve the congruence x 4 301 (modd 13) Fermat s Little Theorem implies that 4 12 1 (mod 13) since gcd(4, 11) = 1 We have 300 = 12 25 + 1 so 4 301 = (4 12 ) 25 4 1 25 4 4 (mod 13) Hence x = 4 Z 13 Tong-Viet (UKZN) MATH236 Semester 1, 2013 10 / 28
Fermat and Euler Theorems Finding Multiplicative Inverses Corollary If a, m Z, m 2 and gcd(a, m) = 1, then a 1 = a φ(1) 1 is the multiplicative inverse in Z m of a. Proof. Since a φ(m) 1 a = a φ(m) 1 (mod m), the result follows. Example Find 3 1 in Z 10. Tong-Viet (UKZN) MATH236 Semester 1, 2013 11 / 28
Fermat and Euler Theorems Finding Multiplicative Inverses Proof. We have 3 1 = 3 φ(10) 1 = 3 3 = 7 in Z 10. We can check that 3 7 = 21 1 (mod 10) and hence 3 1 = 7 in Z 10 Example Find 7 1 in Z 25. Tong-Viet (UKZN) MATH236 Semester 1, 2013 12 / 28
Fermat and Euler Theorems Finding Multiplicative Inverses Proof. We have 7 1 = 7 φ(25) 1 = 7 20 1 = 7 19 18 (mod 25) Example Solve the congruence equation ax b (mod m) where gcd(a, m) = 1. Tong-Viet (UKZN) MATH236 Semester 1, 2013 13 / 28
Fermat and Euler Theorems Linear congruence equations Example Since a φ(m) 1 (mod m) We have x a φ(m) x (mod m) a φ(m) 1 ax (mod m) a φ(m) 1 b (mod m) Solve the congruence 7x 4 (mod 10) Tong-Viet (UKZN) MATH236 Semester 1, 2013 14 / 28
Fermat and Euler Theorems Linear congruence equations Since gcd(7, 10) = 1, the solution is x 7 φ(10) 1 4 (mod 10) 7 3 4 (mod 10) 343 4 (mod 10) 1372 (mod 10) 2 (mod 10) We can check that 7 2 = 14 4 (mod 10). So x = 2 is a solution of this congruence. Tong-Viet (UKZN) MATH236 Semester 1, 2013 15 / 28
Groups Definition of Groups Definition A group is an ordered pair (S, ), where S is a nonempty set and is a binary operation on S such that the following conditions hold: 1 S is closed under 2 is associative, that is, for all x, y, z S, (x y) z = x (y z) 3 There is a unique element e S such that for all x S, x e = e x = x. The element e is called the identity of S. 4 For every x S, there is a unique element x 1 S such that x x 1 = x 1 x = e. Tong-Viet (UKZN) MATH236 Semester 1, 2013 16 / 28
Groups Definition of Groups In addition, if x y = y x for all x, y S, then (S, ) is called an abelian group. A group (S, ) is called a finite group if S = n is finite. Otherwise, it is called an infinite group S is called the order of the group (S, ) Tong-Viet (UKZN) MATH236 Semester 1, 2013 17 / 28
Groups Examples of Groups Example (Z, +) is an abelian group. The identity element e is the number 0 since x + 0 = 0 + x = x for all x Z + is associative in Z since (x + y) + z = x + (y + z) for all x, y, z Z The inverse of x Z is x since x + ( x) = ( x) + x = 0 Furthermore, x + y = y + x for all x, y Z So (Z, +) is an abelian group. Tong-Viet (UKZN) MATH236 Semester 1, 2013 18 / 28
Groups Examples of Groups Example (Z, ) is not a group. The number 1 is the identity However 2 does not have an inverse in Z under So (Z, ) is not a group. Tong-Viet (UKZN) MATH236 Semester 1, 2013 19 / 28
Groups Examples of Groups Example (Q, ) is an abelian group, where Q = Q {0}. is obviously associative in Q The identity element is 1 For any x Q, x 1 Q exists and x x 1 = 1 for any x, y Q, we have x y = y x Hence (Q, ) is an abelian group Tong-Viet (UKZN) MATH236 Semester 1, 2013 20 / 28
Groups Examples of Groups Example (General Linear Groups) Let n 1 be an integer. Denote by GL n (R) the set of all invertible n n matrices with entries from R. Then GL n (R) together with the operation of matrix multiplication is a group, which is called the general linear group. The identity element is the n n identity matrix I n The group inverse of a matrix A GL n (R) is its matrix inverse A 1. Tong-Viet (UKZN) MATH236 Semester 1, 2013 21 / 28
Groups Examples of Groups Example (Special Linear Groups) For n 1 be an integer. Denote by SL n (R) the subset of GL n (R) consisting of all those invertible n n matrices with determinant 1. Then SL n (R) is a group called the special linear group. Example For n 1 an integer, (Z n, +) is an abelian group, where + denotes addition modulo n. The identity element is the number 0. The inverse of x Z n is the unique number y Z n such that x + y 0 (mod n). Tong-Viet (UKZN) MATH236 Semester 1, 2013 22 / 28
Groups Element orders Definition Let (S, e) be a finite group with identity e. 1 Let a S. The order of a, denoted by a or o(a), is the smallest positive integer k such that a k = e. 2 A group (S, ) is called a cyclic group if there is an element a S such that the order of a is exactly S. In this case, a is called a generator of S. 3 If (S, ) is a cyclic group, then any element x S with x = S is also called a generator of S. Tong-Viet (UKZN) MATH236 Semester 1, 2013 23 / 28
Groups The multiplicative group Example For a positive integer n, the multiplicative group of Z n is Z n = {a Z n : gcd(a, n) = 1} the group operation is multiplication modulo n The identity in Z n is the number 1 Every element a Z n has an inverse The order of Z n is φ(n) If p is a prime, then Z p = Z p {0} = {1, 2,, p 1} Tong-Viet (UKZN) MATH236 Semester 1, 2013 24 / 28
The multiplicative group Groups Example Consider the group Z 15 We have Z 15 = {1, 2, 4, 7, 8, 11, 13, 14} Z 15 = 8 = φ(15) = 15(1 1 3 )(1 1 5 ) Order of 2 Z 15 Thus 2 = 4 in Z 15. k 2 k mod 15 1 2 2 4 3 8 4 1 Tong-Viet (UKZN) MATH236 Semester 1, 2013 25 / 28
Groups The multiplicative group Orders of elements in Z 15 a 1 2 4 7 8 11 13 14 a 1 4 2 4 4 2 4 2 Z 15 is not cyclic as there is no elements whose order is 8 = Z 15 If (S, ) is a finite group and a S, then a divides S. This is a corollary of Lagrange s Theorem in Group Theory. We are interested in the case Z p where p is a prime In this case, Z p is a cyclic group of order φ(p) = p 1 If a is a generator for Z p, then a k is also a generator of Z p whenever gcd(k, p 1) = 1 and so Z p has φ(p 1) generators. Tong-Viet (UKZN) MATH236 Semester 1, 2013 26 / 28
Finding generators Groups Theorem Suppose that p is a prime and α Z p. Then α is a generator of Z p if and only if α (p 1)/q 1 (mod p) for all primes q such that q (p 1). Tong-Viet (UKZN) MATH236 Semester 1, 2013 27 / 28
Finding generators Groups Example Consider the group Z 37. We have 37 1 = 36 = 22 3 2. For α Z 37, we need to compute α 36/2 (mod 37) α 36/3 (mod 37) If all the results are not trivial, then α is a generator of Z 37. We have 2 18 36 and 2 12 26 (mod 37), so 2 is a generator of Z 37 However 4 18 1 and 4 12 10 (mod 37), so 4 is NOT a generator of Z 37 Is 31 a generator of Z 37? Tong-Viet (UKZN) MATH236 Semester 1, 2013 28 / 28