Here are what I learn in week 3...
Conjunction (AND, ∧) noun
“the action or an instance of two or more
events or things occurring at the same point
in time or space.”
To put this in perspective, P(x) ∧ Q(x) means
1)P(x) intercept Q(x)
2)P(x) = True and Q(x) = True
3)The interlocked part of the circles on a Venn Diagram of P(x) and Q(x)
Disjunction (OR, ∨)
"Combine two statements by claiming that at
least one of them is true."
To put this in perspective
1)P(x) union Q(x)
2)P(x) = True, Q(x) = True, or P(x),Q(x) both equal to True
3)Both circles of the Venn Diagram of P(x) and Q(x)
If you want to mean P(x) or Q(x) but not both - that's exclusive-or!
Negation (NOT, ¬)
NOTHING fancy about it, get it?
Literally mean NOT
BUT, you can move a negation further into a bracket by changed the universal quantifier into existential quantifier and vice versa
example:
1)NOT(all Koreans are good at playing League of Legends) = there exist a Korean who is NOT good at playing league of Legends
2)NOT(there exist a chicken who loves eating dog) = all chicken NOT love eating dog.
Parenthesis
1) they are important - you basically need them for every connectives you have (conjunction, disjunction, implication, etc)
2) what happens in the parenthesis stays in the parenthesis (you are have two xs in two parenthesis and they won't mean the same thing)
Truth Table
"Enumerate the outputs over all possible
combinations of input values of P, Q" - and how many other variables you have.
In this case
Input = either True or False
P, Q... are all predicates
You draw a table, where your predicates are in the first few columns, and the predicate logic you want to check are in the following columns.
Now base on the combination of True and False of your variables, you check whether the predicate logic involving those variable are True or False.
It has as many rows are 2 to the power of the number of predicates you have.
1) If a column is all True, then the predicate logic is a tautology
2) If a column is all False, then the predicate logic is unsatisfiable
3) Otherwise, it is satisfiable
4) If two column have the same truth values, then they are equivalent
De Morgan's law
Basically, if you have a negation of a conjunction, NOT(P AND Q)
it can be turn into NOT(P) OR NOT(Q)
similarly NOT(P OR Q) is equivalent to NOT(P) AND NOT(Q)
*Note, you just break the bracket, apply negation to both elements, and change AND to OR
Laws
*For a full list of laws to be used in CSC165,
read Chapter 2.17 of Course Notes
But for those who want to know some
Conjunction and disjunction have the following laws
1) commutative - P AND/OR Q is equivalent to Q AND/OR P
2) associative - where put the bracket is not important for the same sign
3) distributive - P AND (Q OR R) is equivalent to (P AND Q) OR (P AND R)
4) identity - P AND NOT(P) is False, P OR NOT(P) is True
5) idempotent - P OR P, P AND P are equivalent to P
This is all from week 3.............. a little shorter than last week?
Thursday, September 25, 2014
Week 2
Ok, to actually make use of this blog thing, I will make it into my review notes, starting..... now!
From last week we learned ...
Universal quantifier: ∀, “for all” (∀x means - for all x) literally
Existential quantifier: ∃, “there exist"(∃x means - there exist a x) literally
Hence....
NOT ∀x means not all x, and
NOT ∃x means there exist no x.
Quantifiers are followed by predicates (P,Q,R,P(x),Q(x),R(x)) or conditional (P IMPLIES Q), so they makes sense this this way...
∀x, P - for all x, P is true
∃x, (P IMPLIES Q) - there exist a x, where (P IMPLIES Q) is true
This week.... Visualization with Venn Diagram
Venn Diagram, invented by Venn, is (for now) two interlocked circle within a big rectangle.
The rectangle symbolizes the background set, all the elements required by the predicates and more.
Each circle represents a predicate.
The interlocked area represent where both predicates are true.
Hence, we can use the Venn diagram to represent relations between any two predicates EASILY!
Say X mean false, O mean true, P and Q are predicates, z are background data.
X in P means no z JUST in P, it could be in both P and Q though
O in P means there exist z in P
X in the interlocked area means no z is in both P and Q
O in the interlocked area means there exist z in both P and Q
Now about set relations
1) set can be empty - null
2) A union B - A, A and B, B
3) A intercept B - A and B
4) A is a subset of B - all x in A are also in B
5) A is not a subset of B - there exist some x in A that are not in B
6) NOT A - B, other xs
Differences between sentences and statement - statement is a quantifiable sentence, thus can be evaluated to be true or false. Questions are obviously not statements.
Predicates are symbolized statements - P(x) = x wants to be my friend, for example
We can quantify predicates with quantifiers - ∀x, P(x) = everyone wants to be my friend, you see?
Now we are ready for implication
If P, then Q is the same sentence as P IMPLIES Q. P is the antecedent, Q is the consequent
But here the trick is , for P IMPLIES Q to be true, we just need to not prove it false.
The only way to prove it false is when P is True yet Q is False.
In all other cases, P IMPLIES Q is considered true.
Furthermore, just because P IMPLIES Q, does NOT mean Q IMPLIES P, i.e. the converse of P IMPLIES Q is not true. (NOT Q IMPLIES NOT P is true though, this is called the contrapositive)
Simple example.
If I love you, then I will make you breakfast.
This also means - If I don't make you breakfast, I don't love you.
But this doesn't mean - if I make you breakfast, then I love you. That's absurd! See?
Now, vacuous truth...
Remember how I said "for P IMPLIES Q to be true, we just need to not prove it false.
The only way to prove it false is when P is True yet Q is False"
Thus when P is never gonna be True, the statement P IMPLIES Q is vacuously True!
Equivalence! is equivalent to - if and only if
Before we go that far, let's look at what only if means - only if P, then Q
This means 1) P is the only condition where Q is True, which means 2) if Q is true, P must also be true
e.g. Q IMPLIES P
Hence only if is the reverse implication of if!
If P then Q - P IMPLIES Q (P is the sufficient condition for Q)
Only if P then Q - Q IMPLIES P (P is necessary condition for Q, not necessarily sufficient!)
*Quick Note:
Q if P = If P then Q,
Q only if P = Only if P then Q.
Now, what's If and only if P then Q?
P IMPLIES Q and Q IMPLIES P, hence it is P = Q in predicate logic sense
Something weird...
If both P and Q are always False, in the same way as before, we can't prove - that when P is True, Q is not, NOR when Q is True, P is not. Hence P if and only if Q is considered true!
This is all from week 2........................................Finally'
From last week we learned ...
Universal quantifier: ∀, “for all” (∀x means - for all x) literally
Existential quantifier: ∃, “there exist"(∃x means - there exist a x) literally
Hence....
NOT ∀x means not all x, and
NOT ∃x means there exist no x.
Quantifiers are followed by predicates (P,Q,R,P(x),Q(x),R(x)) or conditional (P IMPLIES Q), so they makes sense this this way...
∀x, P - for all x, P is true
∃x, (P IMPLIES Q) - there exist a x, where (P IMPLIES Q) is true
This week.... Visualization with Venn Diagram
Venn Diagram, invented by Venn, is (for now) two interlocked circle within a big rectangle.
The rectangle symbolizes the background set, all the elements required by the predicates and more.
Each circle represents a predicate.
The interlocked area represent where both predicates are true.
Hence, we can use the Venn diagram to represent relations between any two predicates EASILY!
Say X mean false, O mean true, P and Q are predicates, z are background data.
X in P means no z JUST in P, it could be in both P and Q though
O in P means there exist z in P
X in the interlocked area means no z is in both P and Q
O in the interlocked area means there exist z in both P and Q
Now about set relations
1) set can be empty - null
2) A union B - A, A and B, B
3) A intercept B - A and B
4) A is a subset of B - all x in A are also in B
5) A is not a subset of B - there exist some x in A that are not in B
6) NOT A - B, other xs
Differences between sentences and statement - statement is a quantifiable sentence, thus can be evaluated to be true or false. Questions are obviously not statements.
Predicates are symbolized statements - P(x) = x wants to be my friend, for example
We can quantify predicates with quantifiers - ∀x, P(x) = everyone wants to be my friend, you see?
Now we are ready for implication
If P, then Q is the same sentence as P IMPLIES Q. P is the antecedent, Q is the consequent
But here the trick is , for P IMPLIES Q to be true, we just need to not prove it false.
The only way to prove it false is when P is True yet Q is False.
In all other cases, P IMPLIES Q is considered true.
Furthermore, just because P IMPLIES Q, does NOT mean Q IMPLIES P, i.e. the converse of P IMPLIES Q is not true. (NOT Q IMPLIES NOT P is true though, this is called the contrapositive)
Simple example.
If I love you, then I will make you breakfast.
This also means - If I don't make you breakfast, I don't love you.
But this doesn't mean - if I make you breakfast, then I love you. That's absurd! See?
Now, vacuous truth...
Remember how I said "for P IMPLIES Q to be true, we just need to not prove it false.
The only way to prove it false is when P is True yet Q is False"
Thus when P is never gonna be True, the statement P IMPLIES Q is vacuously True!
Equivalence! is equivalent to - if and only if
Before we go that far, let's look at what only if means - only if P, then Q
This means 1) P is the only condition where Q is True, which means 2) if Q is true, P must also be true
e.g. Q IMPLIES P
Hence only if is the reverse implication of if!
If P then Q - P IMPLIES Q (P is the sufficient condition for Q)
Only if P then Q - Q IMPLIES P (P is necessary condition for Q, not necessarily sufficient!)
*Quick Note:
Q if P = If P then Q,
Q only if P = Only if P then Q.
Now, what's If and only if P then Q?
P IMPLIES Q and Q IMPLIES P, hence it is P = Q in predicate logic sense
Something weird...
If both P and Q are always False, in the same way as before, we can't prove - that when P is True, Q is not, NOR when Q is True, P is not. Hence P if and only if Q is considered true!
This is all from week 2........................................Finally'
Sunday, September 14, 2014
Week1 Standard Format
{ what's something new you learned this week in class?
Really want to answer honestly ~ nothing, because CSC240 ruined my life.
But hence I also know the point of this, I would say that I learn
1. CSC165 is the base of all math for computer science, which is the base of mostly everything else in computer science
2. We need to be interested in the course to do well
3. Computer code needs to be super precise
4. How to solve a problem
understand - plan - carry - review
5. Universal quantifier (For All) and existential quantifier (There Exist)
{ what's something you enjoyed this week in class?
The professor is REALLY funny, because he uses memes correctly
Which IS really important for me because that's how I can sit through a 3 hours long class starting at 6pm on a Tuesday night
{ what's something that challenged or frustrated you this week?
NOthing, I am God (jk, 240 ruined my life)
{ how confident do you feel about material covered this week?
VERY
{ how does course material relate to other classes or interests?
I love logic, philosophy for the win, PHL245.
{ what was one of your achievements this week
Met a new friend, his name is Sue Yong, like he is gonna sue me, if I call him So Yong
{ how did your tutorial/test/assignment go this week?
Didn't happen, sorry, nothing interesting here to say.
A math problem...
John is twenty years younger than Amy, and in
five years' time he will be half her age.
What is John's age now?
ANSWER: 15
LOGIC: 2x+20+10=2x+30=3y, x+5=y, hence, x = 15, y = 20
Another math problem...
Let A, B, and C be three statements.
The statement “A being true implying B being true implies C being true” is true if and only if either A is true and B is false or C is true.
Is it true?
(A -> B -> C) <-> A and NOT(B) or C
ANSWER: FALSE
LOGIC: if A is true and B is false, then A being true implying B being true is false also
Really want to answer honestly ~ nothing, because CSC240 ruined my life.
But hence I also know the point of this, I would say that I learn
1. CSC165 is the base of all math for computer science, which is the base of mostly everything else in computer science
2. We need to be interested in the course to do well
3. Computer code needs to be super precise
4. How to solve a problem
understand - plan - carry - review
5. Universal quantifier (For All) and existential quantifier (There Exist)
{ what's something you enjoyed this week in class?
The professor is REALLY funny, because he uses memes correctly
Which IS really important for me because that's how I can sit through a 3 hours long class starting at 6pm on a Tuesday night
{ what's something that challenged or frustrated you this week?
NOthing, I am God (jk, 240 ruined my life)
{ how confident do you feel about material covered this week?
VERY
{ how does course material relate to other classes or interests?
I love logic, philosophy for the win, PHL245.
{ what was one of your achievements this week
Met a new friend, his name is Sue Yong, like he is gonna sue me, if I call him So Yong
{ how did your tutorial/test/assignment go this week?
Didn't happen, sorry, nothing interesting here to say.
A math problem...
John is twenty years younger than Amy, and in
five years' time he will be half her age.
What is John's age now?
ANSWER: 15
LOGIC: 2x+20+10=2x+30=3y, x+5=y, hence, x = 15, y = 20
Another math problem...
Let A, B, and C be three statements.
The statement “A being true implying B being true implies C being true” is true if and only if either A is true and B is false or C is true.
Is it true?
(A -> B -> C) <-> A and NOT(B) or C
ANSWER: FALSE
LOGIC: if A is true and B is false, then A being true implying B being true is false also
Subscribe to:
Posts (Atom)