sqr(max(10,sqr(3)))⇓P100max(10,sqr(3))⇓P1010⇓P10(n)sqr(3)⇓P93⇓P3(n)x∗x{x→3}⇓93⇓P3(n)3⇓P3(n)if x≥y then x else y{x→10,y→9}⇓P1010≥9⇓true10⇓P10(n)9⇓P9(n)(bop)10⇓P10(n)(if)(fnval)[..][..](fnval)
Exercise 2
Prove ∑i=1n(2i−1)=n2.
Base Case:
LHS=(2(1)−1)=1RHS=n2=(1)2=1
Induction Hypothesis:
Assume ∑i=1n(2i−1)=n2
Induction Step:
LHS=i=1∑n+1(2i−1)=i=1∑n(2i−1)+(2(n+1)−1)=n2+2n+1=(n+1)2 as required