0% found this document useful (0 votes)
30 views

Lecture 3

The document discusses logical equivalences and normal forms. It defines tautologies, contradictions, and contingencies. Examples are given to illustrate these concepts using truth tables. Logical equivalences like De Morgan's laws and identities are explained. The document also discusses how to convert logical expressions to conjunctive normal form (CNF) and disjunctive normal form (DNF) using logical laws and truth tables. Steps to obtain CNF and DNF are outlined along with examples.

Uploaded by

Irdina Izzati
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Lecture 3

The document discusses logical equivalences and normal forms. It defines tautologies, contradictions, and contingencies. Examples are given to illustrate these concepts using truth tables. Logical equivalences like De Morgan's laws and identities are explained. The document also discusses how to convert logical expressions to conjunctive normal form (CNF) and disjunctive normal form (DNF) using logical laws and truth tables. Steps to obtain CNF and DNF are outlined along with examples.

Uploaded by

Irdina Izzati
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

CSC510

Discrete Structures
Logic Equivalences and
Soundness
Lecture 3: Logical Equivalences and Equality
Tautology and Contradiction
Definitions:
• A compound proposition that is always true for all possible truth values of
the propositions is called a tautology.
• A compound proposition that is always false is called a contradiction.
• A proposition that is neither a tautology nor contradiction is called a
contingency.
🠶 Example: p ∨ ¬p
p ¬p p ∨ ¬p
1 0 1
0 1 1

p ∨ ¬p is tautology.
Tautology and Contradiction
Definitions:
• A compound proposition that is always true for all possible truth values of
the propositions is called a tautology.
• A compound proposition that is always false is called a contradiction.
• A proposition that is neither a tautology nor contradiction is called a
contingency.
🠶 Example: p ∧ ¬p
p ¬p p ∧ ¬p
1 0 0
0 1 0

p ∧ ¬p is contradiction.
Equivalence
🠶 We have seen that some of the propositions are equivalent.
🠶 Their truth values in the truth table are the same.
🠶 • Example: p → q is equivalent to ¬q → ¬p (contrapositive)

p q ¬p ¬q p→q ¬q → ¬p
1 1 0 0 1 1
1 0 0 1 0 0
0 1 1 0 1 1
0 0 1 1 1 1

Equivalent statements are important for logical reasoning


since they can be substituted and can help us to make a
logical argument.
Logical equivalence

🠶 Definition: The propositions p and q are called logically equivalent if p ↔ q


is a tautology (alternately, if they have the same truth table). The notation
p ↔ q denotes p and q are logically equivalent.

• Example: p → q is equivalent to ¬q → ¬p (contrapositive)


🠶 We can show that these 2 expressions are logically equivalence by using
biconditional notation.
Equivalence
Example: p → q is equivalent to ¬q → ¬p (contrapositive)
🠶 We can show that these 2 expressions are logically equivalence by using
biconditional notation.
🠶 Can you notice that the last column (biconditional) produce
TAUTOLOGY?

p q ¬p ¬q p→q ¬q → ¬p (p → q) ↔
(¬q → ¬p)

1 1 1 0 1 1 1
1 0 1 0 0 0 1
0 1 0 1 1 1 1
0 0 0 1 1 1 1
Important logical equivalences

🠶 Proving: Using Truth Table or Logical Laws

🠶 Example
i. DeMorgan's Laws:
🠶 • 1) ¬( p ∨ q ) ↔ ¬p ∧ ¬q
🠶 • 2) ¬( p ∧ q ) ↔ ¬p ∨ ¬q

🠶 Example: Negate "The summer in Mexico is cold and sunny" with


DeMorgan's Laws
🠶 Solution: "The summer in Mexico is not cold or not sunny."
Important logical equivalences(cont.)

ii. Identity
🠶 –p∧T↔p
🠶 –p∨F ↔ p

iii. Domination
🠶 –p∨T↔T
🠶 –p∧F ↔ F

iv. Idempotent
🠶 –p∨p ↔p
🠶 –p∧p ↔p
Important logical equivalences(cont.)

v. Double negation
🠶 – ¬(¬p) ↔ p

vi. Commutative
🠶 –p∨q↔q∨p
🠶 –p∧q↔q∧p

vii. Associative
🠶 – (p ∨ q) ∨ r ↔ p ∨ (q ∨ r)
🠶 – (p ∧ q) ∧ r ↔ p ∧ (q ∧ r)
Important logical equivalences(cont.)

viii. Distributive
🠶 – p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r)
🠶 – p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r)

ix. Useful
🠶 – p ∨ ¬p ↔ T
🠶 – p ∧ ¬p ↔ F
🠶 – p → q ↔ (¬p ∨ q)
Using logical equivalences

🠶 Equivalences can be used in proofs. A proposition or its part can be


transformed using equivalences and some conclusion can be reached.

Example: Show that (p ∧ q) → p is a tautology.


• Proof: (we must show (p ∧ q) → p ↔ T)
(p ∧ q) → p ↔ ¬(p ∧ q) ∨ p Useful
↔ [¬p ∨ ¬q] ∨ p DeMorgan
↔ [¬q ∨ ¬p] ∨ p Commutative
↔ ¬q ∨ [ ¬p ∨ p ] Associative
↔ ¬q ∨ [ T ] Useful
↔ T Domination
Using logical equivalences(cont.)
🠶 Equivalences can be used in proofs. A proposition or its part can be
transformed using equivalences and some conclusion can be reached.

Example 1: Show (p ∧ q) → p is a tautology.


• Using Truth table:

p q p∧q (p ∧ q) → p

1 1 1 1
1 0 0 1
0 1 0 1
0 0 0 1
Using logical equivalences(cont.)

Example 2: Show (p → q) ↔ (¬q → ¬p)


• Using Logical Laws:
(p → q) ↔ (¬q → ¬p)
↔ ¬(¬q) ∨ (¬p) Useful
↔ q ∨ (¬p) Double negation
↔ ¬p ∨ q Commutative
↔ p→q Useful
End of proof
Normal Forms

🠶 Logical expression is said to be in disjunctive normal form (DNF) if it is written


as a disjunction, in which all terms are conjunctions of literals.

🠶 Logical expression is said to be in conjunctive normal form (CNF) if it is written


as a conjunction of disjunctions of literals.

Example

🠶 DNF : (p ∧q) ∨ (p ∧ ¬q)

🠶 CNF : p ∧ (q ∨ r)
Using Logical Laws

🠶 Three steps to obtain a CNF through algebraic manipulations:


🠶 Remove all → and ⇔
🠶 If the expression contains any negated compound subexpressions,
either remove the negation by using the double-negation law or use
De Morgan’s laws to reduce the scope of the negation
🠶 Once an expression with no negated compound subexpression is
found, use the following two laws to reduce the scope of the ∨.

🠶 A ∨ (B ∧ C) ≡ (A ∨ B) ∧ (A ∨ C) Rule I
🠶 (A ∧ B ) ∨ C ≡ (A ∨ C) ∧ (B ∨ C) Rule II
Using Logical Laws(cont.)

🠶 Example: Convert the following expression into CNF

🠶 ¬((P ∨ ¬Q) ∧ ¬R)


🠶 Solution:
🠶 ¬((P ∨ ¬Q) ∧ ¬R) ≡ ¬(P ∨ ¬Q) ∨ ¬¬R De Morgan
≡ ¬(P ∨ ¬Q) ∨ R Double negation
≡ (¬P ∧ ¬¬Q) ∨ R De Morgan
≡ (¬P ∧ Q) ∨ R Double negation
≡ (¬P ∨ R) ∧ (Q ∨ R) Rule II
Using Logical Laws(cont.)

🠶 Three steps to obtain a DNF through algebraic manipulations:


🠶 Remove all → and ⇔
🠶 If the expression contains any negated compound subexpressions, either
remove the negation by using the double-negation law or use De Morgan’s
laws to reduce the scope of the negation
🠶 Once an expression with no negated compound subexpression is found,
use the following two laws to reduce the scope of the ^.

🠶 A ∧ (B ∨ C) ≡ (A ∧ B) ∨ (A ∧ C) Rule I
🠶 (A ∨ B ) ∧ C ≡ (A ∧ C) ∨ (B ∧ C)Rule II
Using Logical Laws (cont.)

🠶 Example: Convert the following expression into DNF


🠶 (P → (Q ∧ R)) ∨ ¬(P ∨ ¬(R∨S))
🠶 Solution:
🠶 (P → (Q ∧ R)) ∨ ¬(P ∨ ¬(R∨S))

≡ (¬P ∨ (Q ∧ R)) ∨ ¬(P ∨ ¬(R∨S)) Useful


≡ (¬P ∨ (Q ∧ R)) ∨ (¬P ∧ ¬¬(R∨S)) De Morgan
≡ (¬P ∨ (Q ∧ R)) ∨ (¬P ∧ (R∨S)) Double negation
≡ (¬P ∨ (Q ∧ R)) ∨ ((¬P ∧ R) ∨(¬P ∧ S)) Rule I
Using truth table
Conjunctive Normal Form

1. Get the F value from the table


2. Read in disjunctive form of F value
3. Complement of every item in disjunctive expression.

P Q R Output

T T T T
T T F T
T F T F
T F F F
F T T T
F T F T
F F T F
F F F T
Using truth table(cont.)

Conjunctive Normal Form


🠶 Solution:
🠶 Get the F value from the table
🠶 Read in disjunctive form = (P ∧ ¬Q ∧ R) ∨ (P ∧ ¬Q ∧ ¬R) ∨ (¬P ∧ ¬Q ∧ R)
🠶 Complement the whole expressions
= (¬P ∨ Q ∨ ¬R) ∧ (¬P ∨ Q ∨ R) ∧ (P ∨ Q ∨ ¬R)

CNF : (¬P ∨ Q ∨ ¬R) ∧ (¬P ∨ Q ∨ R) ∧ (P ∨ Q ∨ ¬R)


Using truth table(cont.)
Disjunctive Normal Form

1. Get the T value from the table


2. Read in disjunctive form of T value

P Q R Output

T T T T
T T F F
T F T T
T F F F
F T T F
F T F F
F F T T
F F F F
Using truth table(cont.)

Disjunctive Normal Form


🠶 Solution:
🠶 Get the T value from the table
🠶 Read in disjunctive form = (P ∧ Q ∧ R) ∨ (P ∧ ¬Q ∧ R) ∨ (¬P ∧ ¬Q ∧ R)

DNF : (P ∧ Q ∧ R) ∨ (P ∧ ¬Q ∧ R) ∨ (¬P ∧ ¬Q ∧ R)

You might also like