You are on page 1of 13
sas Thus o~b = Qjehn/d), whee tee Zand md €Z Theefireo = Bomodmid). BL 81 2 laedy-);.-ayaaho = Sho 1a, = Yt yae (mod 9) Became 10/1 (meds) fF ery omeatne impr 28. fot, then suppose tht gf. 4 Of he form 6h +5, Let Q = 6gigy---qe— I. Note that Q is ofthe form 6k +5, wheee = qugs ge Ie Let Dips-p be the pine facoization of 0. No pis 2,3, oF any gy, Because the reminder when Q is dviged by 2 L by 362, and by 4, is gy — 1 Al ed primes other than 3 ae of the form 64 +1 of 6+, andthe product of primes ofthe fom 6&1 6 also of this form. Therefore at least ‘one ofthe p's must be ofthe form 64 +5, contradiction 31-4) Not mutually relatively prime »b) Motily relatively rime) Munallyeaively prime) Mutually reaively rime 33.2) The decryption function is stg) = a(g ~8) ‘mod 26, where isan inverse of «modula 26.) PLEASE SEND MONEY 38.1 = 28 (mod 30) 37. Recal that ‘nonconstant polynomial can tke on the same vale oly finite numberof times. Ths fan ake onthe values and 41 only finely many times, soi there snot sme y such that (is compost, then there must be some Such that Cs prime, say p- Look at fx + kp). When we plug e+ pin for x inthe polyoma and multiply it out, every ‘erm wl contain factor ofp excep forthe tems that frm ‘fla. Therefre fg +p) = fan) + mp = me Dp for Some integer. ASA varies, his ale canbe 0, por — oly finitely many ines therefore it must be composite number for some valves of K-39. Assume that every even integer ‘reaterthan 2s the sum of vo primes, and etn be an integer ‘eater than 5. isda writen = 3+ (r~ 3) and decor +4 into the sum of wo primes: if is even, + (n=2) and decompose n 2 = p-+g ino the um of two primes For the converse assume at ev= cy integer greater than $s the sum oft primes, and let nnbeanevenintege greater than 2. Write n-+2 ste sum of thre primes, oe of which is necessarily 2, on +2 = 24 alle primes then write w +a, whence w= pa: 017 gweafa o [Sehe=[2 4] nz0 8Sipoenea=[4 }] ease AB = BA, fsa aeelt ae 7 [} some b= ne vfs] ‘ppertrangularn x n mags, = [ay B=[b,) begin ton hon Answers to dé Numbered Exercises $28 iw) ey 6) Faubyy STADXBON) = ABBA = ALA I. Similarly, (B-!A-'(AB) = 1. Hence, (AB)! [Pi] Thenb, (ay 40 a at Veag A Av ‘A Similarly 0v Hence AN 0 = 0. Simiarly 0.4 = 0.51. We assume that someone has ‘hosen a postv integer less han 2, which we ae to gues, ‘Weak the person o wate the number in bia, sing leading Osi necessary to make it bits lng, We then ak "Ite fist bata 17 "Isthesccond bits 17, “sthethind ita I? and so fon. Afr we know the answers fo thes questions, We will know te number, because we wil know its binary expansion CHAPTER 4 Section 4.1 1. Let Pn) be the statement that the train stops at ste tion n. Basis step: We are told that P(1) iste, Ind te step: We are old that P(n) implies Pn + 1) foreach ‘n> 1. Therefore by the principle of mathematical indo tion, Pn) is tre for all postive integers 3.) 12.3/6 Bath sides of P(1) shown in part (a eal PAR 4 PKL NOEF DIS d) Foreach 1 1 that PO) implies P(R+ 1); in oer words, that a- suming the inductive hypotess [ee part ()] we ean show PED SEES a IP = Ub Dik + 200K-+ 3/6 OU FP bo FE) Ee = + DOR + 1/6) +k + =I + DOAK + 1) + wk Dis (e+ Y/oee + H+ o =e + Hee + 2NQK+3)= K++ 22K 43976) We have cone plcicd both the basis sep andthe inductive step, so by the principle of mathematical induction, the sateen is te for every posite integer m. S.Let Pn) be SPH Fn DP se NGe + 10043)" ‘Basis sep: PO) is tae bese 1? = 1 = (+ 192-0 1) 0-F3y5.tndactv step: Assume tat Pete. Then FEF bo $kE DE DUE DIP = + Dek Wak + 9/3 + Ok + 3 = Gk + ay + Dek DB + Ck + d=2k + 92K + 9 + 10/2 Ok + 3k + Me + BATA + 1) + NDE + D+ URES DS3/3. Ler Pl) be “T5435! A= D/AP Rass sep: POO) is tue becawse Flag} 123236! 1)4 Indcte sep: Assume that E35) = 354! — 1/4 Then SHS. (Lhgd Hy FBS east ya 3S 4 4.381 yd ast yd. a2 Shana tt) B)Basis sep: 2= 1e(-+1) i true. Inductive step: ASsume that 2-444 6-4-4 2k HUED. Then @+ 4464 420-4204 1 Hes N20 FD =O RD. La. 12! 5.26 Answers to O8!- Numbered Exercise (2*= 1/2" by Basis step: P(1) is true because } = (2!— 1/21. Inductive step: Assume that 4, 1/2! = Qh — 12! Then Sj2h b= Oojan P+ = el tat SelB ta paytest 24+ (CUP? = (1 nf + 1/22" Basis step: P(L) is true because FP. Inductive sep: Assume that Pld) is tue, Then P28 nk TE (OG +P = M+ D248 + IF COME + DER ++) = b+ D2) +1] = (CONE + IMR + 2/2. 1S. Let Pen) be “1-2-42-34 “nin 1) = nln + In 4 2)/3" Basis steps PD ise because 1-222 1+ 1X1 +2)/3. Ice step AS sume that P(A) is tue. Then 1-2-42.3-+ 0-4 A(R 1) CF IKE += IN + 293) +O DE) = 4 Dee + 24/3) + N= Kk + De + ONE ay. 17 Let Pn bethestatementthat 8-284 384 bat = min + 1)Qn-+ 1X30 + 3n— 1/30. PCL) is tre because 1.2.3. 5/30 I. Assumetat P(Aistue Then 1" -42"+ Seo Reb Da Ke + NOEL NOE + 3 DAO 0+ DE =(E+ 1/SOIROK-+ NOE +3 — 1) 3 + 1] = [+ D/RO\GEE + 390 + O18 + 89K + M)=[(A-+ D/SO|A+ 242K + 3100+ 1? + H+ 1) ~ This demonstates tat PUI) tue. 18.a)14 |< 2] by Thisisime base 5/4 sles than 6/8.) + [bib <2-f For cach £22 that P(t) im ples PCC 1m ther words we wa 0 show tht a Suing te inductive ypates [ce prt (6) wee show Lefeod beg de dy Olt heat hom im [Er (a weer = 2 Fr ~ mF < 2." We he completed both be ass ep tn te indocve sep 0 y the principle of mathemati ind tn th sateen tee for every integer meet ha 1 2st Pn be "2" > nt? Bass tp P(S) its bees P32 >25= 5 Induce sep, Assume bat PU ste, tats, 2 > Then 291 2220s Ps > dk 4 2b4 1 = (1 becae > 23. By inspection ‘we find thatthe nsgaity n+ 3-= 2" doesnot old fr = 0.1,2.3 Le Pa beth proposition at his neality ‘ods fo the postive integer m.P), he bss ease, ste ease 2-443 = 11-2 16=2 For the inductive sop assume tht UG) i toe. The, by the indie hypoth i 20-41) +3=Gk+3) +2 <2+2. Bie beease Feu2 2224222 Ths sows tha PHD) iste Inductive step (+h) > 0,1 + AKO (Le WL + AES LF AKL iay= leet hea? > 1s Dk FLel Pb SUM + B+ B+ VR > 2( rT” Bass tp: P() i te becase 1> 2(V2~1). Inductive sp: Assume tat (4) i tae Then 14 U2 een WE + JER > 2(VerT~ 1) 1/JEST. HF ve Show that 2(VEFT~ 1) + 1/VEFT > 2( VERE ~ sm ic follows that POL 1) is tue. This inaguaiy is egiv- alent to 2(JE42— VEST) <1/VE+1, which ie equivalent wo 2(VEF2— VEET (Vk r2 + VFI) < YET SEF T+ SES I/F I. Thisisequvlento? < T+ VE+2/JE which ie clay tres 29. Let Pon) be "He © Ibn” Basis step: P(O) is tru because Hp: = y= 121-60 Induce stp: Assume tt y= 1k Then Hse = Haet Sig | S++ 2 (sh) <1 Atle lsQ+ 1), 3, Bass sep: 241 =? i dist De 2 et sp Assume te nce ptr that A+ is divisible by 2. Then (+1)? H+ I B+R+l+k+ 1 =(E 4H +2k+ 0), the sum of a mile f 2 (the nucte ype) nd mae Of 2 by defion), hese, die by 2.38 Let Pl) be w= nis dbl ty 5° Bas soy PQ) se he ue 00 dle by 5 dc stp: Asa at PL i oe, at Se ey & Tn E+ 1 — (b+ 1) = B+ Sk + 108 + 10 + 5k +1) = WeDo (baa e204 20 4) ake de bly 5; besase fh tr in thi su ate dle by 5. 3s Lt tn be the pston tt Gx 11 divisbley Thebes at PO) wie bs 0 Now Sue tat PA) te Bese [20+ 1) IPT = Uk = I] +, PL isa eas thon hein side ae vey Tis show hat Pe) trcfrallpoin mye, om~ ise ye xem sano pe neger_ 97a pW = 19 Sate P= 13 Idee ip Ase thi dev pote, di 1 db 18 er ee ae ee Mee 0's 5-2 = ie 1 183-121 The exesion in puree is le 133 by he ine pes and obvi he send tem se by 1820 he ene quny dist by 133, asdesied 39. Bars: 4) © By taagily ‘ois tt (fey A) © (Ida stp Assn theindve yas a4), e) 1,3, then (Fy © Yay By We want show that 4) &'B, way ONS By Lets bran ata seme of 4) = (Phuc ayo as Base xe 4, we A by he adie bya sis that x € (}_, By; because x € Ay, we know from the Be ft ha hig By Ba To (Mi:8)) 98601 = 74558). A1.Le Pe be “VU AUe-VANMB = (yn BULAN B)U--ULAG 9 1) Basse. PO) ial tects: Ane thar PU) ome, Thea 4) UAW" UALU Ana B= WU Oe DAQU AIA B =I, AU AD) (ina B) Ue Uae Tar 8) Ua BYU UA BULA 0B). A. Let Peo) b6"Ul = Pas asp: PC) vil te Ide ep Asan that Pt istue, Then Uz} Ay = (Up) Uae (Usa) oF = (Mah) ome = MF. sar 4S. Let P(n) be the statement that a set with elements fas mon ~1)/2 tworelement subsets, P), the basis ease, is tru, because a set with two elements his one subst with ‘wo elements—namelyitself—and 202 — 1/2 = L Now a- sume tht P()is true. Let S be ast with £ +1 element. (Choose an clement a in $ and let T= 5 [a). A two. clement subst of S either contains a oF doesnot. Those subsets not containing a ae the subsets of Twit te ce- ments: by the inductive hypothesis there are &(k~ 1)/2 of these. Tore ar subsets ofS with vo clmentsthat ontsin 4, because such a subset conans «and one ofthe le- ‘ment in T. Hence, thre are (k— 1)/2+4 = (k+ Dk/2 two-lement subsets of S. This completes the inductive proof. 47. Thetwo sets donot veri ifn-+ 1 = 2 In ac, the conditional statement P(1) > PC) is fase. 49. The mistake isin applying the inductive hypothesis to lok at max(x~ I,y~1), because eventhough x and y are pot- ive integers, x I and I naed nat be (one oe bath ould be'0). St We use the notation (i,j) to mean the Square in row i and column j and use induction on + j to how that every square cn be reached by the knight. Basis step: There are six ase ese, forthe cases when + J <2. ‘The knight isalready at (0,0 tart, 5 the empty Sequence oftmovesreahesthat square. To reach I, ) he knigh moves (0.0) 2,1) ©,2)— (1,0) Siar to reach (0.1), the Knight moves (0,0) > (1,2) —» (2,0) (0.1). Note thatthe knight has reached (2,0) and (0,2) inthe proces. For the lst basis step there i (0,0) — (1,2) — 2.0) > (0.1) 2,2) 0,3) (1) Inductive step: Assume ‘he indetive hypothesis that the knight can each any square (, )forwhichi'+ j= k,wherefisaninteger greater than ‘We must show bow the Knight can reach ech square /) when (+ j= K+ 1, Because E+ 1 > 3, atleast one off and jis atleast 2 11 = 2, then by the inductive hypoth- sis, tee isa sequence of moves ending at (1 ~2,) +), beciuse = 2-4 )-¢1= 1+) —1 = fom there itis, fone step to (similarly if j > 2. SR. Bave top: The base cates n = and = |aetrve Because the deiative of 4 in(land the dervatve of! = i I. Indutive step: Using the product ue te inductive pois and the ass sep shows that 2 dvaviver keh pst 88, Basis sep. Fork = 0,1 = 1 (med Inductive step: Suppose tata = b (med m) and a = b* (mod m); we must show hata 1 (mod m). By Theorem from Section 3.4, a 1:08 (ened m), which by definition says that a! = Bod). S7Let PCa) be "Tee > pad(s DYN A Put Pa 8 Pet) Pak” Basis step: P2) iste because (P; > pa)» (By -» Bo) {sa tautology. Inductive step: ASSume P(E) is te. To show (pe 2a) A--" (Piet — Pa) A (Pe = Past) > [pinch pion Pe) Puss] 18 2 tautlogy, as sume that the hypothesis of this condiionalsate- rent is tre. Beeause both the hypothesis and PUR) are tue, follows that (py Avo As) —> ‘pc i te, Boose thi i tue, and Because p,—> Py ‘ste (ts part ofthe assumption) it fllows by hypothe syllogism that (py ++ pt) po ste The weaker Anowers to Odd Numbered Exercises $27 statement (py += p46 72) — pt follows fom tis 9, We will hist prove the esl when» is power of 2, tht 'sifm=2,4=1,2....-Let PC) bethe statement > G, ‘whore A and G are the sritimeie and geome means, re spectively, ofa set of n= 2" postive real numbers. Bass sep: b= Vand n =2! = 2. Note that (ai ~ Jas) > 0. Expanding this shows tat ay ~ 2a + ay >0, that is, (ay +2312 > (aa). Inductive Yep: Assume that PCE) 1s wus, with m= 2", We wil how that P(k+ 1) i te We hive 21 = 2n, Now (a) +03-4--++ a3e/(n) Ula, Fas ts al + (gy gga + an) AY and similarly (0232) = [a2 22y)"*)"2. To simplify the notation, let A(t, 95.) and Gey...) denote the arithmetic mean and geometric mean oF x yync- respectively, Alb, ix ©, y= and 30 on, thea Alt, Yon) SAG yoo) and” GEe,y.--) = GO yooh Hace, Alas. daq)= ALA, Alogi: 43)) = ACG(a} the Geos) = GG as 06), Gladys ¥4)) = Gla =v 39) TS finishes the proof for powers of 2. Now im is ot power of 2, let m be the next higher power of 2, and let fyieoee yall egal Ala, -.osa4) =. Then we have (leyay-sag™" = Ala, power of 2, Because Atay, say (ay-ag)aN = a Raising bach sides 10 the myth power gives Gla ...oty) Alda. ood4) (1. Bass stp: orn = 1 the lefchand sie i just, which is 1. For a =2, tore are thre nonempty subsets). 2), and {1,2}, she lefthand sides | +} + gy =2. Inductive step: Assume thatthe statement is true fork The st of the fit +1 postive integers has many nonempty subsets, but they flint thee categories nonempty subset ofthe fist positive integers together with £1, nonempty subset of the st postive integers, o just +1). By the indoctve hypothesis the sum ofthe fist category is . Fo the second ‘ategory, we ean factor out 1/(+ 1) from each erm of the sum and what remains i just k bythe inductive hypothesis, so this part of the sum is K/(-+ 1) Fil, te third eate- gory simply yields 1/(¢-+ 1) ene, the entire summation BEEMAN =k 1 8. Basis step: ‘A. Ay hen Aste the condition of being a subst of ‘ach setin the collection; otherwise As C Aso A sts the condition. nduetiv step: ASsume the inductive hypothe sis,thatthe conditional statement iste fr ks, and suppose we are given + 1 sets that sats the given conditions. By the inductive hypothesis, there must be a set Ay fr some ie kswch that Ay CA, for b= j = IPA, © Aggy, then wwe are done. Otherwise, we know tht Acs; © A\, and this tes us tht Any satisfies the condition of being subset of Ayfeel cube removed. ‘Taebass step (0), holds because neil coincides with the solid be tiled Now assure that Pk) holds Now consider a2 26 2 cube wih a Lx Fx 1 ube removed Split this object into eight pieces using planes parallel ois faces and runing trough its center. The mising 1 1% 1 piccecccurs in one ofthese eight pieces. Now positon one tile with its center at he center ofthe large objet so hat the missing 1% 1% 1 be lies inthe ostant which the lage objets missing a x 1 I cube. This creates eight 2 x 22 cubes, each missing a1 1x | cube By the inductive hypthesis we can fill each ofthese eight objects wi ils. Puting these tings together prodaces the desired tiling. sa 79.Let O(n) be P(n +b ~ 1). The statement that P(ns tre form = 6.64 1.b4 2... isthe same athe staiement that ‘Qimistrueforal positive imgers m, We re given tat P(4) iste ie, hat Q(1) is ue, and that PCR) > PUR 1) or all F> b [ie hat O(m) > O(n + 1) forall postive int 215 ml. Therefore, bythe principe of mathemati! ind ‘on, Om) iste forall positive tgs Section 42 1. Basis step: We ae told we can ran one mile, 0 PCI) is tu. Inductive step: Assume the inductive hypothesis, tht ve can run any number of ils from 1 tok We must show that we can un k++ T miles. IF = I then we are already told hat we can run mils, LA >, then the inductive hypothesis tes us that we cam run &~ 1 miles, 80 we can nin(k=1)-+2= 4+ miles. 3.4) P() is tus, because we can form 8 cent of postage with one 3-ent stamp and tne S-cent stamp, P(9) ite, because we cin form 9 cents of postage with thee 3-cent simp, P(10) stu, bosause ve ean form 10 cents of postage with two S-cent stamps ) The stuement that sing just Scent and S-cent stamps ‘an frm j cents postage forall j with 8 = j <4, where we assume hat k= 10) Assuming the inductive hypothesis ve can form k+ 1 cents postage using just 3-cent and Scent ‘Samps Ad) Because k> 10, we know that P(k~ 2) itr, ‘hat that we can frm A ~ 2 cents of portage, Put one more 3-ceatstamp onthe envelop, and we have formed + I cens ‘of postage.) We have completed both the basi step and te inductive step, so by the principle of seong indo, ‘he tatement is tue for every integer n greater than oF eu OR $.a)4,8,11, 12,15, 16, 19, 20,22, 23, 24,26 27, 28, ad all values greater than or equal t9 30.) Let PC) beth statement tat we can form m cents of postage using just -centand I 1-ent stamps We want to prove hat Pn tee foralln = 30. Fordhebasisstep, 30 =11-+ 11-44-44 “Assume that we can form k ens of postage he inductive y= pothesis; we wll show how to form K+ 1 cents of postage the cents incioded an T-cet stamp, then replace i by three 4-cent stamps. Otherwise, k cents was formed fom just 4-cent stamps. Because f > 30, there must beat least fight dent stamps ivole. Replace eight cent stamps by thre 11-cen stamps, and we ave formed K+ 1 cents in prstage. ©) Pn) is the sume asin pat (b.To prove that ox) sue fo all n> 30, we check for the bass stp that LEN b4s4 Han thy bed eee 32= S444 a 4444444 hand dm ISI il For the ndtv step assume the inte Bytes that PU) iste foral wih = jk where nana inet reaterthan regalo 3. We wan to show that P= is tue Besse 3 > 0 weno ht PU 3) ist, hat is that we cn form —3 cent of ontage. atone moe Cent stump on he nels and we ve forme A+ ens Of pot. in tis poor indutie ype a that Pj) was tre for al aes off betwce 30 and Fs sive ater han just that PG) a ue 7. We an frm Allamouns excep Stand 3 Let PU) beth seme hat ‘can frm n las wig just oli and Salar bls. ‘We want to prove that Pa) tee frall n> 5 (ler tha SL and 83 cannot be forme nd that $2 and canbe formed Fork basse, notett = Sandé-= 2-42 +2 Assume the ndtv hype tat PU) re forall with J < whee an abr interpreter hin ‘or equa o 6. We want to show that PU I stu. Be use 155, wenow at PU 1 tt, at ‘we can frm &~ Idols. Add ante dol il and we hveformed + Idols. 9. Let P(n)bethe statement hat ih Soposteinger ih it V2 1h sa Pista because 2 = 1 > 1/bforallpostiv icp. Induce sty sane tat Psa eal = where isan abitary poste integer we pve tht Pk 1) 1 tueby contain Assunethat 2 = (+1) for some postive integer Then 2)" (b+ 1} x0 (+17 sone neces ve, So wnt f+ 1 = 2 forse pos itv imegere, whence 25 = and? = 2° By the same reasoning bie, iseven, 0b = 2 for some pose ie tegers. Then V2 = (6+ 1b = 20/28) = /s Butt = h $0 this conrad the inde hype and our roo thendntvesepiscomplee. Ie Bas Thtear fur baseeaes fn = 1 = 40+ tence he sonnet ins thee are to, dhe, ofr matches n= 40+ 2, 1), thes the Bis ple cn win ‘by removing all bt one mach nde sp sume he song indoivefypotes, at games with over rtches, the ist pier can win Fk 0.2, ot 3 (ood 8) and he Second payer ean win f k= Lad), Sapose we hive a wane wih EL maces, with > 4, 11k 1 4 (od 4, then the is player can remove te mah, leaving ~ 2maces fr bother payer Becasek =? = 1 (end 4), by he inde hypthesi hs is ane that the sccond player at hat po (wt the fist plper in our ae) can wn, Simla Pk =? (a 8) he te it Pyercanrenoveone mth: andifk +1 = 3 (8) hen the fis player can remove to mathe. Final if fT = Viod 4, then the fist pijer most lewe kk ec k—2 matches forthe er player Bocas = 6 (Good, £1 = 3 (mod 4 and E22 (po 4,30 by the indoive hype ds sa game hat he et per that point (ihe end plier inoue) eh win, 1B.Let Per be the stmt ta xaty n Tmoves ae reed 6 asembe a url with m pisces Now PC ‘vil true. Assume hat P() i efor all j= fy and AnsworstoOdi:Numberd xerises 29 conser a puzle with +1 pieces. The final move must be the joining of two blocks, of size j and k-+ 1 for some integer j with 1 < = By the inductive hypothe sisi equted j~ 1 moves to construct the one block, and H+ 1= 7-154 j moves to const the other. Thee fore, 14( = 1)+(4~ J) = Kmoves ae required in al so P+ I) iste.” 1S. Let the Chomp board have m roms and columns. We claim thatthe fst player can win the ‘ame by making the ist move o leave jus the top row and leftmost column, Let P(r) be the statement tat a plyer ‘as prescoted his opponent wth a Chomp configuration gon sisting of jst cookies in the top row and n cookies in the Jefnostcoluma, then he can inthe game, We wll prove ‘Yan by strong indution. We know that P() sr, be ‘use the opponent is forced to take the poisoned cookie at his ist tun Fix > 1 and assume that PU) true forall J =k. Weclaim tat P(4 + 1)istrue. is th opponent turn ‘wo moe. If she picks the poisoned cookie, then the game 5 ‘overand she loses, Otherwise assume she ick the ook in ‘he top row in column j, the cookie in the Ie column in row J, forsome j with? j = &-+ 1. The fist plyer now Picks the cookie inthe left column in ow jor the cookie in ‘he top rw in column J respectively Ths eaves the positon ‘seed by PU ~ 1) for his opponent, sob the inductive hy pothesis ean win. 17. Let P(n) beth statment tat if ‘Simple polygon with m sides is angulated, then teat ‘ofthe triangles inthe triangulation have two sides tht border the exterior of the polygon. We wll prove ¥n = 4 Pn) The sSaement is clearly tue fo n= 4, because thee is only one ‘agonal, leaving two triangles withthe desired proper. Fix 4 = 4 and assume tht PU) ste forall with 4) = Consider polygon wih +1 sides and ome triangulation ‘fi Pik one ofthe diagonal in thie riangultion Fist sup Prose that this agonal divides the polygon ino one tingle and one polygon wih sides. Then the triangle has v0 ses that border the exterior. Furthermore, the Fz has, bythe indectve lypothess two triangles tat have to sides that boner the exterior of ht Kg, and only one ofthese tian es can fil to be atrangle that ast sides tat bode the Evterior of te orginal poiygon, The ony othe ease is that this agonal divides the polygon into two polygons with sides and k +3 ~ j sides fr some j with = j = k— I. By te inductive hypothesis, ech ofthese Wo polygons has ‘ranges hat have two sides that border hei exterior, an in ‘ch case only one ofthese tangles can fl to bea tian le that has wo sides tht border the exterior ofthe original polygon, 19. Let Pon) be the taterent that the area of 2 simple polygon with mses and vertices all at ative points 's given by 1(P) + B(P)/2 ~ 1. We wll prove Pn forall ‘n> 3, We begin wih an additivity lemma: It P is a simple ‘polygon withall vertcesat the lanie point vied poly ons P; and Ps by @dagonal, ten /(P) + B(P)/2— 1 {1(H)) + 8(P/2~ 1) + U(P2) + B(P)2 — I. To prove this, supose thee are &Tatice points on the diagonal not counting its endpoints. Then 1(P) = (B))+1(P3) + and BP) = B(P)) + B(Ps) ~2k ~2; and theresa fllons by simple algebra, What ths says in patel isha if Pek S.30-Ansverso Oud Numbered Exercises formula gives the correct aes for P and, then it mast sive the correct formula for P, whose ara the sum of the areas for P)and Py; and sini i Pick formula gives the correct area for P and one ofthe P,, then it must give ‘the correct formula forthe ater P. Nex we prove the the- ‘orem for rectangles whose ses are parallel to the coord rate anes. Such a rectangle necessarily has vertices a (22) (aed. Bland de), where, bc, andd ar integer with P'Seanda = d.Isareais(e~ Dla ~ a). Also, B= 2(¢— b4+¢d~a) and I= (c~b~ Id ~a~1)=(e ~BNd — a) (@~b)— (da) + 1. Therefore, 4 B/2— bXd a) -(e~ Bed a) 1+(e~b 4d —a)— (€— 64d —a, which is the desired area. Next consider & right tangle whose legs ae parle to the coordinate avs ‘This angle is hala rectangle ofthe type jst considered {or which Pick’ formula holds, so bythe adivity lena, ‘thos forthe triangle aswel (The values of B and Fare the sume for eac ofthe vo triangles, so if Pick’ formula five an answer that was ether too small or oo lag, then ft would give a correspondingly wrong answer forte ret- angle) For the next step, consider an abitary triangle with ‘vertices athe atic pins that snot ofthe type already con- sidered. Embed itinas small aretangle as possible. There are several posible ways this can happen, bu in any ease (and fing one more edge in one cise, the rectangle wl have been paritioned int the give angle and voor de rght triangles wih sides parallel to the coordinate axes. Again by the adit lemma ve are gunranted tht Pik’ formula ‘sivesthecoretarea forthe giventrangl.Thiscompletesthe roof P(), the basis step nou strong ndtion proof For the inductive stp, even an arbiary polygon, se Lemms | in the text split into two polygons. Thea by th adi- tivity lemma above and the inductive hypothesis, we Know that Pick formula gives the eoret area for this polygon, 21) inthe left figure Zabp is smallest but Bp isnot an ine feror diagonal. b) nthe ight figure bis not an interior diagonal) nthe ight igure Ba is pot an imterioe iago- tal 23-2) When we ryt prve the inductive step and ind triangle ineachsubpolygon wiht east wo sides bordering the extror, it may happen in each case thatthe tingle we sare guranteed infact borers the diagonal (which ie part of the Boundary ofthat polygon. This leaves us with no tan ses guaranteed touch th boundary ofthe original ply gon. ') We prod the stonger tatoment Ya > 4 (a) in Exerise 17,25) Theinductivestep hereallows vs to conlude that (3), POS)... arall tre, but we can conclude noting about PQQ), PCa - =. b) Pon) sre foal postive itegers ‘sing strong induction.) The induce step here enables ustoconcluethat PC), (4), P(8), P16). aeallue, but ‘we can conclude nothing about P(n) when is nota power of2. d) This is mathematical induction; we can conclude that P(n iste forall postiveintgersm. 27. Suppose, for proof by contradiction tha here is some postive integer such hat P(r isnot. Let be the smallest positive ine ae eter than for whic P(r) is true; we know tat such nm exists because P(m) iste for iftely many values of 1m. But we know tht Pm) > Pl ~ 1,80 Pim ~ Iisabo so true Thus, m ~ cannot be greater thann som — 1 = wand Pin)isin active. Ths contacto show that Pn) tre foralln. 28. The ears in going fom thebase case n = 0 to the next case, n= I; We cannot write La the sum of 0 smallrnatral numbers, 3. Assume thatthe wellrdering property holds. Suppose that (1 is tue and that the cond tional statement [P(1)\ PQ) +++ Pla] Pin I) 6 trae for every postive integer, Let 8 be the st of positive Jeger fr Which P(n is alse, We will show § =, Ae sume that $0. Then bythe wel ordering property theres 2 east integer m in S. We know that m cannot be T because Prise Bean =m ste at geht Isis, P(i), PQ)... Pom ~ 1) ae tue, and — Beense [MDAPG) An Pv > Pon) we folloms tht Pl) must also be tue, whichis a sontadieion, Hence, 5 =i.” 33. Incach case, give a roo by contadi= tion based ona “nals counterexample” hati vals of 1 and K such that Pt is at tue and nad ares sstin some sens, a) Choose a counterexample withn + Kas small as possible. We cannot ve = 1 and k= 1, because ‘we ae given that P(1,1) itu. Therefor, citer m > {ot E> In the former case, by ou coice of couterexam- ple, we know that P(e ~ 1.4) sre, Bat the inductive step then forces Pn) tobe te, a contraction. b) Choose 2 outerexampl with nas all as posible, We cannot have n=, beease we ae given tht P(ILA) is tue fora ‘Therefore,n > |. By ourchoie of counterexample, we know that P(a 1-4) i tue. Bu the indtive sep then forces Pn.) to be tue, a contadicion. €) Choose a countere- ample with Fas small as possible. We cant have k= because we are given that Pon) i tre forall n. There fore, > 1. By our choice of counterexample, we know that P(r. k~ steve, But the inductive step then forces Pn) to be re, a contradiction, 38. Let Pn be the statement that fo. ae distnt real numbers, then — 1 muipications ae used to find the product ofthese numbers vo matter how parentheses are inserted in the product. We wil prove that Pn is re using song induction, The bi- sis case P(L) is ue because 1 ~ 1 =0 multiplications are requited to find the prodact of x, a product mith ony ne factor. Suppose that P(K) is tue for << n-The ast le tplicaon used to find the product ofthe r+ 1 distin! real nimbers x. 435-..%q%q1 1-8 mukiplcation ofthe prod uct ofthe fist of thse numbers for Some & and the prod- ut ofthe las +1 — af them. By the inductive hypoth- ‘is, EI multiplications ae used to find the product of k ‘ofthe numbers, o mater how parentheses wer insert in ‘the product of thee numbers, abd n~ & mtpiations are used to find the prodect ofthe other n+ 1—E of them, ‘mater how parentheses were inserted in he product ofthese ‘numbers. Because one more multiplication i required find the product of ll n+ numbers, the taal numberof ml tilications used equals (k~1) + (n ~B) + 1 =n. Hence, Pon is true. 37 Assume that a = dg + with 0 = Te follons tha divides swe have sat 238. Tha paradox caused by elfeference. The answers ‘eal no." Thee are nite numberof English words, so only finite numberof strings of 15 words of fewer: there- for, ony a nite number of postive integers canbe so de- serited notall of hem. 4. Suppose thatthe well-odring roperty were false. Let Sbe a nonempty set of nonnegative Fepers that has no Feast element. Let P(r be he sttement SiS fori =O.1y.-0.m" P()istruebecaseif0 S then Shs least element, namely 0. Now supose that Pn) is true Thus,0 28,1 gS... €S. Cleary + 1 eanotbe {nS fortitwere, woud estlemen. Thus Pa 1) stra. So bythe principle of mathematical induction, m forall nonnepatve integers n, Ths, § = P eontraicton. 43. Tis follows immediately from Exercise (we take the ‘rinciple of mathematical indection as an axiom) and from this exerise together withthe discussion fllowing the for smal satement of stong induction inthe tex, which showed that song induction implies the peincple of mathematical induction if we ke ston induction a an axiom). Section 43 1a f= su f12)=8, 0) = 7, 8) = 18, fi) =33, 7 6) Fa) 36870912 €) f2)=8, 0) = 176, f(4) = 5.164, 174,888) (2)= ~1. 0) f(S)=—32 $a) Notvalid yf 0. dine de if 8) = 1 = uthen fk +1) = f(b)=1= 1h U4), gfe)a4—n if n> 0, and f(O)=2. Basi step: 0) =? and f 1 Induenve step (ith ft: f+). 4—i)=1= 4+, ‘ & fin) = 2, Basis spe (0) = 1 = 210" and fly 2= 208601, Inductive step (wit kU fle tye ofan) = 2d gS ge) 3. Basis step: eval. Induerive sep: Fo om ‘and for even n> I, 1.There sre many osible correct answers. We wil supply relatively simple O08, a) aay = ay +6 frm > Land a= 6 Baya n+? for n> | and ay TB La midtens seve "has ep PUD is te bese Indusve wep Asie at Pb te. Then on fast fat = f+ fs 1S. Basis step: ffi + fifi=O-1+1-1 Fade tp Aine Bal ffs ff foctha = fa Then fp + fife e+ Sacsfat Faas fast fs Bo fae fa Fulfa's fue) faofvam ffs ffs Cie sable = Ae 1 me of done Answers to Odd Numbered Exercises S33 sed by the Euclidean algorithm t0 find ged fot.f) O for m=0, 1 for n=l, and mI foe w= 2. To prove this result for 9 2 we use mathematical indcton, For 8=2, one dhision shows tht ged f) = s082, ed(0}= 1. Now asume that k~ I vsions ae used 1 find goat ys, fie To find gut. fis, fist divide ios bY figs TO obtain fia = > fo + fe Aller one div ‘sion we have sed fra fiys)= sedis Ji). By the inductive hypothesis i follows that exactly moe d- sions ae roquied. This shows tht divisions are ro ‘ure 0 find pe ff) ishing the inductive pro. W. [Als 1 Henge, [a*|-=(—1) Bolles hat ife-t~ J =(-1). 2a) Proof by induction. Bass step: For =, max(—ay) = “ay = ~ mina). For = 2, there are two ‘eases If gp 2 ay, then “ay > ay, $0 max(—a ay = ~minay, a2) Way 2. Then man(0, 723, a4e—dgt)= manana ay) auys) = max(—min(e---.a), a) = —migin (@je2seaQh ays) = — minaret) B)Proof by rmathomatiealinduetion. Bais steps For n=, the result is the identity a) +b) = a) +6). For n= 2, fst cone sider the casein which ay + by > ay +03. Then malay + bas 3) =a) +b. Abo note at ay = masa a2) nd by = manly,b3), 50 0) +b, = mana os) + man) “Therefre,mar(a, +b 0262) = a+b, = mana. 43) + ran(, fo). The se with ay 4by 3, or = 2and > 9,inwhicheace eiher(a - 2.b)or (a,b — 6) ‘must ave postive iteger coordinates whose sum is smaler than a +6 and satisfy the condition for being in S. Then ‘ne application of the recursive step shows that (a, 6) 8 SMeIfx isa set ora variable representing a set, thea x is a wellfomed formula If and y are well-formed forms- Tae then so are, (sy) (8 y)pand (ey). Sa IE FED = (01.2.3,4,5,6,7.8.9} then mx) =a if 45 tx, wheter © D* and e D, then m(s) = mints) x). byLet r= wr, where w € D® and x © D. Iw =2, then mst) = m(sx) = minis). x) = mings), m(x)) bythe recursive step and the bass step of the deftion of m Otherwise, mst) = m(( x) = mings) ) by the d= inion of m. Now m(sw) =i). m(w)) By the ine doce hypothesis ofthe structural indction, 80 mt) — mings) mw), 2) = minis), nnd). by he meaning of min. But mingn(s)x) = mx) = m0) by the recursive sep of the definition of m, Thus, mt) rings), m(0). 38.3% = and (uxy® su fore E, wed Sw® A and wl aww’, 38,When the sa sting consis of m Os followed by m Is fr some no negative integer n "Al, Let PU) Be!) = Iw)” PO) 's tue becase [(v") =0=0- fe). Assume Pl) is te ‘Then tw’) = HG!) = Ke) + Hoe) =I) +=) (4 1)-le). 4B. Bass step: Forte fal binary te co sisting of just a rot the esl i true because m7} and A(T) = 0,and 1 2-0 Inductive sep Asse tat (T) = 2M(T}) + and nT) = 24(T) + 1-By the recursive Akfintons of (P) and WT), we have mF) = 1 nT) + nT) and (7) = 1 max(h(F)- HT). Therefore m(7) = Up) + n(F)> 1+ 2MT)) +1 #2472) +1 2 142. smax(hF).A()) +2 = 1+ YoantT) MT) +1) TH 2H(T). 48. Bai step: ang = O-= 0+ 0. Induce step: Assume thal ee = m4" whenever (mn!) is les than (mn) inthe lexicographic ordering of NN. IF = then dy = gay t= m= 1tmelembe 110, then gy dq) tl=m+n— 1+] =m $7.4) Pag = Pe because a nunber exceeding m cannot be used inaparttion afm.) Because theres only one way to Parton I, namely = , i fllows that Pg =I. Bacuse there is only one way to parton m ino Is, Puy = 1. When ‘n> mit fll that Py = Pe because a number exced= ing m canot be used. Pay = 1 Pan Deeatse one extra Parton namely, m = arises whe m allowed inthe pr tition. Pry = Pat Pyonwifm > mbecaseaparionot ‘mint integers no exceding n ihe doesnt use ays and ene, scountedin Py. orelseuses ann anda parton of sm nandenee,scounedit Py-gn. 6) y= 7, Py =I 49.Let Pin) be “AQn,2) = 4” Bass step: P(L) i tue be- cause A, 2) = AQ. AC, 1) = A0.2) tivestep: Asse that nis truths AC, 2) An + 1.2)= Ala, Air 11) = A, 2 sla) 16 1)65536 58. Use double industion argument to prove the stonger statement: Aim, ) > A(m.2) when > 1. Ba- sis step: When m=0 the statement i re bocause > 1 implies that A(0.A) = 2k > 21 = A(.1). Indutve sep Assume that A(x) > AQ, ») forall nonnegative fate fgets x and y with x> y. We will show tht this implies that Aon + ,8) > Atos 1D) iA > 1 Basis tps: When 1 Oandk > 0, atm + 1,1) = Oandeither tm 41.8) oF Amt 1.) Alm, Adm =D) If m= 0, this is 2A(1,-1)=24 It m0, this i greater than O by the inductive hypothesis In all cases Alm + 1,8) > 0, and in fac Aw} 1.4) 22. If T= 1 and kl, then ‘A+ 11) = 2and Alm 1.8) = Alm, Alm + 1,41), with Ac + 1,1) 2 2. Hence, by te inductive hypoth: sis, Al, Al 1 = 1)) > Alon 2) > Alm 1) = 2. I dhcive step Assume tht Atm + 1.r) > AQm-+ 1.8) foe all> s.8= 0.1... Then if +1 >1-+1 3 follows that AQ + 1,62 1) Alm, Alor 1) > A, Al TA)= AOE LIED. $8 From Exerise $4 fol ows that AG, ) > AW 1,j)> =~ > A(0,/)=2) > f 57. Let Pn) be “Fn well-defined” Then P(0) is re be- ‘use ()isspeciied. Assume that P(A)s tue forall kn ‘Then F(n)iswellefined atm bacause Fn) i given in terms (fF (0), FUDyo ony F(a 1) So Piste forallimegers 59.4) The vale of F(1) is ambiguous. b) F(2) i ot de- fined because F() isnot defined.) F(3) is ambiguous saa and (8) i mt defined bese F(t) makes no sens. 4) Te deison of 11) ambiguous bce Bosh fe Second at thd clase seem tsp”) Fe) canbe computed ease wing to compteF2) Bes FO) = Ut Firiy=1+F0) shay! D2 93 D3 oe pd BS” Gi in)= (nla) 6.L0)= Hope orn 2, Section 44 1. Fist, we use the recursive step to write 5! = 5-41, We then use the recursive sep repeatedly to write 4! = 431, 21, 212-1! and t= 1-01 inserting the vale 1 and working back trough the steps, we se that ai Mad Ma 2-1a 2,3 a3 3-2— 6, 24-31 24.6224, and S12 5-41 = 5-24 = 120. 3.Firs, beemse = 11 is odd. we we the ele clase to see thut-mpower3, 11.5) = (mpower(3.5,5) mod Smod 5) mod's. We next use the ele clase again to See tha mpower(, 8.8) = (mpower(3 2, $F mod $3 ‘mod S) mod's Then we use the else if clause to se that _mponer(3.2.5) = mpower(3. 1,57 mod 5. Us ing the ese clase again, we have mpower(3, 1,5) (npower(3.0,5) mod 5-3 mod $)mod 5. Finally, using the HF cause, we soe that mpower(3,0,5) =. Working backward it follows that_-mpower(3. 1,5) 3mod $) mod $ = 3. mpower(3.2.8) mmpower 3,5. 5) = (4 mod $-3 mod 8) mod nally mpower(3, 1,5) = (3? mod 5-3 mod 5) mod S We conclude tat 3! mod $= 2. §. With his inp, the algorithm uses the ele cause to find that ged, 3) = sd(3 mod 8,8)= getS.8). It ses this clause again to find that _ackS, 8) = gat8 mod 5,5) = sed3, 5), thon to get ga, 8) = sed(S mod 3,3) = god@ 3), then sed2.3)= ged mod 2.2) = ged(l.2), ani once more to get geatl.2) = ged2 mod I, 1) = ge 1). Falls, © find gol0, I) ie uses the fist step wih «= 0 to find that gd, 1) = 1. Consequently, the algorithm finds that gel, 13) = 1 7. procedure mun postive integer, integer) n= 1 them mln) ‘se mall x) = + mul ~ 1.x) 9. procedure sum of ods postive integer) Hen= 1 then sum of odd (9) ese sum of dn) scum of odds (n~ 1) 4-28 = b 1 procedure smalles(a,.-..2yiteges) Hn= then smallest (aya) =) dee smallest ay) -mi(amallest as e-1)44) 13 procedure modfactorial(n,m: postive integers) fn = 1 then moiciorian,m) = ‘se mocoran.m) = (r-modfactoia ~ 1m) mod m 18 procedure gcd, b: nonnegative integers) (a= bassumed to hoi) fa =O then get, Answers to Old Numbered Exercises $3 sea = b— a then gee, b) =o ‘seta < b— a then aca, 5) = gella,b~a) ‘vega, b)= geod a0) 17 procedure mulpy (ry = noanegatve integers) ity =0 then mph (x,») = ‘se ify seven then mula (x)= 2- mali, 92) se mali (9) = 2 malpls, (1/2) 4 19. We use ston induction ona. Basis step: a =0, we ‘ow that go, b) = B for all b> 0, and that i precisely what the Hf clause does. dave sep: Fix A> 0, assume the indvetive hypthess—that the algorit works correctly forall values ofits fist argument es than and conser hat happens with input (6), where # 0, the ese clause is executed and the answer is whatever the algorithm gies es output for inputs (b mod k,£). Because ‘bmmod < f the input pir is valid. By our inductive by Poses, his ouput isin fact ge mod KA), whic equals seal.) by Lemma 1 in Section 3.6. 21.10 m=, then ine =, andthe algo correctly ret x, Assume that te algorithm corey computes x. To compute (4+ ie it recursively computes the product of k-+1—1 = and x, snd then adds. By the inductive hypothesis, it computes that product correctly, so the answer returned is ke + 7 = (4 Dr, whichis correct. 25. procedure suare(n: nonnegative inege) tn = Othen suare(n) else suare(n) = square — 1) +200 — 1) +1 Let Pn) be the statement that his algoritim corel com pes, Because OF = 0 the algorithm works corey (a ing the Hf clause) ifthe input i 0. Asume that the algo rithm works cont for input & Then for input + 1 i ives as ouput (because ofthe ese cause) its eutpur when the input iy pls 2(6 +1 ~ 1) 1. By the indedive hy potest ts ouput at Fis 2, so its ouput at ks 20 +14 1a 4 2k+ 1 = (e+ Dias desid 25.n multiplications versus 2" 27. Ollogn) verse 2. procedure a(n: nonnegative integer) n=O then an) else fn = | them a(n) = 2 else af) 2= an = 1) eal —2) St teratne 23 procedure dean: nonnegative integer) Wy=0thens = | thse fr = 1 then 2 == 2 che begin i=} fori = Lon —2 begin winstyde y SM Answers to Od Numbered Exercises end {= isthe mh term ofthe sequence) 35, We fst give a recursive procedure and thn an iterative procedure procedure 7: nonnegative tegen) I< 3 thenr(n) = nF alse rin) =r(n— 1) (ra —2)F-(n—3) procedure: nonnegative integet) {=the mh erm of the sequence) “The ieatve versions more ecient 37 procedure reverse: bit sing) n= length) itn = then reverse() se reverse) = subst (w, mn everse (subst, Ln — 1) (cubs (ab) ie the sbsring of w consisting of ‘the symbols inthe ath trough th positions} 238. The procedure correctly ives the reversal of 2 as 2. (ba- Sis sep), and because the reversal of string consists of its last character followed by the reversal ofits fist characters (ge Exercise 35 in Section 43), the algorithm hues corectly when # > 0 by the inductive bypothsis. 41. The algorithm implements the idea of Example 13 in See. tion 41, IFm-= (basis step, place the one righ triomino so that its armpit coresponds tothe hole inthe 2 2 board. Im >I, then divide the board into four boards, acho ize 28 21 notice which quater tele occurs, position fone ight iomine atthe centr af the board with ts armpit the quarter where the missing square i (se Figure Bin Sec- ‘tion 4.1), and invoke he slgoritm recursively four times— ‘once on each ofthe 2!» 2°" board, each of whi has fone square missing (either because it was missing to begin ‘with, or because itis covered by the cent tromino) 48, procedure A(m,n: nonaegatve integers) sw 45 ape slope 47 Let he evo lists be 1,2,-...m— Ime tm— Vand, mL. mtn 2, mtn, especively 48.10 n= 1, then the aloritim docs nothing, which i comet because & list wit oa element is alteady sorted sume that the lgo- rithm works corel form = | though n =f iin = + 1, then he Tis is pit int to Liss, Ly and Ly. By the ind tive hypothesis, mergesrt correctly srs each of these sub- lists: furthermore, marge carectly merges two sorted istinto ‘one because with each comparison the smallest element in Lj UL; not yet put into Li pt there, St. O(n) 83.6 $00") Section 45 1 Suppose tht x = 0. The program segment fist assign the ‘vale toy andthenassignsthe values + y = 041 = loz ‘3. Suppose tat y= 3. The program segment assigns the value 2to. and then assigns the value x + Sto2 Be- cause y = 3 > Oitthen assigns the value +1=5++1=6 5. (prcondiont (Sig (pa-condon! ‘ condtion2)(Sslg (os condition! 9 condition? ‘condition — DISsIg iif conditon hen Ss else ifcondtion? then S:...5 ese Sg 17. We wil sbow that p: "power =x"! and = + Iisa Joop iran, Noe ht pit inl, case bei the Toop stars = Land power Next we must Show tha if ps ra and = mae an execution ofthe lop, then prerains tru after one mre execution. The op nee meni by 1 Hence because! < m before tips, = n+ 1 afer his pas. Also the loop asigns power to power. By sas the inductive hyposhesis we se that power is asigned the salue x! n. Consequently at tmmination power = 1", 98 desited 9. Supose tat pis °m and mae integers” Then if the con- tion < Ois tuo, a = n= ilar S isexecuted. the condition < isis, then. afer senate Henee, psig iste where gis p (a= [n). Beeause Sy assigns the value Oto both and its lea that gS is tue wherer is UF = 0) (x = 0), Soppose that er, Let Pk) bes = mk and k= a” Wecan show tat PUL) is Joop invariant forthe loop in $3. P(0) sue because before the loop is entered = 0 = m0 and 0-< a. Now assime P(bjistrueand 0 then = ma =n, so Se asians mn product Hence Sat 8 ftue, 11. Suppose tht the intial assertion p iste. Then because pS} is ue, ois tue afer he segment Sis exe- ‘ited. Because — gs trait alo follows that ys rue alr Sisexceuted. Hene,pIS}q str. 13. We will we the proposition p, "cde 6) = ge, ») andy > 0." a8 the Toop invariant. Note hat p ste before the loop i entered, because a hat pointx =a, y =, and yi positive inte be wsing the intl assertion Now assure that pi ruc and > 0: then the oop willbe execated ex. Insite lop, x and yarereplacedy yandx mod y, respective By Lemma "of Seton 36, gods) = ged x med»), Therefore, ter execution ofthe oop the value of get, yi the same sit was before. Moreover, because) 6 the remainder, its at leat 0. Hence, p remains te, soi 2 lop variant Furthermore, ifthe loop trina, then y= 0 In this se, swehave ged(e.)) =x, the fn astro, Therefore, the po ram, which gives as is output, has correctly computed _cd(, 0). Fly, we can prove the loop must termina, be- ‘aus each iteration causes the value eto decease by at Teast | Therefore, the loop canbe iteatd at ost mes Supplementary Exercises 1. Let Pn be the statement hat this equation hols. Bass step: PI) says 2/3 = 1 ~ (1/5, wish is tue Induce step: Assume that (k) is tue. Then 2/3 + 2/9-+2/27 + +2/38 42/3"! = 1 1/38 42/3" (by the inductive Iypothesis) and his quale 1 — 1/3", as desired. 3. Let Pla) be"E-D 2-2 nm m2 Basis step: P(1) is tue because 1-1 Inductive tp: Assume that P(r, Then 1-1 42:2-+ SET 12 5 = D1 DE 2-1 = [lees L (1a) $4 1G 2¥8n + step: PQ) is tue Because 1/(l-A)= 1/4, Inductive Answers to dé Numbered Exess $35 stop Assane PL) is ae, Thea 1) eo VIGE=2GE+ + Ge: Hoke 9] = Gee 1/IGK Dk 4} = Wierd) Gee skeeo 2 (Gk+ IN DGS DOE 8] Ste + NOE Tet Pla) be "2" > 0 Rass ep PCD) is tre be cause 1024 > 100 induce ep Assme’ PU tae Ther Ut IPe Reser leh yor eke Bow S23 “pissfactor of a= Bais sep: Pi ily, Age P() Ste Thera pang tape ala! — 1) + ba —b). Then because a—b is a fac Wr of Hand oh is. oor of, allows that ab i fcr of otf TL Lat Pl) be tetera) land) =n iXQe bay Bo ss tp: PC) is we este « Hes d)ta td = 2202s Ince sp Ase tat) tw Then a+ (a td) + --» + (a + kd) + fa +b + Dd) = Nyaa hay2-+e + 4 I= [ok 20 as Ad 2a Ue + 2d) = Qak +4 Bd Sd + 24) 4042120 400-4 IM) 1B Boise: Tis efor esse 5/6 10/12. Ie sey Assan tht the eqn bolt for m= hr and comiér'n = E+ Then 2 aatitan = Eis ates + armies siia + ates (by the inde hypo arr COR + ES seem AOR + HOR 318 20451 = serge OP HO #2304 10) = mommy | GFF 10k + DP aralasy Gk UWE 1) MEDD as des 8 Bai te: ‘The statment is te for n~ | beease the devaive of g(0)=30" xe +e = (r- De bythe product le Inducive tp Assume tat the stems i te for n= fe, the th eave is given by = (04 he, Di Fecatating by the product ule gies the (kt dene te gt) (et Det eta bret Ne as dese 17. We wll se tong indton 0 show ht is even (ono 3) ands ol obervse. Bass step This fellows Because fo = 0 seven and f= 1s od. Idee stp Assume tht fh, the fi ven j= (a 3) and ise thei. Now supose +10 (nad 3). Then fess = Ji firs is en Brse fa fs iFE S121 (oo 3) he fs = fe fe ‘yisevenand fn Finaly f+ 12 oy) then “hot = f+ fs od because fis oad fo ven IW. LerPonbethessementht fe fos for fo every nomgaine ines k ass tp Tis consist of Showing that (0) and P(T) bo Bld. (0) 8 te be- aise fifo Sis = fist -O fit l= fi Becase Selif fe fot = fa follows that PI) 8 ire nde tp: Now ase hat PL) hls. Then, by the itv hypothesis ad the recursive defation ofthe Fone numbers follow tht fins fi fa = SUSI) hi + Sie = ition * fe vah + Udi + Sion) = footer + fjten = fue This Shows that PU 1) i tre” 21 Lt P(n) be the st sent b+ = lag +2, Basis ep: PO) and 36 Anowes to Old Numbered Estes PAI) oth old because ff =2? = 2-142 = fli +2 and fo R23 Dah +2. Ince Sep Assume tht P(A) bods, Then by the indocve hy poles BHP + HEAR aha +2 + 2, Toth + fin) + 2 fess +2 This showsthat P+ 1) hols 23,Let Pn) be the statement that the ientiy olds forthe integer. Hass tp P) obvi te Inductive sep: Assume tht P(L) is te. Then cost-+ Ie Usint tye = cathe +2) +1 six +2) = coke cos — sinks sins + i(sinkxcosx + cxskx six) = cose (cooks + isinkxyooss + sins) = (osx + sine (osx +isins) "I follows that P+ 1) is te 28. Rewrte the righthand side a. 2"? — 2n4+3)~6, For n=1 we bine 2=4-2~6, Assime fea consider = + See 243) 6402 42+ by the inde ype thesis) = 292 4 4) =I 42) 6 241) + 3]—6 2M. Let PU) be the statement that this equation bolls. Bais sep: In PC) oth sis relce to 1/3. dnductve sep Asme hat PC) iste. Then E33 — 0 = (Lia VU? — v) + e+ Yt] =tk— Ok 2/IsHE + DIF YMC + P= 1 15 the inductive pots. This spies to (k— 9G + 2y LAs D+ C2 + 26) = GP + SETA + TKR 2))= (0+ 1)— NIU 12H (4+ XL 2), which is cxacly what PR 1) asserts, 28. Let Pa) beth a Serion that at last n-+1 lines are ese to coir the fate pois inthe given angular region. Basi sp (0) i te, because we need at lest one fine 10 cover the ne point at (0,0) Indu tp Assume the inde tive hypothesis that at least A+ ins are needed 10 cover the latice points wih x= 0,» 20, and x +» =k. Com sider the ange of lative points defined by > 0, y > 0 ind x+y <4-+ 1, By way of contain, asume tht 11 tins cold cover hs set. The these Tins mst cover the £-+2 poins on the lie x-+y'=h-+L But ony the line x+y h+1 ial can cover more than one of these poms, because two distin lines intersect a ost. one Pot Therefore none ofthe +1 fins that are ned (by fhe inductive hype) to cover the st of late pints ‘within the tangle ut not on his ie can cover ore han ne ofthe poison hs ine and this ees at ast one int vcore. Therefore ove asungtion iat Hines ould eve the lags sts wrong and our poo iscomplt. 3H. Let Pon) BY = MA'M™, Basis step: Past the even comin dct ep: Assume te inte hates. ‘hen BY! = BBE = MAM IBY = MAM-MA'ME" (oy the indotive hypoess) = MAIA'M-! = MAA'M- MAl"IM- 138 We poe by mathontcal indo he folowing stronger statement For every n > 3, we ca wie taste sum of ofits positive divisors, oe of whieh isI-Thatis wecanwten! = 2+ +--+ a where each 4 isa disor ofthe dito arsenal dereasing te, andy = 1 Basis step: 31 = 3+ 241 Inductive step ‘Assume that we can wit I! asa sum af he deste frm, sab say! = a) +05 +-- +ay, whee each, isa divisor of, the divisors are listed in srl decreasing order, and a, Consider (&-+ 1) Then we have (K+ 1)! = (+ Da Ce Dlay ay +o Hay) = (e+ Day Dab Ue Diy = 0 Nay $0 Das ont ay Bee éause each ay was advisor of, ach E+ Ia 8a dvisce OF (+1! Furhemore, kay =f, which isa divisor of (d+ Df, and a, = 1 so the new last summand i again 1 (Note also that ou list of summands i stil in sity de ‘resing nde) Thus we have weten (& 1) in the desired form. 35. When n = Ith statements acuouly tr, As- sume hatte statements tee forn = fy and consider +1 People standing ina line, witha woman fist anda mar as thei person sa woman, then we ave tat woman standing in front ofthe man athe end. Ifthe kth person is aman, then the fst people in ine satisfy the condition ofthe indcsive hypothesis forthe fst F people in ine, so again we ean conclude that thee isa woman direly io font of ‘aman somewhere inthe line. 37. Basi step: When n = 1 thee is one cic and we ean color the inside bv and the ‘ouside redo satisy the conditions Inductive step: Assume the inductive hypothesis that if here are cicles, then the regions can be 2-colored sich that no regions witha common ‘boundary have the same cole and consider a situation with [E+ I icles, Remove one ofthe cites, producing a pctre with ctl, and invoke the inductive hypothesis color it inthe prescribed manaer. Then replace the removed circle and chage the cole of every regan inside this ele, The resulting figure satis the coniton, because it regions Jvea common boundary. then ithe that boundary involved the new ctl, in which asthe regions on ether side wed berth sume egonandnow the inside portion isifeent fom ‘theousdeoelsethe boundary did notinolvethonew cl, inwich case the region ae colored dierent because they were colored differently before the new ice was restored 38.10 n= then the equation reads 1-1= 12/2, which is teu. Assume thatthe equation is true form ad consider itforn +1 Thea E72) (EE 4) = Lhe — (S234) +e0+n-9- 4 =Dne7- (+ Lit) +t = (HE e-b)+(Taer-o Tiny |) +1 = (hyn) +8524 BE cyte sci typatein = enetPatesd) _ eePoaesh S42, 4La92 91 991 OI QT 91 43. The basis step is incorrect because # | forthe sum show. 48. Let Pl) be “the plane is vided into nn £2 regions by m cls if every 10 ofthese cir les have two common points but no three hve a com ‘mon point” Basis step P(I) is true becuse 2 tle divides the plane into’ 2= 1? 1-42 regions. Inductive step: Assume that P(A) i tre, that is, ils withthe specie properties divide the plane ito &2~ k-+2 regions. ‘Suppose that (K+ Istcircle i added. This circle intersects each ofthe other k circles in two points, so these points of ‘erection form 2 new aes, each of which splits an old sav region. Hees, the re 2k reson spit, which shows tht thre ae 2k more reson tan here were previous. Hence, 11 eles sang ihe speed properics die he pane ino —k-+ 2424 = (242641) 2= (+ F402 eos. 47. Suppose V2 wee re tio, Then V2), where a and Pre psithe i I follows tat the be $= [nv/2ja ENN ist Soaenpy sof postive ego, tense B/2 = a Belongs {0S-Letbe te lex cleat of, wich xs by the wel rig propery Then = s/3 for same inept We ae Popeiyd tm s(/3~ 1301 —3 va pose integer ‘cute J2 > I, Hence, blongs to 8. Thi 4 com falcon beac (1 = VPs Hones, V2 ii tional. 49.4) Let d= goa, a9) Tend sad sorofeachaandsomstea divisor of ea, 5) Heo, Tisacommon iso of ayes, a8 let) “oshow tat tthe greet common dsr of hse me ber, supose htc ia camo disor of thm. Then isa diibor ofa, fr = 1.2.02 an a disor of Flo.) 088 8 ray an a Hse 8 common dsr faa ay abl Hees ita vse fd the retest common dsr ofa. Iolo tht dis be greatest common divisor a ail ‘IF n= 2, apply the Eacidean algorithm. Ober DY the Eldan agri ay a a, obaiing 2,4) and then apply he sloth survey Sycstepd.” Sh fl) =m La Pin) bef) =" ‘Bass sey: P(Distrucbecausef() = | = Pic llows frm be dfn off Ince sep: Assan f() =r Then fon) = +1) ~ +204 1)=1 = fla) Int lant + Int laine 1P S.a)A, 0,1, 00,01, 11,000, 001,011, 11,0000, 001, 0011,0111,11,00000, 00001, 0011, OOIEE, OLLTL, HIT b)S= fap |e is a sting of m Os and isa string of m Is, m > 0,n > 0) 5, Apply the fist ecusive sep tot act ()< B. Apply the second recursive step t this sing to get (\) © B- Ape ply the fist recursive step to this sting to get (00) € B. By Exercise 58, (() is notin B because the number of left parentheses doesnt equal the numberof right parentheses. 57.4,0.(0)00 9-290 B)-2-)2 dO 61 procedure generate: noanegatve integer) nis od then $= S017 = Te) end sein = 0 then begin S end eke begin Ty = Tin 255, = Sin—2) T= TU(G)|x eT US; andl) = Se=S\Ulay [xe Tandy eT US; and end (TUS isthe set of balanced sings of length at most n) by Answers Odd Numbered Exercises $337 63.1 y inital then x= is veo sox = yisapsina te fal aseton (65, procedure zerocount (aa, list fingers) n=l then O then zercount (a, ‘se roca a2...) eke Hag = 0 then zerocount ay a2 -.86)"= sercount (a... dy-i)* 1 se serocount a vd) = zercount(ay dt -idat) 67. We wl prove tat a) sa natal number and a) ‘This is tre forthe ase case n = 0 because fl) = 0. Now assume tht (r= 1) isa natural number and a(n — 1) = n= 1. Then alan ~ 1) @ applied to a natural number Tess han or equal to n— 1 Hence, (a(n 1) 6 also 8 ‘ature number minus than ot equal to n— 1. Therefore, 2 ala(n—1) is minus some natal umber les than (¢ equal 10 mI, whichis a natura murber less than or equal to m._ 69. From Exercise 68, a(n) = [n+ Dy and a(n = 1) = Lt. Because p< 1, these two values ae gual or they difer by 1. Fist suppose that jue ~ Ln] T= Tiss equivalent to an + 1) < E+ un). Its is teu, then uln+ 1] = Lun). On the otber and, yn = Lun} = 1 =u then ln 1) = 1 Jan so late + Lun + 1 8 desired, 71 f(0)= 1, m(0)= 0 1) ‘m(l) = f(2)=2, m(2)= 1; 3) =2, mB) =2; fe 3, ma) m3) =3; /(6)=4, mi $10) = 5,17) =4; (8) = 5,8) = 5; 9) = 6m {5 78. The ls oocurence of in the position for which the ttl numberof I's, 2's. sal togeter shat pos tion number But because a i tbe number of occurrences of Ee thisisjust 7 a8 desired Because fn isthe sum of Ae fst n term ofthe sequence, f/m) isthe sum ofthe fist f(a) terms ofthe sequence. But because fn) isthe las term whos vale ism, this means tha the sm he sum of all terms ofthe Sequence whose vale is at mos. Beease there are a terms he sequence whos ale is his sum is Shea as desired CHAPTER 5 Section 5. 1. )5850 0/383 3.44! ys 5.42 7.268 9.676 11.2% 1B.m+1 (Counting the empty sting) 15,475,255 counting the empty sting) 17. 1,321,368, 961 19.2) Seven: $6, 63,70, 77, 84,91,98 _b)Five:55, 66,77, 199 e)One: 77 2a) 128 b)480 9 675 450 480.9225" B)7S 23.4)950__) 500 2725.3” 27.52,457,00 29.20.077200 31.8) 37,822,859361 4) 8204716800) 4.189050, 880g) 12113640000) 171004208215 9 72083, S410) 6230,721,635 223,140,685 33.4)0 1/120 0720 a) 2520" 38.4)2 if w= 1,2 if n= 2,0

You might also like