Monday 25 March 2013

Focus Shift

After big O proof questions, the focus of course shifted from math oriented to programming oriented. We started to learn to determine whether a piece of code would halt or not and I found that pretty hard. Since the code will be in paper in the exam or assignment, we have to use our own imagination instead of debugger and it's quite abstract. I let the program run in my head and count the number of steps and often end up forgetting where I was and restart it again. Guess I will try to keep track of steps in paper.
Additionally, I have learned python for almost a year, but I still don't have a profound understanding. For example, Prof.Heap mentioned what would happen if we write a def inside of a def; also, what about a parameter of a function is the function itself? I couldn't answer those questions because I never even think about it. The way I learn programming is to copy what professors did in lecture. So for some algorithms, if they never show me, I won't think about it at all. Apparently, copying is not the proper way to study computer science. Since things in real life change very fast, only using the algorithm that was shown in lectures would certainly prevent me from being creative.

Monday 11 March 2013

Comment on Comments

Although a2 reached deadline, the argument within our group members just started. We couldn't come to an agreement on where a comment should be provided. We have different opinions on what should be called 'obvious'. Apparently, that's really subjective.
For example,
x > y
Then 2x > 2y
Is it obvious? For me, it's too obvious.
Also, in terms of the proof structure. Such as
Assume x in N
Do we need a comment for that saying 'to introduce for all'? I don't think so since the intended audience should equip that kind of knowledge, otherwise, we should also comment on the indentation of the proof structure because not everyone would find it obvious.
My partner said he was copying the comments on the slides and prof wrote them for every proof. But I think that's because he was introducing proof to all new learners not experienced scholars and my TA didn't write structure comments in tutorial.
Yes, we might solve the conflict by adding comments on every single line. But that's really annoying and ruin the whole style and format (since sometimes we need to start a new line for comment) and also that's ineffective for both readers and writers.
That really bothers me.  

Tuesday 5 March 2013

Last Question of Assignment 2

For the last problem of A2, we have to prove if m >= n, then gcd(m,n) = gcd(n, m-n). I got stuck at first until being inspired by the project of CSC148.

For CSC148, we wrote bunch of methods such as __less_equal__(self, s2), and __equal__(self, s2). For __equal__, the comment says we can just use __less_equal__ by saying (self <= s2 and s2 <= self). That's smart and tricky then I realized a = b is equivalent to  a<= b and b <= a.
Based on what I found above, instead of proving the equation directly, which I found impossible, I can prove it indirectly by proving gcd(m,n) >= gcd(n, m-n) and gcd(m,n) <= gcd(n, m-n).
Here are the steps. Hope that make sense.


 

Sunday 3 March 2013

Feedback on other Slogers

Recently I start to read other slogers posts and they are quite insightful in terms of how they are organized, what slogers think of the course and its content as well as the slogers' passion shown by words.

Here are some impressive ones I digged out.

http://165uoft.blogspot.ca/
Patrick is a passionate sloger whose posts mainly based on feedback of the course. Sometimes, I am getting used to university daily life and start to pay less attention to new knowledge or experience. Anxiety forces me to finish things as fast as possible and only look at the marks instead of knowledge, which makes university experience pointless. Having read Patrick's posts, I realized we sometimes feel things in the same way, but he is the one who has passion to type that down and keep optimistic attitude all the time.

http://captainslog165.wordpress.com/
Captain's Log is also impressive in terms of the amount of posts and the length of each post as well as it's organization.(I will definitely start to categorize my posts.) He builds connections with other courses such as CSC148 or even physics. They are quite insightful and the difficulty he had on proof is exactly the same with mine -- sometimes you lose marks for those steps that are too obvious to notice.

To be honest, I am not that into SLOG, and I often find it hard to keep posting and those Slogers really motivate me in a way by showing their great post and passion.

Thank you guys and thanks for reading.

Monday 25 February 2013

Feedback of Test1

I was confident on my test even after comparing the answers from Prof. Heap but the marks were really lower than I expected and I couldn't figure out why.
Here is some comparison.
QUESTION 1.
(sample solution)

(my solution)
 












 
Since question 5 and 8 are so similar, I put the explanation in the top after '#' to reduce redundant words. (The idea comes from programming). Apart from that, I think my solution is identical with the sample solution. For question 7, my idea was if 'for all' (q2) is satisfied,  then 'there exists'(q3) must be satisfied as well.
I couldn't see the flaw in my logic and that's what confused me the most.

QUESTION 2.
(sample solution)






 
(my solution)






Indeed, I should have stated the connection between Delta and Epsilon precisely as sample solution did. But if I choose Delta = Epsilon(for both of them greater than 1), the statement is also satisfied.
Sometimes, I find explanation is the hardest part in the exam or assignment. I have tried my best to express myself as precise and clear as I could but still lose marks for that.


Wednesday 13 February 2013

The Order of Multiple Quantifiers

Thoughts about switching the order of quantifiers.
For example,  for the statement below:
Can we switch the first two quantifiers?
At first I kept thinking about Calculus and it was really distracting. Then I realized I can simply ignore the implication part and focus on the quantifier itself.
Then I thought whether 'there exists a Delta in natural numbers' is in the front or the second, we are going to pick delta first to evaluate the statement. Therefore, there should be no difference if I switch the first two quantifiers.
However, having discussed with TA, I realized there is a difference and the way he showed me was insightful. He further simplified the questions by giving Delta and Epsilon actual meanings:
Let C be courses, S be students, L(x, y) be x likes y.
Statement1: there exists s in S, for all c in C, L(s, c)
Statement2: for all c in C, there exists s in S, L(s, c)
Are S1, S2 the same? No.
S1 is saying that there is a student likes all courses but S2 means that for all courses there is at least one student likes it (that student need not like all courses).
Problem solved. 

Sunday 27 January 2013

Connections btw Venn Diagram&Truth Table

First three weeks' contents are messing up in my head. I don't really want to clear them out and categorize them based on time because I realized that they are strongly connected.

The first Tutorial Problem Set was mainly about venn diagram. The problems were straightforward and Timo(TA) secretly implied us to draw a third circle or even fourth. I was confused: what was the point of the extra circles? 

However, when Prof.Heap introduced how to rewrite an English sentence into symbolic form and the idea of implication, he drew a venn diagram with three circles! Then I realized venn diagram is also useful for dealing with statements(not just sets) and each circle represents a statement.
So I tried the sentence:
                              for all x in T, D(x)^P(x) => Q(x);
there are three statements D(x), P(x), Q(x). So it is going to have three circles in venn diagram with 8 areas to evaluate.
Surprisingly, when I used the new method Truth Table to evaluate the same sentence, I have the same 8 different situations to evaluate!

Basically, venn diagram and Truth Table can approach the same results and with the number of statements increased, venn diagram is better in terms of space-saving and Truth Table is more straightforward and easier to understand. But both of them really help me have better understanding!