2.2 Reasoning
2.2 Reasoning
[Binary Operations]
Smoking is
addictive.
LOGIC the science of reasoning
Proposition
Examples:
Staying late at
night increases
the risk of brain
cancer.
Proposition
Examples:
Daniel loves
Kathryn.
Where do you
live?
Proposition
Is this a proposition?
Thrice a
number
LOGIC the science of reasoning
Proposition
Is this a proposition?
LISTEN!
Pia is beautiful.
Jung Hae In is
cute.
Proposition
Is this a proposition?
SMART.
LOGIC the science of reasoning
Proposition symbols
Pia is beautiful.
LOGIC p
the science of reasoning
Proposition symbols
LOGIC ~p
the science of reasoning
Proposition symbols
SMART.
p
LOGIC the science of reasoning
Negation symbol
~p
LOGIC
NOT SMART.
the science of reasoning
Negation symbol
~
LOGIC thesame
~ p is the
NOT
Some reference use ¬ to denote negation.
science
asof¬ reasoning
p.
TRUTH TABLE
a tabular
representation of
all the
combinations of
values for inputs
and their
corresponding the science of reasoning
outputs
TRUTH TABLE
p ~p
T F
F T
the science of reasoning
Compound propositions
pq
a proposition
formed by
combining two or
s r
more simple
propositions
LOGIC the science of reasoning
Compound propositions
Examples:
I am a Thomasian.
LOGIC
p
the science of reasoning
Compound propositions
Examples:
q
LOGIC
I enjoy flooded areas.
the science of reasoning
Compound propositions
Examples:
p LOGIC
I am a Thomasian. I enjoy flooded area.
q
the science of reasoning
Connectives
Examples:
and
p LOGIC
I am a Thomasian I enjoy flooded area.
^ q
the science of reasoning
Connectives
Examples:
or
p LOGIC
I am a Thomasian I enjoy flooded area.
v q
the science of reasoning
Connectives
Examples:
If thenI enjoy flooded area.
p LOGIC
I am a Thomasian
q
the science of reasoning
Conjunction
Let p and q be propositions.
The conjunction p and q,
LOGIC
denoted by p ∧ q is the
proposition.
p ∧ q is true if and only if both
the science of reasoning
p and q are true. Otherwise,
false.
Conjunction
p ∧ q is true if and only if both p and q are true. Otherwise,
false.
p q p∧q
T
LOGIC
T T
T F F
F T scienceFof reasoning
the
F F F
Conjunction
Construct the truth table for ~p ∧ q
p
T
LOGIC
q
T
~p ~ p ∧ q
F F
T F F F
the science of reasoning
F T T T
F F T F
Conjunction
Construct the truth table for ~p ∧ ~q
p q ~p ~q ~p ∧ ~q
T
T
T
F
F
F
LOGIC F
T
F
F
F T T F F
the science of reasoning
F F T T T
Conjunction
Construct the truth table for ~(p ∧ q)
p
T
q
T
LOGIC p ∧ q ~(p∧q)
F
T
T F F T
the science of reasoning
F T F T
F F F T
Disjunction
p v q is false if and only if both of p and q is false.
Otherwise, true.
p q pvq
T LOGIC
T T
T F T
F T scienceTof reasoning
the
F F F
Disjunction
Construct the truth table for p v ~q
p q ~q p v ~q
T LOGIC
T F T
T F T T
F T F F
the science of reasoning
F F T T
Disjunction
Construct the truth table for ~p v ~q
p q ~p ~q ~pv~q
T
T
T
F
LOGIC F
F
F
T
F
T
F T T F T
the science of reasoning T
F F T T
Disjunction
Construct the truth table for ~(p v q)
p q p v q ~(p v q)
T
T
T
F
LOGIC T
T
F
F
F T T F
the science of reasoning
F F F T
~p ∧ ~q is exactly
the the same
science as ~(p v q)
of reasoning
~(p ∧ q) is exactly the same
the science as ~p v ~q
of reasoning
De Morgan’s Law
De Morgan’s Law
~p ∧ ~q ≡ ~(p v q)
~p v ~q ≡ ~(p ∧ q)
Exclusive Disjunction
p ⊕ q is true when exactly one of p and q is true.
Otherwise, false.
p q p⊕q
T T F
T F T
F T T
F F F
Exclusive Disjunction
Construct the truth table for ~p ⊕ q
p q ~p ~p ⊕ q
T
T
T
F
LOGIC F
F
T
F
F T T F
the science of reasoning
F F T T
NAND (not and)
p NAND q or p|q is false when both p and q are true.
Otherwise, true.
p
T
LOGIC
q
T
p|q
F
T F T
F Tscience ofTreasoning
the
F F T
NAND (not and)
Construct the truth table for p|~q
p q ~q p|~q
T LOGIC
T F T
T F T F
F T F T
the science of reasoning
F F T T
TRY THIS!
Construct the truth table for ~(p ⊕ ~q) ∧ r
p q ~q (p ⊕ ~q) ~(p ⊕ ~q) r ~(p ⊕ ~q) ∧ r
T T F T F T T
T F T F T T T
F T F F T T T
F F T T F T T
T T F T F F F
T F T F T F T
F T F F the science
T of reasoning
F T
F F T T F F F
TRY THIS!
Construct the truth table for ~(p ⊕ ~q) ∧ r
p q ~q (p ⊕ ~q) ~(p ⊕ ~q) r ~(p ⊕ ~q) ∧ r
T T F T F T T
T F T F T T T
F T F F T T T
F F T T F T T
T T F T F F F
T F T F T F T
F T F F the science
T of reasoning
F T
F F T T F F F
TRY THIS!
Construct the truth table for ~(p ⊕ ~q) ∧ r
p q ~q (p ⊕ ~q) ~(p ⊕ ~q) r ~(p ⊕ ~q) ∧ r
T T F T F T T
T F T F T T T
F T F F T T T
F F T T F T T
T T F T F F F
T F T F T F T
F T F F the science
T of reasoning
F T
F F T T F F F
TRY THIS!
Construct the truth table for ~(p ⊕ ~q) ∧ r
p q ~q (p ⊕ ~q) ~(p ⊕ ~q) r ~(p ⊕ ~q) ∧ r
T T F T F T T
T F T F T T T
F T F F T T T
F F T T F T T
T T F T F F F
T F T F T F T
F T F F the science
T of reasoning
F T
F F T T F F F
TRY THIS!
Construct the truth table for ~(p ⊕ ~q) ∧ r
p q ~q (p ⊕ ~q) ~(p ⊕ ~q) r ~(p ⊕ ~q) ∧ r
T T F T F T F
T F T F T T T
F T F F T T T
F F T T F T F
T T F T F F F
T F T F T F F
F T F F the science
T of reasoning
F F
F F T T F F F
TRY THIS!
Is (p v q) ∧ r ≡ (p ∧ r) v (q ∧ r)?
p q pvq r (p v q) ∧ r p∧r q∧r (p ∧ r) v (q ∧ r)
T T T T T T T T
T F T T T T F T
F T T T T F T T
F F F T F F F F
T T T F F F F F
T F T F F F F F
F T T F F the science
F ofF reasoning F
F F F F F F F F
TRY THIS!
Is (p v q) ∧ r ≡ (p ∧ r) v (q ∧ r)?
p q pvq r (p v q) ∧ r p∧r q∧r (p ∧ r) v (q ∧ r)
T T T T T T T T
T F T T T T F T
F T T T T F T T
F F F T F F F F
T T T F F F F F
T F T F F F F F
F T T F F the science
F ofF reasoning F
F F F F F F F F
TRY THIS!
Is (p v q) ∧ r ≡ (p ∧ r) v (q ∧ r)?
p q pvq r (p v q) ∧ r p∧r q∧r (p ∧ r) v (q ∧ r)
T T T T T T T T
T F T T T T F T
F T T T T F T T
F F F T F F F F
T T T F F F F F
T F T F F F F F
F T T F F the science
F ofF reasoning F
F F F F F F F F
TRY THIS!∧
Is (p v q) r ≡ (p ∧ r) v (q ∧ r)?
p q pvq r (p v q) ∧ r p∧r q∧r (p ∧ r) v (q ∧ r)
T T T T T T T T
T F T T T T F T
F T T T T F T T
F F F T F F F F
T T T F F F F F
T F T F F F F F
F T T F F the science
F ofF reasoning F
F F F F F F F F
TRY THIS!
Is (p v q) ∧ r ≡ (p ∧ r) v (q ∧ r)?
p q pvq r (p v q) ∧ r p∧r q∧r (p ∧ r) v (q ∧ r)
T T T T T T T T
T F T T T T F T
F T T T T F T T
F F F T F F F F
T T T F F F F F
T F T F F F F F
F T T F F the science
F ofF reasoning F
F F F F F F F F
TRY THIS!∧
Is (p v q) r ≡ (p ∧ r) v (q ∧ r)?
p q pvq r (p v q) ∧ r p∧r q∧r (p ∧ r) v (q ∧ r)
T T T T T T T T
T F T T T T F T
F T T T T F T T
F F F T F F F F
T T T F F F F F
T F T F F F F F
F T T F F the science
F ofF reasoning F
F F F F F F F F
LOGIC
CONDITIONAL
STATEMENTS
q
the science of reasoning
Conditional Statement
p→q
p is called the hypothesis,
LOGIC
the premise or the antecedent.
p: I am a K-pop.
q: I understand 사랑해.
the science of reasoning
Conditional Statement
p→q
If p 𝑡ℎ𝑒𝑛 q.
LOGIC
p is sufficient for q.
q if p.
q is necessary for
the science p.
of reasoning
p only if p.
Conditional Statement
p→q
If p 𝑡ℎ𝑒𝑛 q.
LOGIC
q when p.
q follows from p.
the science of reasoning
Conditional Statement
p → q is true on the condition the p holds.
p q p q
T LOGIC
T T
T F F
F T T
the science of reasoning
F F T
Conditional Statement
Construct a truth table for ~p→~q
p q ~p ~q ~p ~q
T T F F T
T F F T T
F T T F F
the science of reasoning
F F T T T
Conditional Statement
Note that:
q → p is the converse of p → q.
~q → ~p is the contrapositive of p → q.
~p → ~q is the inverse of p → q.
the science of reasoning
Bi-conditional Statement
p ↔ q is true when both (p and q) statements are the same.
p q p q
T T T
T F F
F T F
the science of reasoning
F F T
Bi-conditional Statement
Construct a truth table for p ↔ ~q.
p q ~q p ~q
T T F F
T F T T
F T F T
the science of reasoning
F F T F
Exercise:
Construct a truth table for (p ∧ q) → (p → q)
p q p∧q p q (p ∧ q) (p q)
T T T T T
T F F F T
F T F T T
F F F T
Tthe science of reasoning
Types of compound propositions
If a compound proposition is always true, it is called
a tautology.
p: You smoke.
q: You have lung cancer.
the science of reasoning
If you smoke, then you will have lung cancer.
p→q
You have lung cancer.
q
Therefore, you smoke.
the science of reasoning
∴p
p→q q p
T T T T T
T F F F T
F T T T F
F F T F T
the science of reasoning
Is this a valid argument?
If you smoke, then you will have lung cancer.
You have lung cancer.
Therefore, you smoke.
T T T T T T T T
T F F T T F T T
F T T T T T T T
F F T T T T T T
T T T F F F F T
T F F F T F F T
F T T F F F
the science ofTreasoning T
F F T F T T T T
Truth table
[(p → q) ∧ (q → r)] → (p → r)
p q p q r qr [(p q) ∧ (qr)] p r [(p q) ∧ (q r)] (p r)
T T T T T T T T
T F F T T F T T
F T T T T T T T
F F T T T T T T
T T T F F F F T
T F F F T F F T
F T T F F F
the science ofTreasoning T
F F T F T T T T
Truth table
[(p → q) ∧ (q → r)] → (p → r)
p q p q r qr [(p q) ∧ (qr)] p r [(p q) ∧ (q r)] (p r)
T T T T T T T T
T F F T T F T T
F T T T T T T T
F F T T T T T T
T T T F F F F T
T F F F T F F T
F T T F F F
the science ofTreasoning T
F F T F T T T T
Truth table
[(p → q) ∧ (q → r)] → (p → r)
p q p q r qr [(p q) ∧ (qr)] p r [(p q) ∧ (q r)] (p r)
T T T T T T T T
T F F T T F T T
F T T T T T T T
F F T T T T T T
T T T F F F F T
T F F F T F F T
F T T F F F
the science ofTreasoning T
F F T F T T T T
Truth table
[(p → q) ∧ (q → r)] → (p → r)
p q p q r qr [(p q) ∧ (qr)] p r [(p q) ∧ (q r)] (p r)
T T T T T T T T
T F F T T F T T
F T T T T T T T
F F T T T T T T
T T T F F F F T
T F F F T F F T
F T T F F F
the science ofTreasoning T
F F T F T T T T
Truth table
[(p → q) ∧ (q → r)] → (p → r)
p q p q r qr [(p q) ∧ (qr)] p r [(p q) ∧ (q r)] (p r)
T T T T T T T T
T F F T T F T T
F T T T T T T T
F F T T T T T T
T T T F F F F T
T F F F T F F T
F T T F F F
the science ofTreasoning T
F F T F T T T T
Is this a valid argument?
If it rains nonstop, then UST will be flooded.
If is UST is flooded, then there will be
no classes.
It rains nonstop, then there will be no
classes
http://web.stanford.edu/class/cs103/tools/truth-table-tool
http://web.stanford.edu/class/cs103/tools/truth-table-tool
END OF UNIT 2