Professional Documents
Culture Documents
Pro
Pro
Pro
1
Logic and Proofs
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
2
1 - Translating from Natural Languages
EXAMPLE. Translate the following sentence into a logical expression:
"I met my ex-girlfriend today and either she grew taller or I got shorter." p = "I met my ex-girlfriend today."
q = "She grew tailer."
r = "I got shorter."
p/\(qVr)
P /\ q V r would mean something else:
"I got shorter or I met my ex-girlfriend today and she grew taller"
p /\ (q EB r) would also mean something else ...
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
3
EXAMPLE. Translate the following sentence into a logical expression:
"You get an A only if you score at least 50% on the midterm or you submit a
HW."
p = "You get an A."
q = "You score at least 50% on the midterm." r = "You submit a HW."
p-+(qVr)
(q V r) -+ p would mean something else:
"You get an A if you score at least 50% on the midterm or you submit a HW."
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
4
2 - Solving Puzzles using Propositional Logic
EXAMPLE. An island has two types of inhabitants: knights, who always tell the truth, and knaves, who always lie. You meet two people from this island: Alice and Bob. Alice says "Bob is a knight" and Bob says "The two of us are opposite types."
Let p= "Alice is a knight." Let q= "Bob is a knight."
Alice said q and Bob said p EB q.
Island Rule: Alice is a knight iff what she said is true and Bob is a knight iff what he said
is true. (p ~ q) /\ (q ~ (p EB q))
'p= "Alice is a knave."
=o- "Bob is a knave."
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
5
Let p= "Alice is a knight." Let u= "Bob is a knight." Alice said q and Bob said p EB q.
Island Rule: Alice is a knight iff what she said is true and Bob is a knight iff what he said
is true. (p +--+ q) 1\ (q +--+ (p EB q))
,p= "Alice is a knave." ,q= "Bob is a knave."
Alice said Bob said Island rule
p q ,p ,q pEBq (p +--+ q) 1\ (q +--+ (p EB q) )
T T F F F F
T F F T T F
F T T F T F
F F T T F T Hence, Both Alice and Bob are knaves.
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
6
3 - Tautology and Contradiction
A compound statetement that is always true is called a tautology.
A compound statetement that is always false is called a contradiction.
A compound proposition that is neither a tautology nor a contradiction is called a contingency
TABLE 1 Examples of a Tautology and a
Contradiction.
p 'P' P V·.· P A ,p
.p
T F T F
F T T F COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
7
4 - Equivalence
The compound propositions p and q are called logically equivalent, denoted by p q, if
P +---+ q is a tautology.
Remark: The symbol is not a logical connective and p q is not a compound
proposition but rather is the statement that p +---+ q is a tautology.
Use truth tables to determine logical equivalences. Two compound propositions are equivalent if their columns in the truth table are the same.
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
8
5 - Proving De Morgan Laws
TABLE 31 'fiutlit Tables for 9{P Vq) aud """'p /\9q.
P q P Vq ~(p V q) "9p 9q ~pl\9q
T T T f F f F
T F T r F T F
F T T f T F F
F F f T T T T EXAMPLE. State the negation of "I am a doctor or a lawyer."
"I am not a doctor and I am not a lawyer."
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
9
TABLE 2 De Morgan's Laws.
!(p 1\ q) ! P VI q !(p V q) ! P 1\-, q
EXAMPLE. State the negation of "She is rich and beautiful."
"She is either not rich or not beautiful."
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
10
6 - Equivalence Example
p q -,p =rv « p----+q
T T F T T
T F F F f
F T T T T
F F T T T EXAMPLE. "If you are a freshman you can get a free ticket"
"Either you are not a freshman or you can get a free ticket."
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
11
7 - Distributive Law
p V (q /\ r) (p V q) /\ (p V r)
p /\ (q V r) (p /\ q) V (p /\ r)
TABLE·:5 A D~mons,mra.ti.ou That Jl V ~q 1\ f) lind (1' V q) .1\ (p V 1') Are Lo,gicaUy Equivalent.
p 1I r' qlv p V (q 1\ r) P V li p V II (pVq)!\(pYr)
T T T "I T T T T
T T F F T T T T
r F T F T T I' T
T F f .F T T r T
r T T T T T l' T
f' T F F F T F F
r F T 'F F F T F
f F f F F F F F COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
12
Equivalence Name
p/\ T p Identity Laws
pV F P
pVT T Domination Laws
p/\F F
pVp P Idempotent Laws
p /\p P
-{--,p) P Double Negation Law
pVq qVp Commutative Laws
p/\q q/\p COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
13
I Equivalence
Name
pV(qVr) (pVq)Vr Associative Laws
p/\(q/\r) (p/\q)/\r
p V (q /\ r) (p V q) /\ (p V r) Distributive Laws
p /\ (q V r) (p /\ q) V (p /\ r)
-, (p V q) -'p /\ -, q De Morgan Laws
-, (p /\ q) =» V -, q
p V (p /\ q) P Absorption Laws
p/\(pVq) p
pV-,p T Negation Laws
p /\ -'p F COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
14
TABLE 7 Logical Equivalences Involving Conditional Statements.
p----4q_----.pVq
pVq ,p-+q
P A q -, (p -+, q) -{p -~ q) _ pAc-; q
(p~ q) 1\ (p ~ r) - p .~ (q ;\ r) (p -+ r) A (q ---* r). (p V q) ---* r (p -+ q) V (p -+ r) p ---* (q V r) (p -+ r) V (q -+ r) - (p A q) -+ r
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
15
p+:« (p--+q)l\(q--+p)
TABLE 8 Logical
Eq uivalences Involving Biconditionals.
p ~ q ---, p ~---, q
p ~ q (p 1\ q) V (---, P 1\ ---, q)
---'(p +--+ q) P ~---, q
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
16
8 - Constructing new equivalences
EXAMPLE. Show that ---, (p ----+ q) and p 1\ ---'q are logically equivalent.
---,(---,p V q) (See page 10 of these slides)
---, ( ---,p) 1\ ---'q (De Morgan's Law)
(Double negation)
COT31 00: Applications of Discrete Structures
COT31 00: Propositional Equivalences
17
9 - Proving a Tautology
EXAMPLE. Show that (p /\ q) -----+ (p V q) is a tautology.
(p /\ q) -----+ (p V q)
,(p /\ q) V (p V q)
(See page 10 of these slides)
(,p V ,q) V (p V q) (De Morgan's Law)
( 'p V 'q V p) V q (Associative Law)
(,p V p V ,q) V q (Commutative Law)
( 'p V p) V (,q V q) (Associative Law)
T V T (Negation Law)
T
COT31 00: Applications of Discrete Structures