AU students love CS 70 Theorem given a set of n students they all love Let Pcn be Proof CS 70 PCO is trivially true Based Inducti vestep Assume Pln is true Suppose we're given a set of students Si Sa Sn Sn t By inductive hypothesis students in Sn Si all love 70 Similarly students in all love 0570 CS Sa Sinti all love 0570 Si Sn ti By the principle of induction since PCO istrue and the Nl Pln we know the statement is true p nti D Q What's wrong Do youagree Pco PCD tri c N p Cn we didn't really prove pint D so
1 Induction Induction is a technique for proving An c IN Pcn 1 1 Simple Induction pcl plz 3 PC o t's 0 I 45 To prove Pln is true for all n c IN 2 3 use check P o holds Base case P Rtl for all k C IN Inductive Show Plk a r E.ge Prove that Eiger's ArI where AER r NEIN r D arn a PI Let Pln be the statement Eiger's I r l Af Plo holds because Egar's 1 a WTS fKEIN Rk Inductive P Rtl Assume p k Inductive hypothesis is true i e assume II a oar's art 2 want to show a.EE oar's iark ars EEoars arkt I arkt r 1 ark 12 art a ar Ark 12 I I RT D
4 E.ge Prove that 2ns n for every integer n 34 Let Pln be the statement 2ns n P holds because 24 16 L 4 24 BI Inductivestep WT S F K EN k 34 P K Plk 11 s i.e assume 2k Lk for some integer k Assume Plk 4 want to show 2 K Rtl L k 11 K Notice that I 2K 2kt 2 k X 2 L x Lk 11 K Rti B EI Prove a map with n lines is 2 colorable where n c IN PI Let PIM be the statement a map with n lines is colorable 2 P O holds because we can color the Base cau entire map using a single color NTS f KEN Plk PC kid Inductive Assume Plk ie assume a map with K lines is
Colorable 2 E.ge Prove the sum of the first k odd numbers is a perfect square n PI Let PIM be the statement E M for some mez 2 1 4 InductiveStep Assume Plk holds for some k 2 ie IE j memkEZ1t want to show PCkti holds 2 1 i e D t 2kt I 2kt l m l's a perfect square 2
9 I 13 15 9 I 13 4 22 32 1 1 2x D Let PGD be the statement Eif n PCB holds because 1 12 Bae I K K2 for some KEE Assume E 2X Inductive l X K 11 Then I 2kt I 2 1 2x D t X II K2 2kt I k 115 B l 2 Strong Induction is true for all MEN To prove Pln use check PCO holds Pax Inductivestepi Show t KEIN AP K P Rtl Plo n EI Prove that if n is an integer greater than I then n can be written as a product of primes a prime and a product of itself PI Basecasei 2 is so the statement holds for n 2 Assume all integers 2 Ej Inducti vestep Ek can be written as a product of primes KH is prime we're done Consider Rtl If ab for some integers a b with Kt I Otherwise Q E A b L k 11
a product of primes can be written as By IH aib a product of primes can be written as KH Hence Freddie Pcn Prove that every amount of postage of 12cents or more EI can be formed using just 4 cent and 5 cent stamps Let Pcn be the statement N 4X 15g for some x.ge PI vBaseca 5 O 4 p42 12 3 se is true 14 PG 5 holds because P i3 PC Inductees Assume Pcn holds for all 12 E NE k for some K 315 Consider kIg 4 XH 15g If k 11 y4Xt5y but need 1211 k 3153 ie 4312 4 312 by IH Since KH 4 Rtl 4 59 x y c NI so k 11 4 X 11 15g for g E E tomes 4221314 15 16 Remi Well orderingprinciple states S E NI S least element then S has a The validity of the principle of induction and strong induction follows from WOP
1 3 Recursion To prove a statement holds for recursively definedobjects use Ban case the result holds for all elements specified in thebase case element used to Becursivenstep show if the statement holds for each construct new elements then it holds for these new elements Binary trees can be constructed recursively EI Define height 1h15 recursively gy 1 IT h T 0 T root Base case Tz T Tio Tz hCT It Max ht Recursive step h Td Define number of vertices n CT recursively L T h T Bas root ecase n Ta Recursive step T Ti Tz t n CTi n T t Prove n CT E 2h 1 for any binary tree T l and ACT PI Then n T Ban case F root 0 20 Statement holds because I I 1 Recursive Step Cons der F Ti T2 E 2h'T want to show NLT I
Notice that net dEf I t n Ti t n CTD IE ft zhai 11 14 2h44 T1 11 Ta 11 2h zh 11 2h17 11 zha I y 2 Max zmax HCT h Tz t I 2 Def h CT I 2 2 t 2h51 l D
Recommend
More recommend