Friday, November 7, 2014

Week 9 - Counting steps

This week is a hard week because of tutorial quiz on Monday and the term test 2 on Wednesday. In this week's lecture and tutorial we have learned many new things, on how to count steps in a double while loop as well as finding the worst case (big-O) for different quadratic functions.

Usually in the past few weeks tutorial quiz had been very similar to each other on the concept of proving different types of statements. However I felt that in this week's tutorial there has been a significant difficulty jump, because we had to do something new which is counting steps in a double while loop. From last week's lectures I have learned the general idea of counting a single while loop and that's about it, because I had to focus more on studying for term test instead of understanding other new concepts. This is a very fatal mistake and I believe I did very bad on the quiz because I wasn't quite sure what the question is about and how to solve it, thus taking me a lot of time just trying to figure out what is going on for the problem and made me run out of time so I had to write down just what I had in mind at that time.

Example from course note week 9, page 5
In this week's lecture we have learned more examples on how to solve the big-O argument. As you can see from the classic example of finding big-O in the picture above, we can prove this true by finding a B and c to fit the implication with those inequalities.
-The first step on how to solve this is to pick a B and c, just leave a black space on their value so you can fill it in after a few steps.
-The second step is to rewrite f(n) bit by bit so each new one is bigger and more simplified that the old one. Finally into the form of the O(n^2) which is in the form of cn^2.
-Now you can pick the c where it makes cn^2 bigger or equal to the simplified function you got from f(n).
-Fill in the B black by setting a minimum value for n, for example if you were to write '3<=3n' then you must say that n>0 so 3n won't become 0 when n=0.

No comments:

Post a Comment