Friday, November 13, 2015

Wednesday, December 3, 2014

Week 12

I've used onto and 1-1 (surjective and injective) in linear algebra when looking at isomorphisms. We looked at a number of bijective transformations in class but didn't really analyze some examples that do not fall into that category. How about the following:

f(x) = |x| will cause both x = +1 and x = -1 to yield f(x) = 1 so it won't be 1-1. Secondly, nothing yields -1 so it's not onto either.
f(x) = sqrt(x) is the opposite of the previous example. Instead of taking 2 numbers and giving the same number, it spits out 2 different numbers from the input of only 1. Say x = 1, then f(x) = -1 and 1.

I think these are the simplest examples I can think of.

Week 11

I heard about Alan Turing previously in cognitive science. We were studying the evolution of computers playing chess, and Alan Turing was one of the first to build a machine to do so. For a computer to beat the top player in the world, it has to be able to computer combinations of moves into the future. Your standard novice game might only look 1-3 moves into the future while the top player was able to look 20 or so moves into the future. Once the computer was strong enough to compute that far into the future, Deep Blue I believe was the first, it was able to beat the top players.

Week 10

L'Hopital's rule was something I learned last year in calculus or maybe in grade 12 calculus. To solve these implications, isolate the constant c on one side of the inequality, then use L'Hopital's rule to take the derivative of the top and bottom. I'm a little unsure of what the actually meaning of Omega is. I understand have to prove it, but just not sure what the practical description of it is. While learning big O, we analyzed the code and counted the worse case. I'm assuming that big Omega bounds the best cases from the bottom. I will have to look into this.

Week 9

In this week, the 3 while loops would have had me initially guessing O(n^3). However, when we looked closer, the loop guards were much smaller than n. But then again, we have to multiply the 3 1/3n rather than adding the 3 1/3n to sum to n of power 1. So initially, I was right, but the picture showing i,j and k split along n made me thing that it was O(n) but I was correct in my first naive approach. Disproving or proving it is not an element is pretty textbook here too. Just use negation and prove that.

Week 8

Although I learned about analyzing Python functions and matching them to their respective big O last year at Queen's, this week reinforced my knowledge on the subject. In the first example this week, we found the worst case to be 3n + 3, however in my last year, we would have just said O(n) instead of diving into specifics. We never dove into proving them though, so this was new to me and wasn't covered in the first year computer science program at Queen's. However, it was a pretty straight forward extension of what we already learned earlier in CSC165... Assume or select the variables, assume the antecedent, prove the consequent by finding the existential variables.

Wednesday, November 19, 2014

Week 6

I already used floor and ceiling a number of times before, so the concept was not new to me, just the formal definition. This week, there was only 2 classes and they were both solving example problems, so there's not too much to talk about. In the proof ∀n ∈ N, n^2 + n is even, I am wondering why it is better to factor it to n(n+1), why can't you just try n as an odd and even in n^2 + n? Here I will do it without factoring. It's obviously not a formal proof, just a confident thought process.

Let our even number = 2
Let our odd number = 1

n^2 + n
Odd n = 1^2 + 1 = 2 = Even

n(n+1)
Even n = 4 + 2 = Even

n*n will always produce an even if it's even and odd if it's odd. Adding 2 odd produces even and adding 2 evens produces even also. It's all evens!