Friday, October 19, 2012

Recursive Functions



The test for last week was OK, didn't get time to finish it though spent too much time one the previous questions. Therefore I learned that I should divide the time on all the questions accordingly
I read more about structural induction from the lecture notes and the 236 course notes, but still not sure if I understood the concept. Hopefully we’ll take more things on it in class
I find recursive functions very interesting, since you don’t get an answer right away you eventually need to break it down, then look and understand the relations between the changes then come up with the formula for how many times the function will run. For an example


Where n is greater than zero then we would break it up more
Let us use k = n
F(k) = f(k-1) +2k-1
 = (f(k-2)+2k-1-1) +2n-1= f(k-2)+2*2k-3
= (f(k-3)+2k-2-1)+4k-3= f(k-3)+2*3k-6
= (f(k-4)+2k-3-1)+6k-6 =f(k-4)+2*4k-10
.
.
.
= f(k-i)+2*ik-i^2-i
.
.
.



I like how we are still using complete induction and mathematical inductions to prove the recursive functions. Made my life a little bit easier. But I definitely will have to review theta and big O from last year.

No comments:

Post a Comment