Slides

L02 - And/or/not, Conditional Statements
CSci/Math 2112
08 May 2015
1/9
Pop Quiz!
Don’t forget to put your name on your quiz!
Question 1
Which of the following sentences is a statement?
(a) Every even number is divisible by 2.
(b) Add 5 to both sides.
2/9
Pop Quiz!
Don’t forget to put your name on your quiz!
Question 1
Which of the following sentences is a statement?
(a) Every even number is divisible by 2.
(b) Add 5 to both sides.
Question 2
Find {1, 2, 3} ∪ {1, 3, 4} ∪ {a, b, c}.
2/9
Statements & Open Sentences
Example 1
Which of the following sentences are statements and/or open
sentences?
3/9
Statements & Open Sentences
Example 1
Which of the following sentences are statements and/or open
sentences?
(a) sin(x) = 1
3/9
Statements & Open Sentences
Example 1
Which of the following sentences are statements and/or open
sentences?
(a) sin(x) = 1
(b) sin π2 = 1
3/9
Statements & Open Sentences
Example 1
Which of the following sentences are statements and/or open
sentences?
(a) sin(x) = 1
(b) sin π2 = 1
(c) sin(x)
3/9
And, Or, Xor, Not, Implications
I
And (∧) is similar to an intersection (∩) (both statements
need to be true)
I
Or (∨) is similar to a union (∪) (it is enough for one
statement to be true)
I
Xor (⊕) is similar to (A ∪ B) − (A ∩ B) (exactly one of the
statements has to be true)
I
Not (∼ or ¬) is similar to a complement (the opposite needs
to be true)
I
Implication (⇒) is like a subset (the first cannot be true
without the second)
4/9
Statements
Example 2
For each of the following sentences, decide what the statements P
and Q are, then write the sentence symbolically as P ∧ Q, P ∨ Q,
P ⊕ Q, ∼ P, P ⇒ Q, or a combination thereof.
5/9
Statements
Example 2
For each of the following sentences, decide what the statements P
and Q are, then write the sentence symbolically as P ∧ Q, P ∨ Q,
P ⊕ Q, ∼ P, P ⇒ Q, or a combination thereof.
(a) I like reading and playing games.
5/9
Statements
Example 2
For each of the following sentences, decide what the statements P
and Q are, then write the sentence symbolically as P ∧ Q, P ∨ Q,
P ⊕ Q, ∼ P, P ⇒ Q, or a combination thereof.
(a) I like reading and playing games.
(b) x ∈ (A ∪ B) − (A ∩ B)
5/9
Statements
Example 2
For each of the following sentences, decide what the statements P
and Q are, then write the sentence symbolically as P ∧ Q, P ∨ Q,
P ⊕ Q, ∼ P, P ⇒ Q, or a combination thereof.
(a) I like reading and playing games.
(b) x ∈ (A ∪ B) − (A ∩ B)
(c) If your final grade is less than 50%, you will fail this course.
5/9
Statements
Example 2
For each of the following sentences, decide what the statements P
and Q are, then write the sentence symbolically as P ∧ Q, P ∨ Q,
P ⊕ Q, ∼ P, P ⇒ Q, or a combination thereof.
(a) I like reading and playing games.
(b) x ∈ (A ∪ B) − (A ∩ B)
(c) If your final grade is less than 50%, you will fail this course.
(d) If Pearl was in the ballroom, then so was Venom.
5/9
Statements
Example 2
For each of the following sentences, decide what the statements P
and Q are, then write the sentence symbolically as P ∧ Q, P ∨ Q,
P ⊕ Q, ∼ P, P ⇒ Q, or a combination thereof.
(a) I like reading and playing games.
(b) x ∈ (A ∪ B) − (A ∩ B)
(c) If your final grade is less than 50%, you will fail this course.
(d) If Pearl was in the ballroom, then so was Venom.
(e) Either Pearl or Bob was in the ballroom.
5/9
Statements
Example 3
Find a sentence which is of the following form:
6/9
Statements
Example 3
Find a sentence which is of the following form:
(a) P ∨ Q
6/9
Statements
Example 3
Find a sentence which is of the following form:
(a) P ∨ Q
(b) (P ∧ Q) ⇒ R
6/9
Statements
Example 3
Find a sentence which is of the following form:
(a) P ∨ Q
(b) (P ∧ Q) ⇒ R
(c) P ⇒ (Q ∨ R)
6/9
Statements
Example 3
Find a sentence which is of the following form:
(a) P ∨ Q
(b) (P ∧ Q) ⇒ R
(c) P ⇒ (Q ∨ R)
(d) P ∧ (Q ⊕ R)
6/9
Statements and Sets
Example 4
Some statements (and open sentences) can be thought of in set
theory terms (and conversely).
7/9
Statements and Sets
Example 4
Some statements (and open sentences) can be thought of in set
theory terms (and conversely).
(a) The integer x is divisible by 2 and by 3.
7/9
Statements and Sets
Example 4
Some statements (and open sentences) can be thought of in set
theory terms (and conversely).
(a) The integer x is divisible by 2 and by 3.
I
x ∈ {2n | n ∈ Z} ∩ {3m | m ∈ Z}
7/9
Statements and Sets
Example 4
Some statements (and open sentences) can be thought of in set
theory terms (and conversely).
(a) The integer x is divisible by 2 and by 3.
I
x ∈ {2n | n ∈ Z} ∩ {3m | m ∈ Z}
(b) The integer x is not even.
7/9
Statements and Sets
Example 4
Some statements (and open sentences) can be thought of in set
theory terms (and conversely).
(a) The integer x is divisible by 2 and by 3.
I
x ∈ {2n | n ∈ Z} ∩ {3m | m ∈ Z}
(b) The integer x is not even.
I
x ∈ {2n | n ∈ Z}
7/9
Statements and Sets
Example 4
Some statements (and open sentences) can be thought of in set
theory terms (and conversely).
(a) The integer x is divisible by 2 and by 3.
I
x ∈ {2n | n ∈ Z} ∩ {3m | m ∈ Z}
(b) The integer x is not even.
I
x ∈ {2n | n ∈ Z}
(c) If a number is divisible by 6, then it is even.
7/9
Statements and Sets
Example 4
Some statements (and open sentences) can be thought of in set
theory terms (and conversely).
(a) The integer x is divisible by 2 and by 3.
I
x ∈ {2n | n ∈ Z} ∩ {3m | m ∈ Z}
(b) The integer x is not even.
I
x ∈ {2n | n ∈ Z}
(c) If a number is divisible by 6, then it is even.
I
{6n | n ∈ Z} ⊆ {2n | n ∈ Z}
7/9
Necessary and Sufficient
If we have the statement P ⇒ Q, then:
I
P is a sufficient condition for Q (if P is true, then so is Q).
8/9
Necessary and Sufficient
If we have the statement P ⇒ Q, then:
I
P is a sufficient condition for Q (if P is true, then so is Q).
I
Q is a necessary condition for P (P cannot be true without Q
being true).
8/9
Tautology and Contradiction
I
A tautology is a proposition which is always true, no matter
what value the statement variables take. (The constant
boolean function 1).
9/9
Tautology and Contradiction
I
A tautology is a proposition which is always true, no matter
what value the statement variables take. (The constant
boolean function 1).
I
A contradiction is a proposition which is always false, no
matter what values the statement variables take. (The
constant boolean function 0).
9/9
Tautology and Contradiction
I
A tautology is a proposition which is always true, no matter
what value the statement variables take. (The constant
boolean function 1).
I
A contradiction is a proposition which is always false, no
matter what values the statement variables take. (The
constant boolean function 0).
Example 5
Check using a truth table whether the following are a tautology, a
contradiction, or neither:
9/9
Tautology and Contradiction
I
A tautology is a proposition which is always true, no matter
what value the statement variables take. (The constant
boolean function 1).
I
A contradiction is a proposition which is always false, no
matter what values the statement variables take. (The
constant boolean function 0).
Example 5
Check using a truth table whether the following are a tautology, a
contradiction, or neither:
(a) A∨ ∼ A
9/9
Tautology and Contradiction
I
A tautology is a proposition which is always true, no matter
what value the statement variables take. (The constant
boolean function 1).
I
A contradiction is a proposition which is always false, no
matter what values the statement variables take. (The
constant boolean function 0).
Example 5
Check using a truth table whether the following are a tautology, a
contradiction, or neither:
(a) A∨ ∼ A
(b) A∧ ∼ A
9/9
Tautology and Contradiction
I
A tautology is a proposition which is always true, no matter
what value the statement variables take. (The constant
boolean function 1).
I
A contradiction is a proposition which is always false, no
matter what values the statement variables take. (The
constant boolean function 0).
Example 5
Check using a truth table whether the following are a tautology, a
contradiction, or neither:
(a) A∨ ∼ A
(b) A∧ ∼ A
(c) (P ∨ Q)∧ ∼ (P ∧ Q)
9/9
Tautology and Contradiction
I
A tautology is a proposition which is always true, no matter
what value the statement variables take. (The constant
boolean function 1).
I
A contradiction is a proposition which is always false, no
matter what values the statement variables take. (The
constant boolean function 0).
Example 5
Check using a truth table whether the following are a tautology, a
contradiction, or neither:
(a) A∨ ∼ A
(b) A∧ ∼ A
(c) (P ∨ Q)∧ ∼ (P ∧ Q)
(d) (P∧ ∼ Q) ∨ (∼ P ∧ Q) ∨ (P ∧ Q)∨ ∼ (P ∨ Q)
9/9