Saturday, 15 February 2014

Week 6: Assignment 1 is DONE!

My main focus this past week has been working on finishing Assignment 1.  Having completed TOAHModel.py and ConsoleController.py, I was left with the most interesting part of the problem: figuring out how I was going to code Tour.py and optimize my cheese stacking strategy.  The most important step of this was, of course, figuring out a way to find the elusive i, the variable that optimizes the Towers of Hanoi for four stools.  At first, I attempted to try to find some pattern, but then decided that my complete inability to do computations (perhaps inability is inaccurate, and a strong aversion is more correct) meant that a different solution was suited for me.  I read a slog that has a computational solution to i that you can check out here: http://liamsslog.blogspot.ca/2014/02/week-5-tower-of-hanoi.html.  In the end, I thought about how the simplest way to define the Fibonacci sequence is simply to define it recursively, and then proceeded to question why in the world I would define this sequence differently.  I simply used the formula provided in the handout, and found the minimal number of moves for each number of cheeses.  Then I returned the i that corresponded with that minimal number.

The next thing was to simply use the function provided in class for three cheeses to recursively define a function for four cheeses, as indicated by the handout.  I ended up having an error that took an hour of time and a fresh pair of eyes to find, but in the end, my solution worked, and I had a still-not-yet-proven-optimal solution for four stools. This was followed by coding the bonus, which took a lot less long than I thought.  Finally, I submitted Assignment 1 to MarkUs for the final time on February twelfth.

Labs this week flew by faster than I can say.  My partner and I finished within an hour and I do think I am improving in terms of my familiarity with recursion and my abilities to use it correctly.

Class this week was regarding trees. I'm quite excited about this, since graph theory is one of my mathematical favourites.  I'm not sure that my experience with König's lemma and Aronszajn trees will really help me in this class, but I look forward to this coming chapter of CSC148.  On the other hand, I feel slightly unprepared for the midterm, seeing as I haven't gotten any information regarding its contents, but I'm hoping that more information will come up during this week so that I will have time to fully ready myself.

No comments:

Post a Comment