1 3PropositionalEquivalences
1 3PropositionalEquivalences
• Logical Equivalence
• Important Logical Equivalences
• Showing Logical Equivalence
• Propositional Satisfiability
• Sudoku Puzzle
3
Tautologies, Contradictions, and
Contingencies
• A tautology is a proposition which is always
true. Example: p ∨ ¬p
• A contradiction is a proposition which is
always false. Example: p ∧ ¬p
• A contingency is a proposition which is
neither a tautology nor a contradiction
Example: p p ¬p p ∨ ¬p p ∧ ¬p
F T T F
T F T F
4
Logically Equivalent
• Two compound propositions r and s are
logically equivalent if r ↔ s is a
tautology.
• Denoted by r ⇔ s or as r ≡ s
where r and s are compound propositions.
• In other words, two compound propositions
r and s are equivalent if and only if the
columns in a truth table giving their truth
values agree.
5
Logically Equivalent
• The following truth table shows r : ¬p ∨ q is
equivalent to s: p → q. (and s is Equivalent to r)
r= s=
p q ¬p ¬p ∨ q p → q r ↔ s
F F T T T T
F T T T T T
T F F F F T So r ≡ s
T T F T T T (r ⇔ s )
6
De Morgan’s Laws
¬(p ∧ q) ≡ ¬p ∨ ¬q ¬p ∨ ¬q ≡ ¬(p ∧ q)
¬(p ∨ q) ≡ ¬p ∧ ¬q ¬p ∧ ¬q ≡ ¬(p ∨ q)
This truth table shows that De Morgan’s Second Law holds.
p q ¬p ¬q (p ∨q) ¬(p ∨q) ¬p ∧¬q
F F T T F T T
F T T F T F F
T F F T T F F
T T F F T F F
7
¬p ∨ q ≡ p → q p ∧ ¬q ≡ ¬(p → q)
¬q → ¬p ≡ p → q p → (q ∧ r) ≡ (p → q) ∧ (p → r)
¬p → q ≡ p ∨ q p → (q ∨ r) ≡ (p → q) ∨ (p → r)
¬(p → ¬q) ≡ p ∧ q (p ∨ q) → r ≡ (p → r) ∧ (q → r)
(p ∧ q) → r ≡ (p → r) ∨ (q → r)
10
Logical equivalences involving biconditionals
p ↔ q ≡ (p → q) ∧ (q → p)
p ↔ q ≡ ¬p ↔ ¬q
p ↔ q ≡ (p ∧ q) ∨ (¬p ∧ ¬q)
¬(p ↔ q) ≡ p ↔ ¬q
Review: List of Logical Equivalences 11
p T T ; p F F Domination Laws
p p p ; p p p Idempotent Laws
(p q) r p (q r) ; (p q) r p (q r)
Associative Laws
12
List of Equivalences
p (q r) (p q) (p r) Distribution Laws
p (q r) (p q) (p r)
(p q) (p q) De Morgan’s Laws
(p q) (p q)
p p T OR Tautology
p p F AND Contradiction
(p → q) (p q) Implication Equivalence
pq (p → q) (q → p) Biconditional Equivalence
13
Constructing New Logical Equivalences
• We can show that two expressions are
logically equivalent by developing a
series of logically equivalent statements.
• To prove that A B, we produce a series
of equivalences beginning with A and
ending with B. A A1
A1 A2
AB .
.
.
An B
14
Equivalence Proofs
Example: Show that (p (p q))
is logically equivalent to (p q)
Solution:
(p (p q)) p (p q) 2nd De Morgan L
p [(p ) q)] 1st De Morgan L
p (p q) Double Negation L
(p p) (p q) 2nd Distribution L
F (p q) (p p) F
(p q) F Commutative L for Disjunction
(p q) Identity L for F
15
Prove: p → q q → p Contrapositive
p→q
p q Implication Equivalence
p → q ≡ ¬p ∨ q
q p Commutative
(q) p Double Negation
q → p Implication Equivalence
16
Prove: (p q) q p q
(p q) q Left-Hand Statement
q (p q) Commutative
(q p) (q q) Distributive
(q p) T OR Tautology
qp Identity
pq Commutative
Begin with exactly the left-hand side statement
End with exactly what is on the right
Justify EVERY step with a logical equivalence
17
Prove: p q p q
p q p ↔ q ≡ (p → q) ∧ (q → p)
(p → q) (q → p) Biconditional Equivalence
(p q) (q p) Implication Equivalence (twice)
p → q ≡ ¬p ∨ q
(p q) (q p) Double Negation
(q p) (p q) Commutative twice
(q p) (p q) Double Negation
(q → p) (p → q) Implication Equivalence (twice)
(p → q) (q → p) Commutative
p q Biconditional Equivalence
18
Why do I have to justify everything?
• Note that your operation must have the same
order of operands as the rule you quote unless
you have already proven that order is not
important (and cite the proof) .
3+4=4+3
3/44/3
A * B B * A for everything (for example, matrix
multiplication)
19
Propositional Satisfiability
• A compound proposition is satisfiable if there is an
assignment of truth values to its variables that make it
true. When no such assignments exist, the compound
proposition is unsatisfiable.
• Notation:
• =𝑗ڀ1 𝑝𝑗 is used for p1 p2 … pn
𝑛
• 𝑛
=𝑗ٿ1 𝑝𝑗 is used for p1 p2 … pn
22
Credit D. Fisher
23
Sudoku puzzle
• A Sudoku puzzle is represented by a 9 × 9 grid made up
of nine 3 × 3 subgrids, known as blocks.
• For each puzzle, some of the 81 cells, called givens, are
assigned one of the numbers 1, 2, . . . , 9, and the other
cells are blank.
• The puzzle is solved by assigning a number to each blank
cell so that every row, every column, and every one of the
nine 3 × 3 blocks contains each of the nine possible
numbers.
• Note that instead of using a 9 × 9 grid, Sudoku
puzzles can be based on n2 × n2 grids, for any
positive integer n, with the n2 × n2 grid made up
of n2 subgrids (n × n) .
Easy 4 by 4 puzzle
4 3 1 2
2 1 3 4
3 2 4 1
1 4 2 3
24
Easy 4 by 4 puzzle
3 1 4 2
4 2 3 1
1 3 2 4
2 4 1 3
25
Easy 4 by 4 puzzle
4 1 2 3
2 3 1 4
3 2 4 1
1 4 3 2
26
Easy 4 by 4 puzzle
3 1 4 2
4 2 3 1
2 3 1 4
1 4 2 3
27
4 by 4 puzzle
1 3 4 2
2 4 3 1
4 1 2 3
3 2 1 4
28
4 by 4 puzzle
2 3 4 1
4 1 3 2
3 2 1 4
1 4 2 3
29
4 by 4 puzzle
3 1 4 2
4 2 3 1
1 3 2 4
2 4 1 3
30
4 by 4 puzzle
1 4 2 3
3 2 4 1
4 1 3 2
2 3 1 4
31
9 6 2 7
4 3 8 6
8 1 9 2
1 5 8 3 4 9
7 9
9 8 6 5 1 3
5 9 7 3 2
9 6 4 8
4 2 1 5
32
5 9 3 8 6 2 1 4 7
7 2 4 1 5 3 9 8 6
6 8 1 9 7 4 2 3 5
1 5 8 3 4 9 7 6 2
3 7 6 5 2 1 4 9 8
2 4 9 7 8 6 5 1 3
8 1 5 6 9 7 3 2 4
9 6 2 4 3 5 8 7 1
4 3 7 2 1 8 6 5 9
33
34
Sudoku and logic?
• Let p(i, j, n) denote the proposition asserting
that the cell in row i and column j has the
value n column 1 column 2 column 3 column 4
p(1, 3, 1) p(1, 1, n1) row 1
p(1, 4, 2) p(1, 2, n2)
p(2, 1, 2) p(1, 3, n3)
row 2
p(4, 4, 3) row 4
n1 + n2 + n3 + n4 = 10