Sei sulla pagina 1di 26
MATHIoF! St 2b Sean week & Exangl ExerCise. A notice at the bus stop says that “Buses depart at x minutes past the hour, where x =7 (mod 15)” Thus x 2, 37,52 (mod 60). In usual parlance, we say buses leave at 7,22, 37,52 minutes past the hour Recall that real numbers a,b are inverses if ab = 1. ® Let mm be a positive integer and a, € Z be such that a = 1 (mod m) Then we say = a,b are inverses modulo m. (of gachetle.) © bis an inverse of a modulo m. ® In this case, for any integer ky, a(b+km) =ab=1 (mod m) so b + km is also an inverse of a modulo m. Rares FH doernse sey TOF O ahieys Les invtre Cod we) Example. 3,4 are inverses modulo 11 since 3 x 4 = 12 =1 (mod 11). Example. Use the extended Euclidean algorithm to find an inverse x of 40 modulo 77. 1. We re-write the congruence equation 40¢ = 1 (mod 77) as the ordinary equation Mn —1=T7y, for some y € Z. This is equivalent to 40x — 77y =1. N.B. ged(40,77) = 1 so there is a solution. 2. We now use the extended Euclidean algorithm to find «. T= 1x 40437 -12x3 40 = 1x 37+3 = 37-12(40 12x 341 = 13x 37-12 x 40 =3x1+0 = 13(77 — 40) — 12 x 40 = 13x 77-25 x 40 Example. We have seen that simplifying a" mod m becomes quite easy if there is a small number k such that a* = 1 (mod m). Ina similar way, it is also useful if we have a* = —1 (mod m) for some small k. The trick is to try and keep the numbers between —m/2 and m/2. For example, we will try to simplify 55!" mod 29. We have =25= -4 (mod 29); usual remainder 25 not used! (-4) x5 =-20=9 (mod 29); 9x 5=45=16=-13 (mod 29); (-13) x5=—65=—-7 (mod 29) (-7) x5 =-35=-6 (mod 29); (-6) x 5=—30=-1 (mod 29) Thus, plist pAIOSOLH = (g7)26501 ye 5A = (-1)! x (-13) = —1) x (13) = 13 (mod 29). Example. Unfortunately, we can’t find k with a! = £1 (mod m) if ged(a,rm) #1. Instead we keep an eye out for a1 i ‘pattern” in the numbers. For example, we now try to simplify 62! mod 100. We have 6'=6 (mod 100); 6? = 36 (mod 100); 6° =36 x 6=216=16 (mod 100); 16x 6=96=—4 (mod 100); = (-4) x6 =—24 (mod 100); 6° = (-24) x 6= —144 = —44 (mod 100); = (44) x 6 = —264 = 36 (mod 100). R Hil By I 6 (mod 100), the numbers repeat every 5 steps from here on. 24821 = gots16 — gotatt 6 (mod 100). Since 6° 4 6! (mod 100), the pattern does not hold for smaller powers. The pigeon-hole principle (topic 4) ensures there will eventually be a pattern. Thus, 40 x (-25) — 77 x (-13) =1. is gives a solution 2 = —25 (we don’t care about y). shows that we have the following inverses of 40 modulo 77 @=...,—25,-25 + 77,-25 +2 x 77,...=..., 25, 52, 129,.... Exercise. Find an inverse n of 5 modulo 11. . As ahve; or, Fieve 145 sal, d. taal anderror Salas Bx2210 E-1 Cadi) Mev tifly by SROVE 1 Cred 0) S. the invere of Smmahele ir -L=% Checks Seteee Fld, © Typical Question. Given integers a,b and a positive integer m, find all integers «x satisfying the condition ax=b (mod m). This is a problem of solving a linear congruence There are several cases to consider in solving this congruence equation. ® Theorem. [If xccl(a.117) is not a factor of }, then the congruence ar = b (mod m) has no (integer) solutions. equation requires solving ax-tiny = 6 for some integers 1(a,m)]b. See ote roof. The congruen ay. But we know there are no solutions unless Example. Does 6 = 3 (mod 8) have solutions? Answer: No, because ged(6,8) = 2 and 2}3 The next case is ged(a,m) = 1 so automatically ged(a, m)|b. of a modulo in # Theorem. Suppose ged(a.r) = L and let ¢ be an invel Then the solution to aut = (mod i) is any integer .r such that + = ch (mod 1 Proof. Suppose first that # is a solution to az =6 (mod m). Multiplying both sides of the congruence equation by ¢ shows that cb = car =1z=2 (mod m). axih Curdw) weas axe bak fe tone ntye, & axokm (b) 16x = 19 (mod 22) Me selecting ay ufl? (c) 17@ = 20 (mod 23) Oe Silatton Sometimes we can solve congruences without using the Euclidean Algorithm but rather using the following fact we have observed before. ® Theorem. If ge«(¢.1) = |, then p=q (mod m) if and only if ep=cy (nod m) Thetis divesies by = 15 slloned i ¥her ant because tle Cuchiden, algeria Example. eds da invlsJe & c Gud 4 (mod 60) 1 (mod 15) =14 (mod 15) —9 how tet 7 (mod 15) Exercise. Prove the divisibility by 7 test, namely, 10a +b = 0 (mod 7) if and only if a — 2b = 0 (mod 7). wer 24 Lak faker 02 Jo enethed net £9 wed ~) Saeppere loasleo (~47) l0ae-b (dT) Meltif, both sider \y 2 Y 7 Pelt bet see ye jVla« a = 24 it ar (ned) a-2h <0 Cned 7) ye ew ttl bg th Seder & ale inverse of (0 (m7) > 6 r mlsel tr § Cy teal tad Core) 2la Example. Public Key Cryptography ~ the RSA System was invented by 3 MIT undergraduates (Rivest, Shamir and Adleman) in 1976: © Find two large primes p and q (e.g., 200 digits each) Bole receive, « Form the modulus m = py. « Find an encryption exponent a relatively prime to (p — 1)(q¢— 1). © Find the decryption exponent 3 satisfying 3 = 1 (mod (p — 1)(q—1)) © Publish the numbers a and nm. Forget p and q and keep 3 secret To encrypt... Alice fend te Boh bb Tedi ae, me Alice (= pul le 3) 1. Convert plain text into a string of digits to form a large integer .r. 2. Compute y = (°° mod 1) 3. Send y. To decrypt... 1. Receive y. 2. Compute «= (y° mod i). Note that you only need to know 4 Uses fact that '” "= 1 (mod nm) (see Epp page 629.). 3. Convert . back to plain text. Why is this secure? To decrypt the message we must know 8, which can be obtained if p and q are known. Recall that primality testing is much faster than prime factorization. Although it is easy to find two large primes p and g to form the product m = pq, it is close to impossible to factorize a large m to find the values of p and q. * NOTE THAT RSA IS NOT EXAMINABLE 22 RELATIONS ® A relation R from a set A to a set B is a subset of A x 2B. ws If (a,b) € R we say that a is related to b (by R), and we write « I? b. » If (a,b) € R we write « Bb. © Representing a relation C A x B on finite sets A and B: © Arrow diagram: List the elements of A and the elements of B, and then draw an arrow from a to ly for each pair («.b) © R. & Matrix My: Arrange the elements of A and B in some order ai, a2,--. and bj, 2,..., and then form a rectangular array of numbers where 1 ifakb, the entry in the #th row and jth column = 1; - nin) 0 fa, Rb; & The matrix Mp has |A| rows and |B| columns. & The matrix changes if the elements are arranged in a different order. | Example. Five flatmates Adam, Ben, Cate, Diane, and Eve chatted about who had visited the four cities Montreal, New York, Osaka, and Patis. Their travel experiences lead to a relation “has visited” defined as follows: A = {Adam, Ben, Cate, Diane, Eve} B = {Montreal, New York, Osaka, Paris} R = {(Adam, Montreal), (Ben, New York), (Ben, Paris), (Diane, New York), (Diane, Osaka)} The arrow diagram and matrix for this relation are 1000 o101 Mre=|]0000 0110 0000 The matrix Mp is of size 5 x 4 (reads “5 by 4”) It is based on the alphabetical order of the names and cities. 23 #® A function is just a relation R C A x B with the special property that for every « < A there is exactly one b € 3 such that « Rb. © A relation over two sets as defined above is formally a binary relation. We can also define a ternary relation as a subset of the Cartesian product Ax Bx C of three sets A, B,C, or in general, an n-ary relation as a subset of Ay x Ay x +++ x Ay for sets At, Aas. sAn. ratt largeaye Gov roletionel efabues ® Here we shall consider mainly binary relations ON a set, that is, a relation from a set to itself. © The arrow diagram in this case is essentially a directed graph (see Topic 5) We draw a dot for each element in the set and use an arrow or a loop to represent each ordered pair. # The corresponding matrix .\/;, is a square matrix; that is, there are as many rows as there are columns. Example. We define a relation R on the set A = {2,3,4,5,6} by R = {(a,b) € Ax A| ais a factor of b+2} = {(2,2), (2.4), (2,6), (3.4), (4,2). (4,6), (5,3). (6,4)}- Then we can write, for example, 24 and 3 R4, but 5R4. The arrow diagram and matrix are 10101 oo100 Mr=|10001 01000 00100 Exercise. Let R = {(a,a),(a,b),(b,a), (b,6),(d,6)} be a relation on the set A = {a,b,c,d}. Draw the arrow diagram of R and write down the matrix of R. Qo 0 \ aia a / ° / 11 eo ocao |} \eree) <7 od 24 ® We say that a relation R on a set A is reflexive when for every 1 © «|, aRa, ie., every element is related to itself. ® We say that a relation R on a set A is symmetric when for every a,b © |, aRb implies = b Ra, e., if « is related to 4, then b is related to u. © We say that a relation R ona set A is antisymmetric when for every a. /) «Rb and bRa implies ab, bare lated to gech other, then they must be identical. ign if g Joes of te. ae ret, they con't be related lod \wenge ‘© We say tha a relation oni a set A is transitive when for every «.b.c © | aRb and bRe implies ake, i.e., if a is related to b and b is related to c, then a is related to « ® In terms of arrow diagrams and matrices... arrow diagram matrix reflexive we must have () at every dot | diagonal entries are all 1 symmetric if we have e—e , then we | for i Aj, mjy = mj, must have ¢ antisymmetric | we cannot have ee fori # j, Miz and mj4 cannot both be 1 2 transitive (i) if we have x \; then we | for every nonzero entry in the matrix product Jf? the must have ¥/ \\, corresponding entry in M must be 1 (ii) if we have e—e, then we must have “oe © Note that “antisymmetric” is not the opposite of “symmetric” A relation can be both symmetric and antisymmetric. 25 Exercise. Define the relations Ry, Ra, Rs, Ry on the set A = {a,b,c} by Ry = {(a,0), (4,8), (b,0),(c.8)}, Ra = {(a,b), (2,0), (b,6)}, Ry = {(a,a), (6,6), (c,0)}, Ry = {(a,a), (a,b), (b,a), (0,b)}. For each relation, determine whether it is reflexive, symmetric, antisymmetric, and/or transitive. c c c c R Ry Rs Ra reflexive | N N Y N symmetric | Ar N Y antisymmetric | yy Y y N transitive | Y y Y Exercise. For each relation # defined on the set of all haman beings, determine whether or not it is reflexive, symmetric, antisymmetric, or transitive. ae se x oo nn? (a8) €Ritand ony it|S™ — o™ ot ais the father of b N N Y Ny ais a sibling of b N Y N N ais taller than b N w Y Y Necarse D cold bea scbly of on ant yon + sibliy of ne, bee Lan not a silly of myself 26 Exercise. For cach relation R defined on the set of all integers, determine whether or not it is reflexive, symmetric, antisymmetric, or transitive. = AC . yic metre ve met jay ive (x,y) € Rif and only if | 8" sy ais ran (a) x=y Y Y Y Y (b) w>y N N Y Y (co) asy y N Y Y (d) w4y N Y Nv N ix integer m > 2. Oe eda) YoY NY (f) wis a multiple of y Y N N Y Give reasons for (¢). Nea 2-2 eg. 1-0 Reasons {.. (e) Le Llenive: Peemse ax (mode) becase x-R1Ow Snetics TH LY Cod ~) Leyrke fee tome foteye k ark Sie Crodm) Let actidyanetics Et and Dee bod) (eontermae) Fase: Lt vey (mdm) wh yee (ned ~) re yeke Le tenemtgek yoye kim fetene mtep b! See Br ek Le xl \ “6 « ye Se A (med wm) 27 © A reflexive, symmetric, and transitive relation is calledan equivalence relation. © We often write ~ to denote an equivalence relation: a~ breads “a is equivalent to b" (with respect to ~). ® Intuitively, an equivalence relation tells us when two things are “the same” in an appropriate way. Example. Two angles (in radians) which differ by an integer multiple of 2x are essentially “the same”. We can express this idea using the relation ~ on R defined by c-y ar rey ifand only if eZ. 1. For all 2 € R, clearly =" = 0 € Z so x ~ x and ~ is reflexive. 2. Suppose that « ~ y so that 5" € Z. Then its negative “= € Z. Thus y~ x and ~ is symmetric. 3. Suppose that x ~ y and y ~ 2 for some x,y,z € IR. Then #24, eZ. Hence, their sum 4=* € Z so x ~ 2. Thus, ~ is transitive. Since ~ is reflexive, symmetric, and transitive, it is an equivalence relation. Two real numbers are equivalent with respect to ~ if they represent the same angle. ® Let ~ be an equivalence relation on a set A. For any element a € A, the equivalence class of a with respect to ~, denoted by «|, is the set Ajo ~a}. © Intuitively, an equivalence class collects all the objects that are “the same’ so that we can regard them as a single object. ® We let 1/~ denote the set of equivalence classes. Thus A/~ © P(A). Example. For the equivalence relation ~ in the previous example, a typical element of R/~ is an equivalence class like [2] Elements of R/~ represent angles. ee (f| 2°2' 272° 28 Functions with period 27 like sine and cosine are functions of angles and thus functions on R/~. For example, we can define cos : R/~ + R by cos((a}) = cosa’ for any a’ € [a]. Note that the choice of a’ doesn’t affect the definition because cos has period Qn. Example. Let A = {a,b,¢,d,e, f} and R = {(a,a), (a,c), (a,d), (0,6), (b, f),(e.4), (6,0). (4), (d,a), (4,0), (4,4), (e,€), f.0). (,P)} @ ® Since R is reflexive, symmetric, and transitive, it is an equivalence relation. The equivalence classes are [a] = {a,c,d}, (b] = {oF}, lel = {a,e,d}i (d) = faje ay ld = fe} (fl = £6.53 In particular, we have [ {d] and (6) = [f] # Theorem. Let ~ be an equivalence relation on a set A. Then il fl (i) For alla € A, a € [a]. Hence + every element of | belongs to at least one equivalence class * every equivalence class contains at least one element. (ii) For all a,b € A, a ~ bif and only if [a] = [b (iii) For all a.b © A, a of Dif and only if [a] 9 [b] = @ + Hence any two equivalence classes are either equal or disjoint Proof. (i) Since ~ is reflexive, for every element a we have a ~ a and so a € [a] (ii) Let a ~ b. Suppose x € [a], which means a ~ a. Since ~ is transitive, we have x ~ b, which leads to « € [b]. Thus, [a] [8]. Similarly, we can show that [b] C [a]. Hence, a ~ b implies that [a] = [0]. Now let {a] = [0]. By i) we have a € [a] soa € [b]. Thus a ~b and [a] = [6] implies a ~ b. Hence, a ~ b if and only if {a] = [b. 29 (iii) Let a of &. Suppose [a] Mb] # @ so there's some x € [a] (6). Then x € [a] and x € [b]. Then ~ a and 2 ~ b. Since ~ is symmetric, we have a ~ x and x ~ b, Since ~ is transitive, we have a ~ b. This contradicts the fact that a % b. Hence, if a % b, then [a] 9 [b] = 2. Now let [a] [2] = @. Suppose a ~ b. Then by (ii) and (i) we have [a] = [6] 4 . This contradicts [a] M [b] = @. Thus, if [a] 9 [b] = @, then ag. Hence, a 7 b if and only if [a] M1 [8] = © A partition of a set A is a collection of disjoint nonempty subsets of «A whose union equals .1. When this holds, we say that these sets partition A. Example. Let A = {a,0,¢,d,¢, f}. The subsets {a,c,d}, {b, f}, {e} partition A. Note these were the equivalence classes in the previous example #® Theorem. Let | be a set. (ii) Any partition of A can be to form an equivalence relation on .| Proof. (i) Since every element of A belongs to some equivalence class, we have that the union of the equivalence classes equals A. Since the equivalence classes are either equal or disjoint, we conclude that the equivalence classes par- tition A. (ii) Suppose that we have a partition of A, that is, we have a collection of disjoint nonempty subsets of A whose union equals A. We define a relation ~ on A by a~b ifand only if a and 6 belong to the same subset. 1. For any a € A, since a belongs to one of these subsets we have a ~ a. Thus, ~ is reflexive. 2. For any a,b € A, if a and b belong to the same subset, then b and a belong to the same subset. Thus, ~ is symmetric. * (i) The equivalence classes of an equivalence relation on -\ partition | MK 30 3. For any a,6,¢ € A, if a and b belong to the same subset and b and ¢ belong to the same subset, then all three elements belong to the same subset, and in particular, a and ¢ belong to the same subset. Thus, ~ is transitive. Hence, ~ is an equivalence relation on A. Example. Let m be a positive integer. We saw in a previous exercise that the relation “congruence modulo m” on the set of integers, that is, a~b ifand only if a=b (modm), is reflexive, symmetric and transitive. It is thus an equivalence relation. For m = 2, we get a partition of Z into and = the set of even numb {1} =[3]=...= the set of odd numbers 3. Col, oy, ty Exercise. List all equivalence relations on the set A = {1,2,3} Exercise. List the equivalence classes for the case m st lectern of A (ch, fy Lah 23, Gh Lrsy GY (2.3 ct {1,3} Hyav many postition ofa set vf nh T1b combusted (See Wekipedins Patines Loa set) 31 ® Areflexive, antisymmetric, and transitive relation is called a partial order. © We often write ~ to denote a partial order: a < b reads “a precedes b" ® Intuitively, a partial ordering tells us which of two things “comes first” with respect to the particular way of ordering things. Example. Consider the relation < on the set of real numbers R. 1. For any a € R, we have a < a. Thus, < is reflexive. 2. For any a,b ER, ifa < band b < a, thena = b. Thus, < is antisymmetric. 3. For any a,b,c € R, ifa < 6 and b is a partial ordering on the set of real numbers R. a >b means that a comes before b if we list the numbers in decreasing order. Exercise. Prove that divisibility | defines a partial order on the set of positive integers Z* > Me oe Exercise. For any set S, prove that the relation C is a partial order on P(S). Transitive: Suge XET ad YO? Gtxye X¥ tn CEY because xeoy XEZ become YOR Je xX eZ% fea ¢. ae c ty tranr tive 32 Prove divahitty a qectial order GO) beLlesree acta So ela Lf wy aeg* a Gt elb ad be f-abee" beka and gel Yo cabeger kL eZ bs kk’b kkel og fecklel Cpaitta meyer) azb Je tle peldin~ is ra tisgmneetnic GQ) lr afb ad Ve beka ah ce bb Behe begat feb: ce (kha Wied” ‘. ale J. (S tea fee 5 | wa yore orde- SL, © Asset A together with a partial order ~ is called a partially ordered set or a poset. We denote this by (4. ~). ® We say that two elements a,b € A are comparable with respect to a partial order ~ if and only if at least one of v x 6 or b X « holds. © A partial order in which every pair of two elements are comparable is called a total order or a linear order. Example. (IR, <) is a poset. Moreover, < is a total order on R. Similarly, (R, >) is a totally ordered se Example. (Z*,|) is a poset but not a total order. For instance, 2 +7 and 742, $0 2 and 7 are not comparable in this poset. Exercise. We have shown earlier that (P(S), C) is a poset for any set S. Is the relation C a total order on P(S)? Not ConntereXauryle S > {ey Kel ye bey Netle KCY we yoy Example. On the set Rx R, we define (z,2') X (w,w’) if and only if z he / re ye) Ny leo Exercise. Determine the poset represented by the following Hasse diagram. ee of Cc | d aN, ; 1@,2),0).- GY, 40,0, GO, D9), (9) ,@,5), Ge) U5) } 34 ® Let (A, x) be a poset. An element x € A is called £ a maximal element iff there is no element a € A with

Potrebbero piacerti anche