Functions, Sequence and Relations
Functions, Sequence and Relations
=p or a proot by contraction, '© For sivtements involving negation, De Morgan's Jaws can be very helpful. '® Look for definitdons and theorems relevant tote ‘expressions mentioned in the statements to be | A definition that invelves cases suggests a pro! hy cases. 3.2 + Sequences and Strings Blue ‘Taxi ic, charges St for the first mile and 50: cents for each additional mile, The {allowing (able shows the cost of traveling from 1 1a 1) les. tn general, the cust Cy of ‘raveling 1» mniles is 1.00 (che cast of teaveing the Bet miley plus 0:30 time the aumber (a= 1) of additional miles. That is, C= 14081 = 1505- +0K5— = 1405-4 Cos b+ OMe 0, 4253 Copyrighted materialBe ene 3.2 @ Sequences and Strings 137 waileage Cost $1.00 130 2.00 290 3.00, a0 400 4% son 5 ‘The list of fares C= 1.00, C2= 1.50, C,=2.00, C= 250, y= 3.00, Cy = 450, Cp = 4.00, Cy=450, Cy= 5.00, Cio= 5.50 furnishes an example of 4 sequence, which is a special rype of function in which the consists of a set aif consecutive integers, Fur the sequence of fares, the domain 3.4.5.6. 7,89, 10), The mth term is typically denoted Cx. although 1 the more general function notation, it coud be tand sometimes is ‘written Cia). We gall nthe index of the sequence. A sequence named, say, «is denoted ¥ oF [ss]. Here s oF {sy} denotes the entire sequence ‘We use the now sg to denone the single element of the sequence s ‘Consider the sequence + ‘The first element of the sequence is 2, the second element of the sequence is 4, and 50 fon, The nth element of the sequence is 2n, If the frst index is I, we hive 4 a4 =6, fn = 2a. < ‘Consisier the sequence # amb a “The first element of the: sequence is a, the second element of the sequence is a, and so fon, Ifthe first inde 8 L. we Ihave hea I the: domain of the sequence is infinite (as in Example 3.2.1}, we say that the sequence is infinite. Wthe domain of the sequence is finite (as in Example 3.2.2), we state the initial index sé of an infinite sequence 5, we can write 4x43. Par example, ax infinite sequence v whese initial index Is 0 ean be denoted [,]og. A finite sequence x indexed from i to j ean For example, a sequence f whose domain is |=1,0, 1, 2,3} can be138 Chapter 3% Functions, Sequences, and Relations SU Dee eete die) The sequence fay) devined by the rule ENE ESO) Define a sequence b by the mule by is the nih let Ha 1 ne ‘can be demoted {n}%,). The name of the index can be chosen in any conventent way, For ‘example. the sequence u ean alse be denoted faa index m is ‘This sequence is an infinite sequence. Fist terms 1, them By can be denoted [0 Hor and I by = by = BESET sve cancers the elements of. are Ro 1B, AI. BEE Deline a sequences as (a) Find sy. (b) Find sy (©) Find a formula for 5; d) Find a formula for 551 (2) Find a formula for sy-2 (1) Prove that [re] satisfies Sy = Soe 4— Oh forall = 2 (a) Replacing a by Qin definition 3.2.1, we obtain wa eas (b) Replacis (e) Replacis (d) Replacing a by — 1 in definition 3.2.1, we obiain ge The formuly fue the term having < in the word digital, I'the index of the This sequence is a finite sequence «4 B21) (322)ea Cre een See ete 3.2 ® Sequences and Strings 139 (e) Replacing n by a ~ 2 in definition 3.2.1, we obtain 0) To prove equation (3.2.2), we will replace s-1 and S42 in the right side of ‘equation (3.2.2) by the formulas of purts (and (c). We will then use algebra to show that the result is equal to sy. We obtain = 50 4) ~ 2" (522-6? $1504. 4+ the = Prtg ae pt reeves Stq-1~ Bry ‘The techniques shawn in the example will be useful in checking solutions of ecusrence relations in Chapter 7. 4 “Two imponant types of sequences are increasing sequences und decreasing: se- ‘quences, and their relatives: nonincreasing sequences arnt nondereasing sequences. A Sequence sis ineneasing if fe = Sq) forall n foe which w and + | are inthe domain cf the sequence. A sequence s is decreasing if 5. > sa.) foe all» for wich # and ‘1+ Laren the domain of the sequence. A sequence s is nondecreasing Ife = fn forall n for which w and a + | are in the domain of the sequence, (A nondecreasing sequence i like an inzreasing sequence exceps that”-<"is replaced by ~=") A sequence sis noninercasing if ty = 30.) forall for which mand a Lare inthe doreain of the sequence, (A noninereasing sequence is like a decreasing Sequence except that ">" is replaced bby “>, “The sequence 20% 18 108 300 is increasing and swndecre sing. 4 “The sequence a, fel is decreasing and nonincreasing < ‘The sequence Wo, 90, 90, 74, Th 74, 30 is monincreasing, but it is aoy decreasing < ‘The sequence 100 is increasing, decreasing, noninercasing, und nondecreasing since there is no walue of ‘for which both | and i 1 are indexes. 4 aterial140 Chapter 3. Functions, Sequences, and Relations (One way to form a new sequence from a given sequence is to retain only certain terms of the original sequence, maintaining the order of terms in the given sequence: ‘The resulting sequence is called a subsequence of the original soquence, Let ire) be a sequence defined form = m,m-+ 1... anu beta bean increasing sequence whose values are in che set (mi,m + L....). We eall the sequence {5,,) @ subsequence of {59} < ‘The sequence be 823) is a subsequence of the sequence a heb neq a2 Subsequence (3.2.3) is obtained from sequence (3.2.4) by choosing. the third and fourth lerms. The expression 1, of Definition 3.2.11 tells us which terms af (3.2.4) 10 choose to-obtin subseqjuence (3.2.3); thus, A. The subsequence (3.2.3) is a a Notice that the sequence ab ix nos a subsequence of sequence (3.2.4) since the arder of terms in the soquence (3.2.4) is not maintained « ‘The sequence Ra 16 G25) isa subsequence of the sequence 24 6 BI I. A 16. B26) Subsequence (3.2.5) is obtained from sequence (3.2.6) by choosing the first, second. fourth. cighth. and so-on. terms: thus the value af #, of Definition 3.2.11 isa, = 2°! If we define sequence (3.2.6) by 5, = 2a, the subsequence (3.2.5) is detined by too a By ‘Twa important operutions on numerical sequences are adding and niub terms, He faz}, 8. a sequence, we define ya ‘The formalise ay Fetus Beeb a, tanta B27)See eee Example 3. See ee 3.2 ® Sequences and Strings 144 js called the um fe sigine noxation and (3.2.8) is called the product notation. 1n(3:27) 0 3.28), i iscalled the index, os calle the Yower lim, and. is called the appr tnt < Leta be the soquence defined by ay = 2a,.0 = 1. Then Son sata tae 24446212, fy -ay ay 2A 48 4 “The geometric sum par part foe par® cum be rewritten compucily using the sum notation as x 4 Wis sometimes useful to change not only the name of the index, but io change its limits as well. (The process is analogous to changing the variable in an integral in calcul ‘Changing the Index and Limits in a Sum Rewrite the sum se. lex { by J, where t= J — 1 J ethe term te" becomes (2 BrP Cj yeti & Lo when d= 0, j = 1 Thus the lower limit for j i 1. Simiarly, when ok I, ancl the upper limit for j is m+ 1, Theretiore, 1 Bue : a ‘Let a be the sequence defined by the rule a, = 2 sequence 5 defined by Ly 4 = 0 Find a formula for the142 Chapter 3 Functions, Sequences, and Relations ec A ‘We find that fy = 2-1 + Y= + = aaasanaae| 0 « ‘Sometimesthe sum and product notation sare modified to denove sums and products indexed aver urbiteary sets of imegers. Formally, if S isa finite set of integers amd a is a sequence. De tet denotes the sum of the elements [a, | i € S]. Similarly, Te denotes the product of the elements ay | 7 € 5). Hf S denows the set of prime numbers less than 20, totic Tyrer _A.siring is a finite sequence of characters, In programming languages, strings can be used to denoie text. For example, in Java “Let's read Rolling Stone. denoies the string consisting of the sequence of characters Let's read Rolling Stone. {The double quotes * mark the start and end of the string.) im computer, fitstrings (strings-o 0's and 1s) represent data and instructions toexecute, As we will see in Section $.2, the bit string 10111] represents the mumiber47, A siring over X, where X isa fini finite sequence of elements from X. Let X = [a, bch. Uwe let hab fea th ‘we obtain a string over X, This string is written bade < Since a string is u sequence, order is taken into account. For example, the string baae is different from the sicing acab. Repetitions in a string can be specified by superscripts. For example, the string bboawe may be weitten bac ‘The siring with no elements is called the mull string and is denoted. We let X” denoie the sot of all strings over %, including the null string, and we let X* denote the sel of all nonnull strings over X.Bu eee eerree ra eee eee ee tae Z z 2 3 w u ie a v ae 3.2 ® Sequences and Strings 1 ‘Let X = a. }. Some elements in X* are A, a by abab, baba, 4 ‘The length of a string a is the oumber of elements in . The length of eis de- noted la Ie = aabarbs and f= ab4a%, then Jaj=5 and |p] = 39. 4 Ie and are two strings, the string casi called the eoneatenation of z and ing of a followed by i, written cis Iy =aab and @ = cal. then ab, 4 fy scabdaab, yao yeaah, Ay sy Let = [adhe]. If we define fla, B) = a8, ‘where a and fare strings aver then f isa binary operatoron X* < Asubstring of a string o isebtained by selecting some or all consecutive elements ‘of a. The formal definition follows. Asstring # is a substring of the string w if there are strings y and & with a = yi, 4 “The string f= ad isa substring ofthe string ot = aaaddad since. if we ake y = aa and 3-= ad, we have ce = yd, Note that iff isa substring of a. 74 the part of a that precedes (in a), ana # ts the part of that tallows ine), 4 Let X= [a, b). Mor € X* let oe® denote written in reverse, For example if = ab, a = bbe. Define a function from X* to X* as f(a) =a", Prove that f is a bijection, ‘We must show that 7 is one-to-one and onto X*. We first shove that f is one-t0- ‘one, We must show that if f(ce) = (61, then a = 8. So suppose that f(a = /«B). ‘Using the definition of #. we have a* = 1". Reversing each side, we find that u =f. ‘Therefore f is one-to-one, Nextwe show that f is onte X", Wem such that (or) = A, So-suppose that fF © X” Sta) Show that if #< X".sthere exists ¢ X" It we let w= fF%, we have BY = 8 since if we twice reverse a string, we obtain the orginal string, Therefore f is onto X™ ‘We have proved that isa bjestion 4 ‘Let X = [a, bj. Define a funetion from X* xX" to X" as fter, fl) = af. Is f one-to-one” Is f onto X"Chapter 3. Functions, Sequences, and Relations We try ta prove dat fis one-to-one, If we succeed, this part of the example is complete. Ifwve fail, we may learn haw to-construct a counterexample. So suppose that ‘Alay, Bil = flees, Bx). We haveto prove thater, = ly and ag = Bs. Using the definition off, we have aif = 2B. (Can we conclude that ay = A and a Xo! It js possible to concatenate different sirings and produce the same string, For example, baa = a, if we set ay = b and fy = aa. Also. = wf if we seta = bu and, ‘Therefore f is mnraneto-one. We could write up this part of the solution as follows. Wwe setay =, 8) = aa, a2 = ba, and fs = a, then Shoes. Bi) = baer = Fe. Be. Since ay # a3. P is not one-to-one ‘The function f isento X" ifgiven any string y € A" thereexist la, fl) © XX" such that fe, 8} = y. In words, fis onto X* iFevery string in X" is the concaicnation of twosstrings, cuch in X", Since concutenating a string a with the qull string & does not change a, every siring in X* is the concatenation of two strings, each in X. This part Cf the solution could be written up as follows. Leta € X*. Then fla A) = ar =o. Therefore f is ante K*, « Probles ving Tips A sequence is a special type of function; the domain is a set of consecutive integers. If ed}, ... 16.4 sequence, the numbers 1.2... are called indexes, Index I identifies the first clement of the sequence ay; index 2 identifies the second element of the sequence x and 0 an, In this book, “increasing sequence” means strictly increasing; that thesequence Is increasing if dy = ates for all a, We require that ay is strictly less than dy. for every m, Allowing equality yiek!s what we callin this book a “nondecreasing sequence,” ‘Thats, the sequence a 1s nondecreasing if d = cys. foram, Similarrervarks apply to decreasing sequences and noninereasing sequence’, |. Deine sequence, 10. Define string “2, What is am index in 2 sequence”? U1, Die mal A. Deline increasing seuence. 12 WX 4, Deline decreating cequence. 13. exe 5, Define nanincreaing cequence LA. Define fengah of «string. How inthe length of tbe sting a 6 Define nandler reusing sequence. Coote 15. Define conearenatton of stings. How’ is the concatenation af Sea wong mene ‘ 16. Define subrrieg 9, What is TT3.2 ® Sequences and Strings 145 Answer I=3 for the sequences defined by eddie de 1. Find 4. A. Weite « sc astring 2 Find sy Answer 4-10 forthe sequence teed by 4. Bind 5. Find 6 Pid hws 7. Find tar & Fiod S71, 9 Find Sy 10, riod [[. wna [1 roa 3 12, Find a farvol that represents this sequence whose lower inde ist 1 sequence 1S Iss increasing? 18. [6s noninceeasing? Ise decreasing? 16, Isr nondecreasing” Answer 17-24 for the sequence defied by 1. Fd us 19. Fo 2 (sw incpeasing? 28. Is w nonincreasing* 14, Find os 2 an. Find Is a desreasing? 24. Taw nondecreasing? Answer 25-31 for the sequence weal walk ge 28, Is @ decressing? 30. Isp aooddccreasing? @ 27. bsg increasing? 29. tg nonincreasing? Aunswer 31-3 far the sequence wai nes ‘M. le increasing? 33, LF neninereasing’ 32, fer docreasiag™ 34k Isr oowsdecreasing? Aanwer 25-38 for the sequence ce 36, [67 increasing? 37. bs poniosreasingt Bt Is Y decreasing’ 34, Is nondecreasing Answer 39-50 forthe cequence a defined by 117, Kea imereasing? 4S, Tea decreasing? 49, Isccnonincreasing? 50, Tea nondecreasing? Answer SI-S8 for dhe sequence b defined by by = a1 Fi 3 4, Pind a formula for the sequence d defined by Tp 56, sb desesing? [Leb nondecreasing? Ps 58. Is bincreasing? 57. Ie nomincreasing Avs 59-66 fr the sete 9 dee By Find Yn) 61, Find a formu forthe sequence © defined by 3 feral 0, Find 379, (2, Find fort at sequenced lined IIo 63, Is 2 increasing’? 64, Is G2 decrensing? 65, Is 2 ooalncreasing? 66, Ie nondecreasing? Aviso 07-73 forthe sequence x defined by146 Chapter 3. Functions, Sequences, and Relations ©, Pind Formula for the sequence ¢ defined by ade 11 Ia decreasing? TR Is 8 nondeceeasing? m, Is-r increasing? 72 Isr nowinereasing? Answer 7481 for the sequence w defined by tot wo=poaep mel 2 14. Find Jw. 78, Fmt So, ‘16, Finda Focal for the sequence ¢ defined by vy tno ey ole 78. Is w inerensing? - As we decreasing? ‘Is w noninereasing? 81, Ts» oo@decreusing? RE Lethe the sequence defined by HR ty Bt Mae Find a formula forthe sequence defined by we, 4= Jn i Bveciss 3-84 refer to she sequence kg} define By oe nue man wet 153, Lint dhe first seven teem oF Ansicer RASS forthe subsequence of cdvained By waking de fre, hind, terms. 153, List te frst seven lerms of the subsequence, 88, Find a formula for che expoession ny of Detiniiow 32.11 186, Find Foemula for the:kth ten ofthe subsequence, Exercises 83-00 refer to he sequence ti) dethned by tke rude ery 187, List he es seve lems ws Ansiter 85-90 forthe subsequence af abu fy tains the frst ‘second, fourth, seventh, elec. terms: 188, List he test seve rene af ue subse. 49, inn oenmla for dhe expression of Detintion 32.11. Fira Goemala for thet ten of the subsequence Answer 91-9 iting the sequences y and ¢ defied iy woeeh eat on vai(¥»)(35) . vi »)(Es) rman seman) (I) ‘aswer 98-102 for he tence by vee wee 6. Fin oft, 97, Find rz. 98, Find rs. 99, Piel torr for rp. JA, Pied a formula tor >, 192. Prove that (7.] satisfies P= Trt — Ware Answer 03H for the sequence z depined by 108, Find » forma fee azd meen, na 198, Find 20, 104, Find 29, 145, Pind 22. 106. Find <3 167, Pind a formula for), 19, Fina formal dow 22. 110, Prove that {z9| sakinfies fy yy — Mente 6, bere Gem Lye = 2 = 3m an = 5p 108, Find a formals for 24-1, uu. m2, Soe replacing the inden J by &. where & = K+ Le 113, Rewrite the sam Wentee tat replacing the inden & by ¢, where = J 4 |. 4, Leta and # be sequences, and Tet ‘ «=u. Prewe that ‘ Boosts = ratte brs) + soboat Tis equation, Koawe as the ssitmatdiny-parts foritale, isthe siscrete analog of the imegration-by-parts format in ccaleulus Copyrighted material115, Sooietimes we generalize the acttoa of sequence as defined im this section by allowing more general indestag, Soppese ‘tun (a1 isa sequence indeed wver pairsof positive imagers, SS) £5) 116, Compute toe gives quantity using Be sings wsboah Rscmahe, y= bbeb. (ay of hi fer ©) ow «db 8B fe) |e 4) Wa) nh le (Aa Ai) a aan 8) af 4) BBya U7. Lista ssings ver M = (01) oF eng? 1a, Las all sings over X= {0,1} oF length 2 orks. 119, Liat ll cringe over X = {0,1} of feng 3. 128, List all anagsver X= 0, 1} oF Bengt 3 ores 12, Find an substrings of me sting babe, 122, Find all sobarigs the sing ach (23, Use indies to prove that Dm foe sll w= 1, where the sim ie taken overall sonempty subsets jz. -- mb OF EL...) 24, Suppose thatthe sequence (aq) sats, eam bn = Diese. 4 Gena) ford = 3, Use Linton to prove that oe ose ee TT are = Han forall = b, ie Brercives I2SADP. ay, 2. te HE 2 are wea naman onifhing Hy <.kg-< =~ Hy, amt TF am erbionnry reel aumbee: 12S, Prowe thal ify = = ra, thew . = Sos-ai= Vo eat em— a ro forall = 3. 126, Prove that tx 2 ay ore = sq then . = Sou-ale Ele at+ac-an. 7 ro ap i8 te mile Vale OF sy... 4 When w Bs odd, and any value besoreen the tts middle values (Of Ry -soety when n is even. For example, fx; <3 = xg. the medion ibe Way te ky = hein Is any valueberseen 2: and ¥9, including x2 amd 15. 3.2 © Sequences and Stings 147 Uae Execs 125 ad 126d athena oe onto pst ta ese Yen e29 21k ts minimized whee © is equal to 2 medine of 1 we repeat am experiment times and observe tbe Walues aj, ty, the stm (3-29) can be innerpreted a6 a seasure Of tse error in assusBiog that the Coen value is ‘Ths exercise shows thar this erie fs malized by thos ing.c to be-a ein of the values... 4. The requested Inductive argumeot is-atriboted ta F, Lancaster, AR, Prove hat 7 worn Eder stay = fie) = aad, boo Ut = (a te # as am aw 8 fle) = ae, Ts f one-tosone? Is ff onto 8"? Prove your sa tana Apne ep tech ta glee amaurosis cata nes Soa fine a function freer X* io the set of palindromes over X eames a a a Deine: @ fonction from X* 0X" as SF one-to-onet Is f onto 4"? Prove your ‘Let be the seal ering, lacing th nal song. io Be constricted ry xpeted applicasin ofthe flowing eas: es L then aah 6 Land nea € be fa Lond #6 H.sp g B. For evanple. ab isin L,for ifme whew = 3. theca € Lam! the Jest re states hod ab = ab & B. Similar’ bo 6 LAs anavter example, ash icia L for we make = ab, Hew © dy the Fist rule 0abb = oa € L. Ava frat example: uae ain For me woke bo thom or Lond 8 the second rule, cabo = of € L. 1 Sow that aaabie sia, NK Sow that rab isin IBM. Sher that aab is mat in B. U8. Prove that fer a has equal numbers ofa"s ands. 2136, Prove thot fe bacequal azmbercat ae ond Be them a @ ANT Let [22s be a oadecreasing aoqucnce. which iu shore, aid Ket £ Be the lest upper bound of she set Wee | 0 1,2. -.-f. Prive that for every real number «> 0, here exists 8 positive itagee N suc hal k—e = ay = forevery n = N. In caleulus eeminclogs, anondocreasing. sequence, which s howled shove, coavetzs othe Bint £, where 4 the lest upper Boel ofthe st of elenients tthe sequence. Copyrighted material148 Chapter 3 Functions, Sequences, and Relations 33 7 Relations Definition 3.3.1 » ‘A relation from ane set to another can be thought of as. table that lists which elements ff the first set relate to which elements of the second set (see Table 3.3.1}, Table 3.3.1 shows which students are taking which courses, For example. Bill is taking Com Science and An, and Mary is taking. Mathematics, In the terminology of relations, we ‘would say that Bill is related i Computer Science and Art, and that Mary is related Mathematics, OF course, Table 3.3.1 is really just a set of ordered pai relation to be a set of urderes! pairs, In this setting, we consider the ‘ordered pair to be related to the second element ofthe adored gals Abstractly, we deine a element of the TABLE 3.3.1 m Relation of Students to Courses Student Course Bill CompSei Mary a Bill An Bel History ew CompSei Dave Mab A (binary) relation & from ar set X 10. set ¥ is a subset of the Cartesian product X x ¥. Wx. y) © R we write x Ry and suy that v is relaed aay, WX = ¥, we call Ra thinary) relation on X < A function face Section 3.1) is a special type of relation. A function f from X to Y is a relation from X ta Y having the properties: (a) The domain of fis equal to ¥. (b) Foreach x € X, there is exactly ane y € ¥ such that (x, »)€ Tee let X = (Bill, Mary, Beth, Dave} and y [CompSei, Math. Art, History} ‘oureelation R of Table 3.3.1 can be written = [CBN CompSci), (Mary, Math), (Bill, Ar), (Beth, History), (Beth, CompSci), (Dave, Math)). Since (Beth, History) < R, we may write Beth R History, < Example 3.3.2 shows that a relation can be given by simply specifying which ‘ordered pairs belong tothe elation. Qur ext example shows that sometimes tis possible to-define a relation by giving a rule for membership in the relation aterial3.2 © Relations 149° ee X=(2.3.4) and ¥ = 13,4,5,6, 7]. If we define a relation R from X ta ¥ by Lhe Rife divides » ‘we obtain B= 12, 4,02, 61.03, 35,43, 6), (4, dab. Irwe rewrite R as a table, we ebiain puwn |e 4 6 3 6 4 4 IE tet k be the elation on X= (1,2, 3,4] defined by (x, 9) 6 Rix = yx, 7 eX. Then R (LT 22 LM DARD 4 224.6 An infaemative way co picture a relation an a sat isto deaw its digraph, (Dix s2raphs are discussed in moge detail in Chapter 8. Far now, we meation digraphs only in ‘connection with relations.) To draw the digraph of a relation on a set X, we first draw dots o¢ vertices to represent the clements of X. In Figure 3.3.1, we have drawa Four vertices to represent the elements of the set X of Example 3.3.4. New, if the element } is in the relation, we draw an arrow (called a directed edge) from « toy. In Figure 33.1, we have drawn direcied cdges to represent the members of the relation R ‘of Example 3.3.4, Notice that an element ofthe form (x, x) ina relation corresponds to. directed edge from x to. Such an edge isealled a loop. There is. a loop atevery vertex in Figure 3.3.1 ‘igure 3.3.1 The digranb af the relation of Example 334 EERE The relution Ron X = bed] given by the digeaph of Figure 3.3.2 is Re tah (bel (eh (ded : ia Figure 3.3.2 The digsaph of the relation of Example 3.3.3 < right150 Chapter 3 Functions, Sequences, and Relations We next define several properties that relations may have. inition 3.3.6 » | Acelation Ron a set X is reflerive if (x, x) € R farevery x € X. “ ees “The relation # on X = (1,2, 3,4] defined by (x, y) € Rafx yx, y € X, isteflenive because for cach element x € X,(x,.1) € R:specifically, (1, 1), (2, 2),(3, 31, and (4,4) are each in R, The digraph of a reflexive relation has a loop al every vertex, Natice Unat the digraph of this relation (see Figure 3.3.1) has a Toop af every vertex. « By the generalized De Morgan’s laws for logic (Theorem 1.5.14), 2 elation & on AX is not reflexive if there existe.x = X such that (4,2) # R ah R= la, a), hn Ce Ble bd fon X = (ab. cd} 6 not reflexive, For example, b € X. but (b.8) € 8. That this relation is not reflexive can also be seen by looking at is digraph (see Figure 3.3.2 sertex # dacs not have & oop. 4 ‘efinition 3.3 Arelation R om a set X is synumerric if forall. x,y ¢ X.if (x,y) ¢ R,thendy, x) € R. (beter 339°] 1 on X= fa, hye issymmetric because forall, yi Cr. ¥) € Ry then Lys 0) For ‘example, (b,¢¥ isin & amd tc. b) is also in R, The digraph of a symrnetric relation has the propery that wheneverthere is a directed edge from v 10 w, there is alsa a directed edge trom w to-p, Notice that the digraph af this relation (see Figure 3.3.2) has the property that for every dinevted edge from v We ir, there is also-a directed edge from t0 1.4 R= {1a.a), 0, Ce, eG In symbols, a relation & is symmetric if vevy{le, y) € RI [yon € Rb ‘Thus R is not symmetric if [Ye rls, rhe A) [oat 81) Ba) Using the generalized De Morgan's laws for logic (Theorem 1.5.14) and the fuct that Tip + 4) = p Ama (see Example 1.3.13), we find that (3.3.1) is equivalent 0 SrBvllesy}e R)A AIC.) € Rl ‘or, equivalently, Bey llr, ¥) © RPA LOZ RI In words, arelation is oot symmnctri Ay.) is not in R there exist x and y such that (x, ») isin RandExample 3.3.11 > Definition 3.3.12 » Example 3.3.13 » eee eee cca aie aaa) Figure 3.3.3 The digraph of the ‘of Example 3.3.15. 3.3 © Relations 151 ‘The relation Kon X = [1.2.3.4 defined by (xy) Rix < yay © X, is ‘not symmetric. For example, (2,3) € R. but (3.2) ¢ R. The digraph of this relation (see Figure 3.3.1) hus a directed edge from 2 10 3, but there is no directed edge from 3102, 4 Arelition Ran aset X is antigyrametric i forall. y € X,if(x, y)€ Rand (x0) € Re then = y 4 The relation R on X = [1.2.3.4] defined by (x,y) € Rife Z yy € Mis antisymmetric because for all x,y. x,y) € (Le, x 2 yband (uxt eR (Le. z xjthen x = y < I is sometimes moce convenient to replace if (x,y) = Rand (y.2) © Rothen x in the definition of “antisymmetric” (Definition 3.3.12) with its logically equivalent contrapesitive (see Theorem 13.18) ifn #y.thenty. 1g Roe(y x) eR to obtain a logically equivalent characterization of “umtisymmenic”: A relation & on x set X is antisymmetric if for all x, v © X,ifx # y.them(x, v) ¢ Rordy, x) R. ‘Using this equivalent definition of “antisymmewic,” we again see that the relation Ron X = [1.2.3.4] defined by (cy) ¢ Rife < y.c.9 € X, is amisymmesric because for all.x, ysife gy. Ge yh e Raita > voor(y.) ¢ >a ‘The equivalent characterization of “antisymmesric" translates for digraphs as fol- lows, The digraph of an antisymmetric reluiion has the property that between any two distinct vertices there is at most ane directed edge, Notice that the digraph of the relation A in the previous paragraph (see Figure 3.3.1) has at most one directed edge between ‘each pair af vertices, 4 I a relation has 1 members of the form (x,y), #2 y. we see that the equivalent ‘characterization of “antisymmetric” forally.y eX.itx g y.thenir. 9) ¢ Rove, nen ‘sce Example 3.3, 14) is trivially true ¢sinee the hypothesis.c # y is always fal relation R haswermembers of the form (x. 7a # ¥. Thus if inisymmetric. For example, R= [(a.a}, (0, b). te, c}) ‘on X = [a,c] is antisymmetric. The digraph of R shown im Figure 3.3.3 has at most ‘one directed edge betwcen each pair distinat vertices, Notice that Ris also reflexivecand symmetric, This example shorts that“untisymmetic™ snot the same as “not symmetric™ ‘Because this elation i in fat both symmetric and antisyrametric 4 mune if In symbols, «relation & is am Ye¥yIle, ye RAC mde Rl be152 Chapter 3 Functions, Sequences, and Relations eee Se Ee ia ‘Thus R is not antisymmetric iF sIvaVylbe. yr Batya] R] > be = VI] (332) Using the generalized De Morgan's laws for logic (Theorem 1.$.14) and the fact that (pg) = png (see Example 13.13), we find that (3.3.2) is equivalent to Indl, 1) Rady RAL = 9) BrFpl(x, 9) € RACY) RAC FSD {ion R is nos antisymmetric if there oxi and (7.8) are both in wand year #9, sus that (x, 99 ‘The relation Rem [la,0), Oc. Oe bd did fon X = [as by eval is antisymmetric becuse bath (b,c) and te.) are in R. Notice that in the digraph of this relation (see Figure 3.3.2) there aretwo directed edges between bande, 4 Accelution R on a set X is wansitive iffor all x, y.2 2X ifCe. y1 and fe) eR The relation Aon X = (1,2. 5.4] detinedbby (x, 9) € Wife = ys oy © Nyistransitive because forall F(x, yb and (y, cb € R, then (x, 2) © R. Tos formally verify that relation satisties Definition 3.3.17, we can list all paits of pairs of the form (x, ¥) and (y, :) in R and then verify that in every case, 1x, 2) € 2 airs of Form Pair af Form Ga O21 bi) Oe) an an QD 22 an a2 (22) (23) an a3) en ea an ad (2a) a) a2) 22) 2) oa a2) 23) aa) 2) ae a2 aa a4) GB a3) G3) a) aa a a3) 64) a4) Ga) aa ag 48 aa | aa) Actually, some of the entries in the prevesting table were unnecessary. IE.x = y or iy verify thal the condition Cr, yyand Gy, 2) © Re then (1, 27 R is sutisfied since it will automatically be truc. Suppose, forexample, thal x = y-and (x, 9) and (y. 2) are im R. Ys} is im R and the condition is satisfied. right3.3 @ Relations 153 ‘Eliminating the cases. x = y and y = z leaves only the following to be explicitly checked ‘tw verify that the relation is transitive: Pairs of Faema fat Oa (2) 3) (2) ay La) Bah 23) Gay ‘The digraph of atransitive elation asthe property thal whenever there are directed! sedges roi 10 9 ain Troe 9 ta c these is also a directed edge from x 10 z, Notice that the digraph of this relation (see Figure 3.3.1) has this propedty “4 In syurbols, «relation R is transitive if WeMsWElen YVE RA (ye2) © RIF (Or. 23 € RI. Thus & is not transitive if TWva Welln. 9) © Re) © RI U2) © AD 6.33) ‘Using the generalized Be Morgans laws for logie (Theorem 15.14} aid Ube fet that hp yg) = pny bce Exarple 1.3.03), we Me tht (3.3.3) 45 equivalent 16 BedySelts, ye Ry, 2) € RDA Mx, 2h eR) ‘or, equivalently, ArAy3c[tx, ype Roady, sh © Rex, che RI, In words, a relation Fis not wansttive'if thereesist.c, y,and such that ta, 1 and {y, 21 sare iw R, but (x, 2} is not im The telation R= {for 1b, ©), be 8), ta AD) ‘on X = (a, 6c. d] is not transitive. For example, (b, cand (¢, 4) are in R, but ib, Bis ros in, Notice that ja the digraph of tbis relation (see: Figure 3.8.29 there are directed edges from & 10 ¢ and fram «10 blot there is no directed edge from # 10 6, 4 [Relations can be used to onder elements of a set. Far example, the relation R defined on the sel of integers bey (ayeR ifxcy ‘orders the integers. Notice that the-selation R'is reflexive, antisymmetric, and transitive. ‘Such relations are called partial orders. A relation Boon a set Nis a partial ander if R is reflesive, antisymmetric, ane transitive, a154 Chapter 3 Functions, Sequences, and Relations ee Since the relation R defined on the positive integers. by (aye R ie divides y vrder. 4 is reflesive, antisymmevric, und wansitive, Ris 8 pant 1 8 isa partial order on a set X. the notation x ~ y is sometimes used to indicate that (x, v) © R. This notation suggests that we are interpreting the relation as an ordering ‘of the elements in X ‘Suppose that R is a partial onder oma set X.Ifr. y ¢ X andeitherx = yoryRy, is the relation from X Z det by Ryo Ry = (Cn 2h 1 Cty) © Rr and Cy, 2) € Re forsome y € Y ‘Tocompute the eomposit Put(x,2)in Ro Ry nl all puis of the form (x, v) © Ay amdty, 2} © Ra Picea ed 1 What isa binary relation froen X to F 22, Whit isthe digraph of a Binary selation? |. Defioe eeflevive relation, Give an example of o eeflesive relation, Give an example ofa relaton that is fat rePexive 4. Define simmer relation, Give an example of a symmetric relation, Give an example of a relation that is sat symmetric, S. Define ertisymetricreardon. Give an example of un antisym- mettis relatiog, Give an example af a relation that is nat anti- sommeteic, tee (n Exeovives 1-4, write the relarion as a set of oniered pata 1 8D Mammer 9921 Pliers 45, Pai mT Carpet 6 Define transitive erlation, Clive anv example of a transitive relaion. Give at enarnple of a relation that isa transitive. 7. Define partial onter and give aa example ofa partial one, 1% etine imeese velation and give an example of at inverse sclatioa, Detine eanposiion of retions ane) give an example af the ‘samposition of relations,158 Chapter 3 @ Functions, Sequences, and Relations & Sally ‘Math Rath Physics Suen eon a 2 » Un Ecconcses 5-8, wrive dhe relation ase table, SR = fer. 63.4. 3, (a. Uh fo. DP 6 A= eRe, Music} (Pat, Mistry) (en, Reh). Pat, PalySsih 11. The relation @ om 1.2.3.4) deta by (x. 9) € RIFTS y 15 Tie ren fea beset of planes tenet Ff itegers lined by (x, yh ifr iin position y foen the aun jneae- the sun ei i position 1, sed ces he sis ing in (position 2, snd se om) 4 Exersses 9-12, drow the digraplof he relation, 9. The solution of Exercise 400 (heb 10. The relation R=H1, 2012, 1008.00.02 Db ow XSL 23) Uy The relation & = 401, 21.42, 89,3, 4) FA, Dh an (1.2. A] 12, The relation of Exercise 7 In Exercises 13-16, write the relation ava sex of ondeed prs, 13, 6 ‘Find the inverse fais a set of ordered pairs) of each relacien in Exciines 116 Eveatees 18 and 1aefor tothe relaion Wo the $6012, 2,3, 4.5} cefmedd by rhe vante (x, ork Raf 3 divides x — 18, List the elements af Ft, 19. List the elements of R~! 2M, Repeat Exercises 18 ana 19 for the relation on the ast {1.2 3.4, 3) defined by the mule Cr, 9} @¢ Rife + ys 6. 21, Repeal Exersises 18 ned 19 forthe relation om the set 1162.3 4,5) defined by the rule (x, 9} 6 Rife — 1. 22. te the relation of Exercise 20 reflenive, symametti, aeviyen: netic. musts, ar a pata onder? Is the relaiion of Exercise 21 reflesive, symmetric, anlisym- metic, wanstve, ancora alone? fn Exercises 24-24 determine whether cach sate defined én the ser of positive insegors is reflexive, symmetric, amrigymmerric, tronslve, andor a para ander MinyeRifres: aS Hye RIES y Minvle Riles, BOs Rites =v. DAL tc. ye RIT divides = y 29, tr, 91 © RIF divides #428, Woke ye Rie ped MW (aye Riley) 2 3X LeL.X be a nonempty set. Define arelatica.on PUN). the power sola X,20(4, AVG Rif AS B. fs Bisselation reflexive, sy: matric, ntisymenetie, eancitive, andra paral er? 3B, Prov laa relation R oma set X i ainymmekic aad oly for alla, ye X40(a, 9) © 8 andr = 9, then Cy Fe R. 34. Let X beth set of all ourbit sings en, 0011, 0101, 1000). Define a relation & on X as 4 33H some substring of s of tengib 2 is equal 1 some substring of 92 of length 2, F:xam- ples: O11 R NGI (because both 1111 snd {010 caoiain 01), 110 8 G01 -ecause F1-anel OE dno share a cone substring of Hength 2), ls this relation reflexive, symmetric, snfsy mimetic, transite, anda partial onder? Suppose that Ri 4 partial one oa Ni, 4 = 1,2, Show tha Risa partial arderon Xy = Xs if we define Kerra) R era) xy Ry | andl Re ‘6 Let Ry sad Rye the eats on 12,3, 4) gisba by D..410420 (2,1), 03, 1), aob ob, 02, 2a. List he cleentse By o Rad Bo Ry Give exampler of refatiows ow {1.2.3.4} having Je properties “specified in Exercies TP 37, Retlecive, symmetric. and not wapsitse: ‘34, Redleuive, not symouctric, and nos transitive 9. Reflexive, ntisysometti, aod 90 transitive Copyrighted material“40, Noc reflexive, symimetcie, nor antisymmetric, and transitive 41, Not refleive, sot symomenesc, al Wansitive Let R and S be relarionson X. Determine whether-each starement in Exercises 42-4 ds em or fave, [fake stosement is trwe, pve ay onheraise; give a cavareresanipte, 42. FR jewransitive, them R-! is tansitve, WF R and S ure eflexive.then RU Sis reflerive. VER and § are reflenive, then RY Sis reflexive. Rand § are reflexive. then Ro $ is reflexive TER issefiexive then 16 and § are symmetric, then WU S issymamesric. WER sod § ure symmetric, then RS icxymametric. WR aod § ure sprnmnetric. then Ro Sis syemnelee 8 iesymmenric, ten RW! is symmette. HER aod $ are anisymipecte, then WLS is untisymmeric. Hf aod § are antisymmetric, then #77 S fs antisymmetric. inrellenive. Beesear age 3.4 © Equivalence Relations 159° 53. 18 and S are ancsyenonetsic, then Ko Sts uncnyanmesre. 54. ICR is aispmimetic. then A! is amisymnmetsic 58, How many relathons are thereon an n-eleroent set? 4h Buercisey 56-58. determine whenher each retaiow defined ow he collection ofall ponennpy subsets of rea mares ds rere Symmetric, arisymumerric, anmasive, conkior a parti onder 56. (A. B)-e Rif focevery © > M.shereexisisaé Aand be B with a — Bh 8, ST. (AB) € Rifforevery a ¢ dandy = 0, there exists be with ja = By 58. (A.B) 6 Rifforevery a €.A.h-6 Band > O, there exists a’ € Aan B with le — | < ean fa! — Bf < 59, Whats wrode With the folowing argue. whichsupposedly shor ast anyretation & on. thats symmetric und rast isrefecive™ Let X. Using symmetry, We have (4,9 al (9 8) bot in. Sinoe (x, yh ye) © A by Wransviy we have (xx) ¢ Therefore, i isrellerive. 3.4 > Equivalence Relations ‘Suppose thut we have a set X of 10 bulls, each of which is either red, blue, or green (see Figure 3.4.1), If we divide the balls into sets R. Band G according to color, the furily LR, B, G) isa panition of X. (Recall that in Section 1,1, we defined a panttion of a set & X tobe a collection $ of nonempty subsets of X such that every clement in X belongs to exactly one member of 8.) A partition can be used 1o define a relation, 1S isa partion of X, we may define 2 Ry to mean that for some set SS, both x and y belong 19 5. For the example of ‘Figure 3.1, the relation obisined could be described ass the same colar a” The next theorem shows that such 1 elation is always reflexive, symmetric, ad tansitve eoooe Ooo000 Figure 3.4.1 A set of colored balls Theorem 3.4.1 Copyrighted material