Sunday, 16 February 2014

Week #6: Finishing Assignment 1

At the beginning of this week, I had been feeling very good about how my assignment was going. I only had the last two steps left to complete, and felt strongly that I was on the right track.

Unfortunately, Step 5 -- finding the recursive solution to the cheese problem with 4 stools -- proved to be substantially more difficult than I was expecting. I understood out how I should move the cheeses once I new the split 'i', but finding that 'i' seemed impossible. I spent all afternoon on Wednesday testing out different potential solutions, but even when I could find the minimum number of moves, I could not seem to extract the 'i' from function, given its recursive nature.

I expected to spend all Thursday at the library as well, and crossed my fingers that I would find a solution. However, the next morning, after detaching from the problem, a solution occurred to me much more quickly then expected. I could use nested functions, given that I needed the index from the function that found the minimum moves, but could not change the return statement because that would lead to issues during recursive calls.

I learned this week that sometimes staring at a problem for several hours is not the best way to solve it. Often it is better to detach from the problem temporarily, and come back to it later with a fresh pair of eyes.

1 comment:

  1. After reading your blog, I learned this week that sometimes staring at a problem for several hours is not the best way to solve it. Often it is better to detach from the problem temporarily, and come back to it later with a fresh pair of eyes.

    ReplyDelete