Task: Consider the following recursion:

T(n)={T(n1)+3nn>13n=1

Provide a closed (non-recursive) formula for T(n) and prove it using mathematical
induction.

finding a non-recursive formula

  1. recursively insert until you find a pattern
  2. try to write the pattern with a single T() expression, constant expressions / expressions containing n,k and sums
  3. choose a substitution that makes T(n,k,)=T(1)
  4. simplify

T(n)=T(n1)+3n=(T(n2)+3(n1))+3n=([T(n3)+3(n2)]+3(n1))+3(n0)==T(nk)+3nk+j=0k13j=T(nk)+3nk+3(k1)k2=T(1)+3n(n1)+3(n2)(n1)2(k:=n1)=3+3n23n32(n23n+2)(T(1)=3)=(332)n2+(3+92)n+33=32(n2+n)T(n):=32(n2+n)(our Assumption)
proving formula using induction

  1. check base case (2nd case of the induction, in our case n=1)
  2. induction case: choose an substitution for n (for example the previously used subsitution with k)
  3. simplify until you get the induction assumption again

base case (n=1):T(1)=3=3=32(1+1)induction case (n=k+1):T(k+1)=T(k)+3(k+1)=32(k2+k)+3k+3(assumption)=32k2+92k+9=32(k2+3k+2)=32(k2+2k+1+(k+1))=32((k+1)2+(k+1))=32(n2+n)