Thursday 27 November 2014

Week 11

I did not have any class this week for CSC165. However with my new found free time, I browsed some other blogs. Many people are very behind but the blogs I did end up being able to read were quite interesting. It was nice to see how most of the people in the course are in similar situations to myself, and I could relate. A lot of people had similar issues with the course, such as Andrew Goupil having issues with Big O in week 8 (http://andrewgoupilcsc165.blogspot.ca/search?updated-max=2014-11-09T14:58:00-08:00&max-results=7), or Albert Xie getting stressed over exams in week 10 (http://99bugsbutaglitchaintone.blogspot.ca/). Reading these blogs helps me to attain a better mindset heading into class, because I know it's not just me that has issues and everybody struggles.

Friday 14 November 2014

Week 10

    Got my midterm back this week; I didn’t do as well as I thought. I got the easy proof wrong that the class averaged an 8.9 on and the other two right but lost two marks on each of them because I didn’t comment. In MAT137 we also do a lot of proofs and we do not have to be as clear in our explanations. For the most part as long as we figure out the “trick” to the proof we get the answer correct, whereas CSC165 is a lot more focused on form. I did not read the questions well enough and ended up losing out on free marks because of it.

    In this week’s tutorial we worked on Big O proofs which was very helpful but I’m not sure I got the correct answer. I did the quiz in an unorthodox way where my answer was different than anyone else I talked to after so I’m not sure if I got the proof correct.

Wednesday 12 November 2014

Week 9

BIIIIG O PROOOOOFS!!!

    So far this is the most complex and confusing thing so far. I don't really understand them at all, definitely going to put in a little bit of extra work to make sure I can get them done for the exam in December. Our tutorial this week went well, as things get more complex the tutorials get more useful. It's very helpful to get an extra hour for focused work to recall the lecture information.

    We also had a midterm this week, it felt good. All of the proofs weren't too difficult and I figured them out with time to spare. However after the test I realized that I had forgot to comment anything, hopefully I won't lose too many marks due to that. In MAT137, we do not really need to be as precise while doing our proofs, as long as we figure out the trick we pretty much get the mark, but I am not sure that is the case in CSC165; because the proofs are easier the marking may be more restricted to form.

Week 8, The Max Slice

This week in class we covered more on Big O, omega, and simplifying different functions. A challenge for this week was to simplify an original max_slice program given by Larry. I simplified it down to both O(n2) and O(n).

The problem:
Take original max_slice program which runs on O(n3) and simplify it into both O(n2) and O(n).

Is this accomplishable?
Yes. The given statement is a lot more complex than it needs to be.

Devising a Plan
Finding the Connection:
It appears that a major problem with the complexity within the code is that they are not using some of the functions already defined within python, such as max.


Carrying out the Plan:
The goal was to eliminate a loop. I did this by instead of sorting based on max length in each section, just using the built in function max.

Next I had to eliminate one more loop. I added a variable in order to keep track of additional info I would need to record. I used the max function again in order to keep track of another variable to check if the max sum would increase by adding a number.

Looking Back

Examine the Obtained Solution:

Eventually I got what I call the Golden Sum, it seems to work for all numbers and instead of O(n3) or O(n2) it is just O(n) which is as simple as it gets because there is no way this could be done in any O less.