2012年10月28日星期日

My way of doing recursion problems

Usually, you always need to think more about recursion problems than induction problems.
The reason is: for induction problems you always consider the nth case (or first to nth)to imply NO.(n+1) case.But for recursion, you have to think from nth case all the way down the first case and then prove it by induction.

Use repeated substitution (unwinding) to find a closed form for the recurrence S when n is a power of 3:
          1 if n < 3
S(n) = {
          a1*S(ceiling[n/3])+ a2*S(floor[n/3])+sqr(n) if n>2
... where integers a1,a2≥0 and a1 + a2 = 3.

The question gives the condition of n always related to other factors.
You can find n is a power of 3 and ceiling[n/3] floor[n/3]
Since n is a power of 3 which means n=3^^k.
Then try to substitute n=3^^k into S(n) when n>2.
Because n is a power of 3,ceiling[n/3]=floor[n/3]=3^^k-1
Then S(n)=3S(n/3)+n^^2 which is 3S(3^^k-1)+n^^2

substitute again then will be able to find S(n)=9S(n/9)+n^^2/3+n^^2

keep substituting until get S(n)=n+3/2n(n-1)

then prove it by induction.

The key point is to find the realtionship between S(n) S(n/k) S(n/k^^2)....and at the end S(1)

2012年10月18日星期四

Questions about complete induction.

We all know that complete induction is (P(0),P(1),P(2)...P(n)=>P(n+1))=>P(n).
Is possible if i use (P(1),P(3),P(5),...P(n+1)=>P(n+3))=>P(n), but i said before the induction steps that n is a odd positive integer.

My way for doing induction problems.

 Proof questions are nightmares for most student.

There are two way--mathematical induction and complete induction for solving different problem.
However, I find using mathematical induction more often than using complete induction.
What 3 steps I used for proving statements:
First step: Define P(n).
  In order to do so, I will read question really carefully to get what kind of  P(n) I have to define and what n means in P(n).

Examples:
the square of b is greater than double of itself when b is a natural number greater than 2.
then P(n) would be: sqr(n)>2n.

Second step:Finding base cases for P(n).
  For this step, always find the eaziest case but the smallest case that P(n) is true. That u will be able to find the range of n.

Examples:

For sqr(n)>2n.
Find P(n) is true for n=3.

Third step:(most important steps)Induction steps
For mathematical induction using P(n)=>P(n+1) to prove all n is true for P(n)

Examples:
  if P(n) is true. then prove P(n+1)
       for the examples about just to find the different between sqr(n+1) and sqr(n) is greater than or equal to 2(n+1)-2(n).


Complete Induction has first two similar steps but the third steps will be (P(0),P(1),...P(n)=>P(n+1)) =>P(n).

That is how I did for proof questions using induction method.

I just realized that I have to set up a blog for CSC236

Always being late for class. I just knew that I have to make a blog for CSC236.
Hope it is not too late to get the credit.