Thursday, September 18, 2014

SLOG first 2 weeks in CSC165

During the first week, we reviewed on sets and some basic logic questions.
   We learned the definition of a "subset" and "empty set".
   A subset is:
 set the members of which are all members of some given class:A is a subset of B is usually written A⊆B
  An empty set is a subset of every set.
  We learned about vine diagrams:
  









  As the picture shows, circle B and C are 2 sets, section A is the subset of set B and set C. A is also referred as the intersection of set B and C. That means the item in section A exists in both set B and C. Section D is the universe.

  We also had some python questions:

def qo(S1, S2):
    ''' (set, set) -> bool
    '''
    return any({x in S2 for x in S1})

this function returns true if there is any item in S2 is in S1.
   Converting a function into a English sentence is quite interesting for me, but also pretty hard.

   During the tutorial this week we practiced some exercise about these basic logic problems. I figured that some English problems are tricky, such as question 1 in exercise #1:
  Some of the three python programs don't pass all three test units.
  This means that there is at least one program failed at least one test. To make this statement false, we should have all three functions pass all three test.
  Rephrase those sentences to a easier way to say can help us understand it, it's kind of tricky but also interesting to do so.


Symbols!!


∈ b : means that set a is a subset of set b(a is  element of b)

\notin \!\, b : means a is not a subset of b(a is not element of b)
      
\neg \!\, : negation, \neg \!\, A is true if only if A is false.

\forall \!\, : means for all

\exists \!\, : means there exists

Implication:
f(x) => g(x)
if f(x) then g(x)

Converse:
g(x) => f(x)
if g(x) then f(x)

Contrapositive:
\neg \!\,f(x) => g(x)
if not f(x) then not g(x)

Overall:
I learned many things about logic, it's been a very interesting start for this course. I'm sure I will be doing well in this useful course. Of course there are some problems that is confusing me, I will work on thinking about those questions in a good efficient logic, and I will conquer those problems!!




                                                                Haonan Gong