DMS Solution Manual PDF
DMS Solution Manual PDF
2 and |[a]/a] > 2 4 1. However, for 0.5 1 and all n = 1,2,3,...,k—1,k. Forn =k+l we have ay41 = 2ay(nsy/2j < 2|(k + 1)/2], where the inequality follows from the assumption ‘of the induction hypothesis. When & is odd, then, {(k + 1)/2| = (k +1)/2 and we have apis < 2{(k + 1)/2] = k+1. When & is even, then [(k + 1)/2| = [(k/2) + (1/2)] = (4/2), and here we find that gy, S Ak/2) = RS RTL In either case it follows from ayasiyjaj < [(# + 1)/2] that axe, < E+ 1. So we have established the inductive step of the proof. Therefore, it follows from the Alternative Form of the Principle of Mathematical Induction that We Zt a, Sn. 1381B. 16. iw 18. 19. 20. 21, 22. (a) One-to-one. The range is the set of all odd integers. (b) One-to-one. Range = Q (c) Since f(1) = f(0),f is not one-to-one. The range of f = {0, £6,124, £60....} = {n? —njn € Z}. (a) One-to-one. Range = (0, +00) = R+ (c) One-to-one. Range = [1,1] (f) Since f(x/4) = f(3x/4), fis not one-to-one. The range of f = (0,1). (a) {4,9} (b) {4,9} (ec) (0,9) (4) [0,9) (©) [0,49] (f) (9,16) U [25, 36) ‘The extension must include f(1) and f(4). Since |B] =4 there are four choices for each of 1 and 4, so there are 4? = 16 ways to extend the given function g. Let A= {1,2},B = {3,4} and f = {(1,3),(2,3)}. For Ai = {1}, Az = {2}, f(AiMAn) = £(0) =O while f(As)M f(Az) = {3} 9 {3} = {3}. (a) f(ArU Aa) = {y € Bly = f(z), 2 € AyU Ay} = {y © Bly = f(z), 2 € A or 2 € Aa} = {y € Bly = f(x), 2 € Ai} U {y € Bly = f(z), 2 € Ar} = f(Ar)U f(Ad). (©) y € f(Ai) 1 f(A) => v = F(z1) = Fea), a € Ar, 2 © Ar => y = f(z1) with 21 = 22, since f is one-to-one => y € f(A 42). ‘The number of injective (or, one-to-one) functions from A to B is (|BU!)/(\B|-5)!= 6720, and {B|=8. No. Let A= {1,2}, X = {1}, ¥ = {2}, B= {3}. For f = {(1,3), (2,3)} we have flx, fly one-to-one, but f is not one-to-one. (a) A monotone increasing function f : Xy — Xs determines a selection, with repe- titions allowed, of size 7 from {1,2,3,4,5}, and vice versa, For example, the selection 1,1,2,2,8,55 corresponds to the monotone increasing function g : X; + Xs, where g = {(1,1), (2,1), (3,2), (4,2), (5, 3), (6, 5), (7,5)}. (Note the second components.) Consequently, the mumber of monotone increasing functions f : X;~» Xs is (7-4) = (#) = 330. (&) (5) = (¢) = 003. (c) For m,n € Z*, the number of monotone increasing functions f : X,, + X, is (*"""). (a) Since (4) = 4, it follows that f({1,2,3}) © {2,2,3,4} and f({5,6,7,8,9,10}) C '4,5,6,7,8} because f is monotone increasing. The number of these functions is ast) (F464) = (¢)(12) = (20)(210) = 4200. ©) (2)G) = 4080. () Let m,n,k,é € Zt with 1S kB where f(a) = f(b) = 1 and J (c) = 2. Hence {S| = 1. (b) Since f(c) = 3 we have two choices — namely 1,2 — for each of f(a) and f(b). Consequently, |S3| = 2°. (c) With f(c) =i +1 there are i choices — namely 1,2,3,...,i~ 1,1 — for each of f(a) and f(b), 80 [Si] = 7. (a) Any function f in 7; is determined by two elements 2,y in B, where 1 <2 0) we have A(1,é) = k-+2. ‘Then we find that A(1,#+1) = A(O, A(L, 4) = A(1, A) +1 = (k+2)+1=(k+1) +2, 60 the truth at n = k implies the truth at n = +1, Consequently, A(1,n) =n +2 for all n€N by the Principle of Mathematical Induction. (c) Here we find that A(2,0) = A(1,1) = 142 = 3 (by the result in part(b)). So A(2,0) = 3+2-0 and the given (open) statement is true in this first case. Next we assume the result true for some k (> 0) — that is, we assume that A(2, k) = 3-+2k. For k +1 we then find that A(2,k + 1) = A(1,A(2,&)) = A(2,4) + 2 (by part (b)) = (3+ 2k) +2 (by the induetion hypothesis) = 3 + 2(k +1). Consequently, for all n € N, A(2,n) = 3 +2n — by the Principle of Mathematical Induction. (d) Once again we consider what happens for n = 0. Since A(3,0) = A(2,1) = 3 +2(1) (by part (c)) = 5 = 2°*9 — 3, the result holds in this first case. So now we assume the given (open) statement is true for some k (> 0) and this gives us the induction hypothesis: 4(3,k) = 2493. For n = k+1 it then follows that A(3, E-+1) = A(2, AQ, k)) = 3 +2A(3, k) (by part (c)) = 3 +2(24 — 3) (by the induction hypothesis) = 2(+)+9 — 3, so the result holds for n = k + 1 whenever it does for n = k. ‘Therefore, A(3,n) = 2"*°—3, for all n € N — by the Principle of Mathematical Induction. (@) (S)4t+ (4+ + (Jat = 4 +8 - (as — (ar = 58-4 1 (0) (rant + (eet tot (F)nt = (et Dt =m 1. Section 5.3 1,2,3,4},.B = {v,w,zy,z} (a) f= {(1,»),(2,»), (3,0), (4,2)} (2,¥), (2,2), (3,9), (4,2)} 10252}, F = {(1, w),(2,w),(3, 2), (4,4),(5, 2)}- 2,4, 2},F = {(1,w), (2,2), (3.4), (4,2)}- (2) One-to-one and onto. (b) One-to-one but not onto. The range consists of all the odd integers. (c) One-to-one and onto. (4) Since f(-1) F = {0,1,4,9, 16, (e) Since f(0) = f(-1), f is not one-to-one. Also f is not onto. The range of f= {0,2,6,12,20,...}, (One-to-one but not onto. The range of f = (... = f(1), f is not oneto-one, Also f is not onto. The range of 7, ~8, -1,0,1,8,27,...}. (a), (b), (6), (£) One-to-one and onto. (a) Neither one-to-one nor onte, Range (e) Neither one-to-one nor onto. Range10. (a) 6; 6!/2!; 0 {b) 4°; (4)5(6,4); 0 For n= 5,m = 3, Dhao(—1)*(65,)(5—)? = (—1)°(9) 6+ (1) (+1) G+ (1 (8) 2) + 1)" + (1) (8)? = 125 - 320 + 70-8045 = 0 @ SOAs = Hays. + Qense.2) + Oepscr.s) + Qaysa.9+ (§)G!)S(7,5) = (5)(1)(1) + (10}(2)(63) + (10)(6)(301) + (5)(24)(350) + (1)(120)(14) = 78,125 = 5". (b) The expression m" counts the number of ways to distribute n distinet objects among m distinct containers. For 1 (7)(i!)S(n, 4) also counts the number of ways to distribute n distinct objects among m Hence m* = 3-(s)(i)S(n,i). inct containers. (a) @_ 218(7,2) (i) ets, 2)] ii) 315(7,3) Gv) Q)is!s(7,3)1 (w) 419¢7,4) (wi) GQ) e907,4)} (b) (2) S(n, &)) Let A be the set of compounds and B the set of assistants. Then the number of assignments with no idle assistants is the number of onto functions from set A to set B. ‘There are 515(9,5) such functions. For each r€ R there is at least one a € R auch that a? —2a?+a—r = 0 because the polynomial x°— 227+ 2—r has odd degree and real coefficients. Consequently, f is onto, However, f(0)=0= (2), so fis not one-to-one. (@) (4)S(7,4) (>) (3!)S(6,3) (Here container II contains only the blue ball) + (4!)5(6,4) (Here container II contains more than just the biue ball). {c) S(7,4) + S(7,3) + (7,2) + (7,1). 142M1. 12 13. 14, 15. 1 255 3025 7770 6951 2646 462 36 1 10 | 1 511 9330 34105 42525 22827 5880 750 45 1 (a) Since 31,100,905 = 5 x 11 x 17 x 29 x 31 x 37, we find that there are (6,3) = 90 unordered factorizations of 31,100,905 into three factors — each greater than 1. (b) If the order of the factors in part (a) is considered relevant then there are (3!)5(6,3) = 540 such factorizations. (©) 58(6, i) = S(6,2) + $(6, 3) + 5(6,4) + $(6, 5) + S(6,6) = 31+90+654+15+1 = 202 a (@ SUYSU6,x) = )S(,2) + (8)5(6,3) + (4S(6,4) + G1)S(6, 5) + (61)5(6,6) = a (2)(31) + (6)(90) + (24)(65) + (120)(15) + (720)(1) = 4682. (a) Since 156,009 = 3 x 7 x 17 x 19 x 23, it follows that there are 5(5,2) = 15 two-factor unordered factorizations of 158,009, where each factor is greater than 1. (b) 56,8) = S(5,2) + S(5,3) + $(5,4) + S(5,5) = 15+254+10+1=51. a () OS(n,4). a Dim S(12, 12) For I =1To 12 SW) =1 Next I Print “M For M ele To 12 4 For N = 2 To M-1 S(M,N) = S(M-1,N-1) + N*S(M-1,N) 100 Print S(M.N}; 4"; 10 Next N 120 Print “ 1” 130 Next M 140 End SSassseys ajn=4 7 nab: Sas,s) st is 14316, it. 18. In general, the answer is }i!S(n, i). 12 b) (8) So is(42,i). Fa a) (i) 10! (ii) The given outcome — namely, {C2,Cs,Cr}, {C1,Cs,Co, Cio}, {Cs}, (Cs,Cs} — is an example of @ distribution of ten distinct objects among four distinct containers, with no container left empty. [Or it is an example of an onto function f : A > B where A = {C1,C3,...,Cio} and B = {1,2,3,4}.] There are 4!5(10,4) such distributions or functions}. 10 ‘The answer to the question is J” i!5(10, ). 4 cain (BREA, 1 >) @yas.a) ©) For 0 m we have (m,n) =0, because there are more tables than people. 144.19. (b) For m 2 1, (i) s(m,m) = 1 because the ordering of the m tables is not taken into account; and, (ii) s(m, 1) =(m~1)!, as in Example 1.16, (c) Here there are two people at one table and one at each of the other m — 1 tables. There are (’s) such arrangements. (a) When m people are seated around m—2 tables there are two cases to consider: (1) One table with three occupants and m ~3 tables, each with one occupant — there are (5})(2!) such arrangements; and, (2) Two tables, each with two occupants, and m — 4 tables each with a single occupant — there are (1/2)() (5?) of these arrangements, We then find that (5)(21)+(1/2)(5) ("52) = (1/8){rm)(m—1)(m—2)+(1/2)1(1/2)(en)(m—I)]{(4/2)(m— 2)(m~3)] = (rn)(m —1}(m—2){(1/3) + (1/8)(om —8)} = (1/24)(mn)(m ~ 1}{m ~2)(3m 1). (a) We know that s(m,n) counts the number of ways we can place m people — call them pi, pzy-+-+Pm — around n circular tables, with at least one occupant at cach table. These arrangements fall into two disjoint sets: (1) The arrangements where p; is alone: There are s(m ~1,n ~1) such arrangements; and, (2) The arrangements where p, shares a table with at least one of the other m —1 people: There are s(m — 1,n) ways where PasPoy.++>Pm can be seated around the n tables so that every table is occupied. Each such arrangement determines a total of m ~ 1 locations (at all the n tables) where p: can now be seated — this for a total of (mn — i)s(m —1,n) arrangements. Consequently, (m,n) = (m—1)s(m ~ 1,n) + s(m ~ In = 1), for m > n> 1. (b) For m = 2, we have s(m,2) = 1 = 11(1/1) = (m— Et. So the result is true in this case; this establishes the basis step for a proof by athe induction, Assuming the result for m = k( 2) we have a(f,2) = (k — yd Using the result from part (a) we now find that 6(k-+1,2) = ke(k,2)+0(4,1) = k(k ys 24-0! = . é HO 4. The result now follows for all m 2 2 by the Principle of Mathematical Induction. = Sayayet = Section 5.4 Beere we find, for exemple, that F(a, f(b,6)} (a) For all a,b € R, f(a,b) = [a +5] = [b +a] = f(b,a), because the real numbers are commutative under addition, Hence f is a commutative (closed) binary operation. (b) This binary operation is not associative, For example, F(F(B.2,4.7),6.4) = f([3.244.7], 6.4) = f([7.9],6.4) = f(8,6.4) = [846.4] = [14.4] = 15, 145nL while, £(8.2, f(4.7,6.4)) = (8.2, [4.746.4]) = f(8.2, [1L1]) = f(8.2,12) = [8.2419] = [15.2 (c) There is no identity element. If a € RZ then for any } € R, fa +8] € Z. Soif z were the identity element we would have a = f(a,2) = [a+2] with a € R—-Z and fate] eZ. (a) f(2,y)=2+y—2y =y+z2—ye = f(y,z), so the binary operation is commutative. Fw, 2)u) = fw, 2) +9 flw2)y = (ws wa) + y-(wt2—wr)y=wtety~ we — wy —2y + way. fl, f(@,y)) = w+ flesy) —w- flay) = wt (e+y—2y)—w(ety—zy) =wtety— we — wy — cy + wry. Since f(f(w, 2), y) = f(w, f(z, y)), the (closed) binary operation is associative. (b), (4) Commutative and associative (c) Neither commutative nor associative. (a) The identity is = = 0. (a) The identity is z= 3. (b), (c) Neither of these (closed) binary operations has an identity. () 2% (b) 5 ( (@ 5° (a) (b) 3 {c) 3-58, because neither a nor b can be an identity. (@) 3-89 (a) Yes (b) Yes (©) No Each clement in A is of the form 2! for some 1 < i <5, and ged(2,2°) = 80 2° = 32 is the identity element for f. (32)(38) = 1216. (b) The identity element for f is pq". = ged(2*, 2), For n € Zt let pi,pay-.-/Bp be distinct primes and for each 1 0 and ged(2,m) = 1. ‘There are 150 possibilities for m: namely, 1,3,5,...,299. In selecting 151 numbers from {1,2,3,...,300} there must be two numbers of the form 2 =2*-m,y=2'-m. I z 3, 32,y € S where z,y are both even or both odd. In either case t+y is even. (&) (= 22+) (©) = 242) 147(a) For n€Zt let $= {(ay,02,...,an))a; € 24,1 (Wis¥2y-+-sYn) such that 25+ yy is even Wisin. {e) 5 ~ os in part (b). (a) Forany ¢ € {1,2,3,...,100},1 < Vé < 10. Selecting 11 elements from {1,2,3,...,100} there must be two, say 2 and y, where |/z] =| /ij], so that 0 <|Yz— J <1. (b) Let n€Z*. If n+1 clements are selected from {1,2,3,...,n7}, then there exist two, say z and y, where 0 <|¥e— Ji] <1. 4s10, 12. 13. 4. 15. In triangle ABC, divide ench side into three equal parts and form the nine congruent triangles shown in the figure. Let Ry be the interior of triangle ADE together with the points on segment DE, excluding D,B. Region Ry is the interior of triangle DFG together with the points on segments DG, FG, excluding D,F. Regions Rs,...,R9 ave defined similarly so that the interior of A ABC is the union of these nine regions and Rj 0 Rj = 0, for i # j. Then if 10 points are chosen in the interior of A ABC, at east two of these points are in Rj for some 1 7m — 21 or 148 > 7m, Hence 7 $m <2. 14916. i. 18. 19. 20, 2. 22, 23. Proof: Consider the k +1 integers: (1) 3; (2) 33; (3) 333; ...; and (k +1) 333 where for all 1 b, Then a~6= (qi ~q2)k, s0 ki(a— 6) and the only digits in a —} are 0’s and 3's, [Note:The integer 3 is not special. The result is also true if we replace 3 by any of the digits 1, 2, 4, 5, 6, 7, 8, 9. However, we cannot obtain the result without using the digit 0,] (a) 24,13 (b) 3,6,9,2,5,8,1,4,7 (c) For n > 2, there exists a sequence of n® distinct real numbers with no decreasing or increasing subsequence of length n+1. For example, consider n,2n,3n,...,(n—1)n,n?, (n— 1), Qn—1),...,(n?=1), (n-2), (2n~2),...,(n?—2),-.-41, (N41), (2N41),-..,(n—Wn +l. (4) The result in Example 5.49 (for n > 2) is best possible ~ in the sense that we cannot reduce the length of the sequence from n?+1 to n? and still obtain the desired subsequence of length n +1. This follows from the result due to Paul Erdés and George Szekeres: A sequence of 50(= 7? +1) distinct real numbers contains a decreasing or increasing subsequence of Jength &=7+1). Proof: If not each pigeonhole contains at most k pigeons — for a total of at most kn pigeons. But we have kn +1 pigeons. So we have a contradiction and the result then follows. (@) 7 (b) 13 (©) 6-1) +1 (a) 1001 (b) 2001 (©) Let k,n € Z+. The smallest value for |S| (where $C Z*) so that there exist n elements 21,22,...,2, €S where all n of these integers have the same remainder upon division by & is k(n — 1) +1. Proof: If not, each pigeonhole contains at most [(m —1)/n] pigeons ~ for a total of n{(m—1)/n} < m—1 pigeons. But this contradicts the fact that we have m pigeons. The result then follows. {Note: This result is true even if m acz + ad+b = acz +be+d => adt+b=be+d (a) (foghx) =3x-1; (go f(z) = 82-1); Pa? + (2ab—a)a + (6? 6 +1). By -1 or a=~3,b=2, tonya) ={ A ae (ho gz) ={ : cod” (Fo(ao hia) = (a 0 hY2)) = { 3 oa enya)={ Fon seu a fh eee ©) Pe) = Mle) = 2-2 P(e) = 2-3; G2) = 965 g(e) = 2a; Ws =H =H, (a) If c€C, there is an element a€ A such that (go f)(a) =e. Then g(f(a)) =e with f(a) € B, so g is onto. 15110. wa 12. 13. (b) Let 2,yEA. fe) = fly) => o(f(2)) = o( fw) => (90 Ie) = (90 Fy) = = y, since go f is one-to-one. (a) fe) = }(énz - 5) (b) For 2 €R*,(f 0 f(z) = f(E(enz — 5) = eM(UAMEne-B)N48 a fre 845 we glee = 2 for 2 ER, (f-to f)(z) = f-'(e**) = 3[en(e***) — 3] = 122+ 5-5] =z. (a) fo ={(,v)Qy+32= 7} (b) ft = {(e,y)lay + bz =0, b #0, a AO} (ce) fl = {le w)ly = 2°} = ((z, yz = 0} (d) Here f(0) = f(-1) = 0, so f is not one-to-one, and consequently f is not invertible. fig invertible => cach of f,g is both one-to-one and onto ==> go fis one-to-one and onto => of invertible. Since (go f)o(f-tog™) = Io and (fog )o(gof)= la, fv? og7 is an inverse of go f. By uniqueness of inverses f~? 0 g~! = (go f)"'. (a) F1(2)) = {a € Alfa) € {2} {ae Alf(a) € {6}} = {a € Alf(a) = (a € Alf(a) € {6,8}} = {a € Alf(a) = 6 or f(a) = 8} = {2,3,4,5,6}, (3) = f(5) = 6 and f(4) = f(6) = 8. (d)_ f-2({8,8, 10}) = {2,3,4,5,6} = f-"({6,8}) since f-*({10}) = 0. (e) £-*({6,8, 10, 12}) = {2,3,4,5.6,7} 6) F*H39, 12}) = {7} (a) f7{-10) = {x ER] 2 $10 and ¢ +7= ~10} = {-17} £7(0) = {~7,5/2} SA) = {-3,1/2,5} £76) = {-1,7} FD) = {0,8} £-(8) = {9} 15214. 15. 18. 17. (b) @) f-(-5,-1) = {2 E R| 2 2. But we also find that (fo 9)(2) = f(max{1,0}) = F(1) = 2, s0 (f og)(1) # 1, and, consequently, fog # 1z+. 15318. 19. 20. 2 22. (a) (0,0) = 0 = f(@, {1}) and (0,9) # (0, {1}), so f is not one-to-one. 9({1},{2}) = {1,2} = 9({1, 2}, {2}) and ({1}, {2}) # ({1,2}, {2}), 80 9 is not one-to- one. A({1}, {2}) = {1,2} = h({2}, {1}) and ({1}, {2}) # ({2}, {1}), 80 A is not one-to-one. (b) For each subset A of Zt, f(A, A) = 9(A,A) = h(A4,8) = A, so each of the three functions f, g, and h, is an onto function. (c) From the results in part (a) it follows that none of these functions is invertible. (a) The sets f-*(0), h-*(B), F'({1}), A"{3}), F*(L4,7}), and A-*({5,9}), are all infinite. (©) [-*(8) = {(0,0)}, 80 |o~*(B)| = 2. 9 *(42}) = {(8, {2}), ({2},8), ({2}, {2})}, s0 lo *({2})] = 3 lg *{8,12})] = 9. (a) @€ f*(BiNB2) => fla) € BAB, <= f(a) € By and f(a) € B, => a€ f-(By) and a € f-'(By) => a € f*(Bi)N f-(B2) (©) a€ f"(Bi) => fla) € Bi > f(a) ¢ Bi > ag fDi) > ae FB) (a) (i) f(x) = 22; (i) f(z) = [z/2] (b) No. The set Z is not finite. (a) Suppose that 21,2 € Zand f(x;) = f(x). Then either f(z,), f(z2) are both even or they are both odd. If they are both even, then f(z1) = f(22) = —2e1 = —2ra = a; = 22. Otherwise, f(21), f(¢2) are both odd and f(2:) = f(v2) + 20; —1 = 2x, —1 > 2x = 2x4 => m, = 7. Consequently, the function f is one-to-one. In order to prove that f is an onto function let n € N. If n is even, then (~n/2) € Z and (-n/2) <0, and f(—n/2) = -2(—n/2) = n. For the case where n is odd we find that (n+1)/2 €Z and (n +1)/2 > 0, and f((n +1)/2) = 2(n + 1)/2]-1=(n41)~1=n. Hence f is onto. (b) ft: NZ, where _f/ Per), =1,3,5,7... eae sass It follows from Theorem 5.11 that there are 5! invertible functions f : A —+ B. (2) For all n EN, (go fn) = (ho fy(n) = (ko fin) =n. (b) The results in part (a) do not contradict Theorem 5.7. For although go f = ho f = ko f = In, we note that @) (f09)) = £({1/3]) = £0) = 3- Gi) (Fo A)(1) = f({2/3]) = $0) =3-0= 04 1, 50 foh # Ip; and Gi) (FBG) = F((3/3]) = £0) = 3-1 = 3 #1, 90 Fok IN. Consequently, none of g, h, and k, is the inverse of f. (After all, since f is not onto it is not invertible.) OF 1,80 fog # IN; 1545 7 Section 5.7 (a) fe O(n) (b) fe 00) () fe O(n’) () fFEOm) (e) FEO(n) — f) FE O(n’) (8) f€ O(n?) Let m = 1 and k = 1 in Definition 5.23. Then Vn > k |f(n)| =n < n+ (1/n) = |g(n)i, s0 f € O(9). howd m=2 and k=1. Then Vn > k (g(n)| =n + (1/n) ) For n = 6, 2" = 64 < 3096 = 4096 ~ 1000 = 2"? - 1000 = 2 — 1000. Assuming that 2* < 2?*— 1000 for n =k > 6, we find that 2 < 2? =» 2(2) < 2°(2%* — 1000) < 292% — 1000, or 2441 < 22+) — 1000, so f(n) < g(n) for all n 2 6. Therefore, with k=6 and m=1 in Definition 5.23 we find that for n > k {f(n)| < mig(n)| and Fe Oy). (c) For all n > 4, n? < 2" (A formal proof of this can be given by mathematical induction.) So let k= 4 and m=3 in Definition 5.23. Then for n> k, |f(n)| =3n? < 32") < 3(2” + 2n) = mlg(n)| and f € O(g). Let m=11 and k=1. Then Yn > k |f(n)| =n +100 < 11n? = mlg(n)|, so f € O(g). However, Vim € R* Vk € Z+ choose n> mar{k,100+m}. Then n? > (100-+m)n = 100n + mr > 100m + mn = m(100 +n) = mif(n)I, so g ¢ O(f). To show that f € O(g), let k= 1 and m = 4 in Definition 5.23. Then for all n> k, If(n)| =n tn k) A (lo(n)| > mif(n))]- So not matter what the values of m and & are, choose n > maz{4m,k}. Then [o(n)[ = (1/2)n® > (1/2)(4m)n? = m(2n2) > m(n? +n) =mlf(n)|, 90 9 ¢ OCF). Vm € Rt Vk € Z+ choose n> max{k,m} with n odd. Then n= |f(n)]>m=m-1= mig(n)|, 30 f ¢ O(g). Ina similar way, Vm € Rt Vk € Z* now choose n > maz{k,m} with n even. Then n= |g(n)i>m=m-1=mlf(n)l, and g ¢ O(f). For all n > 1,logyn < n, so with k =1 and m=1- in Definition 5.23 we have ig(n)| =log,n m, or [f(n)| =n > mlogyn = mlg(n)|. Hence f ¢ O(g). f € O(g) => 3m, € Rt 3k, € Zt 50 that Yn > hy [f(n)| < milg(n)]. g € O(h) => mg € Rt Fk, € Z* so that Yn > kz |o(n)| < ma|h(n)|. Therefore, Vn > max{ky, ka} we have [f(n)| < miJg(n)| < mmjh(n)| and f € O(h). Since f € O(g), there exists m€ R+,k € Z* so that |f(n)| k. But then [f(n)| < [m/lel]leg(n)| for all n> k, so f € O(cg). (a) Let k=1 and m=1 in Definition 5.23. (b) If he O(f) and f € O(g), then h € O(g) by Exercise 8. Likewise, if h € O(g) and g € O(f) then h € O(f) - again by Exercise 8. (©) This follows from parts (a) and (b). (a) For all n > 1, f(n) = Sn? +3n > n? = g(n). So with M = 1and k |f(n)| > Mlg(n)| for all n > k and it follows that f € 2(g). (b) For all n > 1, (n) = n® = (1/10)(5n? + 5n*) > (1/10)(5n? + 3n) = (1/10)f(n). So with M = (1/10) and k = 1, we find that |g(n}| > M|f(n)| for all n > & and it follows that g € Of). (c) For all n > 1, f(n) = 5n?43n > n= A(n). With M = 1 and & = 1, we have [f(n)| = Mlh(n)| for all n > k and so f € 2(h). (a) Suppose that h € M(f). If so, there exist M € R+ and k € Zt with n = |a(n)| > Mij(n)| = M(5n? +3n) for all n> &, Then 0 < M < n/(5n?+3n) = 1/(5n+3). But how can M be a positive constant while 1/(5n +3) approaches 0 as n (a variable) gets largex? From this contradiction it follows that h ¢ 2(f). Proof: Suppose that f € (9). Then there exist M € R* and k € Zt such that If(@)| > Mlg(n)| for all n 2 k. Consequently, |g(n)! < (1/M)If(n)| for all n > k, so ge OF). Conversely, 9 € O(f) => 3m € Rt 3k € Z* Vn > k (|g(n)] < mif(n)|) > 3m € Rt 3k € Zt Yn > k (If(n)] > (1/m)lo(n))) > 3M € Rt 3k € Zt Vn > k (If(n)] > Mig(n)}) > f € %(g). [Here M =1/m.] [Note: Upon replacing each occurrence of + by 4 we can establish this “f and only if” proof without the first (separate) part in the first paragraph.] (a) Porn 21, fin) = Dhy i = nln +: 1)/2 = (n2/2) + (n/2) > (n?/2). With k = 1 and M = 1/2, we have |f(n)| 2 M|n{ for all n > &. Hence f € Q(n?). (bo) Dh? = P42 Het? > [afte tn? > [nfo + [nf]? = fla + 1)/2\{n/2)? > n3/8. With k = 1 and M = 1/8, we have {g(n)| > Mjn°| for all n > k. Hence g € (n°). Alternately, for n > 1, 9(n) = Di, i? = n(n + 1)(2n + 1)/6 = (2n* + 3n* + n)/6 > n3/6. 1, we have 15614, 15. 16. With & = 1 and M = 1/6, we find that |g(n)| > M|n®| for all n > k ~ so g € Yn°). (0) Chg if = UHR tnt > [r/2]tp---tnt > [n/2]t4---+[n/2}t = f(nt1)/2] [0/2]! > (n/2)). With & = 1 and M = (1/2), we have |h(n)| > M|n‘t#| for all n > k. Hence he Mn), Proof: f € O(g) = Fmi,m, € Rt Fk € Zt Vn 2 k milg(n)| < [F(n)| < malg(n)] > Bm, € RY Ak € Zt Yn F |fln)l < malg(n)| => f € O(g) and f € O(g). Conversely, f € 2(g) = 3m: € Rt 3k € Zt Vn > ky milg(n)| < [f(n)]. Likewise, f € O(g) => my E R* 3h; € Zt Yn > ke [f(n}| S raalg(n)|. Let k = max{hy, kp}. Thea for all n > k, mulg(n)| < |f()] < malg(n)], 50 f € Of). Proof: f € O(g) => f € Mg) and f € O(g) (from Exercise 14 of this section) => g € O(f) and g € 2 f) (irom Exercise 12 of this section) > g € O(f). Proof: Part (a) follows from Exercises 14 and 13(a) of this section and part (a) of Example 5.68. ‘The situation is similar for parts (b) and (¢).. Section 5.8 (a) FEO) — (b) FE O(n°) (©) f € O(n?) (d) f € O(log.) (€) f € O(nlog, n) (a) FE On) (b) fe O(n) (a) For the following program segment the value of the integer n, and the values of the array entries A(1), (2), A(3},..., A[n] are supplied beforehand, Also, the variables i, Max, and Location that are used here are integer variables. jegin Max := A(t}; Location := 1; In =1 then Writeln (The first occurrence of the maximum °); Write (entry in the array is et position 1.’) End; If Max < Afi] then Begin 1874. Location End; Writeln (’ The first occurrence of the maximum °); Write (’ entry in the array is at position °, End End; (b) If, as in Exercise 2, we define the worst-case complexity function f(n) as the number of times the comparison Max < Afi] is executed, then f(n) =n ~1 for alln € Z+, and FE O(n). (2) For the following program segment the value of the integer n, and the values of the array entries A(t}, A(2], 4(3),...,A[n] are supplied earlier in the program. Also the variables i, Max, and Min that are used here are integer variables, jegin If Ali] < Min then Min := Ali If Afi] > Max then Max := Ali; End; Writeln (° The minimum value in the array is ’, Min :0); Write (’ and the maximum value is’, Max:0,".’) End; (b) Here we define the worst-case time-complexity function f(n) as the number of com- parisons that are executed in the For loop. Consequently, f(r) = 2(n — 1) for all n € Z+ and f € O(n). (e) Here there are five additions and ten multiplications. (b) For the general case there are n additions and 2n multiplications. (a) For each iteration of the for loop there is one addition and one multiplication. Theze- fore, in total, there are five additions and five multiplications. (b) ‘For the general case there are n additions and n multiplications, , we find that a; = 0 = |0{ = {logy 1], so the result is true in this first Proof: For n = case. Now assume the result true for all n = 1,2,3,...,k, where k > 1, and consider the cases forn=k+1. 15810. nL. (i) n=k+1= 2", where me Z+: Here a, =1+4 ajpjaj = 1+ ayn = 1+ flog, 2-1 1+ (m—1) =m = [log, 2") = flog, nf; and (i) n=k+1=2" +r, where me Zt and 0 1) and consider what happens at n= k +1. () n=k+1=2, where m € Zt: Here ay = 1+ apy) = 1+ ayn-s = 14 flog, 2") = 14 (m~ 1) =m = flog,2”] = flogyn]. (i) n=k+1=2" +r, wherem € Zt and0 2, let f(n) count the maximum number of times the second while loop is executed. The second while loop is executed at most n—1 times for each value of i, where 2 2, let f(n) count the maximum number of comparisons made in the while Joop. This is n — 1, which occurs if the integers in the array are in ascending order or if ay (x € A and z € B) and (y € Aandy € B) = (z,y) € AxB and (z,y) € Bx A= (x,y) € (Ax B)N(Bx A). Consequently, (A x B)N(B x A) = (ANB) x (ANB). (b) Heither A or B is ® then Ax B= 0 = Bx A and the result follows. If not, let (2,y) € (A x B)U(B x A). Then 160(zy) € (Ax B)U(B x A) = (2, y) € Ax B or (z,y) € (Bx A) > (2 € A andy € B) ot (¢ € Bandy € A) +(e € Aorz € B) and (y€ Aory € B) + z,y € AUB S (x,y) € (AU B) x (AUB). (a) True (b) False: Let A= {1,2},B = {x,y}, f = ((,2),2,y)}- (c) False: Let f:Z—+Z,f(e)=22, (4) True. (@) False: Let A= {1,2}, B = (1,2,3},0 = {1,2,3,4},f = {(1,1),(2,2)}, 9 = {(1,1), (2,2), (3,3)},& = (1, 1), (2,2), (3,4)}. () False. Let A= {1,2,3,4}, B= {5,6}, Ar F = {(1,5), (2,6), (3,5), (4,5)}. Then f(AiN Ay (g) True (a) fl) = fQ-1)=1- FG) +1- £4), 80 FQ) = (b) f(0) =0 (c) Proof (by Mathematical Induction): When a = 0 the result is true, so consider a #0. For n = 1, f(a") = f(a) = 1-°- f(a) = na"“*f(a), so the result follows in this first case, and this establishes our basis step. Assume the result true for n = k(2 1) ~- that is, f(at) = ka®~' f(a). For n = k +1 we have f(a?) = f(a-a*) = af(a') + a*f(a) = aka*! f(a) +a*f(a) = ka* f(a) + a*f(a) = (k + 1)a*f(a). Consequently, the truth of the result for n = k + 1 follows from the truth of the result for n = k. So by the Principle of Mathematical Induction the result is true for all n € Z+. 1,2}, Aa = (2, (2) = {6}, Be Caan) = {5,6}. 14x21 = 262, 144 => [A x Bl = 18 => |Aj = 2,[B] =9 or [Al = 3,13] = (x,y) € (ANB) x (CMD) = 2 € ANBy € COND «> (2 € Ay € C) and (© € By € D) = (2,y) €AXC and (2, y) € BX D = (2,y) € (AX C)M(Bx D) () 5! (b) 4 WO<2 <1, then [x] = 0 and 2? jy. Wi <2 <2, then |r| =1 and 2? 3/2. For k € Z* and & 2 2, if k Sz 2 we find that &(k ~1) > 0, so k(k—1) > 1>1/2, and k? ~ k > 1/2. Now kt > k + (1/2) = k > e+ (1/3) = x and we do not have kSack+1 Finally, let & € Z+ and consider —k < 2 < —k+1, Then 2? — [2] = 24-(~k) =a? +h, and 2? — [z] = 1/2 = 21 = —k +1/2 <0, so z cannot be a real number. Consequently, there are only two real numbers that satisfy the equation 2*— [2] = 1/2 — namely, 2 = 1//S and 2 = /3/2. Proof: First we show that the result holds for the first part of the recursive definition. Since 2.1 = 2> 1 we find the result true in part (1). In order to complete the proof we need to verify that every ordered pair (s, t) in R that results from part (2) of the definition satisfies the condition 2s > £, We consider three cases: 16110. wa (i) (@+1,8) with (4,0) € R: Here we have 2a > 6, and since a+ 1 > a it follows that Ya +1) > 2a> bj (i) (a+1,5-+1) with (a,0) © R: Now we find that 2a > b => 2a +22 6+1= 2%a+1) 2 641; and (ii) (a+ 1,64 2) with (a,0) € R: In this last case it follows that 2a > b > 22+2> b4+2>Aat1)> 042. Consequently, for all (a, 6) € R we have 2a > 8. (a) P(z) = F(F(@) = af F(z) +b) — b= al(a(z +5) ~b) +B] — b= a(z48)—b P(2) = F(P(2)) = fla(x +b) — d) = af(a?(z +b) —B) + —b = a(x +b) —b (b) Conjecture: For n € Zt, f*(z) = a*(x +8) — 8. Proof (by Mathematical Induction): The formula is true for n = 1 - by the definition of f(z). Hence we have our basis step. Assume the formula true for n = k(> 1) — that is, f(z) = a*(2 +) — b, Now consider n=k+1. We find that f4"(2) = f(f*(2)) = f(a*(e+8)—8) = al(at(x+)—b) +5]— a*1(z +6) —b. Since the truth of the formula at n= & implies the truth of the formula at n = k+1, it follows that the formula is valid for all n € Z* ~ by the Principle of Mathematical Induction. Let n = |A]—|Ay]. Since |B)? is the number of ways to extend f to A and |B)? then n = 3 and [4] = 8. (a) (7x6 x 5 x 4x 3)/(75) + 0.15. (b) For the computer program the elements of B are replaced by {1,2,3,4,5,6,7}. = 216, 10 Random 20 Dim F(5) 30 Forl=1To5 40 F(1) = Int(Rnd*7 + 1) 30 Next I 60 ForJ=2Tod5 70 For K=1ToJ-1 80 ‘If F(J) = F(K) then GOTO 120 90 Next K 100 Next J 110 GOTO 140 190 C=C+1 130 GOTO 10 140 C=C+iI 150 Print “After ”; C; “ generations the resulting” 160 Print “function is one-to-one.” 170 Print “The one-to-one function is given as:” 180 Forl=1To5 190 Print “(51 4)"5 FOS “” 16212. 13. 14. 15. 16. 17. 18. 19. 20. 200 Next I 210 End For each subset A of S, let +4 denote the sum of the elements of A. Consider only those nonempty subsets A of $ where |A| < 5. There are 2”—1~1—7= 119 such subsets and here 1 <8 $ 20+21+22423-424 = 110. The result follows by the Pigeonhole Principle for there are 119 subsets (pigeons) and 110 possible sums (pigeonholes). For 1 1, flo ft = fro ft. Then fit! of" =(fo fo ft = fo(flof) = fo(froft) =(fofofi=(Moflof = fro(foft) = fro fi, so FP 0 f" = fro f™ for all m,n € Zt, (b) vy € f(Mier Ai) => y = f(z), for some z € Nes Ai => v € f(A), for all i € T= y € Nicer f(Ad)- (c) From part (b), f(Mier Ai) © Mer f(Ai). For the opposite inclusion let y € Myer FAs) Then y € f(Aj) for all i € I, so y = f(z;),2; € Aj, for each i € I. Since f is one-to-one, all of these 2;'s, i € I, yield only one element = € Mier Ai- Hence y = f(z) € f(Mer Ai), 50 (ker f(Ai) © F(Mier Ai) and the equality follows, ‘The proof for part (a) is done in a similar way. - Proof: Let a€ A. Then Ja) = a FF(@)) = FG FFF(@)) = Fla 0 F@)). From f(a) = 9(f(f(a))) we have f7(a) = (f 0 f)(a) = f(a f(F(a))). So f(a) = Fg 0 F(a) = FG FF(F(@)))) = PUF@) = PU P(@)) = FFF) = F(g(F(a))) = 9(a)- Consequently, f = g. 2 (a) nf") = ptr?) (b) nf) (c) ae”) (a) Since [A] = n, there are n choices for each selection of size k, with repetitions allowed, from the set A of size n. ‘There are r = (#7) possibie selections and n™ commutative E-ary operations on A. a) Note that 2 = 2', 16 = 2*, 128 = 27, 1024 = 2!°, 8192 = 2", and 65536 = 2°, Consider the exponents on 2. If four numbers are selected from {1,4,7,10, 13, 16}, there is at least one pair whose sum is 17, Hence if four mumbers are selected from S, there are two numbers whose product is 2" = 131072, b) Let a,,c,d,n € Z*. Let S = (6%, 004, b+... b+=4), If [2] 4-1 numbers are solected from S$ then there are at least two of them whose product is b?¢*™4_ (a) xans,xa*Xe both have domain &/ and codomain {0,1}. For each z € U, x4na(z) = Liff 2 € ANB iff z € A and z € B iff xa(z) = 1 and yp(z) = 1. Also, xuna(z) = 16427. 28. 29, 31. 32. O if x ¢ AN Biff 2 ¢ Aor 2 ¢ Biff xa(z) = 0 or xn (2) = 0 if x4-xa(2) = 0. Hence XanB = XA*XB> (b) The proof here is similar to that of part (a). (©) xa(v) = Lif x € Aff c ¢ Af y4(x) = O18 (1—x4)[z) = 1. yale) = 01 « ¢ Aiff x € Aiff yq(z) = Lif (1—x4)(e) = 0. Hence xg =1— x4. fog={(2,2), (vu), 2k gf = {(2,2), (v2), (ev) f* = {(2,2),(4,2), (vig = (2,9) 2) (2) (go fy" = {2 2), (2), (eu)} = ftom hg tof = K(x, 2), (yy), (z,2)}. (2) f-(8) = {al5z +3 = 8} = {1}. (b) fx? + 8a +1) = 1 => 2? + 8241 = Lora? + 3241 = -1 => 2? +32 = 0 or 22+ 3242 =0 => (a)(2 +3) =0 or (z + 2z +1) =0 => 2 = 0,3 or e = -1,-2. Hence g~*(1) = {—3, —2,—1,0}. (©) {-8/5, -8/3} Under these conditions we know that f-"({6,7,9}) = {2,4,5,6,9}. Consequently we have (i) two choices for each of f(1), f(3), and f(7) ~ namely, 4 or 5; (ii) two choices for each of f(8) and f(10) — namely, 8 or 10; and (iii) three choices for each of f(2), f(4), f(5), £(6), and f(9) ~ namely, 6, 7, or 9. Therefore, by the rule of product, it follows that the number of functions satisfying these conditions is 2° 2? - 3° = 7776. Since f! = f and (f-')! = f-1, the result is true for n = 1. Assume the result for nak: (AT = (FA Born = b+ (PT = (fo ft = (fh oF) = (£2) 0 (f= (F-1)0 (F-)F (by Exercise 21) = (f-1)#1. Therefore, by the Principle of Mathematical Induction, the result is true for all n € Zt. (a) (ro0\(z) =(comz)=2 (b) (2) = 2 —njo%(2) = 2 +n(n > 2). (0) (a) = 2+ njo-"(z) = 2 —n(n > 2). (a) r(n) = (er + ler +1) ---(ee +1) (b) :7(2) = r(3) = 7(5) =2 ke 3:1(2) = 1(3%) = 1(57) = 3 k= 4:4(6) = 7(8) = r(10) =4 k=5: 7(24) = 284 = 7(54) =5 k= 6: 1(12) = r(18) = 7(20) = 6 (c) For all k > 1 and any prime p, 7(p*-!) = k. (@) Let a = pity spit and b= aftgl? gi, where pispay.-. Pls disdas---9ge are +E distinct primes, and ¢;,¢2,...,¢4: fis fay--- fr € Z*. Then r(ab) = (6 +1 Mer +1)--(ee + MA +h +--+) 16533. 34. 35. 36. 37. = [Cert ler +1) + (ee + MMC + Da + 1) (fe + D) = ra)r(8) (8) Here there are eight distinct primes and each subset A satisfying the stated property determines a distribution of the eight distinct objects in X = {2,3,5,7, 11,13, 17, 19} into four identical containers with no container left empty. There are $(8,4) such distributions. (b) S{n,m) Define f : Zt > R by f(n) = 1/n. (a) Let m= 1and k =1, Then for all n > &,|f(n)| $2 <3 < Ig(n)l = F € O(9). (b) Let m = 4 and k = 1. Then for all n > k,|g(n)| <4 = 4-1 < 4/f(n)| = mif(n)], s0 9 € O(f). (a)f € O(f:) => 3m, € Rt 3k; € Z* such that [f(n)| < milfi(n)] Yr > ki 9 € O(G1) => 3m, € R* 3k, € Z* such that |g(n)| < malgi(n)] Vn > ke. Let m = maz{rm,m;}. Then for all n > maz{ki,ko},|(F + o)(n)l = fn) + 9(n)| [F(P)| + lo(m)] < malfi(r)| + mala(n)| < m(fir)| + ln(r))) = mifilr) + 9:(n)) ml(fi + ar)(n)], 90 (fF + 9) € OC +91). (b) Let f,fiygygr sZt —9 R be defined by f(n) =n, fi(n) = 1—n,9(n) = 1, 3(n) =n. lg(n)I, 80 First note that if log, n =r, then n = a” and log, n = logs(a’) = r log; a = (log, a)(log, n). Now let m = (log,a) and k = 1. Then for all n > k,|g(n)| = log,n = (log, a)(log, n) = mif(n}}, 90 9 € OCF). Finally, with m = (log,a)"? = log,6 and k = 1, we find that for all n > &,|f(n)| = log, n = (log, b)(log, 2) = mig(n)]. Hence f € O(9). 16610. a CHAPTER 6 LANGUAGES: FINITE STATE MACHINES Section 6.1 (a) 25; 125 (b) Dike 5! = 3906 (a) 4 &) (a (6) 8° (4) 3° + ()3°+ ({)3 12 (@) 0 (o) 0 _ _ (e) 3 (f) 4 (s) 1 (h) 0 rhs There are 100 substrings of longth 2: 21,22,-.- 205 99 substrings of length 2: 2122, 222%, +} Leubstring of length 100: 2122...2199. So there sre 100-+ 100)(101)/2 = 5050 nonempty substrings in total. (a) { 00,11, 000,111, 0000,1111} (b) {0,1} (c) X*—{A, 00, 11, 000, 111, 0000, 1111} (a) {0,1, 00,11} &) o (£) t= {0, 1, 00, 11} = {A,01, 10} U fw] |] w [2 3} (2) AB = (2000, 101, 1100, 111} (b) BA = {0010,0011, 110,111} (c) A? = {101010, 101011, 101110, 111010, 101111, 111011, 111220, 111111} (a) B? = (0000, 002, 100, 11). (a) 2 € AC =} 2 = a0, for some a€ AcE C => 2 € BD, since AC B,C CD. (bo) HAD #0, let 2 ¢ AD. 2 € AG => x = yz, for some y € A,z ED. But 2 € 0 is impossible. Hence A = 6. {In like manner 0A = 6). (a) AB = {zy,2y2} (b) BA = {2y,22y} (©) B= (A2,2%,25} (d) Bt = {x"|n € Zt} (c) AP = (A, zy, cyey,...} = A} U {(2y)"In € Zt} For any alphabet SI, let BC 5. Then, if A = BY, it follows from part (f) of Theorem 6.2 that A* = (B*)' = Bt = A, 16712, 13. 14, 15, 16. at. 18, (a) Yes (b) Yes (c) Yes (a) Yes (e) No ® Yes (8) Here A* consists of all strings 2 of even length where if 2 # A, then z starts with 0 and ends with 1, and the symbols (0 and 1) alternate. (b) In this case A* contains precisely those strings made up of 3n 0's, for n € N. (c) Here a string z € A” if (and only if) (@) = is a siting of n 0's, for n € N; or (ii) 2 is a string that starts and ends with 0, and has at least one 1 ~ but no consecutive Vs, (€) For this last case A* consists of the following: (i) Any string of n 1's, for n € N; and (ii) Any string that starts with 1 and contains at least one 0, but no consecutive 0's. There are five possible choices: (1) A= {4}, B= {01, 000, 0101, 0111, 01000, 010111}; (2) A= {01,000,0101,0111, 01000, 010111}, B = {); (3) A= {0}, B= {1,00, 101,111, 1000, 10111}; (4) A= {0,010}, B= {1,00,111}; and (3) A= {(,01), B= (01,000, 0111}. Let 5 be an alphabet with @4 ACE". IA] =1and z € A, then zz == since A? = A, But zz [= 2] 2 [=[| 2 l=>l] x j= 0 => x =r. fA} > 1, let 2 € A where fz ||> O but | || is minimal. Then x € A? => 2 = yo, for some y,2 € A. Since {fz =I y I] +12 Ih if {j y [jl] z [> 0, then one of y,z is in A with length smaller than || z ||. Consequently, one of || y [| or || z [is 0, s0 Ae A. (2) Pay Sas7 (b) yd ate onto; pa(5") = (a}E"sa4(E*) = D*a} (c) r is invertible and r~" =r. (a) 25; 125; 5°? for n even, 5#1/? for n odd. (¢) dop)iz)=2 = (rodoros,)(2) () r(B) = {ea, ia, 00, 00, oie, unoie} Pe(B) fos o}- se \(B) ja-"(B)| = Pes '(a)| = Den dz) = Deen 5 = 6(5) = 30 If A = A? then it follows by mathematical induction that A = A® for all n € Z*. Hence A= At, From Exercise 15 we know that A= A? => \€ A, 80 A= A‘, ‘Theorem 6.1(b): 2 €(AB)C += 2 =(ab)e, for some a€ Abe Bee C a= B= (ajaz.,.¢bybz... bm Keres -..¢,), Where a € A,1 2 = yz where y = 4103...0q,2 = dhai,...a,, with a;,d, € A, for 1 00111 € A; and (ai) 00111 ¢ A => OD0IIIi € A. (c) f 00001111 were in A, then from step (2) we see that this word would have to be generated from 000111 (in A). Likewise, 000111 in A => 0011 is in A => O1 is in A. However, there are no words in A of length 2— in fact, there are no words of even length in A. (a) (1) A€ A; and (2) fz € A, then each of the following is also in A: @ al (i) Ie (i) 002 Gv) 200 (v) 020 [And no other string of 0's ond 1’s is in A (b) () A€ 4; and (2) For each ¢ € A the strings 1z and 20 are also in A. 16923. 24, 25. 26. 27. 28. (a) Steps Reasons 1 (isin A. Part (1) of the recursive definition 2 (()) isin A. Step 1 and part (2(ii)) of the definition 3 (OM) isin A. Steps 1, 2, and part (2(i)) of the definition (b) Steps Reasons 1. ()isin A. Part (1) of the recursive definition 2 (isin a. Step 1 and part (2(ii)) of the definition 3 ()M ) isin A. Steps 1, 2, and part (2(i)) of the definition 4. ()OO isin A. Steps 1, 3, and part (2(i)) of the definition (c) Steps Reasons L (isin AL Part (1) of the recursive definition 2 (\()isin A. Step 1 and part (2()) of the definition 3. (CQ) isin A. Step 2 and part (2(i)) of the definition 4. (OQ) isin 4. Steps 1, 3, and part (2(i)) of the definition (1) A€ Aand s € A for all s € D5 and (2) For each 2 € A and s € 5, the string sx is also in A. {No other string from 5 is in A] Length 3: (3+ () = ree BrBt Length 6: (5) +(¢)+ ({)+ (2) = 13 [Here the summand (§) counts the strings where there are no 0s; the summand (3) counts the strings where we arrange the symbols 1,1,1,1,00; the summand ({) is for the arrangements of 1,1,00,00; and the summand (3) counts the arrangements of 00,00, 00.) [Here (f) counts the arrangements for one 111 and eight 00's; (2) counts the arrangements for three 111’s and five 00's; and (f) is for the arrangements of five 111’s and two 00's.] o A: (Q) EA (2) Ifae A, then Oa0, Oa), 120, lal € A. B: (1) G1¢4. (2) Hae A, then 0a0,0a1, 100, lal € A. Of the 3-3-3-3 = 34 = 81 words in SY, there are 3-3-3-2 = 27-2 = 54 words that start with one of the letters a,b, or c and end with a different letter. Consequently, one naust select at least 54 +2 = 56 words from [* to guarantee that at least two start and end with the same letter. 1703. Section 6.2 (a) 0010101; s: (b) 0000000; +, (c) 001000000; s0 Because of the first output of 1 we must be at state s; when the third input is read. This then forces the first three inputs to be 1,0,1. To get the second output of 1 we must be at state #2 when the fifth input is read. This forces the remaining two inputs to de 0,1. Hence z = 10101. (a) 010110 (b) 171§ = {s:|0 . 173OQ” Lo 0 0,0 LY (®) >) @) Input 1m Or " Output O11 (i) Input 1910 on Oui 2 (iii) Input 00011 Output 00001 (©) The machine outpute a 0 followed by the first n — 1 symbols of the n symbol input string 2. Hence the machine is a unit delay. (a) ‘The machine here performs the same tasks as the one in Fig. 6.13 (and has only two states.) 1756. Suppose the contrary and let the machine have n states, for some n € Z*. Consider the input string 0°11". We expect the output here to be 0"*'1", As the 0’s in this input string are processed we obtain n +1 states s1,52,---)Sn)Sn41 from the function v. Consequently, by the Pigeonhole Principle, there are two states s;,8; where i < j but 4; = s;. So if the states s,, for i+1< m 0), but AG B. 3. Let 2 € E and A = {2}. Then A? = {27} and (A) = {A,2%,24,...}. However A Q2,27,...} and (4°)? = AY, 50 (A ¢ (47). 4. (a) A*CB*. [For example, 111 € B* but 111 ¢ 4+} (b) At=C". 5. Opa : Starting at sq we can return to so for any input from {1,00}*. To finish at state 6 requires an input of 0. Hence Oo: = {1,00}*{0} Ora : {0}{1,00}"{0} On:8 Ova: {1,00}* ~ {A} Oyo + {3}{1,00}* U {20}{2,00}* 1766. (a) ve ov ijo7 so{so 8/0 0 si] 4 42 |0 0 sil sz $3 /0 0 $353 4 |0 1 (b) For any input string 2, this mechine recognizes (with output 1) the occurrence of every fourth 1 in x. (©) (3) +) + (6) = 7. (The first summand is for the sequence of eight 1’s, the second summand for the sequences of four 1’s and four 0’s, and the last summand for the sequence of eight 0s.) For || z {J 12, there are (12) + (12) + (12) + (12) = 992 such sequences. 7. (a) By the Pigeonhole Principle there is a first state s that is encountered twice. Let y be the output string that resulted since s was first encountered until we reach this state a second time. Then from that point on the output is yyy... (b) (2 8. 9. 10, | fo iyo 7a a} a 6/0 1 fsa 4/1 0 oa) 42 82/1 0 ss{ sr so{9 1 Here the table for w is obtained from Table 6.15 by reversing @ and 1 (and, 1 and 0) for the columns under 0 and 1. aT1. 12 a if (0183) | ($0184) (s1+43) (80,84) | (80,83) (81554) (81,83) | (81583) (2,84) (8154) | ($1584) (#2583) (22,83) | (8253) (0,84) (s2y$a) | (S284) (80983) (b) ($0, 43); 1101) = 1111; My is in state sp and My is in state s4. @) ee el ‘The following program determines the output for the input string 1000011000. 10 Dim A(3,2), B(3,2) 20 Mat Read A,B 30 Data 2,1,3,1,3,1,0,0,0,0,1,1 40 Dim P(100), $(100) 50 Read N 60 Forl=itoN 70 Read X 80 KI <> 1 Then 120 90 Hf X = 0 Then P(1) = B(1j1) Else P(1! 100 If X = 0 Then S(1) = A(1,1) Else S(1) 10 Go To 140 120 Y=X+1 130 P(1) = B(S(L1)Y) : S(I) = A(S(I-1),Y) 140 Next I 150 Data 10,1,0,0,0,0,1,1,0,0,0 160 Print “The output is”; 170)“ ForI = 1 To N-1 180 Print P(D); 190 Next I 200 Print P(N) 210 Print “The machine is now in state”; S(N) 220 End 178CHAPTER 7 RELATIONS: THE SECOND TIME AROUND Section 7.1 A. (a) {(1,1),(2,2),(8,8).(4,4),(1,2),(2,1),(2,8),(8,2)} (b) {,1),2,2),(8,8),(4,4),,2)} (c) {(1,1),(2,2),(2,2),(2,1)} 2, ~9,-2,5,12,19 3. (a) Let fi fasts € F with fi(n)=n+1, foln) =5n, and fa(n) = 4n+1/n. (b) Let 91,92,99 € F with or(n} = 3, a(n) = 1/m, and fa(n) = 4, (a) The relation R on the set A is (i) refiexive if Ve € A (2,2) €R (ii) symmetric if Vz,y € A [(z,y) € R => (y.2) € R (iii) transitive if Vz,y,z € A {(z,y),(y,2) € R => (2,2) € R] (iv) anticymmetric if Vz,y € A [(z,y),(y,2) € R= ¢ = y). (b) The relation R on the set A is (i) not reflexive if 3x € A (2,2) ¢R (ii) not symmetric if 3z,y € A [(z,y) € RA(y, x) ¢ R) (ii) not transitive if 3e,y,z € A {(2,y),(y,z) € RA (2,2) ¢R] (iv) not antisymmetric if 3z,y € A [(2,y),(v.z) € RAZ y)- 5. (a) reflexive, antisymmetric, transitive (b) transitive (c) reflexive, symmetric, transitive (4) symmetric (e) (odd): symmetric (f) (even): reflexive, symmetric, transitive (g) reflexive, symmetric (h) reflexive, transitive 6. The relation in part (a) is a partial order. The relations in parts (c) and (f) are equivalence relations, 7. (a) Forall c € A, (2,2) € Rs, Ra, 80 (2,2) € Ri Re and Ry N Re is reflexive. 17910. i. (b) All of these results are trne. For example if R1,Ra are both transitive and (2, y),(y,2) € Ri NR then (2, y),(y,z) € Ri, Rea, s0 (x, 2) € Ri, Ra (transitive property) and («,z) € Ri Ra. [The proofs for the symmetric and antisymmetric properties are similar.) (a) For all 2 € A,(2,2) € Ri,Ra © Ry U Ra, 50 if either Ry or Ry is reflexive, then Ry U Re is reflexive. (>) (Ixy € A and (2,y) € Ry U Rp, assume without loss of generality, that (ey) € Rr. (x,y) € Ri and R symmetric => (y,z) € Ri => (y,2) € Ri U Re, 80 Ri U Re is symmetric. (i) False: Let A = {1,2},R1 = {(1,1),(1,2)}, Ra = ((2,1)}. Then (1,2),(2,1) € Ri U Ry, and 1 # 2, 80 R, UR, is not antisymmetric. (ii) False: Let A= {1,2,3}, Ri = {(1,1), (1,2)}, Re = {(2,3)}. Then (1,2), (2,3) € Rs U Re, but (1,3) ¢ Ri U Ra, 80 Ri U Ry is not transitive. (a) False: Let A= {1,2} and R = {(1,2),(2,1)}- (b) (i) Reffexive: True (ii) Symmetric: False. Let A= {1,2},Ra = {(1,1)}, Ra = (01,1), (1,2). (iii) Antisymmetric & Transitive: False. Let A= {1,2}, = {(1,2)}, Re = {(1,2); (21)}- (©) (i) Reflexive: False. Let A = {1,2}, ®i = {(1,1)}, Ra = {(1,1),(2,2)}. (i) Symmetric: False. Let A= {1,2},Ri = {(1,2)}, Re = {(1,2),(2,)}. (iii) Antisymmetric: True (iv) Transitive: False. Let A= {1,2),Rs = {(1,2),(2,1)}, Re = {(1,1),(,2), (2,1), (2,2)}- (d) True (=) 2 ) COQ = 2 (©) (d) 2" (e) (28)(25) = 2° (f) 2-38 (s) 2-3" @) @1 ©) CP )C) = G) &) PHYO) = ( fe) (Ese to eye = © C)'=6)= (Q) Since 13, 860 = 2?-3*-5-7- 11, it follows that R contains as a (-1)° = 3 a" (@y = (36)(27) = 972 ordered pairs. u RB i 2 18012. 13. 14, 18. 16. at. 18. Since 5880 = neste ce (ae bi (7) = Ganj + 20 +), we find that 56 = (k+2)(k+1) and k=6. For n = pipSp$ there are (5 + 1)(3 +1)(6 + 1) = (6)(4)(7) = 168 positive integer divisors, so [A] = 168. There may exist an clement a € A such that for all b € B neither (a, 6) nor (b,a) € R. There are n ordered pairs of the form (2,2),2 € A, For each of the (n? ~ n)/2 seta {(,u).(y,2)} of ordered pairs where z,y € A,x # y, one element is chosen. This results in a maximum value of n+ (n? ~n)/2 = (n? +n)/2. The number of antisymmetric relations that can have this size is °°-"/2, rn counts the elements in R of the form (a,5),a # b. Since R is symmetric, r—n is even. (2) @Ry fe (2,2) € R. (2,2) €R,(z,2) € R=? (2,2) ROR=R?. (a,d) € (Ri 0 Ra) o Ra => (a,c) € Rio Ra, (c,d) € Rs for some c € C => (a,b) € Ru, (b,c) € Ra,(c,d) € Rs for some b € B,c € C =» (a,b) € Ry, (b,d) € Ryo Rs => (a,d) € Ry 0 (Rao Rs), and (Ry 0 Rr) o Rs C Ri 0 (Rao Rs). 181WW. is (a) Ri o(R2U Ra) = Rr © {(w, 4), (w, 5), (x, 6), (uv, 4), (ys 5), (v, 6)} = {(1,4), (4, 5), (8,4), 3,5), 2,6), (1,6)} (Ry 0 Ra) U (Ri o Rs) (1,5), (3, 5), (2,6), (1,4), (1,6)} U {(1,4), (1,5), (3, 4), (3, 5)} = {(1,4),(1, 5), (1, 6), (2,6), (3,4), (3,5)} (b) Ri o(R2M Rs) = Rr o {(w,5)} = {(1, 5), (3,5)} (Ra 0 Ra) 1 (Ry © Rs) = {(1,5), (3, 5), (2, 6), (1,4), (1,6)} 9 (2,4), (1,5), (3,4), (3,5)} = {(1,4), (1,5), (3,5)}- Ry o(RaM Ra) = Ra o {(m,3), (mm, 4)} = {(1,3),(1,4)} (Rx 0 Ra) M (Rr © Rs) = {(1,3),(1,4)} 9 {(1,3), (1,4)} = 40, 3), (1,4) }. (a) (2,2) € Rio (Re U Ro) => for some y € B,(2,y) € Ra, (y.2) € RaU Ra +> for some y € B,((e,u) € Rr,(y, 2) € Ra) or ((z,y) € Ra,(y,z) € Ra) => (zz) € Rio Ry or (2,2) € RyoRy > (2, 2) € (RyoRa)U(RyORs), so Ry 0(Ry0Rs) C (Ry ORs) U(Ri ORs). For the opposite inclusion, (x, 2) € (Ri 0 Ra) U (Ry © Ra) => (2,2) € Ri oR or (2,2) € Ry Rs, Assume without loss of generality that (x, 2) € Ryo Ra. Then there exists an clement y € B so that (z,y) € Ri and (y,2) € Rz. But (y,2) € Ra => (yz) € RaU Ra, 30 (2,2) € Ry 0(RaU Rs), and the result follows, (b) The proof here is similar to that in part (a). To show that the inclusion can be proper, let A= B 1,2,3} with Ry = {(1,2),, Dh, Ra = ((2,3)},Rs = {(1,3)}- ‘Then Ry 0 (Ry oR) = Ri 00 =, but (Ry o Ry) o (Ry © Ra) = {(1,3)}- ‘This follows by the Pigeonhole Principle. Here the pigeons are the 2" +1 integers between 0 and 2”, inclusive, and the pigeonholes are the 2” relations on A. Let $= {(1,1),(1,2), (1, 4)} and T = {(2,1), (2,2), (1,4)}- Here there are two choices for each ajj,1 < i < 6, For each pair aj;,aj1 Si 1 by the Principle of Mathematical Induction. (a) R reflexive <> (x,2) € R, for all c € A <=> mzy = 1 in M = (mis)nxn, for all reAeol, [Vz,y € A (2,y) € R= (2) ER) => [ey EA may =1in M => my =1in M] <=> M=M". 18314. 10! BEESS SSERRESERS g 3 g ‘THIS PROGRAM MAY BE USED TO DETERMINE IF A RELATION ON A SET OF SIZE N, WHERE N <= 20, 15 AN EQUIVALENCE RELATION. WE ASSUME WITHOUT LOSS OF GENERALITY THAT THE ELEMENTS ARE 1,2,3,...,N. INPUT ‘N =";N PRINT“ INPUT THE RELATION MATRIX FOR THE RELATION” PRINT “BEING EXAMINED BY TYPING A(I,J) = 1 FOR EACH” PRINT “1 <= I<=N,1<= J <= N, WHERE (IJ) IS IN” PRINT “THE RELATION. WHEN ALL THE ORDERED PAIRS HAVE” PRINT “BEEN ENTERED TYPE ‘CONT’ ” sTOP DIM A(20,20), C(20,20), D(20,20) FORK=1TON T=T+A(KK) NEXT K IF T =N THEN & PRINT ‘R IS REFLEXIVE”; X = 1: PRINT “R IS NOT REFLEXIVE” FORI=1TON FORJ=I+1T0N IF A(,J) <> AGI) THEN GO TO 260 NEXT J NEXT I PRINT “R IS SYMMETRIC”: Y = 1 GO TO 270 PRINT ‘R IS NOT SYMMETRIC” MATC=A MAT D = A*C FORI=1TON FORJ=1TON IF D(I,J) > 0 AND A(1,J) = 0 THEN GO TO 360 NEXT 3 NEXT I PRINT “R IS TRANSITIVE”; GO TO 370 PRINT “R IS NOT TRANSITIVE” IFX+Y+Z=3 THEN & PRINT “R IS AN EQUIVALENCE RELATION” & ELSE PRINT “R IS NOT AN EQUIVALENCE RELATION” END =115. (a) a g f b ‘ c ) 5 x 8 L_—y w z 16. (a) True (b) True (c) True (@) False 17. (i) R= {(a,4), (6,2), (ae), (€, 4), (6, €), (c,5), (6,4), (4, b), (6, €), (618), (de) (4), (4), Fa} (a) () (A) (e)(F} (@) fo10010 @lrorid () |010000 MB= 1010011 (@|1109e100 ()looo100 For parts (i), (ii), und (iv), the rows and columns of the relation matrix are indexed as 185in part (i). (&) R= {(a, 2), (6,€), (4,0), (4,0), (6, A} o1g000 ooo0010 oo00000 M®=\o 11000 oo0000 ooo00n0 (iii) R= {(a, 4), (4,8), (6,4), (6.4), (4,0), (40), (6.4 (4 A (60, (6 (het 110000 100000 ooo0100 MR =lo 91011 oo00101 000110 (iv) R= {(b, 4), (b,€), (65), (0, €), (6,4), (e,4)} M(R) = oooore eooHoe eooone erHones eocore ecooce 18. (a) R= {(v,w),(v,2), (w,v), (w,z), (w,y)s(w, 2), (2,2), (ys 2} v(b) R= {(v,w),(%, 2), (059), (w, 0); (2), (2,0), (2,0), (2, 2), (9,0): (¥s2), 2) ew) 19. R: Ry: Rand Rt: 20. (a) @) @) (ii) Each directed path corresponds to a subset of {2,3,4,5,6}. There are 2° subsets of {2,3,4,5,6} and, consequently, 2° directed paths in G from 1 to 7. @) @ () =12h Gi) There are 2"~? directed paths in G from 1 to n. {iii} There are 2lt(-s1)-2) = 2"! directed paths in G from a to b, 18721. 22, 23. 24, 23. 2, (28)(219) = 235 BS, (28)(229) = 15 (a) Ri: Ra 11000 11100 11000 11100 0011.0 11100 oo1i0 oooi1t 00001 oooi2 (b) Given an equivalence relation R on a finite set A, list the elements of A so that elements in the same cell of the partition (See Section 7.4.) are adjacent. The resulting relation matrix will then have square blocks of 1’s along the diagonal (from upper left to lower right). (i Es 5 s (a) Let ke Z*. Then R™* = {(1,1),(2,2),(3, 3), (4,4), (5,5), (6,6), (7, 7)} and RUM = R. The smallest value of nm > 1 such that R" = R isn = 13. For all multiples of 12 the graph consists of all loops. When n = 3,(5,5),(6,6),(7,7) € R°, and this is the smallest power of ® that contains at least one loop. (b) When n = 2, we find (1,1), (2,2) in R. For all & € Z*,R™ = {(2,2))2 € 241 S 2 $10} and R™+ = R. Hence R is the smallest power of R (for n > 1) where R* = R. 188(©) Let ® be a relation on set A where |Al =m. Let G be the directed graph associated with R — each component of G is a directed cycle C; on m, vertices, with 1 aRyc,cRia and bRad,dRob => a = cb = d => (a,b) = (c,d), #0 R is antisymmetric, Finally, (a,8)R(c,d), (c,d)R(e, f) => aRye,cRye and PRad,dRaf => aRye,¥Rof => (a,))R(e, f), and R is transitive. Consequently, Ris 1 partial order. No. Let A= B = {1,2} with each of Ri, Ry the usual “is less than or equal to” relation, ‘Then R is a partial order but it is not a total order for we cannot compare (1,2) and (2,1). @< {1} < {2} < {3} < {1,2} < {1,3} < {2,3} < {1,2,3}. (There are other possibilities.) (a) @ ©) © @ ©) (@) i a 5 i 1 (bo) jo 1 0 1 1 M(R)= (c) |0 0 1 1 1 (a) Jo 0 0 a 1 () Lo 0 0 0 1 (>) (Jacb 2 = a. So if M(R) is the relation matrix for R, the column under ‘a’ has all 0's except for the one 1 for the ordered pair (a,a). (b) Let 6 € A, with b a greatest element. Then the column under ‘6’ in M(R) has all 1's. Ifc€ A and cis a least element, then the row of M(R) determined by ‘ec’ has all 1’s. lub glb lub glb lub gib (@) {12} 6 (c) {1,2} 6 (e) {1,23} 0 (b) {1,23} 0 (4) {1,28} {1} (a) (G) Only one such upper bound ~ {1,23}. (ii) Here the upper bound has the for: {1,2,3,2} where x € Uf and 4 a = b, so R is antisymmetric 19220. a. 22. Consequently, the relation ® is a partial order for Z. But it is not a total order. For example, 2,3 € Z and we have neither 2R3 nor 3R2, because neither ~1 nor 1, respectively, is a nonnegative even integer. (a) For all (a,8) € A, a = a and & < b, s0 (a, 5)R(a,) and the relation is reflexive. If (a,b), (c,d) € A with (a, b)R(c,d) and (c, d)R(a, 6), then if a # ¢ we find that (a, 8)R(e,d) a ¢ Sd, and (q.d)R(a, b) +d Gy = fig, 80 E = F - and the “precedes” relation is antisymmetric. Finally, suppose that E = (¢ij)mzny F = (fij)nxns and G = (gi;)mxn are (0,1)-matrices, with E < F and F< G. Then, for all 1 SiS m,1 ¢4j $ gij, 80 E ty = #23 (22,4a)R(es, Ys) => ta = zs. With 21 = 22,22 = 2g, it follows that 21 = zy, so (21,41) R(x3, ys) and RF is transitive. (b) Each equivalence class consists of the points on a vertical line. The collection of these vertical lines then provides a partition of the real plane, (a) For all (2,y)€ Ae ty =2+y = (x,y)R(e,y). yw )Reyw) SS atnu=antnntp=nth = (2a; y2)R(z1,91)- (21, vn) Ra, va) (22, v2) Res, ys) => 19510. i. 2 th = Ta + Yay ta + Ya = ts +s; 80 21 +41 = ay + ys and (41,41) R(es, 4s). Since R is reflexive, symmetric and transitive, it ia an equivalence relation. (b) (4,3)} = {,3),2,2),8,0} (2,4)] = {0,5),(2,4),6.3),(4,2),6,)}; (G0) = {1}. (c) A= {(1,1)}U {(1,2), (2, D}U {, 3), (2,2), (3, JU {(1, 4), (2,3), (3, 2), (4,19) U {(2, 5), (2, 4); (3,3), (4,2), (5, 1)}U {(2,5), (3,4), (4,3), (5, 2)} U {(3, 5), (4,4); (5,3)} U {(4,5), (5, 4)} U {6,5)}. (0) For alla € Aya ce Z => b-a=3(- and aRb, bRe, then a—b = 3m,b—c = 3n, for some m,n € Z => (a—b) +(b—c) = 38m + 3n => a—c=3(m +n), 9 aRe. Consequently, R is transitive. (b) 1] = [4] = [7] = (1,4, 75 [2] = [5] = {2,5}; [5] = [6] = {5,6}. A= {1,4,7} U {2,5} U {3,6}. (a) For all (a, 5) € A we have ab = ab, so (a, 8)R(a, 6) and R is reflexive, To see that R is symmetric, suppose that (a, ), (c,d) € A.and that (a, 6)R(c,d). Then (a, 8)R(c,d) => ad = be = ch = da = (c,d)R(a,)), so R is symmetric. Finally, let (a,), (c,d), (e, f) € A with (a, b)R(o, d) and (c,d)R(e, f), Then (a, b)R(c,d) = ad = be and (c, d)R(¢, f) = cf = de, 80 adf = bef = bde and since d #0, we have af = be. But af = be = (a,5)R(e, f), and consequently R is transitive. It follows from the above that R is an equivalence relation on A. (b) [(2,14)} = {(2,14)} ((-3,-9)] = {(-3,-9), (-1, ~3), (4,12)} (4,8) = {(-2,-4), (1,2), (8,5), (4,8)} (c) There are five cells in the partition — in fact, A= [(-4,~20)] U [(-3, -9)] U [(-2, -4)] U (-1, -12)} U [(2, 14). (a) For all X © A,BN.X = BAX, so XRX and R is reflexive. If X,Y € A, then XRY =2 XNB=YNB = YNB = XNB => YRX, so Ris symmetric. And finally, if W,X,Y C A with WRX and XRY, then WN B=XNBand XNB=YNB. Hence WNB=YNB, so WRY and R is transitive. Consequently R is an equivalence relation on P(A). (bo) {0,433} U {£2}, (1,5}3 U {2}, {2,3}} U {1,2}, (1,2, 3}} (c) [X] = {{1,3}, (1,3, 4}, (1,3, 5}, (1, 3,4, 5}} (a) 8~ one for each subset of B. ®) (B)() - The factor (}) is needed because each selection af size 3 should account for only one such equivalence relation, not two. For example, if {a,),c} is selected we get 19612, 13. 14, 15. 16, it. the partition {a,b,c} U {d,e, f} that corresponds with an equivalence relation, But the selection {d,e, f} gives us the same partition and corresponding equivalence relation. (b) ()[. +3] = 4({) - After selecting 3 of the elements we can partition the remaining 3 in (2) 1 way into three equivalence classes of size 1; or (i) 3 ways into one equivalence class of size 1 and one of size 2. © (a+ =2() @ DE) +4@) +20) + +@) (a) 21° = 1024 (b) DE, S(5, i) = 1415 42541041 = 52 (c) 1024 — 52 = 972 (a) 8(5,2) = 15 (©) i194) = 1474641215 (HOR, SBi)=14341=5 (e) Dh SG) =1t3+1=5 (b) (Shes SB.) — (ha S24) = 3 300 (a) Not possible. With R reflexive, |R| > 7. (b+) R={(e,z)e €Z1sest. (c) Not possible. With ® symmetric, [R| — 7 must be even. (@) R= ((z,2)e €Z1 z,y € Ai, for some i € [=> y,2 € Aj, for some i € I => yRz, 60 R is symmetric. If zRy and yRz, then 2,y € Aj and y, 2 € A; for some i,j € I. Since A;M A; contains y and {Aj}ier is a partition, from A; A; = 0 it follows that A; = Aj, so i= j. Hence 2,2 € Aj, 80 #Rz and R is transitive, Let P = UjerA; be a partition of A. Then E = Ujer(4; x A,) is an equivalence relation and f(E) = P, 90 f is onto. Now let E;,E2 be two equivalence relations on A. If E, # E;, then there exists x,y € A where (2,y) € H, and (2,y) ¢ Ey, Hence if f(E,) = P, = UierA; and f(y) = Py = UjerAj, then (2,4) € By => ,y € Ay, Fi € I, while (2,y) ¢ Ey => Vj € J (@ GA; Vy ¢ Aj). Consequently, P, # Ps and f is one-to-one. Proof: Since {B,, Bz, Bs,..., By} is a partition of B, we have B = ByUB,UBsU...UB,. Therefore A = f-'(B) = f-(B,U...UB,) = f-(B,)U...Uf"(B,) [by generalizing part (b) of Theorem 5.10}. For 15 i (a,a) € Nie/R; for all a € A => (a, a) € R; for alla A and all i € I <=> R; is reflexive for all i € I. (i) (a) False. Let A = {1,2},Ri = {(1,2)}, Ra = {(2,1)}. Then R, U Ry is symmetric although neither R; nor Ry is symmetric. Conversely, however, if each R;,i € I, is symmetric and (2, y) € UjerRj, then (2, y) € R; for some i € I. Since R; is symmetric, (y,z) € Rj, so (y,z) € UserR; and UserR; is symmetric. (b) If (2,y) € MicrRi, then (z,y) € Ri, for all i € I. Since each R; is symmetric, (y.2) € Rj, for all i € L, s0 (y,z) € MierR; and NierR; is symmetric. ‘The converse, however, is false. Let A = {1,2,3}, with Ri = {(1,2), (2,1),(1,3)} and R; = {(1,2),(2,1),(3,2)}. Then neither R, nor Ry is symmetric, but Ry Rs = {(1,2),(2,V)} is symmetric. (iii) (w) Let A = (1,2,3} with R, = {(1,2)} and R) = {(2,1)}. Then both Ry, Ra are transitive but R, UR, is not transitive. Conversely, for A = {1,2,3} and Ry = {(1,3)}, Re = {(1,2),(2,3)}, Ri U Ra = {(1,2),(2,3),(1,3)} is transitive although Ra is not transitive. (b) If (x,y), (y,2) € Migs Ri, then (x,y), (y,2) € Ry for all i € J. With each R;,i € I, transitive, it follows that (x, 2) € Ry, 80 (x, 2) € Nie/Ry and NyerR; is transitive. Conversely, however, {(1,2),(2,3)} = Ry and R, = {(1,2)} result in the transitive relation Ri Ra = {(1,2)} even though R, is not transitive. (i) The results for part (i) follow in a similar manner. (a,c) € Rao Ry => for some b € A, (a,b) € Ra, (b,c) € Ri. With Rj, Ry symmetric, (b,a) € Ra,(e,b) € Rr, 80 (ca) € Ry oR, © Ryo Ry. (c,a) € Ryo Ry => (c,d) € Ray (d,a) € Ry, for some d € A. Then (d,c) € Ro,(a,d) € Ry by symmetry, and (a,c) € 19910. Ryo Ra, 80 Ry Ri S Ry 0 Ry and the result follows. (a) Reflexive, symmetric. (b) Equivalence relation. Each equivalence class is of the form A, = {t € 7| the area of t=ryr€R*}. Then T =Ujer+A,. (c) Reflexive, antisymmetric. (a) Symmetric. (©) Equivalence relation. {(1,1)] = {(2,1), (2,2), (8,3), (4,4); ((2,2)] = {(1,2), (2, 1), (2, 3), (3, 2), (3,4), (4,3); (1, 3)] = {(1,3), (8, 1), (2, 4), (4, 2)}; (2, 4)] = {(,4), (4). A=[(,0]V (A, 2) 4 (2,3) U0,4)). (ca) € (Ry 0 Ra)° => (a,c) € Ry oRy + (a,b) € Ry, (b,c) € Ra, for some bE Be (c,b) € 5, (6, a) € RG, for some b € B => (c,a) € R§o Ry. (a) If P is a partition of A then P < P, so R is reflexive. For partitions P,P; of A if P, < P; and P; < P, then P; = P; and R is antisymmetric, Finally, if P,P), P, are partitions of A and A-RP;, PRPs, then P; < P; and P; < Py, so each cell of P; is contained in a cell of Py and P; < Py. Hence R is transitive and is a partial order. ®) . ZN, ~ 3 Py ie Let U = {1,2,3,4,5},4 = PU) — {4,0}. Under the inelusion relation A is » poset with the five minimal elements {z},1 < 2 <5, but no least element. Also, A has five maximal elements ~ the five subsets of Uf of size 4 - but no greatest element, (b) (G1) = {11}; (2.2)] = {(1,4),(2,2),(4.))5 ((8,2)] = {€,6),(2,3),(3,2),(6.1)}; [(4,3)] = {(2,6),(3,4),(4,5),(6,2)}. n=10 (a) For each f € F,|f(n)| < 1/f(n)] for all n > 1, a0 FR, and R is reflexive. Second, if f,g € F, then fRg => (f € O(g) and g € O(f)) = (g € O(f) and f € O(e)) => 9Rf, 60 R is symmetric. Finally, let f,g,h € F with fRo,oRf,gRh, and hRy. Then there exist m,,m2 € Rt, and ky,k, € Zt so that [f(n}]| < milg(n)| for all n > ky, and |g(n)| < ma|h(n)| for all n > ky. Consequently, for all n > maz{hy, ka} we have |F(n)| < my|g(n)| < mymz|h(n)| so f € O(h). And in a similar manner h € O(f). So FRA and R is transitive. {b)_ For each f € F, f is dominated by itself, so [f]${f] and Sis reflexive. Second, if {a}, {h] € #* with [g}S{h] and {h]S{g}, then gh (as in part (a)), and {g) = {A}. Consequently, Sis antisymmetric. Finally, if [f],[y], [A] € ¥’ with [f]5[g] and [g]5{h], then f is dominated 200by g and g is dominated by h. So, as in part (a), f is dominated by A and [f]S{h], making S tronsitive, (c) Let f, fis fa € F with f(n) = n, fi(n) = +3, and fa(n) = 2—n. Then (fi+-Aa)(n) and fit fa ¢ [f], because f is not dominated by fi + fa 5, ‘Kdjacency [Tndex . iseaicy | tae List | List eee ea ee eer ile i a Wt TT 2 iy 2] 3 j2i2 Hl a aia 2{ 3 |2}2 @{S} 1 [3/31 M)]31 5 [sls] @js} 1 [3}3 4} 4 [4] 5 Al te Waite 4] 4 jale 5} 5 |5i6 aa leis 5} 5 [5l7 6] 3 |6/8 | ale 6| 1 lels 75 J ald 20112. 13. 14 (a) For each v € V,v = v so oRv, If vRw then there is a path from v to w. Since the graph G is undirected, the path from v to w is also a path from w to v, so wRv and R is symmetric. Finally, if vRw and wRz, then a subset of the edges in the paths from v to w and w to ¢ provide a path from v to x. Hence R is transitive and R is an equivalence relation. (b) The cells of the partition are the (connected) components of @. (a) Pr: {51,8387}, {82) 8485, 96, 88} Py: {51,55 87}, {825 $5) 5}; {84 36} {51}, {85187}, {525 $5, 58}, {54h {56} =P vy fe a ijoi $3 3) 1 0 fs 8310 0 83 | 43 32/1 0 ss | 82 83] 0 0 se _|sa_ si] 0 (b) ys {or}sssyr)s (62545598), {54)5 (80) oy Pat fansite} (sates) (oe 40) 00 0,0 Pri {8128387}, {82) 84) $55 80555} 01 | 0,0 202Hence w(s4,000) = 001 # 000 = (s6,000), s0 000 is a distinguishing string for 2, and se. 15. One pombe onder x 10,38, 6, 7,941,445, 2 where program 10 is run first and programa 2 last. 16, (a) @)n=2: (i)n=4 (ii) n=6: 4 6 I 2 e 2 3 L t 4 (iv) n=8 (vi) n= 30: 16 2 : a 4 6 ‘ : 2 t 4 : (viii) n = 24: (vill) n = 30 (ix) n= 32: 32 a sos Oo it. Se | {b) For 2. 1, there are 3" ordered pairs in the relation R. Since | = n,{P(U| = 2" and so there are (2")(2") = 4" ordered pairs of the form (A,B) where A,B CU. From Exercise 18 (above) there are 3° order pairs of the form (A, B) where AC B. [Note: If (A,B) € R, then so is (B,A).] Hence there are 3° + 3" — 2" ordered pairs (A,B) where either A C B or BC A, or both. We subtract 2* because we have counted the 2° ordered pairs (A,B), where A = B, twice. Therefore the number of ordered pairs in this relation is 4" — (2-3" — 2") = 4" — 2-3" 42", (a) There are 2” equivalence classes ~ one for each subset of B. (am (a) @) BRARC; (ii) BRORF BRARORF is a maximal chain. There are six such maximal chains. (b) Here 11 R 385 is a maximal chain of length 2, while 2 R 6 R 12 is one of length 3. The length of a longest chain for this poset is 3. (©) @OC {1} ¢ (4,2) ¢ {1,2,3) Cus (ii) OC {2} {2,3} ¢ {12,3} Cu. ‘There are 4! = 24 such maximal chains. (a) nt If c; is not a minimal element of (A,), then there is an element a ¢ A with aRe;. But then this contradicts the maximality of the chain (C,R’) ‘The proof for c, maximal in (A, 2) is similar. Let a)Ra,R...Ra,1Ra,, be a longest (maximal) chain in (A,). Then a, is a maximal element in (A, R) and a,Ro,R...Ra,.1 is & maximal chain in (B,R’). Hence the length of a longest chain in (B,?’) is at least n—1. If there is a chain bR’,R’ ... R'b, in (B,R') of length n, then this is also a chain of length n in (A,). But then b, roust be a maximal element of (A,R), and this contradicts &, € B. (@) {2,35}; {5,6,7,11}; {2,3,5,7,11} 20425. 26. 27. (b) {(1,2},{3,4}), 11,2,3}, {2,3,4}}; 4 (©) Consider the set M of all maximal elements in (A,R). If this set is not an antichain then there are two elements a,b € M where aRb or 6Ra. Assume, without loss of generality, that @Rb. If this is so, then a is not a maximal element of (A, R). Hence (M,(M x M)NR) is an antichain in (A,R). ‘The proof for the set of all minimal elements is similar. Ef on=1, then forall x,y A, if e#y then 2Ry and yRe. Hence (4,R) isan antichain, and the result follows. Now assume the result true for n =k > 1, and let (A,R) be a poset where the length of a longest chain is k+1. If M is the set of all maximal elements in (A,R), then M40 and M isan antichain in (A,R). Also, by virtue of Exercise 23 above, (A — M,R’), for R! =((A—M)x(A~M))NR, is a poset with k the length of a longest chain. So by the induction hypothesis A—_M = C,UC,U...UCg, a partition into k antichains. Consequently, A= C,UC,U...UC,UM, a partition into k +1 antichains. (a) Since 96 = 25-3, there are }('2) = 192 ways to totally order the partial order of 12 positive integer divisors of 96. (b) Here we have 96 > 32 and mus: now totally order the partial order of 10 positive integer divisors of 48. This can be done in }("f) = 42 ways. (c) Aside from 1 and 3 there are ten other positive integer divisors of 96. The Hasse diagram for the partial order of these ten integers ~ namely, 2,4,6,8,12,16,24,32,48,96 ~ is structurally the same as the Hasse diagram for the partial order of positive integer divisors of 48. So as in part (b) the answer is 42 ways. (a) Here there are 14 such total orders. (a) There are n edges ~ namely, (0,1), (1,2), (2,3),-..,(a = 1yn). (b) The number of partitions, as described here, equals the number of compositions of n. So the answer is 2-1. (c) The number of such partitions is 29-1 . 25-1 = 64, for there are 2°-! compositions of 3 and 2° compositions of 5(= 12 - 7). 205PART 2 FURTHER TOPICS IN ENUMERATIONCHAPTER 8 ‘THE PRINCIPLE OF INCLUSION AND EXCLUSION Section 8.1 Let ¢ € S and let n be the number of conditions (from among ¢,¢2,¢s,¢4) satisfied by #: (n= 0): Here « is counted once in N(@;252,) and once in N (22,2364). ( If z satisfies c; (and not cz,¢5,¢4), then x is counted once in N(@€3%4) and once in N(créx63%). If satisfies ¢;, for i # 1, then is not counted in any of the three terms in the equation. (n= 2,3,4): If 2 satisfies at least two of the four conditions, then z is not counted in any of the three terms in the equation. ‘The preceding observations show that the two sides of the given equation count the same elements from $, and this provides a combinatorial proof for the formula N(@@%4) = N(crBxtats) + N(Gi@rtst.)- Proof (By the Principle of Mathematical Induction): If t = 1, then we have W = N(@) = the number of elements in S that do not satisfy condition cy = N — N(cy). This is the basis step for the proof. Now assume the result true for k conditions, where k (> 1) is fixed but arbitrary, and for any finite set $. That is, N(@2at... 2) = N — [N(cx) + Nex) + N(cs) +--+ + N(ce)] + [IN (crea) +N (eres) +++ +N (cree) +N (crea) +: + +N (cace) ++ +N (ecg) +> + +N (c4-102)]— [N(creaes) +--+ N(ch-2ce-iee)} +++ + (- TAN (cxcace--- cx) ‘Now consider the case for ¢ = k +1 conditions. From the induction hypothesis we have N (GG. Zecets) = N(cu41) ~ [N (creas) + N(caceer) + N(cackes) + °° + N(ceeees)] IN (ereacnys) + N(crcaciga) + +++ + N(crcecegs) + N(cacscess) + +++ + N(creecess) here N(eacxcugs) + +++ + N(ce-acncugs)] ~ [N(ereaeascees) +07 + N(ch-a¢h-164¢e41)] + +++ + (~1)EN (creacs »-. cxceys)- Subtracting this last equation from the one given in the induction hypothesis we find that N(GjGats---Bitiin) = N(Gskaea.. Ge) — NGtres..-Fecues) = N ~[N(cx) + N(ea) +++ + N(ca)] + [M(ciea) + N(cres) + +++ + N(cica) + N(caes) tore (cacy) +++ N (cae) +----+N(ce-104)} ~[N(ereres) +++ N(cn-2ee-ace)] 007+ (SDN (ereaes « C4) N (eee) +EN (ereear +N (exenar) + --+N (exeets )I— EN (creaciss) + N(Cxeacigs) + +++ + N(Ch-aCeeeea)] + 20+ (1) N (erences. + CeCe41) = 209N~[N(c1) +N (ca) -+-+-+ N(cu) + N(cuss)] +1 (crea) +++ +N (crea) + N(crcear) t+ N(cx-1cee1) + N(cecegs)} —[N (create) + +++ + N(ce-ach-r04) bo +N (cu-seuceya to + (=D)EN (cyeze3 ... ceCe41 So the Principle of Inclusion and Exclusion is true for any given finite set $ and any number # (> 1) of conditions ~ by the Principle of Mathematical Induction. N= 100 N(ex) = 35; N(c2) = 30; N(es) = 30; N(c4) = 41 1; N(cxes) = 13; N(czes) = 10; N(caea) = 145 N(oocs) = 10. = 6; N(cresca) = 6; N(caesea) = 6 (a) N(Gikresta) = N (Gees) — N(Gieatse4) N(@itats) = N -[N(cr) + N(62) + Nca)] +{N (e102) + N(caca) + N(e2ca)] ~ N(cxcace) = 100 — [35 + 30 + 41] + [9 +13 + 14] -6 = 100 ~ 106 + 36-6 = 24 N(@:@034) = 12 (as shown in Example 8.3) So N(@e,¢s@4) = 24-12 = 12 Alternately, NG N ~ [N(c1) + N(e2) + N(ca)] + [N (ere2) + N(cree) + N(e2e4)] — N(crezea); 50 N(@éaes@s) = N(es)—[N (eres) + N(cres) + N(csea)] + [N(ercres) + N(cresca) + N(cresca)] —N(cyeregea) = 30 ~ (11 + 10 +10] + [5 +646] -4=30~31417-4=12. (b) N (Giza) = N - [N(cx) + N(ca)] + N(erea), 80 N(Zre2e52) = N(c26s) ~ [N(ereaes) + N(cacses)] + N(crercscs) = 10 — [5 + 6] +4 =3. cx: Staff member brings hot dogs cq: Staff member brings fried chicken eg: Staff member brings salads ce: Staff member brings desserts N=65 N(c) = 21; N(ea) = 35; N(¢s) = 28; N(c4) = 32 N(ce2) = 13; N (exes) = 10; N(cres) = 9; N(cxca) = 12; N(caca) = 175 N(caea) = 14 N(cxe2¢3) = 4; N(cxcocs) = 6; N(cresce) = 5; N(cacgca) = 7 N(exeyeae4) = 2. (8) N(Geests) = G5 ~ (21+ 35+ 28-452] + [13+ 10494 12417414] ~ [446454742 = 65-116 +75—22+2=4. (b) N(Exbsi4) = N ~[N(c2)+N(ca)-+N(ca)] +[N (e200) + N(caca) + N(esc4)] ~N (cacaca), 80 N(cxEx63t4) (es) LM (exea) +N (cies)-+ N (ere4)] + LN (creat) +N (ereaca) + N(eresca)]— N(cycq¢3¢4) = 21 ~ (13 + 10 + 9] + [4464 5]-2= 21-324+15-2=2. (c) N(Zieaés@s) = N(e2) — [N(ere2) + N(eaes) + N(eaes)] + [N(ereaes) + N(eveaea) + N(cxesea)} — N(creea¢s) = 35 ~ [13 +12 +17] + [446+ 7] -2= 95 -42417-2=8 210N(ca)—[N (eres) +N (cats) +N (cses)) +N (creates) +N (creaca) +N (creaca)]~ — [10 + 12 + 14] + [445 +7]—-2 = 28-36 +16 -2=6. N(c4)—[N (crea) +N (cars) +. (caca)] + [NV (crcace) +N (cresca) +N (eresca)] — —B+17 +14] + [6+54+7]-2= 32-404 18-2=8. So the answer is 2+8+6+8= 24. (a) ci: number n is divisible by 2 cz: number n is divisible by 3 es: number n is divisible by 5 N(cy) = [2000/2] = 1000, N(cs) = {2000/3] = 666, N(cs) = [2000/5] = 400, N(ere2) = |2000/(2)(3)| = 333, N(caes) = |2000/(3)(5)} = 133, N(cics} = |2000/(2)(5)] = 200, N(e,e2ca) = {2000/(2)(3)(5)| = 66. N(&é2¢3) = 2000 — (1000 + 666 + 400) + (383 + 200 + 133) ~ 66 = 534 (b) Let c1,02,¢5 be as in part (a). Let cq denote the number n is divisible by 7. Then N(ca) = 285, N(crca) = 142, N(caea) = 95, N(eaca) = 57, N(crcaea) = 47, N(cxcace) = 28, N(cacaca) = 19, N(creresce) = 9. N(&e,85¢4) = 2000 ~ (1000 + 666 + 400 + 285) + (933 + 200 + 133 + 142 +95 + 57) — (66+ 47 + 28 + 19) + 9 = 458 (c) 584-458 = 76. ayaa tant ty = 19. (@) O 6; ¢2: #227; es: 2925; i 426. war )= (8 N(ey), Nea): ex tea tes baa 7 Nae) ayt+atratm= cr) =) N(ea): a1 +224 23+24=6: (*47) = (3) Nea): 21+ a24+25+24=8: (37) = (3) N(eyes) = 1 N(cies) : 21+ 22t20424=2: (7%) = (2) 21b. a. 10. N(cres) : y+ 22+ 03+ 24 = Cr)=@ N(cxes) = (f), N(eaca) = 1, N(caea) = N(Geaeaes) = (i) ~ (2(7) + (@) + ()1-+ 201+ () + Gh ‘Let c, denote the condition where an arrangement of these 11 letters contains two occur- rences of the consecutive pair IN. Define similar conditions ¢2,¢3,¢4,¢s, and cs, for the consecutive pairs NI, 10, O1, NO, and ON, respectively. Then N = Sy=111/(28) Nex) = 91/(28), S; N(cxe2) = N(exes) N(Csco) = 0, N(cxea) S3 = Sy = Ss = Se=0. G)ernenty N(cye0) = N(caca) = N(exes) = N(caes) = N(cses) = N (cae) = 71/21, and S, = (6)(71/2!}; and Consequently, the number of arrangements under the given restrictions is N(& So— Si + Sr = [111/29 - (Slo! 4, 460, 400. ) !)*] + (6)[7!/2!] = 4,989,600 — 544,320 + 15, 120 ‘The number of integer solutions for 21+ #2 +25 +24 = 19, -5 <2, $10, 19 (or 25210). N(ci) is the number of integer solutions for yy +29 +25-+...+27 = 21, 05m, 0S % for 2 4 (or y; > 3) and yj > 0 for 1 4. Then i<4 let ¢; denote messed = (2) 0) +00: Let cy denote that the arrangement contains the pattern spin. Likewise, let ¢2,¢3,¢4 denote this for the patterns game, path, and net, respectively. N(&\2,éa¢4) = 26!~[3(23!)+ 24] — (201 +21!) Let a,b,c,d,e, f denote the six villages. For 1 19 (> 20), ¢= 1,2,3,4. Then M(q) = ("2") = (B), isis 36) New) = ("5") = (si 6. Then the number of integer solutions for tht tat us tue t us = 15, where 0 < yi $5 for 1 n=2. (a) (6000) = 9(2* - 3 - 5) = 6000(1 — (1/2))(1 — (1/3))(1 — (1/5) = 1600. (b) 6000 ~ 1600 — 1 (for 6000) = 4399. Proof: #(n™) = (n™) TI (1 a But for every prime p it follows from Lemma 4.3 that if, = pin then pin. Therefore, @") Tla- pian $n -g(n). mmo TT a 4(17) = 4(82) = ¢(48) = 16. For ¢(n) to be a power of 2 we must have one of the following: (1) n=24, for k 21; 21529, (2) n=pip2-++ ps, where t > 1 and each prime p; has the form 2 +1, for 1 1, t > 1, and each prime p; has the form 24 + 1, for lsist. If 4 divides 4(n) then one of the following must hold: (1) nis divisible by 8 (2) nis divisible by two (or more ) distinet odd primes; (3) n is divisible by an odd prime p (such as 5, 13, and 17) where 4 divides p~ 1; and (4) nis divisible by 4 (and not 8) and at least one odd prime. For 1 < i < 5 let condition o; denote the situation where the seating arrangement has family i seated all together. Then the anawer to this problem is N(22,2,2405)- Here Sp is the number of ways one can arrange 15 distinct objects around a circular table. This is (15 — 1)! = 14! N(cx) = 6(13 — 1)! = 6(12)), for there are (13 — 1)! = 12! ways to arrange 13 distinct objects [family 1 (considered as one object) and the other 12 people] and 6 ways to seat the three members of family 1 so that they are side by side. Consequently, 5; = (°)6(12!). Similar reasoning leads us to N(cie2) = 6710!) Sy = (ero) N(creaes) = 6(8!) Ss = (5) 6%8!) N(ciexescs) = 66!) Sa = (‘)o4(6!) N(creaeacacs) = 64!) Sy = (°) 64). ‘Therefore, N( Wf) = So ~ S; + Sy ~ Sy + Se - Ss = Fh.o(-1)'(*)6(14 - 2)! = 87,178, 291, 200 ~ 14, 370, 048, 000 + 1, 306, 368, 000 ~ 87, 091, 200 + 4, 665, 600 — 186, 624 = 74,031, 998, 976. Section 8.2 Eq = 168; By = 205; By = 40; Ey = 10; Ey= 0; By =1. LB = 04 =. & (a) Let denote the condition that the two A’s are together in an arrangement of ARRANGEMENT. Conditions ¢2,c3,¢, are defined similarly for the two B's, N’s, and Ris, respectively. N = (111)/{(2!)"] = 2494800 For 1 + (I(S-7-6-5)e4 +... + (3)(8N)a* = Theo (1) Paz". (b) Eo (1) Pride! (Cy, 2) = 14 40 + 3a? = r(Cy,z) (a) (i) (+22) (i) 14 82 4 142? + 42° (ii) 1492 + 257+ 2125 (iv) 1+ 82 + 162? + 72° (b) Ifthe board C consists of n steps, and each step has & blocks, then r(C,2) = (1+ ke)". (a) Select the & row positions in @) ways. As we go from row 1 to row 2 to ... to row 1m, for the first row containing a rook there are n column choices. For the second such row there are n—1 column choices, ..., and for the row containing the &-th rook there are n—k+1 column choices. Hence we can arrange the & identical nontaking rooks on © in (F)@\n- 1) =F +1) = CD(T) waye (b) r(Cy2) = 1+ (rinje + (4) (m)n — De? + tytn =A(n = 229 +--+ (M)(n)n — Ife — 2) +++ (es + 1)e™ = (3) + (Free + (F) 0 - Ye? + (Joa I(u = 2) + + (s)(a)(n = 1Xn—2)--- (n= m+ Da” = Do (Fane -2)--- (nF Det = Tita (7) 220[Perl SQL (1) Jeanne (2) Charles (3) Todd (4) Paul (3) Sandra r(C,x) = (1+ 4a + 32°)(1 + de +22”) = 1+ 80 + Qe? + 202° + 624 For 1 9 (or n; > 10). 7437-1) _ (43) saw =( 37 )-(@) (cx) is the number of nonnegative integer solutions for 2) +2, +23 +...+27 = 27 here 21 +10 = ny, and 2; = nj for 2 5 (or yi 2 6) and yj 2 0 for all 1 $j $4, j #4. Then, for example, N(c1) is the number of nonnegative integer solutions for toy + wy + toy + oy = 10. [Here w +6 = y; and wi = yj fori = 2,3,4] So N(a) = (“137) = (2) and 5, = (1) (8). Similar arguments show us that N(c\c) = (477) = ({) and S, = (3) ({); and S,=S,=0. Therefore the number of distributions for the given restrictions is woos) =(*)-('('8) (0). 223and Joseph and Jeffrey can arrange the 24 balls in reareons|()-() 60) +) Here 5 = {1,2,3,...,1000} and NV = Sp = 1000. We define the conditions c1, ¢, ¢3 on the elements of S as follows: eu: n€ Sand nis a perfect square; ox n€ Sand nis a perfect cube; and ex: n € Sand nis a perfect fourth power. Then N(e) = 31, N(er)=10, N(es)=5, N (cre) = 3, N(eres) = N(cs) =5, Nieres) = 1, and N(cieacs) = N(eaes) = 1. Consequently, N(E:&2%3) = So— Si + Sy — Sy = 1000 ~ [31+ 10+ 5] + [3 +5+1]—1 = 1000-46 +9~1 = 962. Let ¢ denote the occurrence of the pattern i(i4+1) for 1 m and 2; is not in the selection. N=() Mead=()asism s = ()(5') 22512, 13. i. 15. N(cjiej) = (*2),1 Si <5 Sm; S, = (5) (777), ete (52) = NG@ie-.-&n) = Dhol) (7). (2) Define conditions ¢:, 1 1, Then $n) = TT ye (1 ~ (/p)) $ _ _ contradiction! (a) S = {1,5,7, 11, 13,17} Sy = {2,4,8, 10,14, 16} Ss = {3,15} Se = {6,12} {9} Six = {18}16. it. 18. (b) [51] = 6 = 6(18) |Ss| = 2 = 4(6) [52] = 6 = (9) {Sel = 2 = 9(3) (a) Let k € Z+,1 < k < m. Then ged(k,m) = d < m, for some d € Dy. If k € Sa,,Sa, then dy = ged(k,m) = dy. So the collection Sz,d € Dra, provides a partition of {1,2,3,4,...,m—1,m). (b) Recall that ged(n,m) = d if and only if ged(n/d,m/d) = 1, s0 [Sel = [{n]0 1 and m is odd, Then 2n = 24m and (2n) = (24°) ~ P)b(ra) = 244 (rn) = 224) 9 (on) = 2[2*(1 — })o(m)] = 2[g(24mn)] = 24(n). (b) When n is odd we find that $(2n) = (2n)(1~4)[](— >” where the product is taken a over all (odd) primes dividing n. (If n = 1 then [](1 > is 1.) But (2n)(1—-HTTa— 5 = Pin pin nf] - 2) = 6m). win PB Proof: Let a = pip! ...p™ and b= ph pi? ---pM, where pi,p2,---,P: Ps are distinet primes, and shy gy cosas aves EN. Then c= ged(a, 8) = pan pinnae) nn) So 4(ab)¢(e) = bret ppm. mmm) Gg A area p) and 40 Sgt sovive=| eo-2||n4 w-4 (n. sein. For 1 0: (The same type of argument applies if 0 9) =1-@)- = SH=Hd = 18 2 0.326591. Alternately, Pr(¥ > 3 PO cay = OG og FPG G+ = GPF DTG? + =e a {e) Pr(¥ 2 5) = Des(F)"1(8) = GG) + (HP) + HG) + D+ G+ GP += OO = Gt = Bh ao t0cba2. 23329, 30, 31. 32. 33. _ Pr¥ > 5 and ¥ > 3) (@) Pr 2 SY 28) = “Sasa Gy. ft (e) Pr(¥ > )lY 2 4) = (4 = (4. (© Var (Y) = 9/p*, where ¢ = 1—p = 7. So Var (¥) = (7)/(2Y = F/G) = QB) = F- Consequently, oy = \/28/9 = 1.763834. (a) The differences are 3—1,6~3,8—6,15—8, and 15-15 — that is 2,3,2,7, and 0, where2+34+2+7+0=14. (b) {35,815} (c) {lta,lta+bl+atbteltat+b+c+d} = Pr(y 2 ay/PHY 23) = Gy = 4 Using the ideas developed in Example 9.17, we consider one such subset: 1<1<3< 6 < 10 < 15 < 30 < 42 < 50. This subset determines the differences 0,2,8,4,5,15,12,8, which sum to 49. A second such subset is 1 $7 <9 < 15 < 21 < 32 < 43 < 50 < 50, which provides the differences 6,2,6,6,11,11,7, 0, which also sum to 49. These observations suggest @ one-to-one correspondence between the subsets and the in- teger solutions ofc + cp +cat... ca = 49 where c,ce > 0 and oq >2 for 2 5. (b) Q-z+a2?-29+-)Q-242?-23 +...) = wig = (1 +2)", the generating function for the sequence (77), (57), (3), (3),-.~ Hence the convolution of the given be ir of sequences is co, ¢1, 62... Where @=C apemet) 2 -1r(“) = (-1)\(n+1),neN. {Thies the alternating sequence 1, 2,3, —4,8,-6,7,..-] Section 9.3 7; G+; 52; FAL+N; 4435 44241; 4414144; 34941; 34-242; 8424141; BEIFD 4141; 2424241; 221414]; QL ELL 4 4; 1414141414141 (a) f(@) = (1/0 ~ 21/0 ~ 29/0 ~ 2)9}-+ = A/G ~ 27) {b) o{z) = (142?) + 241 +2°)-- = TNE, +2) (c) A(e)=(+z)(1 +291 +25)-- (L$ 24) The number of partitions of 6 into 1’s, 2’s, and 3's is 7. (@) G/a~*))0/0 -#)1N/G - A/C ~ #7) (>) / ~ AYE /G = #17 — EEA 7, (a)and(b) (ita? +at+a%+...)(L+atta%+.. tees e + = Ma ee (a) fa) =(tete+...¢ 21 e227 ¢28+...¢2%) = T+ of tae% +... + 2%) = 1 (1 — 2)/(1 — 24)] (b) TAG +24 42% 4.04 28) = TAI ~ 2) - 2)] Let f(z) be the generating funcion for the number of partitions of n where no summand appears more than twice. Let g(z) be the generating function for the number of partitions of n where no summand is divisible by 3. Bee dei (l+z+27\(l+2? avi +2°)(ltattzt) bgp eet = oe) Let f(z) be the generating function for the number of partitions of n where no summand is divisible by 4; (2) is the generating function for the number of partitions of n_ where no even summand is repeated (odd summands may be repeated). $@)= ate eae ie 235,10. gis: ae pie (1 +29) = he ES ae ‘This result follows from the one-to-one correspondence between the Ferrers graphs with summands (rows) not exceeding m and the transpose graphs (also Ferrers graphs) that have m summands (rows). Consider the Ferrers graph for a partition of 2n into n summands (rows). Remove the first column of dots and the result is a Ferrers graph for a partition of n. This correspondence is one-to-one, from which the result follows. Section 9.4 (a) oF (b) && @ew (d) = (e) ae" (f) re* (a) fle) = 3e* = 80%, 82, so f(x) is the exponential generating function for the sequence 3,3?,3°,... (>) f(a) = Ge 3c = 6 DE, SA aE, 2H, so f(z) is the exponential generating function for the sequence 3,24, 138,...,6(5") ~ 3(2%),... (©) 1,1,3,1,1,1,1,..- (a) 1,9,14,-10,24,25, 28... () f)=leetergert+ function for the sequence 0!, 1!,2!,3! (£) f(2) = 3[1 422+ (22)? + (22) +...]+ Dino , 50 f(z) is the exponential generating function for the sequence 4,7,25,145,...,(3n!)2"+1,... (a) 2) = f(z) + [3 ~ aal{z°/3!) (b) of) = f(z) + [-1 ~ a3](2°/31) = e* — (12625)/3! (c) g(a) = 2f(a) + [2 — 2a|(a"/1!) + [4 — 2aa}( 22/28) (G) oz) = 2f(z) + Be? + [2— 2a — B(x" /1!) + [4 — Zag ~ 3](x?/2!) + [8 — ay ~ 3]{z°/3!) fe) (+ (2/2!) + (2°/3)) +...) =(e — Ht =e — (Jet + (Je (er + ((). The cocfficient of 219/12! in (e* ~1)* is 41? ({)3 + ($2 - (Za (b) How many onto functions are there from A = {1,2,3,...,12) to B= {red, white, blue, black}? (©) fle) = (+a t (27/21) +... PG + (22/21) + (tA + , 80 f(z) is the exponential generating Mee +) /2P = 23610. (1/4)(e™*)(e* + 2 + e-%*) = (1/4)(e + 2e* + 1). Here the coefficient of 219/(12!) is (1/4)[4!? +2(2!)] and this counts the number of signals where the number of blue flags is even and the number of black flags is even. oz) = (L42+(z7/21)+....)(e+ (09/31) +...)! = 2[(e* ~e7*)/2}? = (1/4)(e —2e** +1). ‘The coefficient of 2!7/(12!) in g(x) is (1/4)[4'? — 2(2!)], and this counts the signals where the numbers of blue and black flags are both odd. Consequently, the number of signals where the total number of blue and black lags is even is (1/4)[4? + 2(2"*)] + (1/4)[4"? — 2(2"9)] = (1/2)(49). We find that oe is ltatet gate OFFA +OE+ ONE +, so 1/(1 ~ z) is the exponential generating function for the sequence 0!, 1!,2!,3!,.... (a) @) (1+27(Q +2 + (27/21) (i) (Lp 2d x + (27/21) +x + (@?/2!) + (29/31) + (4/41) (ii) + 2p +24 (0/2) (b) (L+z)-(1+24(2?/2!))-(L+2+4(x?/2!)+(29/3!) + (24 /4!))-((2?/2!) +(29/3!) +-(24/4))). uu The answer is the coefficient of i in (+ at4...4 48)". A(z) = F(z)g(x) = co + ez + co(z*/2!) + c9(29/3!) + ..., where en(2"/n!) = heal afi) ( Oya [(n — 3!) = [Staub ne)/Ciln — s)DJa" = [Ltaolnl/Cil(n ~ s)]asb.d(2" /nl) = [Choo (F) aba dl(2*/nl) (a) (1/2)/9% + 1)/(9) (b) (1/4)[3% + 3]/(3°) fe) (1/2) — 11/(8%) (a) (0/2)13* - )03") {e) (2/2)[3” + 1]/(3") (a) F(x) = (a + (27/31) + (2/51) +...) (a+ (29/28) + (29/98) +...) eK e*) = (1/2)(e* — 1)*(€?*) = (1/2)(e* — 1Y(e% — e*) = (1/2)(e% — e* ~ €* + €*). ‘The answer is the coefficient of 2%/(20!) in f(z) which is (1/2)[4— 3° — 2 4 1], (b) ghz) = (Lt a + (29/3!) + (ot /At) +.) = (e* ~ (27/2))! = ef - (JePa(x4/2) + (Set(a2/2)? — ()er(a?/2)° + (22/2), The coefficient of 2% /(20!) in g(x) is 4°°~ ({)¢a/2)¢8"")(20)(29)+ (2)(1/4)(2"*)(20)(19)(18)(27)~ (3) (2/8)(4"*)(20)(19)(28)(27)(16)(15) (©) Wz) = (1 +2 + (2/8!) + (24/4) +.) = Ce ~ (27/2)! = ef — (e*(n9/8) + 237(4) e%*(28/6)* ~ (4)e*(25/6)* + (2°/6)'. The coefficient of 27°/(20!) in A(z) is 4° — e 3 ({)a7ey(a"*)(20y(29y(a8) + (2)(4/6)*(2"*)(20)(19)¢18)(1716)(45) ~ ($) (2/6)*(20)/(421). (d) The coefficient of 2%°/(20!) in (e*)%(1 + (22/2!) = e + (27/2!) is 3 + (1/2)(3*)(20)(19). Section 9.5 + (a) 142 +27 is the generating function for the sequence 1,1,1,0,0,0,..., so (1+2+2%)/(1~2) is the generating function for the sequence L1+L1+141,14+1+1+40,... ~ that is, the sequence 1,2,3,3,.... (b) 1+2 +2? + 2° is the generating function for the sequence 1,1,1,1,0,0,0,..., 80 (l+2+2?+2°)/(1—2) is the generating function for the sequence 1,1 +1,14+1+1,1+ T4+141,1414+1+1+40,14+14+1+1+4040,...~- that is, the sequence 1,2,3,4,4,4,.... (c)_142z is the generating function for the sequence 1,2,0, 0,0, 50 (14+2z)/(1~2) js the generating function for the sequence 1,1 +2,1-+2+ 0,1 0+0,... ~ that is, the sequence 1,3,3,3,.... Consequently, (1/(1~2))[(1 + 22)/(1 ~ 2)} = (1+ 22)/(1~2)? is the generating function for the sequence 1,1 + 3,14+3+43,1+3+4343,... — that is, the sequence 1,4,7,10,.... © @= (@) 2/Q-2) Gi) 2/0 -2) iv) 2/0-29 Dhak the coefficient of 2” in 2/(1~z)* the coefficient of 2” in 2(1—2)~* the coefficient of 2*-! in (1 — 2) apr = yr RS) nt) = Mn +1)(n) F(z) = [e(1+2)}/(1—z)* generates 0?,1°,2?,3%,...; [(1t2)|/(1—2)* = 07412242222 Peart. (d/dollats/1—z)| = P42 tbo? 2(d/dz){(2+2?)/(—2)] = OF Pr + %- 2? 439-22 4...; (d/de)(x + 2?)/(1 — 2) (2? + de + 1/11 —2)', so a(z? + 4a + 1)/(2 —2)§ generates 0°,0° + 19,0 + 19+ 2°,..., and the coefficient of 2" is Dhoi®. (e44e4+2)(1—a)* = (8442742) ((Z)+(5 1 (B)i-2)*+...]. Here the coefficient of a® is (B)- ayn? 44(c8)(~ ay? + (8) (aad = (mt) + 4(083) + (43) = (1/4) f(r + Tn )(n — Dn ~ 2) + 4(n + 2}(n + 1)(n){n = 1) + (n + 3)(n + 2X(n + I(n)] = [Gn + 1}()/41](Gn? + 6n) = (1/4)(n + 1(n)(n? + n) = (nr + (n)/2 (b) ee aon . The function (1 + 2)f(x) generates the sequence ap, ao + 41,41 + 43,42 + s,.... For the BEQUENCE Mg, Go + G1, Oo + G1 + G2, 01 + G2 + Gy, G2 + G3 + a4,..., the generating function is 238(Q+242%)f(2). (1-2) f(2) = (1-2)(ag-+ar24-ay2?4052+...) = ay +(a; ag )e-+(a2— 43 )2? +-(a3—ay)29-+ +180 (1—2)f(z) is the generating function for the sequence do,a1—ao,42~4},43—a2,..+ Lf(2) — FQYI/@ — 1) = (1 ~ 1))(¢0 — a0) + (are ~ 4) + (a22? — a) +... For n> 0, (@q2" — @,)/(2 — 1) = aa" — D(a - 1) = a(2" $29 +... +22 4241), 50 [fe — FM/(@ = 1) = a taal t Dt ane? +241) tage? +e? +241) +... Hence the coefficient of 2%, for n>0,is D2aq a Since e* is the generating function for 1,1,1/21,1/3!,..., it follows that e*/(1 — 2) generates the sequence 9,01,42,..., Where dq = FRe(1/il). (0) py = 142427 42° +++ is the generating function for the sequence 1, 1, 1,1, -.+ Applying the summation operator, we then learn that (;1z)? is the generating function for the sequence 1,14+1,1+1+1,1+1+1+1,...~ that is, the sequence 1, 2, 3, 4, .... Consequently, z/(1 — z)? is the generating function for 0, 1, 2, 3, 4, ... and «/(1—z)* the generating function for 0,0+1,04+1+2,0+14+24+3,0414243+4,... that is, the sequence 0, 1, 3, 6, 10, ... (where 1, 3, 6, 10, ... are the triangular numbers). (b) The sum of the first n triangular numbers is the coefficient of 2* in the generating function ¢/(1— 2) = 2(1—2)* = af(t) + (54)(-2) + (F)(-2)? +--4. So the answer is the coefficient of 2"? in (1—2)~* and this is (“4)(—1)"-? = (-1)"71 (“#O7} 1) (aye = (222) = G/6)n(n + 1)(n +2), as we learned in Example 4.5. Supplementary Exercises (a) 6/Q-2)+1/4-2)? — (b) 1/(-az) (©) Wl-G+a)z] (a) 1/Q-2)+ 1/0 - az) Let f(z) = (2S+28 +2 4244217) = 2%(1 423 4+2%+42%42"), The coefficient of 2 in f(z) equals the coefficient of 2* in a 1 2¥8)/(1 — 29)! = (1 — 2!) — 2?) = a(t? 2 (9 2 — 20}. 1(-2) 4 (O20 vee P)(-2)? +... This coefficient mCi (ICI CIC = CIE) + ONE. ‘The generating function for each type of bullet is S datttes aM bet att +2°)}', The coefficient of 2" in (1~2°)*(1-2)-* = [1 — ({)z® * a 50) + *) G)Cd+ ICH 1 & GIO) OG) = )+G)- By the rule of product the answer is {(}3) ~ (1) (6) + ()F- Fa)=(e ree $eh$ bdo pate $.). SNR tal te% 24.) 2398 10. Let f(z) be the generating function for the number of partitions of n where no even summand is repeated (although an odd summand may be repeated); g(z) is the generating function for the number of partitions of nin which no summand occurs more than three times. Then g(2) = (1+2+2?+0)(1t2?+a*+2°(L¢2% 42°49) 1+2)(1+27)][(+ YA + 2QIG +29) + 29)... = (A 2?)/(1 2) +2 2/1 ~ 2) + 2A) ~ eA) +2)... = 1/2) +2) /O~ 291424) 1/02) +: aferta%t... lta? 1t2% taf po%4.. i +et\(l tao +2424. lta! (z). This result is the coefficient of 2'°/(10!) in (1+(z?/2!)+(2°/3!)-+...)! = (ef 2)! = (Daze + (s)a%et ~ (S)zte* + (et. This coefficient is 4°°— (4) (10)(3°) + (4) 10)(9)(28)— (s)caoy¢oy¢s). (a) (1 22)-#? 21 Ep, LHAMHM= NAPA Ae ACH/—r4_pgVr = 14 D%, MMe=42 gr, 59 g(z) is the exponential generating function for 1,5,5(7), 5(7)(9),-.- (b) (az) = 14 58, Miemeadetor (ag = 1 ~ abs + Wb 1a2a?/2t +. Consequently, by comparing coefficients of like powers of , we have ~ab = 7, (b—i)a? = Tell and a=4,b=-7/4. For ench partition of n, place a row of n+k dots above the top row in its Ferrers graph and the result is a Ferrers graph for a partition of 2n+k where n+k is the largest summand, This one-to-one correspondence yields P, = P3. Taking the transpose of a Ferrers graph for a partition in P; yields the Ferrers graph for a partition in P,, and vice versa. The result now follows from these two observations. For each n € 2+, (1+2)" = (5) +(t)2+ (p)2?+(s)2*+...+(t)2". Taking the derivative of both sides we find that et ee @) +a(p)er ap) + ta(Men warns) f(z) = (+ 2)i te? + etl te +284 2% oP Tz) mies n(1 + 1)°t = n(2" Atak ot pope p ah) =coms 12, 13. 14. 15. 16. (a) The coefficient of z™ in (c+2?+...)% = 2%1+e+2+...)" is the coefficient of 2 in (Ltztz?+...)!? = (1-2), and thisis (-?)(-1)8 = (-1)8(487)(-1)8 = (¥7). (b) The coefficient of 2° in (e+2?+...)9=2%(1+2427+...)° is (7)(-1)*= (2). The probability for this type of distribution is (4) (2)/(%). Fix m, 0 | = &, for k a fixed positive integer, we have a, = k" and the generating function is g(z) = 1+ ke + Kz? ++ = 1+ (ke) + (ka) +-- = ple. {@) 2*f(z) 0) (fhe) = (09 aye bags +o baat)" (a) 1= Deby H(A) = AL + 3+ (2) +] = Bacal = HIL/(8/4)] = (4/3), 20 & = 9/4, 24417. 18. (b) Pr(X = 3) = (3/4)(1/4)? = 3/256 Pr{X < 3) = The Pr(X = 2) = (9/4)[1 + (1/4) + (1/4)? + (1/4)] = (3 /4)(85/64) = 255/256 Pr(X > 3) =1~Pr(X <3) = 1 — (255/256) = 1/256 {Alternately, Pr(X > 3) = Pr(X > 4) = Dy Pr(X = x) = (3/4)|(1/4)* + (1/4) + G/4ye te] = (3/4)(1/4)*[1 + (0/4) + (0/4)? ++ 1 = (3/4)(1/4) faa] = (2/4) = 1/256] Pr(X 2 2) = Dey Pr(X = 2) = D,(3/4)(1/4)" = (8/4)(1/4)"[1 + (1/4) + (1/4)? + +=] = (8/64) [gap] = (1/4)? = 1/16. (6) For n € Z*, Pr(X > n) = DE, Pr(X = 2) = E2,(8/4)(1/4)" = (8/4)(1/4)" Lo(1/4)" = 1/4)". ME Ry Consequently, Pr(z > 4|X > 2) = EO ge) = Pr(X > 4)/Pr(X > 2) = (1/4)4/(1/4)? = (1/4). Likewise Pr(X > 104, > 102) = (1/4). For k € Z+, k fixed, we find that Pr(¥ > &) = DE, q""'p (where g = 1—p) =a iptatpt aps = plltgt ete] =o gly =a pd) = 1. Consequently, Pr(¥ 2 mY > n) = Pr(¥ > mand ¥ > n)/Pr(¥ 2 n) = Pr(¥ > m)/Pr(¥ > n) = g™"/gr? = g™*. [This property is the reason why a geometric random variable is said to be memoryless. In fact, the geometric random variable is the only discrete random variable with this property.] (a) The car travels the first mile in one hour, the second mile in 1/2 hour, the third mile in 1/4 {= (1/2)? hour, and the fourth mile in 1/8 {= (1/2)°] hour. Consequently, the average velocity for the first four miles is 4/{1+(1/2)+(1/2)*+(1/2))} = 4/{[1—(1/2)4]/f1—-(1/2)]] = 4/|2(25/16)] = 32/15 = 22 miles per hour. (b) The average velocity for the finst n miles is n/[1 + (1/2) + (1/2)? +--+ (1/2)"4] = neff — (1/2)"1/( — 2/2)]] = n/[2[(2* ~ 1)/2"]] = n(2"-*)/[2" — 1] miles per hour. (©) For n= 19 the average velocity is 4980736/524287 = 9.500018120 miles per hour. For ni = 20 the average velocity is 2097152/209715 = 10.00000954 miles per hour. Hence the smallest value of n for which the average velocity for the first n miles exceeds 10 miles per hour is n = 20. 242,CHAPTER 10 RECURRENCE RELATIONS Section 10.1 (a) Gq = Baya, 2 21, ao = (b) a, = —8an-1, n 21, ag =6 (a) augt = L5aq) Gy = (1.5)"ao, 0 2 0. (b) ay = Sanaa, dy = (1.25)"ao, 2 0. (6) Bany1 = dy, Bay = 15 = dag, a = 15/4, 50 4, = (4/3)"a0 = (4/8)"(15/4) = 6(4/3)""', n 2 0. (2) ay = (8/2)tnn1, te = (8/2) toy 81 = a4 = (8/2)'aq 80 ap = 16 and oy = (16)(3/2)", n 2 0. @n41 — day, = 0, 2 20,80 a, = dao. 153/49 = ay = Pap, 1377/2401 = as = dag => as/as = d? = 9/49 and d = 43/7. (©) a, = (2/8)aq1, 221, a9 = Gy 41 = Gy + 2.5a,, 0 > 0. @,, = (8.5)"aq = (3.6)"(1000). For n = 12, a, = (3.5)!2(1000) = 3,379,220, 508. P, = 100(1 + 0.015)", Po = 100 200 = 100(1.015)" => 2 = (1.015)" (1.015)* = 1.9835 and (1.015)* = 2.0133. Hence Laura must wait (47)(3) = 141 months for her money to double. Py = Po(1.02)" 7218.27 = Py 1.02), so Po = (7218.27){1.02)- = $2200.00 (a) 194184174...410= 145 (bo) 94+84+74...41=45 (a) Suppose that for i =k, where 1 < k Section 10.2 (a) Gy = 5ay1 + 6aq-2, 222, a = 1, a = 3. Let a, = er", c,r #0. Then the characteristic equation is r?—-5r—6 = 80 1,6 are the characteristic roots. a, = A(—1)" + B(6)" B A+6B,s0 B=4/7 and A=3/7. (3/7)(—1)" + (4/7)(6)", n > 0. (b) a, = 4(1/2)" ~ 215)", n> 0. ©) dna +m = 0, 2 20; a9 = 0, ay = 3. With a, = cr", cr #0, the characteristic equation r?+1=0 yields the characteristic roots ti. Hence a, = Afi)" + B(—i)" = A(cos(n/2) + isin(x/2))" + B(cos(x/2) + isin(—1/2))* = C cos(nx/2) + Dsin(nx/2). 0 = ay =C, 3 = a; = Dsin(x/2) =D, so a, =3sin(nx/2), n> 0. (4) 4, ~6a,1 + 9a,-3 = 0, n> 2, ao = 5, ay = 12. Let a, = or", cr #0, Then r?~6r+9 = 0 = (r—3)?, so the characteristic roots are 3,3 and a, = A(3") + Bn(3*). Bay = A; 12=a, =3A4 3B = 1543B, B= ~1. a, = 5(3") — n(8") = (5 ~ n)(3*), n> 0. (0) dy + 2onet + dy =0, 2B 2, ay = 1, ay = 3. 4 2r $20, r=—1ti (-1 48) = Vi(cos(3x/4) + isin(3x/4)) (-1— i) = V2(cos(5x/4) + isin(Sx/4)) = V2(cos(—34/4) + i sin(—3%/4)) = V/2(cos(3x/4) ~ isin(3x/4)) (/2)"[A cos(3n/4) + B sin(3an/4)] V2jvos(3x/4) + Bsin(3x/4)] =v3(-1/v2) + B(1/v2)], so 3=-14+B, B=4 a, = (72)"|eoa(3nn/4) + 4sin(37n/4)), n> 0 (a) Example 10.14: a, = 10ay-1 + 20a,-2, n > 2, a) = 10, a = 100. 1? —10r ~29 = 0, r= 5 £6V6. a, = A(5 + 6V6)" + B(S — 66)" a = 100 = 10a; + 29a = 100 + 2919, 80 ag = 0 Oa = A+B, 00 B=—A. a, = 406 + 6¥5)" (5 -6v6)"] 10 = a; = Al + 6V6 — 3 ovi\=12VEA, A= 5/6v8. a, = (5/6V6)[(5 + 6V6)" — (5 ~6V6)"], n 0. ex(2") +ean(2"), 2 > 0, ag =1, a = 3. a = 2+ e1(2), e0 = 1/2, ay = (2" yt + “oD, n2>0. (b) Example 10.16: a, = a,-1+dg-2, 2 22, ap = 1, 4 = 2 Sees ee te a + ¥5)/2] + BIC — V5)/2] a= AQ4 5) 4.0 V5) = (A+B) +V5(A—B) = 14-V5(A—B), s0 3 = V5(A—B) and A~B=3/v5. 2A = (A+ B)+(A-B) =143/V5 = (3 + V5)/V5, A = (3 + V5)/2V5; B (v5 —3)/2V5, ay = [(v8 + 8)/2VB]|C1 + ¥5)/2F + [v5 ~ 3)/2V8I{(a — V5)/2]", 2 20 A= (N= 0): ay + bay + cay = 0 = 44 KI) +c(0), 80 b= 4. (n= 1): a3 —4ay + ca = 0 =37~-4(4) +c,80 c= —21. An42 ~ Ady ~ 21a = 0 —4r 2 =0=(r- Yr +3), r= 7,-3 A=1/10, B= ~1/10 and a, = (1/10){(7)"—(—3)"], n 20. sn = Oy + gay D2, dg = ay = 1 rly —1=0, r= (14 V5)/2 a, = A((i + ¥5)/2)" + B((L~ vB)/2)" Oy = a = 1 => A=(1+ ¥5)/2¥5, B= (V5~1)/2V5 ay, = (1/VB)I((1 + ¥5)/2)""* ~ (02 ~ ¥B)/2)"*4] . For all three parts, let a,, 2 0, count the number of ways to fill the n spaces under the condition(s) specified. (a) Here ap = 1 and a, = 2. For n > 2, consider the nth space. If this space is occupied by @ motorcycle ~ in one of two ways, then we have 24,1 of the ways to fill the n spaces,6. Further, there are ay ways to fill the n spaces when a compact car occupies positions n—1and n. These two cases are exhaustive and have nothing in common, so Gy = ay) +Gn-2, ZZ, dg=1, ay =2. Let dq = cr", c # 0, r #0. Upon substitution we have r? —2r—1=0,s0r =1+ V2 and a, = e:(1 + V2)" + c(1 — V9)", n > 0. From 1 = a9 = cy +e) and 2 = a = ex(1 + V3) + en(1 — V2), we have ¢, = #42 and e = +28. So a, = ((V2+2)/4)(1 + Wa) 4 (2 ~ VB) ~ VE = C/A + VEY — Ch VBA, n SO. (b) Here ay = 1 and a; = 1. For n > 2, consider the nth space. This space can be occupied by a motorcycle in one way and accounts for ay... of the a, ways to fill the n spaces. If a compact car occupies the (n ~ I)st and nth spaces, then we have the remaining 3a, ways to fill n spaces. So here ay = dy + 3dq-2, > 2 dy = 1, a) = 1. Let a, = er, e# 0, #0. Upon substitution we have r? —r—3=0, 80 r= (14 Vi3)/2, and a, = ex{(1 + VI3)/2)" + c9{(1 ~ V13)/2)", n > 0. From 1 = ap = ey +02 and 1 = a; = e{(1 + v13)/2] + ca[(1 — V13)/2], we find that c, = ((1+ V13)/2V73] and eq = [(-1+ V13)/2VI3}. So ay = (1/Vi13)[(1 + Vi3)/2""" — (/VI3)[ - Visa, n>0. (c) Comparable to parts (a) and (b), here we have ay = 2a,-1 + 34,2, n > 2, a9 = 1, a = 2 Substituting a, = cr”, ¢ # 0, r # 0, into the recurrence relation, we find that r= 2r—3 = 050 (r—3)(r+1) = O and r = 3,7 = —1, Consequently, a, = 1(3")+6,(~1)", n 20. From 1 = ap = c; + ¢7 and 2 = a; = 3e, ~ cp, we learn that cy = 3/4 and c= 1/4. ‘Therefore, a, = (3/4)(3") + (1/4)(-1)", n 2 0. For all three parts, let 5, n > 0, count the number of ways to fill the n spaces under the condition(s) specified ~ including the condition allowing empty spaces. (a) Here by = 1, bj = 3, and b, = 3b, +bq-2, n > 2. This recurrence relation leads us to the characteristic equation r’ — 3r — 1 = 0, and the characteristic roots r = (3 + V13)/2. Consequently, b, = ex{(3 + V13)/2]" + co{(3 ~ VT3)/2)", n > 0. From 1 = by =a +c and 3 = by = cyf(3 + ¥13)/2] + cp{(3 — V13)/2], we find that cy = (3 + 13)/2Vi3 and en = (“3+ Vi8)/2Vi8. So by = (1/VIS)I3 + VI8)/2I" ~ (1/Vi8)(3 — ViayaP4, n20 (b) For this part we have b, = 2b,-; +3b,-2, n 2 0, by = 1, = equation is r? — 2r ~ 3 = 0 and the characteristic roots are r . Here the characteristic r= 1. Therefore, 5, = ex(3") + co(—1)", n > 0. From 1 = by = cy + cz and 2 = by = 3c, ~ c2, we find that cr = 3/4, c= 1/4. So by = (3/4)(3") + 1/41)", n 2 0. (c) Here by = 1, b; = 3, and 6, = 3b; + 3d:-2, n > 2. The characteristic equation 1? = 3r +3 gives us the characteristic roots r = (3 + V21)/2. So b, = ey{(3 + V21)/2° + ods V2i)/2)", n 2 0. From 1 = bp = 0 +e; and 3 = by = o4{(3 + V21)/2] + of(3 — 91) /2}, we have c, = [(3 + ¥21)/2V2I} and cy = [(—-3 + V21)/2V2). Consequently, 2, = (/VEI)(@ + V31)/2)"*" - (8 — V21)/2)")], n> 0. 247(a) Fant = Fan — Fan-2 Conjecture: For all n € Z+, Fi + Fs+ Fy +--+ Fant = Fin — Fo = Fin Proof: (By the Principle of Mathematical Induetioy For n= 1 we have Fj = Fy, and this is true since F, = 1 = Fy. Consequently, the result is true in this first case (and this establishes the basis step for the proof). Next we assume the result true for n = k (> 1) — that is, we assume Ait K+ B+ + Bia = Fe When n = k +1 we then find that Fy + Ft Fote++ + Fon + Fae = (Fit Fat Bot -++ + Fagen) + Foes = Fae + Facts = Fousa = Fags). ‘Therefore the truth for n = & implies the truth at n = k +1, so by the Principle of Mathematical Induction it follows that for all n € Z+ Pit Fat Fot--++ Fant = Fane (b) BR R-K Ro=R-K Fe F,-Fs Fin = Fanti — Fant Conjecture: For alln € N, Fy +Fy+-+++ Fan = Fat Fat Fut +++ + Fan = Fant — Fi = Fag — 1. Proof: (By the Principle of Mathematical Induction) ‘When n = 0 we find that 0 = J, = Fi — F, = 0, so the result is true for this initial case, and this provides the basis step for the proof. t Assuming the result true for n = k (> 0) we have 37 Fy; = Fagyy — 1. Then when n = k-+1 g ’ it follows that en Fait Faust) = Fas ~ 1+ Fanta = (Fae + Fao) Fang — 1 = Fyaryaa ~ 1 Consequently we see how the truth of the result for n = & implies the truth of the result for n = k +1. Therefore it follows that for all n € N. Pot Fit Fite + Fin = Fins 1, 248,10. i by the Principle of Mathematical Induction. Stan Fatt = I asVEns vipa (a /Syayr" (0) Figen EA an Oe - 4/02)" —(-/9)/a" S 900 H+ ¥5)/2)°— (5/2) = Tita os SHEL" (where a = MY, p= 1sy8) Bynat ; 1 = Eitan EE Since || <1 and jal > 1, it follows that |} <1 and ||" +0 as n — 00. Consequently, lity Fit = hy = a= YS, (b) @) AC/AX = sin AXC/sin ACX = sin 108°/ sin 36° = 2sin 36° cos 36°/ sin 36° = 2.08 36° (i) cos 18° = sin 72” = 2sin 36° cos 36° = 2(2sin 18° cos 18°)(1 ~ 2sin?18°) => 1 4sin 18°(1 — 2sin? 18°) = 4 sin 18° — 8sin? 18°, 0 = 8sin® 18° — 4sin 18° +1, so sin 18° isa root of 8z9—4z2+1=0. 825 — 42 +1 = (22 —1)(42? + 22-1) =0. ‘The roots of 427+ 22—1=0 are (~1+ V)/4. Since 0 < sin 18° < sin30° = 1/2, sin18° = (-1+ V5)/4. (©) (1/2)(AC/AX) = cos 36° = 1 — 2sin? 18° = 1 — 2[(-14 V5)/4)? = (1+ V5)/4. AC/AX = 2(1 + ¥5)/4 = (1 + V5)/2. ees aga tena M20 gosa=t (Append 41”) (Append 42’) ay = Al(a + v8)/2)" + BCL — v8)/2)" L=ay)= A+B; 1 =a = A(1 + ¥5)/2+ B(1— V5)/2 oF 2=(A+B)+V5(A- B)=14V5(A-B) and A-B 5, 1S A+B, /Vb = A~B => A = (1+ V8)/2V5, B= (V5—1)/2V5 and a, = (a/V5)[((1 + ¥5)/2)"* — (C1 — ¥5)/2)""4], n 20. Here a; = 1 and a = 1. For n > 3, ay = ay~1 + Gq-2, because the strings counted by ay either end in 1 (and there are a,_. such strings) or they end in 00 (and there are a, euch strings). Consequently, ay = Fa, the nth Fibonacei number, for n > 1. a) The solution here is similar to that for part (b) of Example 10.16. For n = 1, there are two strings - namely, 0 and 1. When n = 2, we find three such strings: 00, 10, 01. For n> 3, we can build the required strings of length n (1) by appending ‘0’ to each of the yx strings of length n ~ 1; or (2) by appending ‘01’ to each of the a,-2 strings of length 24912. 13. n—2. These two cases have nothing in common and cover all possibilities, so Gp = Anat FOnn2, MZ I,a; = 2,0) = 3. We find that a, = Fu42 = (a+? ~ $"42)/(a— 8) where a = (1+ ¥5)/2 and 8 = (1- ¥8)/2. b) Here 4, = 1 since 0 is the only string of length 1 that satisfies both conditions. For n= 2, there are three strings: 00, 10, and 01 ~ s0 by = 3. For n > 3, consider the bit in the nth position of such a binary string of length n. (1) Ef the nth bit is « 0, then there are a,_1 possibilities for the remaining n — 1 bits. (2) If the nth bit is a 1, then the (n ~ 1)st and Ist bits are 0, and so there are ay_s possibilities for the remaining n ~ 3 bits. Hence by, = Gn-1+ Gn-2 = Fata + Fn-1, from part (a). So by = (Fn + Fat) + (Fu-a + Fa) = (Fa + Fa-a) + (Fa-t + Fava) = Bana + dana. ‘The characteristic equation 2* — x — 1 = 0 has characteristic roots a = (1+ ¥5)/2 and B = (1 — V5)/2, 80 b, = cra” +28", From 1 = C10 + eof and 3 = by = ca? + c28? we learn that ¢ =o = 1. Hence}, =a" + 6" = Lq, the nth Lucas number. [Recall that in Example 4.20 we showed that L, = Fuji + Frat.) Let a, count the number of ways to arrange n such chips with no consecutive blue chips. Let 6, equal the number of arrangements counted in a, that end in blue; ¢, = a, —b,. Then dn31 = Bln + Cn = 3(bn + on) + tn = By + Baya Hence aay, — 3a, ~ 3,1 = 0, n > 1, ao = 1, a; = 4, This recurrence relation has characteristic roots r = (3+ V/21)/2 and a, = A((3 + ¥21)/2)" + B((3 ~ V21)/2)". do =1, a =4=> A= (5+ V2)/2V21, B=(V21—5)/2V27 and aq = [(5+ VBI) /(2VAA)IB + V21)/2)" — [(6 — V31)/(2V21)]{3 — V21)/2)*,n > 0. For n > 0, let a, count the number of words of length n in 31" where there are no consecutive alphabetic characters. Let a{!) count those words that end with a numeric character, while (2) counts those that end with an alphabetic character. Then a, = a) + al) Tal? + 4a?) [4a + 400) + 7af =. 4a, + 7a) = dey + M(dons) = dan + Bans, For 121, @att and dy = 1, a; = 11. Now let a,, = cr", where c,r # 0 and n > 0. Then the resulting characteristic equation is rv —4r—28=0, where r = (44 V128)/2 =24 472. 25014. 15. 16. 17. 18. Hence a, = A[2 + 4V2}" + B[2 - 4y2)", n 20. Lay ay 11 A+B, and Al2 + 4/9] + Bl2 — 49} = Al2+4v2}+(1- Alle - 49] [2-42] + Al2 +4V2 -244v3} [2-4v2] +8v24, so A = (9 + 4V2)/(8V2) = (8 +9V2)/16, and B=1~-A= (8 ~9V2)/16. Consequently, [(8 + 9V2)/16][2 + 4v2]" + (8 — 9V2)/16][2 — 4V2I", n D0. Om Using the ideas developed in the prior exercise we find that Tk = 63, or k = 9. a, = 2, ay = 23, ane, a, = 2, ag = 2, and, in general, a, = 2", where F,, is the nth Fibonacci number for n > 0. @ =0, a =1, ag = 1, For n>4,let n= 2) 4+02+...+21, where 2; >2 for 12 and (2;—1)+22+...4 2, is counted in ay_y. Hence @, = ¢,-1 +a,-2, n > 3, and a, = Fy-1, the (n ~ 1}-st Fibonacci number. (a) From the previous exercise the number of compositions of n+-3 with no 1s as summands is Fuga. (b) (@) The number that start with 2 is the number of compositions of n +1 with no Is as summands. This is F,. @i) Ra Gi) The onmber that start with k, for 2 < k (1+ ¥5)/: a2, Fy (3+ ¥9)/2 > (3+ v5)/2 so the result is true for these first two cases (where n = 3,4). This establishes the basis step. Assuming the truth of the statement for n = 3,4,5,...,k(2 4), where k is a fixed (but arbitrary) integer, we continue now with n = k +1: Fin = Fit Fier > ak? a alti ot bak? ot, “8a + 1) a3 a? = at! = albtt-2 Consequently, F, > 0°? for all n > 3 — by the Alternative Form of the Principle of Mathematical Dae FS + vi/2 < (3+ vi/2 Fy a 1<24 V5 = 03 = at so this result is true for these first two — (where n == 3,4). This establishes the basis step. Assuming the truth of the statement for n = 3,4,5,...,4(2 4), where k is a fixed (but ecbitrary) integer, we continue now with n= k +1: Fass Fat Fea ei oh) taht naa 1) Realname Consoquently, F, < a! for all n > 3 ~ by the Altemative Form of the Principle of Mathematical Induction. sot, 25222. 24, (a) Since ay41 = 2a, we have a, = o(2*),n 21. Then a) = 2=> 2c=2--c=1, 50a, = 2", Consequently, for n even, the number of palindromes of n is counted by Gajq = 2? = oll, (b) Here by41 = 2b, 2 > 1, by = 1. Sob, = d(2"),n > Land =132d=15d=1/2, 50 6, = 2°", Hence, for n odd, the number of palindromes of n is counted by asa = AMF /AIH1 = glo—0/2 = gia}, Here we shall use auxiliary variables, For n > 1, let a{ count the number of ternary strings of length n where there are no consecutive is and no consecutive 2s and the nth symbol is 0. We define a{" and al?) analogously. Then ay = all) +) + ol aot + [ayaa = a4] + fanaa — af an + fans — a), — a, = Danan + aly = 2g + Onna Letting a, = er", ¢ #0, r # 0, we find that r? —2r —1 = 0, so the characteristic roots are 1+ V2. Consequently, dq = (1+ V2)" + c2(1 — V2)". Here a; = 3, for the three one-symbol ternary strings 0, 1, and 2. Since we cannot use the two-symbol ternary strings 11 and 22, we have a, = 3? 2 = 7. Extending the recurrence relation so that we can use n= 0, we have ay = 2a; + dy 80 do = ay ~ 2a; =7~2-3=1. With 1=dy = 4 -+e,, and Bea = (1+ V2) +0,(1 - v2) (er +62) + V2(cr ~ €2), we now have 1 = ¢ +0 and V2 = ¢ ~ 2, 80 c = (1+ V2)/2 and cy = (1 ~ v2)/2. Consequently, 4 a, = (1/2)(1 + V2)" + (1/2) - V2)", n> 0. Here a; = 1, for the case of one vertical domino, and az = 3 ~ use (i) one square tile ; or (Gi) two horizontal dominoes; or (iii) two vertical dominoes. For n > 3 consider the nth column of the chessboard. This column can be covered by (1) one vertical domino ~ this accounts for a,.~1 of the tilings of the 2 x n chessboard; (2) the right squares af two horizontal dominoes placed in the four squares for the (n—1)st and nth columns of the chessboard ~ this accounts for 0,2 of the tilings; and (8) the right column of a square tile placed on the four squares for the (n ~ 1)st and nth columns of the chessboard ~ this also accounts for a,2 of the tilings. ‘These three eases account for all the possible tilings and no two casea have anything in common so Gy = yy + 2dyn, 23,4; = yay = 3. Here the characteristic equation is 2? - 2 ~2 = 0 which gives x = 2, 2 characteristic roots, Consequently, a, = ¢)(~1)" + ¢2(2)?, n > 1. From ~1 as the ex{-1) + 25325. 26. 27. (2) and 3 = a = cy(~1)? + €9(2)? we learn that ¢; = 1/3, ey = 2/3. So ay = (1/3)(2"7 + (C2)"], 2B 1. [The sequence 1,3,5,11,21,..., described here, is known as the Jacobsthal sequence} Let a, count the number of ways one can tile a 2x n chessboard using these colored dominoes and square tiles, Here a, = 4, a; = 4? +4 4?45 = 37, and, for n > 3, a, = Adiy-1+160,-9+50,~2 = 40, 1+21dy~2. The characteristic equation is z?—42—21 = 0 and this gives 2 = 7, 2 = —3 as the characteristic roots. Consequently, a, = (7)" + eo(—3)", n>L Here ag = (1/21\(a, ~ 4a) = 1 can be introduced to simplify the calculations for ¢1, 62. From 1 = ag = ¢1 +c and 4 = 7c; — 3ez we learn that ; = 7/10, c2 = 3/10, 80 a, = (7/10)(7)" + (3/10)(-3)", n > 0. ‘When n = 10 we find that the 2x 10 chessboard can be tiled in (7/10)(7)!° +(3/10)—3)! = 197, 750, 389 ways. Here a; = 1 (for the string 0) and a = 3 (for the strings 00, 01 and 11). For n > 3, there are three cases to consider: (1) The nth symbol is 0: There are a, such strings. (2) The (n — 1)st and nth symbols are 0, 1, respectively: There are a, such strings. (8) The (n ~ 1)st and nth symbols are both 1: Here there are also ay-2 strings. These three cases include all possibilities and no two cases have anything in common. Consequently, Gy, = O41 + 2ay-2, 0; = 1, G2 = 3. The characteristic equation, r? - r ~ 2 = 0, yields the characteristic roots 2 and —1, so ay = 0x(2)" + €x(-1)". From 1 2ey — cz and 3 = a; = 4c, + cz, we learn that ey = 2/3 and c = 1/3, So a 2/3)(2)" + (2/3(-I)", n 21. [So here we find another occurrence of the Jacobsthal numbers ] cn ‘There is a; = 1 string of length 1 (namely, 0) in A*, and a, = 2 strings of length 2 (namely, 00 and 01) and as = 5 strings of length 3 (namely, 000, 001, 010, 011 and 121). Forn >4 we consider the entry from A at the (right) end of the string. (1) 0: there are a,.1 strings. (2) 01: there are a,-2 strings. (3) O12, 111: there are a,-5 strings in each of these two cases. Consequently, Oy = Gang + y-2 + 2,3, N>4, a =1, 2 =2, ag=d. From the characteristic equation r?—-r?—r—2 = 0, we find that (r—2)(r?+r +1) = 0 and the characteristic roots are 2 and (—14i-V3)/2. Since (~1+iV3)/2 = cos 120°-+i sin 120° = 25429, cos(2£) + isin(2), we have oy = e1(2)" + ex00s 7B + sin 22%, n>1. From 1 = ay = 2ey ~ 9/2 + 05(V3/2) 2 = ay = des ~ 02/2 — co V3/2} 5 = ay = 8c, +e, we learn that ¢) = 4/7, e7 = 3/7, and cy = 3/21, so a, = (4/7)(2)" + (8/7) cos(2nx/3) + (V3/21) sin(2nz/3), n> 1. {Note that , also counts the number of ways one can tile a 1 x n chessboard using 1 x 1 square tiles of one color, 1 x 2 rectangular tiles of one color, and 1 x 3 rectangular tiles that come in two colors,] Here a; = 1 (for 0), az = 2 (for 00,01), ag = 4 (for 000, 001, 010, 011), ay = 9 (for 0000, 0001, 0010, 0100, 0011, 0110, 0111, 1111, 0101), and for n > 5 iy, = Oya + Ong + Oya + Uoqna- ‘The characteristic equation ré—r?—r?—r —2 = 0 tells us that (r —2)(r + 1)(r? +1) =0, so the characteristic roots are 2,—1, 4%. Consequently, Gy = 04(2)" + ex(-1)" + € co8(na/2) + casin(na/2), n> 1. en +e tee ~e ~ee Ge; ten tea 8/15, ca = 1/6, cs = 3/10, and cq = 1/10, so a, = (8/15)(2)" + (1/6)(-1)" + (8/10) coa(nx/2) + (1/10)sin(nx/2), n > 1. [Note that a, also counts the number of ways one can tile a 1x n chessboard using red 1x 1 square tiles, white 1 x 2 rectangular tiles, blue 1 x 3 rectangular tiles, black 1x 4 rectangular tiles and green 1 x 4 rectangular tiles.] Jy R20, 2% =1,and x =5. Bug ~ Engr = Ang tata — Beng + 22, 0 For n > 0, let 2, = cr", where c,r # 0. Then we get the characteristic equation r?—3r-+2 = (r= 2\(r ~ 1), 50 ay = A(2") + BUI) = A(2") + B. =244+B Hence 4= A, B= ~3, and 2, = 4(2")-3=2"?—3, for n>0. n= 255,30. 31. 32. 33. 34, Expanding by row 1, Dy = 2D,.1~D, where D is an (n—1) by (n—1) determinant whose value, upon expansion by its first column, is Dy. Hence D,, = 2Dq-1 — Dy. This recurrence relation determines the characteristic roots r = 1, 1 so the value of D, = A(1)" + Bn(1)* = A+ Bn. D, = |2|=2 Di= 2=D,=A+B;3=D,=A+2B => B=A=1 and D,=1injn21 Let b, = ai, by = 16, by = 169. This yields the linear relation by42 — 5Sdns1 + 4U, =0 with characteristic roots r= 4,1, 90 b, = A(1)" + B(4)*. bo = 16, b = 169 => A = -35, B = 51 and & = 51(4)"— 35. Hence a, = 514)" — 35, n > 0. dy = c1 + 0,(7)", n 2 0, is the solution of aniz + bang + Can = 0, 8017 + br +e =0 is the characteristic equation and (r—1)(r —7) = (r? —8r +7) =r? + br +e. Consequently, b=-8ande=7. Since ged(F,, Fy) = 1 = ged(F;, F)), consider n > 2. Then R= Fi+F(=1) RaRth P= h+h Fas = Fat Fra Reversing the order of these equations we have the steps in the Euclidean Algorithm for computing the ged of F,41 and Fy, for n > 2. Since the last nonzero remainder is F, = 1, it follows that ged(Fh41,F,) = 1 for all n > 2. Program Fibonacci (input, output); Ver number: integer; {the input} i: integer; {i is counter} current: integer; Fibonacci: array (1..100] of integer; Begin Write (“This program is designed to determine if"); Write (‘a given nonnegative integer is a’); Writeln (‘Fibonacci number. Writeln (‘What nonnegative integer n do you wish to test?"); White (‘a= "); 2561. Readin (number); If number < 0 then Writeln (‘Your input is not appropriate.’) Else if number = 0 then Writeln (‘Your number is the 0-th Fibonacci number.) Else if number = 1 then Writeln (“Your number is the L-st Fibonacci number.") Else {number > 2} Begin Fibonacci (1) Fibonacci [2] Hf number < current then Writeln (‘Your number is not a Fibonacci number.’) Else if number = current then Writeln (‘Your number is the ’, i: ‘th Fibonacci number.’) Elsei:=i+1 {number > count} End {while} End {else} End. Section 10.3 (8) Gags ~ dy = 2n-+3, 220, dg = 1 a =a +043 ay = a +243 = Oy +2423) + 22) + iq = as +23) + ay + 2+ 2(2) +3(8) ay + [2 + 2(2) + 2(8)] + 4(3) Oy = dg FYIFZAG +... + (n~ VD] $3) = 14 2n(n —1)/2] +30 = L4+n(n—1)-+3n= n+2ntl=(n+1), 120. (b) a, =34+n(n—1),n20 (©) ngs — 2a, = 5, 2 20, ao Gy = 2ag $5 = IVS ay = 2a $5 =P H2-5+5 dy = 2ag +5 = P+ (27424195 287Gy, = PF 51 $242 4,..42"7 (@) a, = 2 +nQQ"""), n 20. a, = Tho nga = Oy + (1+ 1)%, 1 20; ao = 0. Gynt — On = (B+ 1) =n? + 2n +1 al) = A, al?) = Bn + Cn? + Dn? Bin +1) + C(nt 1)? + Din4 19 = Bn + Cn? + Dn? +n? 4 2nt 1 => Bnt+ B+Cn? +2Cn+C + Dné +3Dn? +3Dn + D = Bn+Cn?+ Dn? +n? +2nt1 By comparing coefficients on like powers of n we find that C+3D =C+1,s0 D =1/3. Also B+2C+3D =B+2,s0 C= 1/2, Finally, B+} C+D=1=> B=1/6. So ay = A+ (1/6)n + (1/2)n? +(1/3)n®. With ao = 0, it follows that A=0 and a, = (1/6)(n)[1 + 3n + 2n4] = (1/6)(n)(n + 1)Qn +1),n 20. (a) Let a, = the number of regions determined by the n lines under the conditions specified. When the n-th line is drawn there are _n—1 points of intersection and n segments are formed on the line. Each of these segments divides a region into two regions and this increases the number of previously existing regions, namely a,.1, by n. Gy = Oya +, 2 > 1, ay = 1. al) = A, al?) = Bn +Cn? Bn+Cn? = B(n-1)+C(n-1P +n, Bn+ Cn? ~ Bn+B-Cn?+2Cn-C=n. By comparing the coefficients on like powers of n we have B= C= 1/2 and a, = A+ (1/2)n +(1/2)n?. L=ag=A 30 a, =14(1/2\(nj(n +1), n 20. (b) Let 6, = the number of infinite regions that result for n such lines, When the nth line is drawn it is divided into n segments. The first and nth segments each create a new infinite region. Hence b,, = 6,1 +2, n > 2, b; = 2. The solution of this recurrence relation ia by = 2n, nD 1, by 2 +5(2* —1) = 6( Let py be the value of the sccount n months after January 1 of the year the account is started. Po = 1000 Pi = 1000 + (.005)(1000) + 200 = (1.005)p» + 200 Pas = (1.005)p, + 200, 0 9C +9C +20 = 1 => C = 1/20. a, = A(~1)* + B(—2)" + (1/20)(3)" A+ B+ (1/20) 5 = —A - 2B + (3/20) Hence 1 = a +a, = —B + (4/20) and B= ~4/5. Then A ay = (3/4)(—1)" + (-4/5)(—2)" + (1/20)(3)", n 2 0 (b) ay = (2/9)(—-2)" — (5/6)(n)(—2)" + (7/9), n 20 52 — 6ng1 + 9dq = 3(2)" +703)", n> O, ao =1, ay = 4. al’) = A(3)* + Bn(3)" a) = C(2)" + Dn2(3)". Substituting a) into the given recurrence relation, by comparison of coefficients we find that C =3, D=7/18. a, = A(3)" + Bn(3)" + 3(2)" + (7/18)n™(3)" 1 = @,4= a; =} A= ~1,B = 17/18, s0 (—2}(3)" + (17/18)n(3)" + (7/18)n2(3)" + 3(2)", n > 0. Here the characteristic equation is r? — 3°? + 3r —1 al) = A+ Bn+ Cn’, al?) = Dn? + Ent. D(n+3)'+ E(n+3)*—3D(n +2)° —3E(n +2) +3D(n +1)? +3E(n+1)*~Dn3 — Ent = 345n => D = ~3/4, B=5/24. a, = A+ Bn + Cn? — (3/4)n? + (5/24)n4, n> 0. G43 = Bay +3", do = 1, a, = 4. The term 3” accounts for the sequences of length n that end in 3; 3a, accounts for those sequences of length n that end in 0, 1, or 2. af!) = AB", a) = Bn3* Bln +1)8"* = 3(Bn3") + 3" => 3B(n +1) = 3Bn+1 => 3B =1 => B= 1/3 Gy = Asn Bet 1=a9=A,s0 a, =3"+n3"#,n 20. From Example 10.29, P = (Si)[1~ (1+ i)", where P is the payment, S' is the loan (82500), Tis the number of payments (24) and i is the interest rate per month (1%). —B — (1/20) = 3/4. (r—1), 90 r=1,3,1 and P = (2500)(0.01){1 — (1.01)74 Ginga + bydngs + batty = byn + by ay = C12" +628" +n —7 P thr th =(r—2r-3uu. 12. a =n—7 [n+ 2) — 7] — 5[(n + 1) ~ 7] + (ne ~ 7) = dam + by => by = 2, by = 17. (a) Let &=b,n 20 Bue ~ Bbygs + Oy = 7 off) = A(3") + B(2"), of) =Cn+D C(n +2) +.D~3[C(n +1) + D] + 6(Cn+ D) = In => C= 7/2, D= 21/4 by = A(3") + B(2") + (Tn/2) + (21/4) 1, =a?=1 3A+2B A=3/4, B= a, = ((8/4)(8)* — 5(2)" + (7n/2) + (21/4)}7, n 20 (b) a2 —2ay-1= 0, n 21, ao =2 logs an. ‘The solution of the recurrence relation 2b, =1+by-1 is by bby = logy do = log, 2=1, 50 1=bo=A+1 and A=0. Consequently, 6, = 1, n>0,and a, =2,n>0. A(L/2)" +1. Consider the nth symbol for the strings counted by a,. For n > 2, we consider two cases: (2) If this symbol is 0, 2, or 3, then the preceding n—1 symbols provide a string of length n—1 counted by dat. (2) If this symbol is 1, then the preceding n ~1 symbols contain an even number of Is — there are 4"~ — a,_, such strings of length n — 1. Since these two cases are exhaustive and have nothing in common we have Gy = Bay_y + A? — yt) = ya $4", 22. Here a, = al) + al?), where af?) = A(4*-1) and al) = ¢(2"). Substituting a(?) into the above recurrence relation for a, we find that A(4"~-* 2A(4*"?) +41, 50 4A = 2A 44 and A= 2, ‘There is only one string of length 1 where there is an odd number of Is ~ namely, the string 1. So a, =1=e(2)4+2(4°), and ¢=—1/2. Consequently, @y = (—1/2)(2") + 2(4""1), n 21. ‘We can check this result by using an exponential generating function. Here a, is the coefficient of x*/n! in e(=$ )(et)? = Let” — 1e3*, Hence a, = (4)(4") — 1(2"),n 21. 26043. 14, (a) Consider the 2” binary strings of length n. Half of these strings (2"-") end in 0 and the other half (2"~) in 1. For the 2"? binary strings of length (n — 1), there are t. runs. When we append 0 to each of these strings we get t,-1 + (1)(2""") runs, where the additional (4)(2""") runs arise when we append 0 to the ()(2"~*) strings of length (n—1) that end in 1. Upon appending 1 to each of the 2°! binary strings of length n—1, we get the remaining ¢,-1 + (})(2""?) runs, Consequently we find that ty = ty 2°71, n2B2 t= 2 Here #{") = o{2"), so #{f) = An(2*). Substituting #) into the recurrence relation we have An(2") = 2A(n —1)2"-! 42-1 = An(2") — AQ) $2 By comparison of coefficients for 2" and n2" we learn that A = 1!) $20) = 0(2") + n(2""1), and 2 = t = (2)+1 => c=}, 80 ty (n+1)(2"),n 21. (b) Here there are 4" quaternary strings of length n and 4°~! of these end in each of the one symbol suffices 0,1,2, and 3. In this ease Consequently, t, (Denner ta = Alta +Ge Ayn +34 ) N22, had Comparable to the solution for part (a), here ¢{*) = ¢(4") and t(?) = An(4"). So And’ 4A(n — 1)4"-? + (3)(4-1) = And™ ~ A(4") + (3)4", and A = 3. Consequently, t, (4) + (3)n4™ and 4 = ty = 4c + (3)(4) + c= 3, 50 ty = (4)4" + (Fnd” = 4-1(1 + 3n), nz (c) For an alphabet ©, where {S| =r > 1, there are r™ strings of length n and these r* strings determine a total of r"-'{1 + (r —1)n} runs. [Note: This formula includes the case where r= 1] (8) Sati = Sn + taya = Su + (n+ 1)(n + 2)/2 Sntt — Sn = (1/2)(n? + Sn + 2) a= all +o of), ~ 6) =0, 00 sft) = AI") = A 3?) = n(Bn? + Cn + D) = Bn + Cn? + Dr Bin +1) + C(n + 1)? + D(n+ 1) — Bn? — Cn? — Dn = (1/2)(n? + 3n +2) => B= 16, C =1/2, D=1/3 fm = A +(1/6)n? + (1/2)n? + (1/3)n Since 6; = =1, 1 = A+(1/6)+(1/2)+(1/3) => A =0, and 5, = (1/6)(n\inti)int2). (b) G)_ sre00000 atoms. (3) 520,906 — S1ogm + 1.665 x 10 atoms. 2611 Program Towers of Hanoi (input, output); Var number: integer; {number = number of disks} Procedure Move The Disks (n: integer; start, inter, finish; char); {This procedure will move n disks from the start peg to the finish peg using inter as the intermediary peg,} Begin Ins then Writeln (‘Move disk from ’, start,‘ to ’, finish, ‘.’) Else Begin Move_The Disks (n-1, start, finish, inter); Move The Disks (1, start, ‘’, finish); Move. The Disks (n-1, inter, start, finish) End {else} End; {procedure} Begin {main program} Write (‘How many disks are there? *); Readin (number); IW number < 1 then ‘Writeln (‘Your input is not appropriate.’) Else Move ‘The_Disks (number, 3") End. Section 10.4 (@) ang1 a, = 3" 2 20, ag =1 Let f(z) = Sho dus*. Sega et ey ast = Sey aa [f() — a0] — 2f(z) = 2 Deho(82)" = #/(1 ~ 32) #3 ~1~2f(z) = 2/(Q- 32) (1 ~ 2) + 2/((1 ~ 2)(1 ~ 32) = 1/1 ~ 2) + (~1/2)/( ~ 2) + 0/2)/(0 - 32) = avy ~ #)+ (1/2) ~ $2), and a, = (1/2)[1 + 3"],n 2 0. (6) ay = 1+ [n(n ~ 1)2n - 1)/s},n 20. (©) Gu42 Sang + 2m, =0, 220, a= 1, 4 =6 Sass? 3S aa! +23 age 3 = a 262LV aneae™*? ~ 32 Y angie"! +207 Yann” = 0 ce} = = Let f(2) = Soa,2". Then = (f(z) - 1-62) —32( f(x) ~ 1) +227 f(a) = 0, and f(x)(1-32 +227) = 14+62—3x = 1432, Consequently, 1+3e = 22) and a, = 5(2")-4, n 20. (4) Gaga — 2dnga + Gn = 2", 220, ap = 1, 4 =2 Deeg dagaZt? — 202g dngiz™t + Dg ane™t? = Derg Bat? Let f(e) = Doane”. Then [F(@) ~ a0 ~ az] ~ 2cl f(x) ~ ao] + 2?F (2) = 2? Dero(22)" f(a) — 1-20 — 2x f(x) +20 + 27f(2) = 27/(1 22) (2? — 2e + 1)f(2) =1+427/(1 — 22) => f(z) = 1/(1-2)*+ 2? /((1—22)(1 —2)*) = (1-22 +07)/((1~ 2)*(1 —22)) = 1/(1-2e) = 1 +22 +(22)?+..., 80 dy = 2", n> 0. f(a) = 2502)" 42, = =o . a(n,r) = aln—1yr—1) +a(n—1yr), r 21. TA a(n,rje" 4, an ~1,r—1)2" + D2, a(n — Lr )2” a(n,0) =1, n> 0; a(0,r) =0, r > 0. Let fa = E%oa(n,r)a". a —a(n,0) = thar + fr +2)fy-1 and = = D%ya(0,r)z" = a(0,0) + a(0, 1)z + a(0,2)2? +... = a(0,0) = 1,80 fy =(1+z2)" generates a(n,r), r>0. Let f(z) = Deo dut™, oft) = Dnco bao”. PE 25S ome 4g het? Tmo tnt + 6 Dig batt f(z) ~ ag = —22 f(z) ~ 4zg(z) g(2) — by = 42 f(z) + 629(z) S(a)(1 + 22) + 4zg(2) =1 S(z—4z) + (1 6z)g(z) = 0 2631 0 1 — 62) ay ( z DY = (1 ~62)/(1 ~22)? = oie (=e) f(z) = (1 G2)(1 — 2)? = (1 ~ 62){(3) + (F)(-22) + (F)(-2e? +] ay = (2)(-2)" ~ 6(-4)(~2)""1 = 2° — 2a), 2 20 F(z)(—4z) + (1 - 62) o(z ==> of) = (42) f(z) ~ 62)? => g(2) = 4e(1— 22)? and b= 4(23)(—2)? = nf"), n 20. (b) an = (—8/4) + (1/2)(n + 1) + (1/4)(3"), 220 b, = (3/4) + (1/2)(n + 1) — (1/4)(3"), 2 20 Section 10.5 + by = Bobs + bibs + baby + baby = 25 +2) = 14 by = [(2n)I/((n + 1)(nl))], 4 = 81/(5!4!) = 14 AMOS ES NNON 372 ‘Qn +2 on ) = (1/2\(1/(2n +1)) [& +2)2n+ hee 7 csayaran-+1p( Iie + DE = (1/2)[(2n +2)/(n + 1PMAn}i/(nt)'} = A/a + D)(2) ant) f2n—1) _ f@n~at] (@n-1)t i . ( a ) Go) -[s3 woe - (2n — I)iin + 2] _[@n-Dia-1)] | (2n — 1)! @ Fim —il| ~[@-e+y'| * (e+e — il (@+)-@-D= 264t (2n ~1)}(2) @4DIe = (a) No (b) Yes (c) No (d) Yes (@) (@/9y('s) (>) woe © (a/o(?)Ia/3)(¢)1 @ ao? (@) tayit For n> 2, let 0,02,...,0n1 be the vertices of a convex (n+ 1)-gon. In each partition of this polygon into triangles, with no diagonals intersecting, the side vitnair is part of one of these triangles. The triangle is given by vivitnin, 25% Sn. For cach 2< i 0, otherwise we end up with intersecting chords. For each n> 1, let 1 2, Lis at the end of the pernmtation or is the first component of a rise in such a permutation. Therefore, 1 must be at position Lor Sor... or 2{(n —1)/2) +1. (f) As in part (d) look now for 1 in a rise/fall permutation of 1,2,3,...,n. We find 1 is position 24 + 1 for some 0 < i < {(n —1)/2J. Here there are 21 numbers that precede 1. These can be selected in (";;') ways and give rise to Ey; rise/fall permutations. The 268remaining (n ~ 1) — 21 = n ~ 2i ~ 1 numbers thet follow 1 give rise to Ey-ai-1 rise/fall permutations, ‘Theron, By = DSM (2) Ba Ba aay Le (g) From parts (d) and (f) we have: (A) By = ("*)ErBn at (5) EaBnea too + (gyapan) Batnsaj—1Zn-ainras (8) Bu ("54) BoE nas + ("5") BoB nna to + (gens) Eatin ryt Bn—alinv ait Adding these equations we find that 22, = DE} (NEB or Ey = (1/2) Ded (°F) BE ai Bo = (1/2)Dhao ({) Ess = (1/2){(8) Boks + (EE + (2 Pats Cs + Cae GE = (1/2)1-1-16+5-1-5410-1- aoe s145-5-141-16-1] ) = (1/2)[16 + 25 + 20 + 20-4 25 + 16] = Ey = (1/2)¥to ({) BiBo-« (1/2)[L-1-6146-1-16415-1-54+20-2-2415-5-146-16-141-61-3} 272 (i) Consider the Maclaurin series expansions sece = 1427/2! + 524/4! + 612°/6! +--+ and tang = £4 22°/3! + 1625/5! + 27227/7! + -- ‘One finds that sec2 + tanz is the exponential generating function of the sequence 1,1,1,2,5,16,61,272,... ~ namely, the sequence of Euler numbers. Section 10.6 (a) fn) = (5/3)(4n&4—1) and f € O(n for ne {3} € N} (b) f(n) = T(loggn +1) and f € O(log,n) for n€ {5'|i € N} [As in the proof of Theorem 10.1 we find that fin) =a*f(1)+efl+ata?+...ta l= adteltata+...ta 1, (a) Fora=1, fin) =d+ck = d+clogn, since n= bt. (b) For a> 1, fin) = afd +el(at — D)/(6- 1)] n= Bd kx logy at = GPE" = nF => log,(a!%") = log, n® => (log, n)(logy a) = x(log, n) => 2 = log, a. So for a>1, f(n) = dnl%* + (e/(a — 1))fnls? — 1}. . (a) £€ Ollogyn) on {bk € N} (b) fe O(n") on (Hk EN} (a) d=0,0=2,6=5,c=3 269f(r) = 3pnboes? — 1) FE O(n?) (b) d=1,a=1,b6=2,c=2 J(n) = 14 2logn f € O(log, n) (a) fQ)=0 f(r) = 2f(n/2) +1 From Exercise 2(b), f(n) =n—1. (b) The equation f(n) = f(n/2) +(n/2) asises as follows: There are (n/2) matches played in the first round. Then there are (n/2) players remaining, so we need j(n/2) additional matches to determine the winner. (@) Corollary 10.1: From Theorem 10.1 (1) f(a) =e (lon +1) for n= 1,0,8%,..., when a= 1. Hence f € O(log;n) on S= {tk EN}. (2) f(n) = [e/(a ~ 1)}fan’o* — 1} for n= 1,0,0%,..., when a > 2, Therefore f € O(n’®*) on S = {bk EN}. (ii) Theorem 10.2(b): Since f € O(g) on S, and g € O(nlogn), it follows that Ff € O(nlogn) on S. So by Definition 10.1 we know that there exist constants _m€ R+ and s € Z* such that f(n) = |f(n)| < mnlogn| = mnlogn for all n € S where n> s. We need to find constants M€R* and s, €Z+ sothat f(n) 9, —not just those n € S. Choose ¢ € Z*+ so that s < bf 1). Since f is monotone increasing and positive, FOS FO) < mbH og) m bE flog oF + log ] m BY log +m BF log b m Bt (log bt + log 5)] 1m Ofb* log (1 + lob) m (1 + logb)(6* log HF) m B(1 + logb)tlogt Sowith M =m (1 +logs), and s; = bt +1, we find that for all t€ Z*, if ¢> 9 then f() < M(tlogt) (s0 f(t) < M(tlogt), and f € O(n logn)}. 90) (@) Here f(1) = 0, (2) = 1, f(8) = 3, f(4) = 4, 80 f(4) < f(2) < F(8) < f@). To show that f is monotone increasing we shall use the Alternative Form of the Principle of Mathematical Induction. We aséume that for all i,j € {1,2,3,...,n}, 7 >i => fG) > (i). Now we consider the case for n+1, where n > 4. (Case 1: n-+1 is odd) Here we write n+-1 = 2k-+1 andhave f(nt1) = f(k+1)+f(b)+2 2 HAWK HWA A 27010. F(k) + f(B) +2 = f(2k) = f(n), since kk +1 3). Then f(n +1) = f(2r) = f(r) + f(r) + 2f(r) + flr - 1) +2 = fr —1) = fin), because F(r) 2 f(r — 1) by the induction hypothesis. ‘Therefore f is a monotone increasing function. (b) From part (a), Example 10.48, and Theorem 10.2 (¢) it follows that f € O(n) for all ne Zt. () Fin) < af(nfb) + em af(nfd) < af(nfi*) + ac(n/t) @f(n/P) < @f(n/P) + aeln/t?) @fl(n/P) < afln/s) + ateln/i?) ANf0/P) S abfln/it) + ee) Hence f(n) < at f(n/b)* + en[l + (a/b) + (a/b)? +... + (a/b) = ak f(1) + nfl + (a/b) + (a/)? +... + (a/b)], since n = bt. Since f(1) 6, then logya>1, and f € O(n™*) on Zt. (a) 0 = 9, b=, niet = niet? =n? 2714, R(n) =n € O(n?) fore = 1, So by case (i) for the Master Theorem we have f € @(n?). (b) a= 2,b=2, nes = nbetonton A(n) = 1 € O(n? ~ €) for e= 1. By case (i) for the Master Theorem it follows that f € O(n). (0) a= 1, b= 3/2, nies = nits! = n= 1, Hn) = LE O(n) Here case (ii) for the Master Theorem applies and we find that f € @(n!®*log,n) = (log, n). (a) @= 2, b= 3, ns = nhs? = 2S Kn) = n € O(n 24) where € = 0.369. Further, for all sufficiently large n, a h(n/d) = 2h(n/3) = 2(n/3) = (2/3)n < (3/4)n = ce h(n), for 0 <¢= 3/4 <1, Thus, case (iii) of the Master Theorem tells us that f € O(n). (2) a= 4, b= 2, nPHs = nett = 9? h(n) = n? € Ont) From case (ii) of the Master Theorem we have f € O(n! log, n) = @(n® log, n). Supplementary Exercises (e3:) -eanececy- pea FH) () (a) Consider the element n+1 in S = {1,2,3,....,n +1}. For each partition of S we consider the size of the subset containing n +1. If the size is 1, then n+1 is by itself and there are B, partitions where this happens. If the size is 2, there are (3) =n ways this can occur, and B,_1 ways to partition the other n—1 integers. This results in ({)By-1 partitions of S. In general, if n +1 is ina subset of size 1+1, 0S 1. For 1 1. Thea tiyta,-..5t provide a partition of n—k into exactly k summands. These cases are exhaustive and disjoint, 90 by the rule of sum. p(n, k) = p(n —1,k ~ 1) + p(n — kk). Here a) =1 and a2 For n>3 write n= 2, +22+...+ 24, where each z;, for 1 3, and a, = Fy, the nth Fibonacci number, for n > 1, 5. (a) [2558 2 ‘ -[z a]: tl u Bm mS are aa aa 7 Ne Me At we (b) Conjecture: Forn €Z*+, A" = where F, denotes the nth Fibonacci number. Proof: For n 7 a=a'e[} al-[% Fy | the rn ie tru in this first case, Assume the result true for n =k > 1, ie., |: For makya, atm asta atean |e Fe IE: al F, Fiaj[1 0 Faas + Fa Fees] [Faiz Fait Fit Fea Fe Far Feo Consequently, the result is true for all n € Z+ by the Principle of Mathematical Induction. Set eae (2) ole eto eh ieee (iis at 2 @ue[I 3) ie ghae=([§ Bhae-[2 oa fia] [a an 23)_[RR ome[t a]-[8 a] u le |= etal a sf 8 2)_[ RR w-[5 s| [F F| w= [3 a> Ral Fina Fan |: ee + Mts We claim that forme Zt, Mm =| ph) Proof: We see that the claim is true for n = 1 (as well as, 2, 3, and 4), Assume the result true for A(2 1) and consider what happens when n = k +1. ae vay _faatfrap_fa 1] Aen Fa 12 P2y{1 2} [1 2), me Fen 273Fait Far Fae + Fares - [ Fuit2Fx Fut 2Pan | _ | Fan Fans (Fina + Fat) + Far (Fae + Fay) + Fangs _ | Fan Fay | Fon Fina Fay + Fai Fata + Fares Farsz Fases [Fe Be Fan Fantt |” It follows from the Principle of Mathematical Induction that M* = | alln>1. Fin Fan fe Fan zl a From 2?—1 = 144 we find that z*—z = 241, or z?~22-1 = 0. Since (-1)°-2(-1)-1 = -142-1>=0, it follows that —1 is a root of z*— 2z—1. Consequently, x—(~1)=z+1 is a factor and we have z3 —2z ~ 1 = (x + 1)(2?— 2 — 1). So the roots of 2* — 2z —1 are —1,(1+ ¥8)/2, and (1 — ¥5)/2. For 2 =—1,y=(-1)?-1=0. For 2 = (1+ V8)/2, v = [(1 + v5)/2P ~ 1 = (1/4)(6 + 2V8) — 1 = [(8 + ¥5)/2} -1 = G+ v5)/2. For 2 = (1 — V5)/2, y = (1 — V8)/2)? — 1 = (1/4)(6 - 28) ~ 1 = [(3 - ¥5)/2]-1 = a- ¥5)/2. So the points of intersection are (—1,0), ((1~V5)/2, (14+-V5)/2) = (a,a), and ((i-V5)/2, (1 ~ ¥5)/2) = (6,8). - (a) a? = (1 + VB)2/4 = (6 + 2V5)/4 = (3 + V5)/2 a+1 (1+ ¥5)/2+1=(3 + V5)/2 B? = (1 — V5)/4 = (6 - 2V5)/4 = (3 - V8)/2 B+i=(1- v5)/2+1= (3 - v5)/2 (b) Chao (2) Fi = Diao (2)(a* - BAe ~ 8) = [1/(a~ BylEtao (?)a* ~ Chao (7) 440) = [Ia - AIG +4)" - 0 +8)" = [ila - BY?" — (8 )"] = (a — 8) /(a ~ B) = Fin {c) a? =a(a*) = [(1 + ¥5)/2I[(3 + V5)/2] = (8 + 4v5)/4 = 24 VE 1+ 2a = 1421 + ¥5)/2] = 24+ V5 #9 = (B?) = ((1 ~ V8)/2\{(3 — V)/2] = (8 4V5)/4 = 2- VE 1426 =142{(1 - V8)/2]=2- V5 (hao (3) 24Fe = hho (7) 24 a4 ~ PHY/La- 8) 27410. = [/(a~ BYR (2) 2a — Dike (2)2484 = [1/(a~ AZo (7) 2eax)* ~ Lao (3)(2)4 = [1a AA +2a)* ~ (1+28)] = [2/(a— A)][a°* — 6] = (a> ~ )/(a~ A) = Fan (a) Since a? = a +1, it follows that o? +1 = 2+ and (24a)? = 444+? = A(1 +a) +0? = 507. (b) Since 6? = 6+1 we find that §?+1 = $+2 and (248)? = 44+48+f? = 4(1+8)+8? = 5B. 0 F(Z) E (7) See] _ = cna ~ an] (f)corton-¥ (Planter) = (1a B)fo™(a-+ 02) — BC+ 8) = Gla ~ A)er2+ a)" 22+ 3) = (Ka ~ Alan((2-+4)9 —A"(2+ AN) = (ila ~ Ale (Bay ~ (58°) = SU /(a~ Bila" ~ P| = 5Fangne (a) Let pp = $4000, the price first set by Renu, and let p, = $3000, the first offer made by Narmada. For n > 0, we have Pata = (1/2)(Puta + Po) This gives us the characteristic equation 2x? —2—1 = 0; the characteristic roots are 1 and. -1/2, So Pe = A(1)" + B(-1/2)", n> 0. From po = 4000, p; = 3000 it follows that A = 10,000/3, B = 2000/3. ‘Narmada’s fifth offer occurs for n = 9(= 2-5—1) and pa = $3332.03. Her 10th offer occurs for n = 19 and pp = $3933.33. For k 2 1, her kth offer occurs when n = 2k ~1 and Px = (10,000/3) + (2000/3)(-1/2)""?. (b) As n increases the term (—1/2)" decreases to 0, so p(n) approaches $10,000/3 = $3333.33. (c) Here p, = A(1)* + B(-1/2)*, n 2 0, with pp = $4000. As n increases p,, approaches A = $3200, So 4000 = pp = 3200+ B, and B = 800. With p, = 3200 + 800(~1/2)" we find the solution p: = 3200 + 800(—1/2) = $2800. 25i. 12 13. Consider the case where n is even. (The argument for n odd is similar.) For the fence Fa = {01,42,-..54n}, there are cy; order-preserving functions f : F, -+ {1,2} where ‘F(ay) = 2. [Note that ({1,2},<) is the same partial order as Fy.) When such a function satisfies f(a,) = 1, then we must have f(a,-1) = 1, and there are c,-2 of these order- preserving functions. Consequently, since these two cases have nothing in common and cover all possibilities, we find that Cn Cnt tb Onna, C1 = 2, cr = 3, So cy = Fy42, the (n + 2)nd Fibonacci number. This combinatorial identity follows by observing that Fyy2 and Dfg ("E4), for m = [(n41)/2], each count the number of subsets of {1,2,3,...,n} that contain no consecutive integers. (a) For n > 1, let a, count the number of ways one can tile a 1 x n chessboard using the 1x 1 white tiles and 1 x 2 blue tiles. Then a; = 1 and a, = 2. For n > 3, consider the nth square (at the right end) of the 1x n chessboard. Two situations are possible here: (1) This square is covered by a 1x 1 white tile, so the preceding n~1 squares (of the 1xn chessboard) can be covered in d,-1 Ways; (2) This square and the preceding ((n — 1)st) square are both covered by a 1 x 2 blue tile, 90 the preceding n ~2 squares (of the 1x n chessboard) can be covered in an-2 ways. These two situations cover all possibilities and are disjoint, so we have 2 Oy = dat + naz, M23, a= 1; ae Consequently, a, = F,41, the (n + 1)st Fibonacci number. (b) (i) There is only 1 = (*) ) = (253,) way to tile the 1 x n chessboard using all white squares. (i) Consider the equation 21 +21+++--+2,-1 = n—1, where 2; = 1 for can select one of the x;, where 1 Oit follows that c= a = (1+ V5)/2. = 5{°7! (sch). {Compare this result with the formula presented (a) For each derangement, 1 is placed in position i, 2 0, we get 2n new points of intersection which split the perimeter of this oval into 20 segments. Each segment takes an existing region and divides it into two regions. So 2. Ong1 = dy + 2n, n> 1, @ al = A, af?) = n(Bn+C) (n4-1[B(n +1) +C] = n(Bn+C)+2n => Bln? +2n41)+Cn4+C = Bn? 4+Cn42n = 2B+C =C+2, B4+C =0=9 B=1, C=-1,00 a =Atni-n, 2a eA a, =n? —n$2= n(n —1)/ +2. (8) a, = () (b) ce) e ea r() + G)te/ne + ({)(efr a? + - do + aye + [e(t - 1)/2] = s(t ~1) = 8,80 6 ) t= 1/2, and 2718. 19, 20. (©) Let a coin be tossed 2n times with the sequence of H's and T’s counted in ay. For 1SiSn, there isa smallest i where the number of H’s equals the number of ‘I's for the first time after 2i tosses. This sequence of 2i tosses is counted in bj; the given sequence of 2n tosses is counted in a,-:6. Since bo =0, as i varies from 0 to n, Gn = Dheo Gibnwie (A) Let g(z) = Do bat”, (2) = Die dye” = (1 — 4), TEy ane" = Ea toby + abyaa tot yby)e” => f(t) — ao = f(s)g(z) or o(2) =1-[1/f(2)} =1-(1-42)'7, (142)? = [(42) + (*7)(—42) + ((P)(—4ey +] ‘The coefficient of 2" in (1-42)? is ()(—4)" = GPNG/2) ~ G12) — 2) (G2) 94D gyn. CAVES)" 2a 3) pny _ nt nf -1/(2n — 1} (2. Consequently, the coefficient of 2" in g(z) is by =[i/(2n~1))(**), n21, b =0. 1a = PSA) = 41 <1, 90 Debt = ty = ahs = a = te EE = = stp =~) = -2. 7 (]D GN) ---2n — 3)(2)(4) --- (n= 2)(2n) __(=1)_ (An) nln! ~ @n=1) nln! Since a + 8 = (H4¥8) + (1x) =1, it follows that a —1=—f. Lo l6lt = DEG)" = coy = aay = ae YE = SE = 4 = (D+ V5), and a? = (14y8)? = (#8848) = (3)(3 + v5). For x,y,7 ER, FFl@ yh 2) = flatbey+el2+y), 2) = atb[(atbey+e(2+y))2]+el(atbey+ele+y))+2)) Satact cx they + Rays + bere + Ay + boyz + abs + cz, and F(a, Fu, z)) = flava + byz + ea +y)) = at bala + bys + ely + 2) + ele + (a+ byz + e(y + 2))] satactabetertety +z + Bayz + bery + bexz + boyz. f associative > f({(z,y),=) = f(z, f(y.z)) > 2x + (ab+c)z = abe + cx +z. With ab = 1 it follows that Oztztez=atezter, or (A —c~1)2=(c?—c-1)z. Since x, z are arbitrary, we have c — c—1 = 0, Consequently, ¢ = @ or c = 8. (a) @= B= (2) + V8) ~ (4) - V5) = vB 2782. 22. 23. a? =a? = (SE (YG + V5 -3 + V5) = Bt ~ B= (GAR? ~ RE) = hy - SP = (A) + V5 -3 4 V5) = V5. (b) Using the Binet form we have Fess, - (ay a emcees eee = Slee agrie (since af = -1) = (a — BP )/(ar~ 8) ffrom the results in part (a)) = (c) Here the base angles are 60° and the altitude is a Consequently, the area of T is (1/2)(V8/2)Fa[Fu-1 + Fass] = (V3/4)FalFa-1 + Fatt) Returning to part (b) we find that Fin = Fy; — Fina = (Fut ~ Fr-t)(Fatt + Fra) = FFaui + F,Fy-1. Consequently, the area of T = (/3/4)Fa,- Since ANB = 0, Pr(S) = Pr(AUB) = Pr(A) + Pr(B). Consequently, we have 1 = P+, sop? +p—1 = 0 and p= (~1 4 ¥5)/2. Since (-1 — ¥5)/2 < 0 it follows that p=(-1+ ¥5)/2=—-A. ‘The probability that Sandra wins is p+(1—p)(1—p)*p+(1—p)(1—p)*(1—p)(1—p)pt e+ = pil +(1— py + (1~ p+ (Ap) ++] = pl - Ap) For the game to be fair we must have 1/2 = p[1/[1— (1 — p)°J], 80 (1/2){1 - 0 — p)] [1-G.-p))]=1~(.- 3p + 3p? - p*) 3p ~ Sp + p®, an P— Sp?-+ p= pp? ~ Sp +1). Since p > 0, it follows that p? — 3p + 1 = 0, or p = (3 + V5)/2. Since p < 1, we find that p= (3~ ¥5)/2 = [(1 ~ v5)/2)? =p Here a; = 1 (for the string 0) and az = 2 (for the strings 00, 11). For n > 8, consider the nth bit of a binary string (of length n) where there is no run of 1’s of odd length. (If this bit is 0 then the preceding n ~ 1 bits can arise in a, ways; and (ii) If thie bit is 1, then the (n — 1)st bit must also be 1 and the preceding n — 2 bits can arise in a,» ways. Since the situations in (i) and (i) have nothing in common and cover all cases we have Oy =a tor, NZ 3,q = 1,0 =2 27924, 25. Here a, = Fyyx,n > 1, and so we have another instance where the Fibonacci numbers arise. Here 29 = a, 2) =}, 22 = a12¢ = ba, ey = 290; = Wa, zy = 2yey = Ba, and ay = 24z3 = ba, These results suggest that 2» = a and, for n > 1, xq = bF*al1, where Fy denotes the nth Fibonacci number (for n > 1). To establish this in general we proceed by mathematical induction. The result is true for n = 0, as well as for n = 1,2,3,4,5. Ces the result true for n = 0,1,2,...,4—1,4, where & is a fixed (but arbitrary) ive integer. Hence 24-1 = Pia? and 14 = Wea, 90 te = tate = (rahe (UF aFe-2) = PFet Fit ghi-ithi-a = pFitig!h, by the recursuve definition of the Fibonacci numbers. Consequently, by the alternative form of the Principle of Mathematical Induction the result is true for (n= 0 and) all n > 1. (Second Solution). For n > 0 let a = logy. ‘Then yp = loga, 11 = logs, and y, = Ynta + Un-ay 2 > 2. SO Ym = 10" + c25%, where a = (1+ ¥5)/2 and 8 = (1 — ¥8)/2. Joga = ¢1 + en logh = cra + en8 => 2 = (~1/¥5)logb + ((1 + ¥)/2V8l loga, 4 = (1/¥5)logb + ((—1 + V5)/2V5} log a, where the base for the log function is 10 (although any positive real number, other than 1, may be used here for the base). ‘Consequently, we = ca" + enh" {Q/V8)log6 + [(-1 + V5)/2V5} log aja” +[(—1/V¥5) log b + (0. + V5)/2V5)log a] 3", so yore 10U-1V5/2Vi}tog (VS) so” 1010+ V8) 2V8)logat(-1//i)logd}s" alll-14VEi2vBan sieveyavilorylon-oryV5 AP O-PYVE pao = afeibhs, since F, = (a* ~ *)/(a ~ A) = (a — *)/VE. @) (1=0) F}- RR -FR=P-0-1~0'=1 (n=1) -AR-ReaP?-11-Pe-1 (n=2) R-R-Fp=P-1-2-V=1 (n=3) F}- BR, - Fe =3-2-3-2=-1 (b) Conjecture: For n > 0, 1, Fla Raia ({_p 8SS (©) Proof: The result is true for n = 0,1,2,3, by the calculations in part (a). Assume the result true for n = k(> 3). There are two cases to consider — namely, k even and 28027. 28. 29. k odd. We shall establish the result for k even, the proof for k odd being similar. Our induction hypothesis tells us that F?,, — F.Fisi — Ff = 1. When n = k + 1(> 4) we find that Fe.a~ FaeiFes2 — Foyy = (Feta + Fi)? ~ Fats(Fesa + Fi) — Fla = Fl + 2Fep Fe + FR - Fh, — Faas Fe ~ Fi = Fat Fe + FE - Fi = —[FB - FP — FE] = -1. The result follows for all n € N, by the Principle of Mathematical Induction. The answer is the number of subsets of {1,2,3,...,n} which contain no consecutive entries. ‘We learned in Section 10.2 that this is F,42, the (n + 2)nd Fibonacci number. (a) r(Cy2)=1lte (Cs, 2) = 14 40 +327 r(Cy,2) = 1422 r(Cs,2) = 1452 + 62? + 2° r(Ca,2) = 1432427 r(Cs,2) = 14 6x + 1027 + 429 In general, for n > 3, r(Cq,2) = r(Cn-12) + 2r(Cnu2y2). (b) r(Ci,1 (Cs, 1) =5 r(Cs,1) = 13 r(Ca,1) r(C4,1) =8 r(Co,1) =21 [Note: For 1 A= 1/18, 50 pa = n/18. Hence Jill has probability 10/18 = 5/9 of (a) The partitions counted in f(n,m) fall into two categories: (1) Partitions where m is a summand. These are counted in f(n ~m,m), for m ‘may occur more than once. (2) Pastitions where m is not a summiand - eo that m—1_ is the largest possible summand. These partitions are counted in f(n,m ~ 1). Since these two categories are exhaustive and mutually disjoint it follows that f(n,m) = f(n — mm) + f(a,m ~ 1). (b) Program Summands(input,output); Var n: integer;30. Function {(n,m: integer): integer; End; {of function f} Begin Writeln (‘What is the value of 17”); Readin (n); Writeln (‘What ie the value of m2’); Readin (m); Write (‘There are *, f(n,m):0,‘ partitions of °); Write (n:0,‘ where °,m:0,‘ is the largest’); Writeln (‘summand possible’) End. (e) Program Partitions(input,output); Var in: integer; Function {(n,m: integer): integer; Begin If n=0 then f Else if (n < 0) or (m < 1) then Else f := f(n,m-1) + f(a-m,m) End; {of function f} Begin ‘Writeln (‘What is the value of n2”); Readln (n); Write (‘For n =", :0,‘ the number of ” Write (‘partitions p(’, 0:0, *) is’, (an): Let [B|=n=1 and [Al=m. Then f:A->B where f(a) =6 forall aé A and {6} = B, is the only onto function from A to B. Hence a(m,1) 28231. For m>n>1, n™ = the total number of functions f: A> B. If 1 05 (2) v2 + Ug > U4 Ung O25 (= 1) Oper 9 Oe 1 + Ung Oe} and (1) Oy + Uy Ya Opt Ope When n = 4 the vertices v1,02,5,04 provide a cycle. The other four cycles of length 4 consist of vertex vs and three of the four vertices v1, 02,03, V4. (i) There are n +1 cycles of length n in Wy: (1) p90) 9 1) OS (2) OL Ong Fy FOE oF Oped eS (3) 0p Ong P49 1S Po Oped Oy Og} ne ee ae (R41) 0g Ong Fy 7 19 Ong FOF One For n > 1, let a, count the number of closed v ~ v walks of length n (where, in this case, we allow such @ walk to contain or consist of one or more loops). Here a; = 1 and a = 2. For n > 3 there are a,_; » ~v walks where the last edge is the loop {v,v} and a,-2 ov walks where the last two edges are both {v,w}. Since these two cases are exhaustive and have nothing in common we have dy = dy_1 + ay-2, > 8 = 1, a) = 2. We find that a, = F,.41, the (n +1)st Fibonacci number. a) There are two other unit-interval graphs for three unit intervals. 289ol — 0 il oe oe ee 0 10 10 1 Oo 1 . ° ° wi w2 w3 Wr wo w3 010101 001011 ) For four unit intervals there are 14 unit-inteval graphs. ¢) For n> 1, there are 5, = =1;(*) unit-interval graphs for n unit intervals. Here }, is the nth Catalan number. The binary representations set up a one-to-one correspondence with the situations in Example 1.40 ~ in particular, change 0 to 1 and 1 to 0 in part (b) of Example 1.40 to obtain the binary representations of the 14 unit-interval graphs on four ‘unit intervals. Section 11.2 (a) Three: (1) {6,4}, {a,c}, {c,d}, {d,a} (2) {frch: {ea}, {ad}, {a,c} (3) fi,d}, {dc}, {e,9}, {ad} {b) G1 is the subgraph induced by U = {a,6,d, f,g, hi, j} G, =G~{c} (c) Gz is the subgraph indeed by W = {b,c,d, f,9,i,3} G.=G@~ {a,h} @ br ©) o a eg : f, -T' g : j _ 3 (s} Gy is not an induced subgraph of G if thave-exists.an edge {2,8} in E such that 290a,bEV, but {a,b} ¢ By. (b) Let ¢ = {a,d}. Then @—e is a subgraph of @ but it is not an induced subgraph. (a) There are 2° = 512 spanning subgraphs. (>) Four of the spanning subgraphs in part (a) are connected, (co) 2 ‘There is only one ~ the graph G itself. G is (or is isomorphic to) the complete graph Ky, where n= |V|. ‘There are 11 loop-free nonisomorphic undizected graphs with four vertices. M, @) ®@ “TEP Zz * . @ ca) XR (8) (9) (Qo) (a) Six of these graphs are connected. . (a) (b) No solution. [hb “Es ‘Ch wee © w 2 v 8 aL: jw w[e]s vEe}* o[«] ¥ a ® w {a) There are (1/2(7)(8)(5)(4)(3) = 1260 paths of length 4 in Kr. (>) The number of paths of length m in K,, for 0 3|V|, 20 the maximum value of [V| is 11. Since 38 = 2|E| = 7 deg(v) > 4IV], the largest possible value for |V| is 9. We can have 4 (i) seven vertices of degree 4 and two of degree 5; or (ii) eight vertices of degree 4 and one of degree 6. The graph in pact (2) of the figure is an example for case (i); an example for case (ii) is provided in part (b) of the figure. (a) (b) a) We must note here that G need not be connected. Up to isomorphism G is either a cycle on six vertices or (a disjoint union of) two cycles, each on three vertices. b) Here G is either a cycle on seven vertices or (a disjoint union of) two cycles — one on three vertices and the other on foar. ©) For such a graph G,, G; is one of the graphs in part (a). Hence there are two such grophs Gi. d) Here Gj is one of the graphs in part (b). There are two such graphs G; (up to isomorphism). e) Let G: = (Vi, Ei) be a loop-free undirected (n ~ 3)-regular graph with |V| =n. Up to isomorphism the number of such graphs G is the number of partitions of n into summands that exceed 2. (a) [Vi] = 8 = [Woh [Bi] = 14 = |B. (b) For Vj we find that deg(a) = 3, deg(b) = 4, deg(c) = 4, deg(d) deg(f) = 4, deg(g) = 4, and deg(h) = 3. For V; we have deg(s) degiu) = 4, deg(v) of the two graphs has four vertices of degree 3 and four of degree 4. (c) Despite the results in parts (a) and (b) the graphs G, and G, are not isomorphic. In the graph G; the four vertices of degree 4 — namely, t,u,w, and z ~ are on a cycle of length 4. For the graph G; the vertices b,c, f, and g — each of degree 4 -- do not lie on a cycle of length 4, 294‘A second way to observe that G and G; are not isomorphic is to consider once again the vertices of degree 4 in each graph. In G, these vertices induce a disconnected subgraph consisting of the two edges {,c} and {f,9}. The four vertices of degree 4 in graph G2 induce 2 connected subgraph that has five edges — every possible edge except {u, 2}. Gi % 10. nL 12, 4 e \, 4 a a c a e bd o e 6 ) a f f c i) Citi) a) 19 b) y (3) [Note: No assumption about connectedness ia made here.} a) There are 8-2” = 1024 edges in Qs. b) The maximum distance between pairs of vertices is 8. For example, the distance ‘between 00000000 and 11111121 is 8. ) A longest path in Qs contains all of the vertices in Qg. Such a path has length 2 -1= 255, a) n-2*! = 524,288 => n= 16 b) n-2? = 4,980, 736 = n= 19, so there are 2!° = 524, 288 vertices in this hypercube. ‘The typical path of length 2 uses two edges of the form {a,b}, {b,c}. We can select the vertex 6 as any vertex of Q,, so there are 2" choices for 6. The vertex 6 (labeled by a binary n-tuple) is adjacent to n other vertices in Q,, and we can choose two of these in (5) ways. Consequently, there are (jen paths of length 2 in Qa. The number of edges in K,, is (3) = n(n —1)/2. If the edges of K,, can be partitioned into such cycles of length 4, then 4 divides (3) and (3) = 4¢ for some ¢ € Z*+. For each vertex 0 that appears in a cycle, there are two edges (of K,,) incident to v. Consequently, each vertex v of K,, has even degree, so n is odd. Therefore, n—1 is even and as 4f = G) = n(n—1)/2, it follows that 8t = n(n — 1). So 8 divides n(n — 1), and since n is odd, it follows (from the Fundamental Theorem of Arithmetic) that 8 divides n—1, Hence n—1 = 8k, or n= 8k +1, for some k € Z*. a) Let v € V. Then vRv since v and itself have the same bit in position k and the same 29513, 14, 13. 16, Dit in position € — hence, R is reflexive. If vw € V and wRw then v,w have the same bit in position & and the same bit in position £. Hence w,v have the same bit in position k and the same bit in position £. So wRv and R is symmetric. Finally, suppose that v,w,2 €V with vRw and wRz. Then v,w have the same bit in position k and the same Dit in position , and w,« have the same bit in position k and the same bit in position £, Consequently, »,z have the same bit in position k and the same bit in position £, so uRz — and ® is transitive. In so much as R is reflexive, symmetric and transitive, it follows that 2 is an equivalence relation. ‘There are four blocks for (the partition induced by) this equivalence relation. Each block contains 2°-? vertices; the vertices in each such block induce a subgraph isomorphic to Qua (b) For n> 1 let V denote the vertices in Q,. For 1 < hy < hy <...< hj Snand w,z € V define the relation R on V by wR if w,x have the same bit in position ky, the same bit in position &;,..., and the same bit in position k,. Then R is an equivalence relation for V and it partitions V into blocks. Each block contains 2*~' vertices and the vertices in each such block induce a subgraph of Q,, isomorphic to Qn. 8|V] < Deev deg(v) < AJV|. Since 2|E| = Dyey deg(v), it follows that 6|V| <21B| < AIV| 80 6 < 2(e/n) there exist unique a,€V with f(a) =<, f(b) =y. If {a,b} ¢ B, then {f(a), f()} ¢ EB (b) If deg(a) =n, then there exist 21,22,...,24 €V and {a,z;} € B,1 n, let y €V! such that y # f(z,) for alll n. Hence deg f(a) =n. Proof: Start with a cycle vy —+ Up + ty >... —+ vase > Uae + vp. Then dravw the k edges {01 depths {025 Pesahs-- 2 {0 b4e}s-+-1 {049 tay} The resulting graph has 2k vertices each of degree 3. Proof: (By the Alternative Form of the Principle of Mathematical Induction) ‘The result is true for n = 1 (for the complete graph Kz) and for n = 2 (for the path on four vertices). So let as assume the result for all 1 k>1 forall v EV. If k=1 the result follows. If & > 1, suppose that we have selected vi, v2,...,0 EV with {v1,v2}, {v2 vs},--++{0e-1 4} € E. Since deg(vg) > ky there exists u,4, € Vi where vpyi $v; for 1 Si < k-1, and {vy,v441} € E. Then {v1.02}, (02 05},--- {0-10}, (04, tep1) provides a path of length k. (a) Let a,b,c,2,y€V with deg(a) = deg(b) = deg(c) = 1, deg(z) =5, and deg(y) = 7. Since deg(y) = 7, y is adjacent to all of the other (seven) vertices in V. Therefore vertex is not adjacent to any of the vertices a,é, and ¢. Since 2 cannot be adjacent to itself, unless we have loops, it follows that deg(z) < 4, and we cannot draw a graph for the given conditions. () (8) @sbrcrg aka ia gobafajoinfretizhodsesto aa (bl) dta+badshrinesfrisjsafabocetgs+k4jogsbo € n odd: n=2 22. 1; Any single bridge. Yes. Model the situation with a graph where there is a vertex for each room and the surrounding corridor, Draw an edge between two vertices if there is a door common to both rooms, or a room and the surrounding corridor. The resulting multigraph is connected with every vertex of even degree. 29724, 25. 26. We find that J> id(v) =e = Yo od(s). cag oe (a) (i) Let the vertices of Kg be v;, v2, 03, 04,5, %, Where deg(v,) = 5 for all 1 2 Since G is loop-fice and connected, for all z € V_ we have 1S deg(z) {2,y,2} by F(a) = y, f(b) = 2, fc) = 2. This function provides an isomorphism for these two graphs. Alternatively, if we stuct with the first matrix and interchange rows 1 and 3 and then interchange columns 1 and 3 (on the resulting matrix), we obtain the second matrix. This also shows us that the graphs (corresponding to these adjacency matrices) are isomorphic. (b) Yes {c) No (2) Here each graph is a cycle on three vertices ~ so they are isomorphic. 30035. 37. (b) The graphs here are not isomorphic. The graph for the first incidence matrix is a cycle of length 3 with the fourth (remaining) edge incident with one of the cycle vertices. The second graph is a cycle on four vertices, (©) Yea No, Let each person represent a vertex for a graph. If v,w represent two of these people, draw the edge {v,w) if the two shake hands, If the situation were possible, then we would have a graph with 15 vertices, each of degree 3. So the sum of the degrees of the vertices would be 45, an odd integer. This contradicts Theorem 11.2. Define the function f from the domain A x B (or the set of processors of the grid) to the codomain of corresponding vertices of Qs as follows: $((ab, cde)) = abede, where ab € A, ede € B, and a,b,c,d,e € {0,1}. If f((ab, ede)) = f(aybs,crdye1)), then abede = aybycydyey, 90.0 = ay, b= by, = c,d = dy, € = ey, and (ab, cde) = (a:bj, crdye:), making f one-to-one. Since |A x B] = 15 = the number of vertices (of Qs) in the codomain of f, it follows from Theorem 5.11 that f is also onto. Now let. {(ab, ede), (vw, zyz)} be an edge in the 3x 5 grid. Then either ab = vw and ede, xyz differ in (exactly) one component or ede = xyz and ab, vw differ in (exactly) one ‘component. Suppose that ab = vw (soa=v,b=w) ande=2,d=y, bute ¢z. Then {abede, vw2yz} is an edge in Qs. {The other four cases follow in a similar way.] Conversely, suppose that {f(arbi, e141 ¢1), f(0i%1, 219121)} is an edge in the subgraph of Qs induced by the codomain of f. Then a,b,ed;¢; and vy.0,2412 differ in (exactly) one component ~ say the last, Then in the 3 x 5 grid, there is an edge for the vertices (a1bs,¢1410), (axbiexd:1). {Similar arguments can be given for any of the other first four components.] Consequently, F provides an isomorphism between the 3 x 6 grid and a subgraph of Qs. [Note that the 3 x 5 grid has 22 edges while Qs has 5 - 2+ = 80 edges} Assign the Gray code {00,01,11,10} to the four horizontal levels: top ~ 00; second (from the top) - 01; second from the bottom ~ 11; bottom ~ 10. Likewise, assign the same code to the four vertical levels: left (or, first) ~ 00; second — 01; third - 11; right (or, fourth) — 10. This provides the labels for pi,p2,-.-, Pio, where, for instance, p; has the label (00,00), 2 has the Inbel (01,00),...,pr has the label (11,01),...,pi1 has the label (11,10), and pre has the label (10, 10). Define the function f from the set of 16 vertices of this grid to the vertices of Q, by $l(ab, ed)) = abed. Here f((ab,ct)) = f((asbiyexds)) + abed = aybyeydh = a = a,b = hue = e1,d = dh = (abjed) = (a:h,¢,ch) = f is one-to-one. Since the domain and codomain of f both contain 16 vertices, it follows from Theorem 5.11 that f is also onto. Finally, let {(ab, ed), (we, y2)} be an edge in the grid. Then either ab = wz and cd,yz differ in one component or ed = yz and ab, we differ in one component. Suppose that ab = wz ande= y, but df z. Then {abed, wey} is an edge in Qu. The other cases follow in a similar way. Conversely, suppose that {f((a:b,,¢14s)), #((00121,4h21))} is an edge in Qe. Then a,b,erd;, 1219121 differ im exactly one component ~ say the first. Then in the 301grid, there is an edge for the vertices (0b,,¢r¢}), (1h, ed). The arguments are similar for the other three components. Consequently, f establishes an isomorphism between the three-by-three grid and a subgraph of Q4. [Note: The three-by-three grid has 24 edges while Q, has 32 edges.) Section 11.4 In this situation vertex b is in the region formed by the edges {ad}, {4\c}, {c,a} and vertex ¢ is outside of this region. Consequently the edge {b,e} will cross one of the edges {ad}, {d,c}, {a,c} (as shown). 302From the symmetry in these graphs the following demonstrate the situations we must consider Ky: Kas: (a) Graph Number of vertices Number of edges Kay 1 28 Kru 18 7 Kran mtn mn (b) m=6 Let G = (V,E) be bipartite with V partitioned as Vj U Va, so that each edge in E is of the form {a,b} where a ¢ Vi, 6 € Vz. If H is a subgraph of G let W denote the set of vertices for H. Then W = WAV = WO(WUN) = (WOK) UWA), where (WV) A(WAMV) =O. Hf {zy} is an edge in H then {x,y} is an edge in G — where, say, 2 € Vj and y € Vz, Hence z € Wi, y € W, and H is a bipartite graph. (a) Let ¥ = {a,d,e,h} and Vz = {5,¢,f,g}. Then every vertex of G is in Vi UV; and ViNV, = @. Also every edge in G may be written as {z,y} where zs € Vj and y € V}. Consequently, the graph G in part (a) of the figure is bipartite. (b) Let Vj = {a,b,9,h} and Vj = {c,d,¢, f}. Then every vertex of G’ is in Vi UVj and V{N Vj = 0. Since every edge of G’ may be written as {z,y}, with z € Vj and y € Vj, it follows that this graph is bipartite. In fact G’ is (isomorphic to) the complete bipartite graph Kyy. (c) This graph is not bipartite. If G" = (V",E") were bipartite, let the vertices of G" be partitioned as ¥j" U Vj’, where each edge in G” is of the form {x,y} with x € Vj’ and v € Vj. We essume vertex a is in Vj', Now consider the vertices b,¢,d, and e, Since {a, 8} and {a,c} are edges of G" we must have 6, ¢ in Vj’. Also, {6, d} is an edge in the graph, 60 dis in Vj’. But then {d,e} € B" = ¢ € Vf’, while {c,c} € E” => e € Vj". There are four vertices in K, and we can select four vertices from those of Ky in (5) ways. Since each of the four vertices (in each of the (3) selections) can be the unique vertex of degree 3 in K;,s, there are 4(%) subgraphs of K, that are isomorphic to Ki. Alternately, select the vertex of degree 3 in Ky, — this can be done in n ways. Then select 30310. 1. 12 the remaining pendant vertices — this can be done in (;') ways. Hence the number of subgraphs of K,, that are isomorphic to Ky. is “(5 ) = (n(n — 1)(n ~ 2)(n — 3)/6 = (4)[(n)(n — 1)(n — 2)(n — 3)/24] = 4(}). The vertices in Km, may be partitioned as Vj UV; where [Yj] =m, |Ve| =n, and each edge of the graph has the form {z,y} where x € Vj and y € V3. (a) In order to obtain a cycle of length four we need to select two vertices from each of Vj; and Vj. This can be done in Gg) ways — each resulting in a distinct cycle of length four. [Note: Say we select vertices a,b from Vj and vertices ¢,d from V3. We do not distinguish the cycles a> e+ b—+d—aandasd+b+c+a] (b) For a path of length two there is one vertex of (path) degree 2 and two vertices of (path) degree 1. If the vertex of (path) degree 2 is in Vj then there are m{(") such paths. There are n(‘;) such paths when the vertex of (path) degree 2 is in Vz. Hence there are m(3) + n(3) = (1/2)(mn)[m +n — 2] paths of length 2 in Kinn- (c) Here a path of length 3 has the form a —+ b> ed where a,c € Vj and b,d € V3. By the rule of product there are (m)(n)(m — 1)(n ~ 1) = 4(3) (3) such paths in Kn. (a) 2 (b) 6 (= 2(3)) (©) 14 (= 47) (a) 2m (b) (1/2)(7)(3)(6)(2)(5)(A)(4) = 2520 (©) 50,295,168,000 i {a/2ynyeaxn ~ 1m — I(r ~ 2)---2)(n = (m+ D\(A(m — m) Let G = (V,E) be bipartite with V=VU¥;, Wn; = 6. If G has a cycle of odd length then there is an edge in the cycle of the form {x,y} with z,y€V; (or z,y€ V4). This contradicts the definition of a bipartite graph. Partition V as VWiUV with [Vi] =m, |Val = u—m. If G is bipartite, then the maximum number of edges that @ can have is m(v—m) = —[m ~— (v/2)}? + (v/2), a function of m. For a given value of v, when v is even, m = v/2 maximizes m(v — m) = (v/2)[v — (v/2)] = (v/29. For » odd, m= (v—1)/2 or m= (v+1)/2 maximizes m(v —m) = [(v ~1)/2]{v ~((v ~1)/2)} = [(v~ 1)/2){(v +1)/2} = (et Die” ((o + 1)/2)] = (x? — 1)/4 = [(v/2)9] < (0/2). Hence if [E] > (v/2)*, @ cannot be bipartite. (a) There are 3: (i) Kis: (ii) Kay; and (iii) Kyo. (b) [n/2| for ne Zt, n>218. (a) a: {1,2} E (4,5) bi {3,4} {2,5} 2,3} a: {2,4} {1,3} e: {3,3} & {14} a ¢ (b) G is (isomorphic to) the Petersen graph. (See Fig, 11.52(a)). 14, (a) (2) 3) Not cM? BX PY Graph (1) shows that the first graph contains a subgraph homeomorphie to Ka, 80 it is not planar. The second graph is planar and isomorphic to the second graph of the exercise. ‘The third graph provides a subgraph homeomorphic to K3,3_so the third graph given here is not planes. Graph (6) is not planar because it contains a subgraph homeomorphic to Ks. AN ® 15. ‘The result follows if and only if mn is even (that is, at least one of m,n is even). Suppose, without loss of generality, that m is even — say, m = 2t. Let V denote the vertex set Of Km where V = VjUV, and Vi = {015 025-+- 501) Upty-+-20m fo Va = (Way Way on} The mn edges in Kw, are of the form {v;,wj} where 1 5(53), or |E| > (1/2)(5)(53). And from Theorem 11.6 we have |V| = |E|~-53+2 = |E|~B1 > (1/2)(5)(53)— 51 = (265/2) — 51 = 81}. Hence |V| > 82. 10 (a) For each component Cj = (Vi, Hi), 1S i Sn, of G, if ¢ —%j42= rj, Summing as i goes from 1 to n wehave e~v+2n the infinite region is counted n = n(G) times, Hence ¢—v-+n+1 (b) Using the same notation as in part (a) we have 3r; < 2e;, 1 Si 6 for all v © V. Then 2¢ = Suey deg(v) > 6|V|, so € > 3]VI, contradicting ¢ < 3|V|—6 (Corollary 11.3.) (a) Suppose that G = (V,E) with |V|=11. Then @ = (V,E,) where {a,b} € Ey if {a,b} ¢ BE. Let e = {Ele = |B). Hf both G and @ are planar, then by Corollary 11.3 (and part (b) of Exercise 20, if necessary), ¢ < ave 6 = 33-6=27 and e; < 3|V|—6 = 27. But with |V| = 11, there are (3) 55 edges in Ky, 80 {B|+ |Z) = 55 and cither > 28 or e; 2 28. Hence, one of G, G must be planar. If G=(V,E) and |V} > 11, consider an induced subgraph of G on VC V where Ke ¢ a d 323. a4. 25. 26. (a) 2e > kr = R2+e—v) => 2— Be > k(2—v) = eS [k/(k— 2M - 2). (b) 4 (c) In Kaa, ¢ = 9, v = 6. [k/(k - 2)l(v — 2) = (4/2)(4) = 8 <9 =e. Since Kas is connected, it must be nonplanar. (a) Here k= 5, 0 = 10, e = 15 and [k/(k — 2))(v — 2) = (5/3)(8) = (40/3) < 15 =e. Since the Petersen graph is connected, it must be nonplanar. @ (b) There are no pendant vertices. But this does not contradict the condition mentioned Because the loops contain other vertices and edges of the graph. (a) The dual for the tetrahedron (Fig. 11.59(b)) is the graph itself. For the graph (cube) in Fig. 11.59(d) the dual is the octahedron, and vice versa. Likewise, the dual of the dodecahedron is the icosahedron, and vice verse. (b) For n € Z+, n> 3, the dual of the wheel graph W, is Wa itself. (a) The correspondence a v, b-» w, cy, d—+ 2, e+ 2 provides an isomorphism. © @® » ® > (/ 7 ‘ PRA 2 (c) in ths first graph in part (b) vertex cf has degree 5. Since no vertex has degree 5 in the second graph, the two graphs cannot be isomorphic. 30727. 28. 29. be ‘The number of vertices in G4, the dual of G, is r, the number of regions in a planar depiction of G. Since G is isomorphic to Gt it follows that r = n. Consequently, |V|— |B] +r = 2=n—|B)+n=2= |B] =2n-2 Proof: a) As we mentioned in the remark following Example 11.18, when G,,G2 are homeo- morphic graphs then they may be regarded as isomorphic except, possibly, for vertices of degree 2. Consequently, two such graphs will have the same number of vertices of odd degree. b) Now if G; has an Euler trail, then G; (is connected and) has all vertices of even degree ~ except two, those being the vertices at the beginning and end of the Euler trail. From part (a) Gz is likewise connected with all vertices of even degree, except for two of odd degree. Consequently, G has an Euler trail. [The converse follows in a similar way.] ©) If G, has an Baler circuit, then G, (is connected and) has all vertices of even degree. From part (a) Gz is likewise connected with all vertices of even degree, co G, has an Buler 3084 cireuit. [The converse follows in a similar manner.] Section 11.5 @) @) (©) (d) ‘The graph is a path (cycle). (a) Hamilton cydle: a+ g + ki thabsceod4jof4esa (b) Hamilton cycle: ad beg j>ivfrohocwa (c) Hamilton cycle: a he fg3ivd—+e+b—a (a) The edges {a,c}, {c,d}, {4,5}, {b,€}, {e,f}, {f,9} provide a Hamilton path for the given graph. However, there is no Hamilton cycle, for such a cycle would have to include the edges {6,d}, {5,e}, {a,c}, {a,¢}, {9, f}, and {g,e} - and, consequently, the vertex e will have degree greater than 2. (e) The patha +b +c dte+jrishigofokslomnois one possible Hamilton path for this graph. Another possibility is the path a + b> c+ d>irhagofakal+m—+n-o-+j + €. However, there is no Hamilton cycle, For if we try to construct # Hamilton cycle we must include the edges {a, 5}, {a, f}, {F.4} {81}, {se}, {ei}; {ise} and {n,0}. This then forces us to eliminate the edges {f,g} and {i,j} from further consideration. Now consider the vertex i. If we use edges {di} and {é,n}, then we have o cycle on the vertices d,e,j,0,n and i ~ and we cannot get a Hamilton cycle for the given graph. Hence we must use only one of the edges {d, i} and {i,n}. Because of the symmetry in this graph let us select edge {d,i} - and then edge {hy #} 90 that vertex i will have degree 2 in the Hamilton cycle we are trying to construct. Since edges {di} and {d,e} are now being used, we eliminate edge {c,d} and this then forces us to include edges {b,c} and {c,h} in our construction. Also we must include the edge {m,n} since we eliminated edge {i,n} from consideration. Next we eliminate edges {h,m}, {h,g} and {5,9}. Finally we must inchide edge {m,/} and then eliminate edge {i,g). But now we have eliminated the four edges {6,9}, {f,9}, {h,g} and {Ig} and g is consequently isolated. (O) For this graph we find the Hamilton cycle a +b +e+d e+ jrivrhog— lom-ns03t+sorsgspako fsa, (®) Consider the graph as shown in Fig. 11.52(a). We demonstrate one case, Start at vertex a and consider the partial path a —+ f —+ i» d. These choices require the removal of edges {f,h} and {g,i} from further consideration since each vertex of the graph will be incident with exactiy two edges in the Hamilton cycle. At vertex d we can 3096. go to either vertex ¢ or vertex e. (i) If we go to vertex ¢ we eliminate edge {c,d} from consideration, but we must now include edges {e,j} and {e,a}, and this forces the elimination of edge {a,b}. Now we must consider vertex b, for by eliminating edge {a,b} we are now required to include edges {4,g} and {b,c} in the cycle. This forces us to remove edge {c,h} from further consideration. But we have now removed edges {f,h} and {c,h} and there is only one other edge that is incident with h, so no Hamilton cycle can be obtained. (ii) Selecting verter e after d, we remove edge {d,c} and include {c,h} and {b,c}. Having removed {g,i} we must include {g,6} and {g,j}. This forces the elimination of {a,b}, the inclusion of {a,e} (and the elimination of {e, j}). We now have » cycle containing a, f,i,d,¢, hence this method has also failed. However, this graph does bave a Hamilton path: a+b —+c+d—+e+joh—of— ing (b) For example, remove vertex j and the edges {e,j},{9,j},{h,j}- Then ¢-»a—> f h-+0e+b-+9 i+ d—e provides a Hamilton cycle for this subgraph. (a) If we remove any one of the vertices a, or g, the resulting subgraph has a Hamilton cycle. For example, upon removing vertex a, we find the Hamilton cycle b+ d— c+ fogresb (b) The following Hamilton cycle exists if we remove vertex g: a+ b—+e+d—e—> jto+nsicho+m—+1l—+k— fa, A symmetric situation results upon removing vertex i. Let the vertices on the cycle (rim) of W,, be consecutively denoted by vj,U2,.-.,0,, and let 441 denote the additional (central) vertex of W_. Then the following cycles provide n Hamilton cycles for the wheel graph W,. (1) Oy bag U2 Ug POG Da FO OY; (2) vy 9 v2 ppt Ua U4 oF Od On > OY (3) v1 0g Va Ong PVE Dyed On OY; (1 = 2) vy > 02 Uy 4 oF Dead > Ong > Pn OH; aD (2) 0 9 0g 9 0g 9 04 9 oF Dye UF Mad PL (a) (1/2)(n- Dt (b) 10 (©) 9 (a) Partition the vertices of Kan as XUY where |X| = |¥] =n. Write X= fest). 12ahs Y= {¥rstes--stah each edge of Ky is of the form {2;,y:} where 1Séj $n. Since x is on every Hamilton cycle of K., start with 2). There ere then n choices for yj where {21,y;} is on the cycle. From y; we can return to X in n-1 ways (we cannot use z, again), forming the second edge {y;,x;}, where 2 ) Im a similar way, if G@ has a Hamilton path P, then P has |V|—1 edges and the vertices on P must alternate between the vertices in Vj and those in Vs. Since Vil # IVI, it follows that {V4] — [Val = 1. (c) Let V = {a,b,c,d,e} with Vj = {a,b}, Ve = {e,d,c} and E = {{a,c}, {a,d}, {a,e}, {b,c}. au.1. (a) a a ¢ b ¢ b () a b a b 4 c 4 c id(a) id(0) id(c id(d) =2 a b a c 12. Proof: From Example 11.26 we know the result is true for n = 2, Assume that Q, has a Hamilton cycle for some arbitrary (but fixed) n > 2. Now consider Q,.1. From Example 11.12 we know that Q,41 can be constructed from two copies of Q, ~ one copy, Qno, induced by the vertices of Qui1 that start with 0, the other copy, Qn, induced by the 31213 14. 15. 16, 17. 18. 19, 20. vertices of Qu41 that start with 1. Each of Q,,o, Qa: has « Hamilton cycle - each may have more than one but we agree to pick the same cycle in each. [The only difference in the cycles is the first bit in the vertices of an edge ~ that is, if {02,0y} is an edge in the Hamilton cycle for Quy (where 2,y are binary strings of length n that differ in only one position), then {1z, 1y} is the corresponding edge in the Hamilton cycle for Q,,1.] Select edges {0v,0w} and {1v,1w} from the Hamilton cycles for Quo and Qq,, respectively. Remove these edges and replace them with the edges {0v,1u}, {Ow, lw} (in Quix). The result is a Hamilton cycle for Qnia- Tt now follows from the Principle of Mathematical Induction that @,, has a Hamilton cycle for all n > 2. Proof: If not, there exists a vertex x such that (v,z) ¢ H and, for all y €V,y # 1,2, if (v,y) € B then (y,z) ¢ B. Since (v,2) ¢ B, we have (2,v) € B, as T is a tournament. Also, for each y mentioned earlier, we also have (z, y) € E. Consequently, od(x) > od(v)+1 ~ contradicting od{v) being a maximum! Let @ be any path with more than three vertices. a ‘ 4 For the multigraph in the given figure, |V] = 4 and deg(a) = deg(c) = deg(d) = 2 and deg(s) = 6, Hence dog(z) + deg(y) > 4 > 3 = 4—1 for all nonadjacent #,y € V, but the multigraph has no Hamilton path. ’ Corollary 11.4: Proof: For all z,y € V; deg(s) + deg(y) 2 2{(n ~ 1)/2] = n—1, so the result follows from Theorem 11.8, Corollary 11.5: Proof: Let a,b € V where {a,6} ¢ E. Then deg(a) + deg(b) > (n/2) + {n/2) =n, so the result follows from Theorem 11.9. For n > 5 let C, = (V,E) denote the cyele on n vertices. Then Cy, has (actually is) a Hamilton cycle, but for all v € V,deg(v) = 2 i= {Vv}. Proof: Let ,y € V with {x,y} € E. Consequently, z, y are nonadjacent in @. In @ we find that degg(x) = dega(y) > 2n+2—n = n+2, so dega(z)+dega{y) = 2n+4 > In+2 = |Vj. ‘Therefore, by virtue of Theorem 11.9, the graph G has a Hasmilton cycle, 31321, 22, 23. 24, When n = 5 the graphs Cy and Cs are isomorphic, and both are Hamilton cycles on five vertices. For n > 6, let u, » denote nonadjacent vertices in C,. Since deg(u) = deg(v) = 3 we find that deg(u) + deg(v) = 2n —6. Also, 2n ~6 > n <=> n > 6, s0 it follows from ‘Theorem 11.9 that the cocycle ©,, contains a Hamilton cycle when n > 6. (a) fx fvandy # », then deg(z) = deg(y) = n—2, and deg(z) +deg(y) = 2n-4>n, for n > 4. Hf one of z,y is v, say z, then deg(z) = 2 and deg(y) = n — 2, and deg(z) + deg(y) =n. (b) From part (a) it follows that deg(z) + deg(y) > n for all nonadjacent x,y in V. Therefore G,, has a Hamilton cycle — by virtue of Theorem 11.9. (c) Here |B| = (*;') ~1+2, where we subtract 1 for the edge {v1, v2}, and add 2 for the pair of edges {v1,0} and {v, v2}. Consequently, |E| = ("5") +1. (d) The results in parts (b) and (c) do not contradict Corollary 11,6. They show that the converse of this corollary is false — as is its inverse. (a) The path v + vy > v — v3 +... vg-1 provides a Hamilton path for Hy. Since deg(v) = 1 the graph cannot have a Hamilton cycle. (b) Here |E| = ("5") +1. (Go the number of edges required in Corollary 11.6 cannot be decreased.) (a) 200 Since the given graph has a Hamilton path we use this path to provide the following Gray code for 1,2,3,...,8. o11 1: 000 2: 010 3: lio 4: 100 5B: 101 6 it T Ol & 001 (b) 1: 0000 0001 3: 0011 oni & MM 1110 7 M00 1000 % 1910 i011 1001 1101 13: 0101 0100 15: 0110 0010 31425. 26. @) @ facfh}tag}s (i) {2}, {uy} (b) @ 2G) =4; (#) 6(@)=3 ©) @) 3 3 Gi) 3 wy) 4 WE (vi) The maximum of m and n. (4) The complete graph on {Z| vertices. (a) Hnot, there is an edge {a,b} in B where a,b € I. This contradicts the independence of 1. (b) A Hamilton eycle on v vertices must have v edges. © 2 eS Let I = {a,b,c,d,f}, as shown in the figure. Here KX. v= I,e= 18, and ¢— Dye: deg(v) + 27) = 18 - (4+ 5. (a) P(G,A) = A-1)° (b) For G = Ky, we find that P(G,A) = A- 1)". x(Kin) = 2. (8) (i) Here we have A choices for vertex a, 1 choice for vertex b (the same choice as that for vertex a), and 4—1 choices for each of vertices x,y,z. Consequently, there are (A ~ 1)* proper colorings of Kz where vertices a and 8 are colored the same. (fi) Now we have \ choices for vertex a, A —1 choices for vertex b, and A — 2 choices for each of the vertices 1, y, and z. And here there are 4(\— 1)(A — 2)® proper colorings. (b) Since the two cases in part (a) are exhaustive and mutually exclusive, the chromatic polynomial for Ky. is A(A = 1)° + A(A = 1A = 2)9 = ACA = 10° — 5? + 10 — 7). x(Ka) = 2. (0) P(Kansd) = A(A— 1)" + AQ TQ — 2)" x(Kan) = 2 (s) 2 {b) 2(n even); 3 (mn odd) (c) Figure 11.59(d): 2; Fig. 11.62(a): 3; Fig. 11.85(3); 2; Fig. 11.85(ii): 3 (4) 2 If G=(V,E) is bipartite, then V=¥, UV; where Vi V;=@ and each edge is of the form {z,y} where z €Vi,y € V2. Color all the vertices in V, with one color and those in Vy with a second color. Then x(@) = 2. Conversely, if x(G) = 2, let Vi be the set of all vertices with one color and V3 the set of vertices with the second color. Then V = Vi UV; with ViNV;=6 and each edge of G has one vertex in V; and the other in V2, so G is bipartite, (@) (1) AA-1PA-2) @)AA— 1-2) - 2042); (3) AQ = 1) - 2)? ~ A+ 7) ©) GQ) 3 23 @) 3 {c) (1) 720; (2) 1020; (8) 420 (a) These graphs are not isomorphic. The first graph has two vertices of degree 4 ~ namely, f and k. The second graph has three vertices of degree 4 ~ namely u,w,z. 316