Friday, September 19, 2014

week2


                                                            CSC165H1 week 2

In this week, we mainly focused on quantifiers, sentences and logical connectives.During this week, the core concept was logic. understanding of logic is usefel for finding out the structure of the sentences which would be favouirng studying for the lecture material of this week.
When the big idea of logic was introduced in lecture, I was confused since it required lots of analysis and understanding of the sentence structure.After the structure was understood, the elements in the set can then be found. After some practices and examples, I was able to understand the logic better, which is quite excited to me since it was the frist difficulty in my campus study xperience. I enjoyed the process to solve the problem a lot.
There are some examples which help a lot:
1 def q0(S1,S2):
    return not all({x in S2 for x in S1})
2 def q1(S1,S2):
   return any({x in S2 for x in S1})
In example 1 if there is any element in S2 not in S1, the statement is true, otherwise it is false. In example 2 if there is any element in S2 containing in S1, the statement is true, if all the elements in S2 are different from S1, the statement is false.