Saturday, November 29, 2014

Last Assignment!

Is it really time for Assignment 3 again?

I'm in the middle of trying to prove number 3, but I feel like it's too simple.
Is it a trick question?

I have to prove that 2^n < 3^n .
It's obviously true, but just stating that it's true (since I cannot think of any way to mathematically prove that it's true) is probably not the right way to justify it.

Update: I'll probably have to look up some ways to prove it by mathematical induction.

Saturday, November 22, 2014

Big Os and Omegas

What is the meaning of these?
It assesses the running time of a program?
I'm thinking we have to graph a function showing the running time, and then we have to estimate approximately how long it will take for the code to execute.

I'm just unsure of what c and B mean.
I know B is the breakpoint and c is the constant that is multiplied with the consequent of the definition of big O, but I'm not sure what it represents when translated graphically (which is how I'm attempting to define it, since that was what we were shown in tutorial.).
At some breakpoint B, it holds true that the consequent function will be greater than the function in the antecedent?
And they are actually the same functions except the consequent is multiplied by some constant?

Sunday, November 9, 2014

A2

Proving the converse of number 2 on the second assignment, I had to find an example of m and n so that it satisfies the conjunction statement of the proof, and then I had to prove that for all k's that the proof holds true. Halfway through the proof, I thought that I had not proved that the proof holds true for all k's, but just for the k's that depends on the existential quantifier associated with the m and n.

But then I remembered that the order of the quantifiers matter.
All the k's were supposed to be dependent on the numbers I chose for m and n.

Tuesday, November 4, 2014

Quiz week of Nov 3

Just came back from writing the quiz.

Halfway through the explanations of sum_up, I realized I read the code wrong.
And then time ran out.

So I realized that sum_up(2) = 3
but I put 2.

I'm a little disappointed in myself, but at least I know what I did wrong?
Instead of moving up to the inner while loop, I went back to the line that assigns j to i
So that's why I got the wrong answer.

So the general formula was supposed to be
s = n + (n-1) + (n-2)

i.e. s = n(n+1) / 2

I hope it doesn't affect my mark too much.
Now I'm getting even more disappointed in myself.

I'm feeling a lot like Liz Lemon right now:



Should have spent more time thinking about the code.