2012年11月3日星期六
Assignment 2
I just submitted the second assignment. In general, I found the second assignment was harder than the first one.
There were two questions in this assignment. Sounds not much, but each question was very long. The first question asked us to unwind first and then prove the closed form. It was very much like a question that was in one of the tutorial. So what I did was to review the tutorial question first and then try to do the question myself. The unwinding was not very complicated for me and since I was pretty clear with Simple Induction and Complete Induction, I solved the first question without too much difficulties.
The second question was about what we learnt in the last week -- time conplexity. I was so glad that I solved all questions that I didn't understand last week so now I was very clear about what steps should I do. If I did not fix my problem last week, I would be confused about how to do this question and it was going to take me a lot of time if I googled online or read through all the pages on the textbook. So, Never Put Off Until Tomorrow What You Can Do Today. ^_^
This week we mainly learnt about proving the correctness of a function.
To prove the correctness of a function. We need to prove that under the assumption that precondition holds, the function terminates and the post condition holds. To prove the function terminates, we have to construct a decreasing sequence in N and then use well-ordering principle to prove that there is a smallest value in N so that the loop will finally terminate.
The second midterm is in next week. I need to read through the text book as much as I can and clear all my questions before the test. Oh~ and do not make the same mistakes again as in Midterm test one. Cheer up and be ready! ^_^
订阅:
博文评论 (Atom)
没有评论:
发表评论