Saturday, October 25, 2008
Concerning Correctness
Sunday, October 19, 2008
Considering Complexity
Friday, October 10, 2008
Midterm Madness
Well, the midterm was this morning, and it didn't go too badly I think. The first question about the Fibonacci sequence was a breeze, almost suspiciously so, but unless I've really gotten bad at reading trick questions then that was fine. The second question, I realized 15 minutes after the test, I pulled some real bull algebra on, so I know I screwed that up, but at least the structure is there, so here's hoping for part marks.
The third question about sets was something more interesting! I stared at it for a good 15 minutes or so, having gotten as far as writing down that all sets have 2^n subsets and that each following set's subsets were those of the previous + subsets containing the element n. With two minutes left on the clock, I had a revelation (though it might have been wrong, I felt pretty good writing it down and remain confident it was a valid proof). By complete induction and partitioning S into S_1 and S_2, where S_1 is S less all the subsets containing {n}, and S_2 is S less all the subsets without {n}, you get two subsets of equal size, and better yet, you know S_1 is just the set of subsets of S:{1,..,n-1} and thus by the I.H. has 3 * 2^n-3 subsets. S_2 being the same size means it will have the same number of valid subsets, so the total will end up being 3*2^n-3 + 3*2^n-3 = 3*(2^n-3 + 2^n-3) = 3*(2^n-2)
Exactly what was needed. That was a fun proof.
I still feel pretty stupid about the algebra in question 2 though, because for some idiotic reason I wrote down 3^n+1 = 3^n + 3^n instead of 3^n + 3^n + 3^n or 3*3^n. Hopefully there'll be some mercy, because I think I did end up pseudo-legitimately showing that 3^n + 3^n > 2*(n+1)^3, so it follows 3^n + 3^n + 3^n could only be larger as well. Oh well, all in all it could've definitely gone a lot worse.
Now with that midterm out of the way and nothing due immediately after the weekend, time to enjoy the long weekend and go party before thanksgiving.
Friday, October 3, 2008
Regarding Recursion

I've always found recursion to be my favourite subject, and this has yet to change. Recursive functions always seem to end up more efficient than the vanilla / iterative alternative, and most of all just seem incredibly elegant to me. Proving recursive functions seems to have a natural flow to it similar to the functions themselves.
Whoever originally came up with the idea of automatically reducing a problem down to near-nothingness to solve the most complicated of things must have been a real genius.