Wednesday, January 29, 2014

Week 4 - Recursion

As much as I disliked MAT102, concepts such as induction were shown to be a lot easier in CSC148 for me. I feel that learning induction and the concept of recursion should have been taught first in CSC148 because it paints a clearer picture as appose to learning it the "hard" way (like MAT102...). Its interesting to see how creative these pieces of code can get, especially when the code works in a way that completes a task in a way CSC rookies won't understand right away. I'm looking forward to how creative and complex assignments and concepts are gonna get in the coming years in CSC....

Examples of recursive statements are algorithms or a series of computations that rely on previous information. You start out with a base case that HAS to work, and you assume that condition holds for the next case, and so on. A common mathematical example of this would be Fibonacci's Sequence. The sequence of numbers rely on the numbers that come before it. I've had some difficulties understanding this in MAT102, I'm not sure why...But going through the first function we did this week (the binary bit function), I fully understood the concept of recursion and induction. Now its just a matter of thinking recursively when it comes to different problems.