2. General plans for analysis of recursive
algorithm
1) decide the input size.
2) identify the basic operation.
3) check how many time the basic operation
performed and determine the best worst and
average case.
4) set up a recursive relation with some initial
condition expressing the basic operation.
5)solve recursion with using forward and backward
substitution and correct formula using mathematical
induction.
4. Mathematical analysis:
Step 1 :input size is n
step 2 :basic operation is multiplication
step 3 :recursive function is
F(n)=F(n-1)*n where n>0
Step 4: multiplication is given as
M(n)=M(n-1)+1
7. Now we correct the formula
Prove: M(n)=n by using mathematical induction
Let n=0
M(n)=0.
M(0)=0=n
Induction: M(n-1)=n-1
M(n)=M(n-1)+1
=n-1+1
=n
M(n)=n
Time complexity. (n)