Task: Consider the following recursion:

T(n)={T(n−1)+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(n−1)+3n=(T(n−2)+3(n−1))+3n=([T(n−3)+3(n−2)]+3(n−1))+3(n−0)=…=T(n−k)+3nk+∑j=0k−13j=T(n−k)+3nk+3(k−1)k2=T(1)+3n(n−1)+3(n−2)(n−1)2(k:=n−1)=3+3n2−3n−32(n2−3n+2)(T(1)=3)=(3−32)n2+(−3+92)n+3−3=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)✓◻