Reltions. Solutions 1. ) true; ) true; ) flse; ) true; e) flse; f) true; g) flse; h) true; 2. 2 A B 3. Consier ll reltions tht o not inlue the given pir s n element. Oviously, the rest of the reltions o. Now if we (x, y) to reltion from the first group, this will eome reltion elonging to the seon group. Sine two ifferent reltions of the first group eome ifferent reltions of the seon group, n sine reltion from the seon group eomes reltion of the first group when (x, y) is strippe off, we onlue tht there is one-to-one orresponene etween elements of the first n seon groups. This, in turn, mens tht for every element of the first group there is extly one element of the seon group n so these groups hve extly the sme numer of elements. Eh group therefore ontins 2 A B / 2 = 2 A B 1 reltions. 4. Intuition my prompt us to give the nswer none, whih is inorret. Inee there is one reltion etween these two sets: the empty set whih is vli reltion etween ny two sets! 5. r 1 = {(,),(,),(,),(,),(,),(,)} r 2 = {(),(),(),()} If the numering is,,, 1,2,3,4, then the mtrix representtion is s follows: F T T T F F F T r 1 = F F T F F T F F F F F F F T T F r 2 = T F F T F F F F 6. T F T F F T F F, where it is ssume tht,,, 1,2,3,4. T F T F T T F F 7. ) the grph shoul hve t lest 4 n t most 7 eges; ) up to 7 loops; ) extly 7. 8. There re 4 elements in the set on whih this reltion is efine. They re {}, {1}, {2}, {1,2}. Let us ssume the following numertion of elements for the logil mtrix: {}, {1}, {2}, {1,2} 1,2,3,4. Then T T T T F T F T =. F F T T F F F T 9. When ll olumns of logil mtrix re ientil, this mens tht the rows re either ll true or ll flse. Therefore, for grph with N verties, some verties will hve N outgoing eges tht go to every vertex of the grph
inluing the vertex itself (tht one is loop), n verties hving no eges or loops whtsoever. Here is n exmple 5-vertex grph: This grph orrespons to the following logil mtrix (ssuming the lphetil orer of the verties): F F F F F T T T T T F F F F F. T T T T T F F F F F 10. Sine every element ours no more thn one, there n not e ny loops on the grph. Any eges of the grph hve to e isjoint. 11. ) ) ) ) 12. The error in the proof is the ssumption tht every element is relte to some element. If tht were the se then oviously the properties of symmetry n trnsitivity woul mke it impossile for the reltion not to e reflexive. It woul hve to e reflexive following the rgument given in the prolem. However, reltion n legitimtely hve verties tht re not relte to ny other verties nor themselves. Suh verties woul not, y themselves, rener the reltion intrnsitive or symmetri the reltion my still e symmetri n trnsitive if the other reltionships re so rrnge. On the other hn, there is no reson why these verties must hve loops, n onsequently there is no reson for the reltion to hve to e reflexive. 13. ) The logil mtrix of reltion must hve true igonl for reltion to e reflexive. The rest of the mtrix elements, nmely n 2 n = n(n-1) ones, re either true or flse. Two reltions iffer if they hve ifferent eges. Different eges mens ifferent sets of true mtrix elements. The set of true elements is suset of the set of ville elements, whose rinlity is n(n-1). Consequently there re s mny reflexive reltions s susets of set of n(n-1) elements, whih is 2 n(n-1).
) For symmetri reltion, only n(n+1)/2 mtrix elements re inepenent, i.e. the igonl n either upper or lower tringulr prt. Consequently, there re 2 n(n+1)/2 symmetri reltions on set of n elements. ) Now the igonl is no longer inepenent. The nswer is 2 n(n 1)/2. ) For reltion to e oth symmetri n ntisymmetri, there shoul e no eges whtsoever. (This is euse symmetry requires tht every ege tht exists in the reltion is oule-hee, whilst ntisymmetry emns tht it is single-hee, hene the only wy to reonile these two efinitions is y hving no eges.) The reltion n still hve loops t ny numer of verties, whih mens tht the igonl mtrix elements n e ritrry. As there re n igonl elements, there shoul e 2 n ifferent symmetri, ntisymmetri reltions. e) There is just one n it is empty. f) Suppose the one element set is {x}. There re two possile reltions: {}, whih is not reflexive ut is symmetri n trnsitive, n {(x,x)} whih is reflexive, symmetri n trnsitive. 14. Define ntireflexivity s the totl lk of loops. The symmetri, trnstive, ntireflexive reltion on set is the empty reltion. Here is the proof it is the only one. Sine there re no loops n the reltion is trnsitive n reflexive, there re no eges either. Inee if there ws n ege, it woul hve to e oule-hee. By trnsitivity, tht woul result in the loops t oth ens of the ege, whih ontrits the ssumption tht there re no loops. 15. ) 2: the reltion {(,),(,)}is intrnsitive. Both reltions on one-element set re trnsitive (see solution to ex.14f). ) 2: the reltion {(,)} is symmetri. Both reltions on one-element set re symmetri(see solution to 14f). ) 0: the only reltion on the empty set is the empty reltion, whih is ntisymmetri s it oes not ontin symmetri reltionships (nor nything else). 16. This is n irreflexive, ntisymmetri n trnsitive reltion. It is irreflexive for it hs no loops ( loop woul use vertex to our twie on the list). It is ntisymmetri sine oule-hee ege woul use the sme. Finlly it is trnsitive euse the efining proposition ( x,y,z) xry n yrz xrz hs ontritory premise. 17. This reltion is lso irreflexive, ntisymmetri n trnsitive, for resons similr to ex.16. 18. Sine x/x=1=2 0, this reltion is reflexive for 0 is n integer numer. If x/y=2 n then y/x=2 n n sine for n integer n, n is lso integer, this reltion is symmetri. Finlly, this reltion is trnsitive sine if x/y=2 n n y/z=2 m then x/z=(x/y)/(y/z)=2 n m n n m is integer for integer n n m. There re in ft two equivlene lsses mong [1], [2], [3], [4]: Clsses [1], [2] n [4] re the sme lss, while lss [3] is ifferent one. 19. Let us ssume, for the ske of ertinty, tht the set tht the reltion is efine on is {,,}. The following prtitions on this set n e efine: 1. {},{},{} 2. {,},{} 3. {,},{} 4. {,},{} 5. {,,} 20. Sine the equivlene lsses o not interset, A 1 = A 2 = A 3 = A /3=8. All elements within lss re relte whih gives 8 2 =64 reltionships in eh lss n finlly q =64 3=192. 21. Denote the two equivlene reltions s n. The solutions involves the following steps. i. Oserve tht the union of two reflexive reltions is reflexive. Inee ( x) (xx or xx) simply euse xx n xx. ii. Oserve tht the union of two symmetri reltions is symmetri. Inee ( xy) (xy or xy) (yx or yx) = not (xy or xy) or (yx or yx) rule for impl. = [(not (xy) n not (xy)) or yx] or yx ssoitivity = [(not (xy) or yx) n (not (xy) or yx)] or yx istriutivity = [(xy yx) n (not (xy) or yx)] or yx = [true n (not (xy) or yx)] or yx is symmetri = not (xy) or yx or yx = not (xy) or yx or yx omm. + sso.
= (xy yx) or yx = true or yx is symmetri = true iii. Denote the union of the reltions s. For ll x, y, z suh tht xy n yz, we wish to know how to mke sure tht xz. Notie tht xy mens tht either xy or xy or oth yz mens tht either yz or yz or oth Also notie tht xy n yz gurntees xz s is trnsitive; similrly xy n yz gurntees xz. However, when xy ut not yz while yz ut not xy, then neither xz nor xz. Inee, if xz then zx y symmetry; ut lso xy n so, y trnsitivity, zy n hene, y symmetry yz. But we ssume not yz, so, y ontrition, not xz. The orollry not xz is proven similrly. Now if neither xz nor xz then not xz, whih reks the trnsitivity of. To prevent tht hppening, we shoul emn tht whenever n element z is relte to some element y y one of the reltions, sy, ut not the other,, it shoul lso e -relte to every element x to whih y is -relte s the following igrm shows: y z Here the she line epits -reltionships n the soli line epits -reltionships. Then y trnsitivity ll the she lines shoul e omplemente y the soli lines n the union of the reltions is trnsitive. It is esy to see tht this igrm mounts to proper enlosure of lsses. If n -lss intersets with -lss, either the former shoul e wholly insie the ltter or the ltter wholly insie the former. The nswer is therefore s follows: for the union of two equivlene reltions to e n equivlene reltion, it is neessry n suffiient tht the equivlene lsses of ifferent reltions re lote wholly insie one nother. 22. ) reflexive losure: r 1 r r 2 r ) symmetri losure: r 1 s r 2 s ) trnsitive losure: r 1 * r 2 *
23. Aoring to the theorem of losure, we nee to prove two sttements: 1) Tht irulr losure is preserve y intersetion. Proof: Let w = u v. Fin n suh tht w n w. By the mening of intersetion, the following re lso true: u, u, v, n v. Sine we must ssume u n v to e irulr, then it is lso true tht u n v. Agin, sine w is the intersetion of u n v, we onlue tht w. Therefore w is irulr n the property of irulrity is preserve y intersetion. 2)Tht the omplete reltion is irulr Proof: sine ( x,y S) xy, where is the omplete reltion on set S, the implition ( n ) is of type true true n so is true for ny n. To uil the irulr losure of reltion, it is neessry n suffiient to ensure tht the implition (r n r) r is true for ll n. In orer to o so, one hs to fin ll suh n tht r n r, n, if neessry, the loop r. In terms of the logil mtrix of reltion r, the rows of the mtrix shoul e snne s follows:........ T.............. T. T.. T.................... T itionl rows to e snne Every row tht hs true element on the igonl (r) shoul e snne to fin ny other true elements (r). If suh n element is foun, perpeniulr shoul e roppe from it onto the igonl to fin the igonl element to e me true (r). This uses itionl rows with true igonl elements to pper whih shoul e snne s well. As there re finite numer of rows in the mtrix n sine eh row only nees to e snne one (prove it!), the lgorithm will terminte. It is ovious tht upon termintion the onition (,) (r n r) r will e stisfie. 24. ) Alwys true. Inee, ll the originl reltionships were symmetri. If we neee to n ege (x,y) while uiling the trnsitive losure, this woul e euse eges (x,z) n (z,y) were foun, with some vertex z. But then, y virtue of symmetry, eges (z,x) n (y,z) lso existe, n hene the ege (y,x) h to e e s well. Therefore the ege etween x n y is symmetri for ny e ege, n the result of trnsitive losure is symmetri reltion. ) My e true or flse. Exmple: onsier reltion r on two-element set {,} efine s follows: r={(,),(,)}. This reltion is trnsitive n so is its symmetri losure (in ft r is symmetri itself). Now ounterexmple: onsier reltion v on the sme set: v={(,)}. Clerly, v is trnsitive, wheres the symmetri losure of v, v s ={(,), (,)} is not. ) Alwys true. The ition or removl of loop oes not rek or promote trnsitivity. Inee if r n r, trnsitivity woul emn tht r, whih is stisfie lrey. On the other hn even if ll possile loops were present, tht woul not mke n ritrry reltion neessrily trnsitive s the onition of trnsitivity pplies to ll reltionships, not just loops. ) My e true or flse. Exmple: on three element set {,,} efine reltion {(,)}. It is n ntisymmetri, trnsitive reltion. Counterexmple: onsier reltion {(,), (,), (,)} on the sme set. It is n ntisymmetri reltion. Its trnsitive losure is the omplete reltion on set {,,}, whih is no longer ntisymmetri. e) My e true or flse. Consier reltion {(,),(,)} on the two-element set {,}. Its symmetri, trnsitive, reflexive losure is the sme reltion {(,),(,)}. But this reltion is ntisymmetri s well s eing ll of those. Counterexmple: now onsier reltion {(,)} on the sme set. Its symmetri, trnsitive, reflexive losure is the omplete reltion on {,}, whih is not ntisymmetri.
25. Numerte the elements of the set in the lpheti orer (you my hoose ifferent numertion, ut then the result woul iffer in pperne from the one elow). Fin the logil mtries of these reltions n pply Wrshll s lgorithm to them. The result shoul e s follows: ) T. T... T. T. T. T... T. T.. T. T. T T T T T T T T T T ) T T T T T T T T T T T T T T T 26. Let the two-element set e {,}. There re four possile reltionships {(,),(,),(,),(,)}. The first two must elong to every reltion of orer on this set euse of reflexivity. The lst two n not our together, euse of ntisymmetry. Therefore there re only three possile reltions of orer: {(,),(,)} {(,),(,),(,)} {(,),(,),(,)} 27. The proof shoul prove reflexivity, ntisymmetry n trnsitivity. Reflexivity: for every integer n, n is relte to n sine n/n = 1 n 1 is n integer numer. Antisymmetry: if n ivies y m then n m. If m ivies y n then m n. Therefore m=n. Trnsitivity: if n ivies y m then n/m=j with some integer j. If lso m ivies y k, then m/k = i with some integer i. But then n/k = (n/m) (m/k) = j i, whih is n integer numer. Therefore n ivies y k. ) This orer is prtil, for exmple elements 5 n 3 re not relte either wy. ) If this reltion is efine on powers of 7, then for two elements, 7 n n 7 m, either the former ivies y the ltter (n m) or the ltter y the former (m n). The orer is hene totl. ) This is prtil orer. For exmple, elements 9 n 49 re unrelte. 28. The igonl mtrix elements must ll e true s this is require y reflexivity. The upper tringle shoul e the mirror imge of the lower tringle, y virtue of symmetry. One n suggest vrious neessry onitions following from trnsitivity. For exmple, if there is true suigonl in the mtrix, i.e. line prllel to the min igonl n forme y true mtrix elements, then the whole (upper or lower) tringle tht rests on tht suigonl must e true. 29. Let us onsier n ritrry topologil sort of the given prtil orer. It is totl orer efine on finite set. List the elements of the set in tht orer. Aoring to the efinition of topologil sort, it is omptile with the originl prtil orer, whih mens tht lthough some reltionships my hve een e, none hs een tken wy. Therefore, sine n element in the kth position on the list is not relte to elements in positions k i (for ny nturl i), y the totl orer, nor shoul it e relte y the prtil orer. In terms of the logil mtrix this implies tht for n pproprite numertion of elements (tht whih follows the topologil sort) the mtrix elements A k,k i, i > 0, re ll flse.
30. Proof y ontrition. If Hsse igrm is not single hin then it is either not hin or not single grph or oth. If there re two or more isjoint omponents on Hsse igrm then elements of one omponent re not relte to ny elements of the other, whih ontrits the totlity of orer. If there is only one omponent of the igrm then it must e hin for the sme reson: if vertex hs t lest two preeessors they must e unrelte (if they were relte either wy then one of the preeessors woul e onnete with the vertex in question y reunnt ege). Tht ontrits the totlity of the orer. We onlue tht the Hsse igrm of totl orer n only e single hin. 31. ) ) ) Prove reflexivity: (,) (,). Inee sine n Prove ntisymmetry: (,) (,) n (,) (,) implies = n =. This follows from the ft tht n implies = n tht n implies =. Prove trnsitivity: (,) (,) n (,) (e,f) implies (,) (e,f). The proof is se on the trnsitivity of. This orer is prtil sine, for exmple, elements (2,3) n (3,2) re not relte either wy. It is ovious tht gl((,),(.))=(min(,), min(,)). Inee, hek tht the right-hn sie is lower oun of (,) n (.): min(,), n min(,),. Now suppose there is lower oun (x,y) tht is greter thn (min(,), min(,)). This mens, in prtiulr, tht x>min(,) n t the sme time x n x. Notie tht min(,) equls either or (the minimum of numers is lwys one of them) so either x > or x > ; ut x n x! The ontrition proves tht there is no lower oun greter thn (min(,), min(,)), n so (min(,), min(,)) is the gretest lower oun of (,) n (.). The lu prt of the proof is fully nlogous. The nswer is negtive. To otin it, there is no nee to hek vrious xioms. Notie tht the rinlity of set W is 7 2 = 49 whih is not power of 2. As Boolen lgers exist only on sets whose rinlity is power of two, this one efinitely is not Boolen lger: neessry onition is not stisfie. 32. Notie tht reltion ( ) on integers is in ft the reltion of equlity. It reltes every integer to itself n nothing else. It is therefore n ientity reltion on this set. ( ) is the reltion tht reltes ny pir of numers oth wys. It is therefore omplete reltion. We onlue tht ( ) ( ) = e = 33. Inee, mens tht ( u,v) u v uv. On the other hn, ( x,z) x( ) z ( y) x y n yz, whih implies ( y) xy n yz. We hve shown tht ( x,z) x( ) z ( y) xy n yz or, put ifferently, ( x,z) x( ) z x( )z, whih mens ( ) ( ). The proof of the other sttement is ompletely nlogous. 34. Wht is trnsitivity from the reltionl lger point of view? By efinition if r is trnsitive then ( x,z) (( y) xry n yrz) xrz. Notie tht the premise prt of the implition is in ft the sttement x (r r) z, so r is trnsitive if n only if ( x,z) (x (r r) z) xrz. This n e interprete s suset reltionship etween these reltions: r r r. Now let us proof tht if r is trnsitive, then r k is lso trnsitive. Using the ft tht omposition is monotoni in the sense of set inlusion (see exerise 33), for trnsitive r we write r 3 = r 2 r r r, i.e. r 3 r 2. One n esily prove y inution (strong form) tht whenever k > m r k r m. But then r k r k r k 1 r k r k 1 r 1, i.e. r k r k r k, whih mens tht r k is trnsitive.
35. If the squre of reltion r is empty, r r =, this mens tht the sttement ( xyz) xry n yrz is flse. Using the rule of negtion for quntifiers, we write the true sttement ( xyz) not (xry n yrz). Using the vuous se of implition: not p, therefore p q, we n mplify this sttement further: ( xyz) not (xry n yrz) = ( xyz) (xry n yrz) xrz whih proves tht r is trnsitive. 36. Yes it is. Inee, ( xy) x ( ) y = ( z) xz n z ( ) y = ( z) xz n (z y n z y) = rop the rkets n use the iempotent lw for the first term: = xz n xz n z y n z y = (xz n z y) n (xz n z y) = x ( ) y, whih proves tht ( ) = ( ) ( ) 37. 38. ) not funtion, sine element 1 is relte to more thn one element ) ijetive funtion, the inverse is {(, ), (, ), (, )} ) this is ijetive funtion y= (1 3x)/2; the inverse is x= (1 2y)/3 ) not funtion. Element x=3 is not relte to ny element. ) orret. For f(g( x)) if x rnges over the omin of g, then g( x) sweeps the oomin of g n hene the omin of f. Uner suh onitions, f, eing surjetion itself, sweeps the whole of its oomin, mking the omposition f(g( x)) surjetive. ) orret. For f(g( x)), g mps ifferent vlues of x onto ifferent vlues of g(x), then f mps ifferent vlues of g(x) onto ifferent vlues in its oomin. The result f(g( x)) mps ifferent vlues of x onto ifferent vlues of f(g( x)). ) inorret. Here is ounterexmple (g is not surjetion ut the result of omposing g with f is): g f ) orret. For f(g( x)) to e n injetion, ifferent vlues of x shoul result in ifferent vlues of f(g( x)). The only wy this n e hieve is y feeing ifferent vlues from g(x) to f, so g hs to e n injetion s well s f, for those ifferent vlues from g must lwys use ifferent vlues of f. e) inorret. Here is ounterexmple (g is n injetion n f is surjetion, ut the omposition is not surjetion). g f f) inorret. Aoring to exerise () for f(g( x)) to e n injetion, oth f n g must e injetions. Sine g is stte to e surjetion, it my not e n injetion, hene the omposition my not e n injetion either.
39. It hs een proven efore, see exerise 38, tht for omposition of funtions to e injetive, oth funtions must e injetive. This proves hlf of the sttement. The other hlf, nmely tht g is surjetion, follows from the ft tht e A uses every element in its oomin. 40. Let R= f r f. It is esy to see tht R is reltion on B suh tht R = f 1 ()r f 1 (). Inee, if R, there shoul e elements x n y of A suh tht f x n y f whih is nother wy to write x = f 1 () n y = f 1 () for ijetive funtion. Now let us hek tht R is reltion of orer: Reflexivity: ( z) zrz = f 1 (z)r f 1 (z); reple f 1 (z) y w resulting in wrw whih is true s r is reflexive. Antisymmetri: ( z,w) zrw n wrz z = w; this mens tht ( z,w) ( f 1 (z)r f 1 (w) n f 1 (z)r f 1 (w)) z = w. On the other hn, for ny n the truth of (r n r) implies =, whih enles the following hin of implitions: ( z,w) ( f 1 (z)r f 1 (w) n f 1 (z)r f 1 (w)) (f 1 (z) = f 1 (w)) z = w, with the ltter implition vli on the sis of f 1 eing n injetion. By hypothetil syllogism, the first unerline proposition implies the lst one, whih proves ntisymmetry. Trnsitivity: ( z,v,w) (zrv n vrw) zrw = ( z,v,w) (f 1 (z)r f 1 (v) n f 1 (v)r f 1 (w)) (f 1 (z)r f 1 (v)) Sine f 1 is surjetion, when its rgument rnges over B, the vlue it yiels sweeps the whole set A. Therefore we n reple f 1 (z), f 1 (v) n f 1 (w) y some, n : ( z,v,w) (f 1 (z)r f 1 (v) n f 1 (v)r f 1 (w)) (f 1 (z)r f 1 (v)) = (,,) (r n r) r, whih i true sine r is trnsitive. We hve proven R to e reflexive, ntisymmetri n trnsitive, hene reltion of orer. Note, tht the pplition of ijetive funtion to reltion r using omposition hs rete reltion with extly the sme properties. Moreover, the whole set of reltions on A n e mppe onto the set of reltions on B one-to-one, preserving those properties (s well s, provly, the other known properties of reltions). Suh mpping is lle isomorphism in mthemtis n is use in the roer ontext of vrious lgeri moels.