Friday 5 April 2013

Entry #11 - Final Week!

This is the final week of lectures, this past week has been very stressful for me. I had my GGR124 assignment 2 essay due on the same date as assignment #3 and my CSC148 project part 2 due today.
I found Prof. Heap a very good lecturer, he talks very clear when explaining whats he doing during the lecture and he also interacted with the other students in the lecture in a positive way.

---

In my first sLog post, I posted a problem solving question I had made up based on what happened in the lecture. I will try and finish it here since I didn't finish it.

Problem:
A: Hey! I haven't seen you since grade 9. How many kids do you have?
B: I have 3 kids and the sum of their ages (rounded down to nearest year) is 28.
A: That doesn't really answer my question.
B: Well, I recently had a one of the kids and - *SOMEONE COUGHS BEHIND YOU*
A: That still doesn't tell me how old they are.
B: Well, the oldest isn't older than the last time I saw you.
A: Okay, I see: their ages are - *your boss calls you*

1. UNDERSTANDING THE PROBLEM
Sum of their ages is 28
Recently had a kid
Oldest isn't older than the last time he saw you

2. DEVISING A PLAN
A person in grade 9 is usually aged 13 or 14 so the oldest is <= 13/14
So there is a restriction on the oldest kid, if the oldest is 10 then the other 2 kids ages sum has to add up to 18 but one of their age cannot be greater than 10.
But if the oldest is aged 9, it won't work because the combined age of the other 2 kids are 19 and one of the kids age would have to be at least greater than 10.
So the oldest kid age has to be restricted in the boundary of [10, 14] and depending on the age the other 2  is also restricted.

if oldest = 10 than the ages of the other 2 kids are [0, 10]
if oldest = 11 than the ages of the other 2 kids are [0, 11]
if oldest = 12 than the ages of the other 2 kids are [0, 12]
if oldest = 13 than the ages of the other 2 kids are [0, 13]
if oldest = 13 than the ages of the other 2 kids are [0, 14]

3. CARRYING OUT THE PLAN
So the solution is that the oldest kid has to be somewhere between the ages of 10 to 14 and the second oldest is less than or equal to the age of the oldest and the other kid is the difference of the ages
---

Here is my python code for the paper folding problem that Prof. Heap showed us in class.
I realized that a noticeable pattern was that every time you fold the paper. The center would always have a down fold and everything to the left of the centre would be the reverse and the opposite of the right side.

This code returns a list with the resultant folds given the num_folds.
Down folds are 'v' and Up folds are '^'.

def paper_folds(num_folds):

    return _paper_folds(num_folds, [])

def _paper_folds(num_folds, folds):

    output = folds
   
    for x in range(num_folds):
        output = _new_folds(output) + ['v'] + output
       
    return output

def _new_folds(folds):

    l = folds[:]
    l.reverse()
    output = []

    for x in l:
        if x == 'v':
            output.append('^')
        else:
            output.append('v')

    return output


Sunday 31 March 2013

Entry #10

The last week of lectures are coming up. I just started assignment 3 with my group on the weekend and so far I've understood a bit of it. The only reason I was understanding a bit of it was because in the past few weeks in the lectures I've been sleeping half the time.

The tutorials were a big help for me because I had understood the basics of Big Oh and Big Omega but haven't practiced much problems on it yet. So for question 1 and 2 on the assignment wasn't that hard because of the tutorials. But for the quiz, the placement of the 1/100 confused for for a while, was it part of the f? or was it part of the entire thing? Hopefully I got it right.

Note: HALTS are very confusing @-@

Saturday 23 March 2013

Entry #9

This week in our lectures, Prof. Heap showed us proof of Big Oh with limits and introduced us to limits. I didn't quite understand how the proof of the Big Oh with limits worked but after taking a quick glance in the next assignment I noticed we have to do some questions with this. I had just finished a 3 week long barrage of term tests and essays from my other 3 courses so I guess the stress from that is making me not understand this. Prof. Heap also showed us some interesting proofs of Big Oh.

In tutorials, our T.A. showed us how to do the first Big Oh proof with a different way of getting the c and b values different from what Prof. Heap showed us. I found this way of proof interesting but I found Prof. Heap's way of doing it easier for me than what my T.A. showed me.

Monday 18 March 2013

Entry #8

I did the second term test the other day and I was disappointed at myself when doing it. I understood the first and second question on the test because they were questions of the assignment. But for some reason I blanked out and was confused on what to write on some of the parts of the proof. Hopefully I didn't do bad on the term test.
In the lectures we did some proofs with Big Oh's and I was confused with one of the proofs that Prof. Heap showed us. He had made c = 9/2 and b = 0 in one of the proofs and for the longest time I was trying to figure out why c = 9/2. Maybe I'll ask my T.A. during the next tutorial about this.

Sunday 10 March 2013

Entry #7

The assignment is finally done and the second term test is coming up. While working the assignment I found the proofs to be very challenging. I wasn't 100% sure of what to write for my proofs and sometimes was doubting my partner's answers because I thought your supposed to prove it like "blah". Like in question 3 of the assignment, the statement is false but I had thought it was true because I picked n = 5. So I got the results of 25 mod 11 = 3 and 5 mod 11 = 5. It looked right to me but my partner had to explain it to me thoroughly and used an example of 289 mod 11 = 3 and 17 mod 11 =/= 5 for me to finally get it.

Friday 1 March 2013

Entry #6

I just started working on the assignment with my partners. So far determining if the statement is True or False and the steps to prove some of the questions wasn't that hard. But the structure of some questions is kind of confusing me. For example, is it supposed to be
Case 1: Assume ...
...
...

or

Case1: Assume ...
     ...
     ...
Tutorial really helped me understand some of the stuff we're doing for this assignment because I was way to sleep during class to pay attention.

Tuesday 19 February 2013

Entry #5

We got back our test and assignment marks, I was disappointed of mark due to silly mistakes I made on the test and our group did "good" on the assignment. Apparently I didn't know that the converse of the contra positive is just the converse. Hopefully I can still boost up my mark because of how our grading is set up.
We did some proofs in tutorials, I get the structure of the proofs but I still had problems tackling the proving part of the problem. According to my T.A. in our next tutorial we might be quizzed on proofing so I hope I can do them.