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

Class3 - CSC510

This document discusses propositional logic and logical equivalences. It introduces propositional logic, truth tables, logical connectives such as AND and OR, and translations between logical statements and circuits. It also covers tautologies, contradictions and logical equivalences such as De Morgan's laws.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Class3 - CSC510

This document discusses propositional logic and logical equivalences. It introduces propositional logic, truth tables, logical connectives such as AND and OR, and translations between logical statements and circuits. It also covers tautologies, contradictions and logical equivalences such as De Morgan's laws.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Discrete Structures

Lecture 3

Propositional logic
Equivalences

Propositional logic: review


• Propositional logic: a formal language for making logical
inferences
• A proposition is a statement that is either true or false.
• A compound proposition can be created from other
propositions using logical connectives
• The truth of a compound proposition is defined by truth
values of elementary propositions and the meaning of
connectives.
• The truth table for a compound proposition: table with
entries (rows) for all possible combinations of truth values of
elementary propositions.
Translation
If you are older than 13 or you are with your parents then you can
attend a PG-13 movie.
Parse:
• If ( you are older than 13 or you are with your parents ) then
( you can attend a PG-13 movie)
– A= you are older than 13
– B= you are with your parents
– C=you can attend a PG-13 movie
• Translation: A ∨ B → C

• Why do we want to do this?


• Inference: Assume I know that A ∨ B → C is a correct
statement and both A and B are true. Then we can
conclude that C is true as well.

Computer representation of True and False

• We need to encode two values True and False:


– use a bit
– a bit represents two possible values:
– 0 (False) or 1(True)

• A variable that takes on values 0 or 1 is called a Boolean


variable.

• Definition: A bit string is a sequence of zero or more bits.


The length of this string is the number of bits in the string.
Bitwise operations
• T and F replaced with 1 and 0
p q p∨q p∧q
1 1 1 1
1 0 1 0
0 1 1 0
0 0 0 0

p ¬p
1 0
0 1

Bitwise operations
• Examples:

1011 0011 1011 0011 1011 0011


∨ 0110 1010 ∧ 0110 1010 ⊕ 0110 1010
Bitwise operations
• Examples:

1011 0011 1011 0011 1011 0011


∨ 0110 1010 ∧ 0110 1010 ⊕ 0110 1010
1111 1011

Bitwise operations
• Examples:

1011 0011 1011 0011 1011 0011


∨ 0110 1010 ∧ 0110 1010 ⊕ 0110 1010
1111 1011 0010 0010
Bitwise operations
• Examples:

1011 0011 1011 0011 1011 0011


∨ 0110 1010 ∧ 0110 1010 ⊕ 0110 1010
1111 1011 0010 0010 1101 1001

Tautology and Contradiction


• Some propositions are interesting since their values in the truth
table are always the same
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
T F
F T
Tautology and Contradiction
• Some propositions are interesting since their values in the truth
table are always the same
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 is a tautology.

p ¬p p ∨ ¬p
T F T
F T T

Tautology and Contradiction


• Some propositions are interesting since their values in the truth
table are always the same
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
T F
F T
Tautology and Contradiction
• Some propositions are interesting since their values in the truth
table are always the same
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 is a contradiction.

p ¬p p ∧ ¬p
T F F
F T F

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 ¬q → ¬p
T T
T F
F T
F F
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 ¬q → ¬p
T T T
T F F
F T T
F F T

• .

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 ¬q → ¬p
T T T T
T F F F
F T T T
F F T T

• 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)

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.

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

(p → q) ↔
p q p→q ¬q → ¬p
(¬q → ¬p)
T T T T T
T F F F T
F T T T T
F F T T T
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.

Important equivalences:
• 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: ?

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 of important equivalences


• 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."
Equivalence
Example of important equivalences
• DeMorgan's Laws:
• 1) ¬( p ∨ q ) <=> ¬p ∧ ¬q
• 2) ¬( p ∧ q ) <=> ¬p ∨ ¬q

To convince us that two propositions are logically equivalent


use the truth table
p q ¬p ¬q ¬(p ∨ q) ¬p ∧ ¬q
T T F F
T F F T
F T T F
F F T T

Equivalence
Example of important equivalences
• DeMorgan's Laws:
• 1) ¬( p ∨ q ) <=> ¬p ∧ ¬q
• 2) ¬( p ∧ q ) <=> ¬p ∨ ¬q

To convince us that two propositions are logically equivalent


use the truth table
p q ¬p ¬q ¬(p ∨ q) ¬p ∧ ¬q
T T F F F
T F F T F
F T T F F
F F T T T
Equivalence
Example of important equivalences
• DeMorgan's Laws:
• 1) ¬( p ∨ q ) <=> ¬p ∧ ¬q
• 2) ¬( p ∧ q ) <=> ¬p ∨ ¬q

To convince us that two propositions are logically equivalent


use the truth table
p q ¬p ¬q ¬(p ∨ q) ¬p ∧ ¬q
T T F F F F
T F F T F F
F T T F F F
F F T T T T

Equivalence
Example of important equivalences
• DeMorgan's Laws:
• 1) ¬( p ∨ q ) <=> ¬p ∧ ¬q
• 2) ¬( p ∧ q ) <=> ¬p ∨ ¬q

To convince us that two propositions are logically equivalent


use the truth table
p q ¬p ¬q ¬(p ∨ q) ¬p ∧ ¬q
T T F F F F
T F F T F F
F T T F F F
F F T T T T
Important logical equivalences
• Identity
– p ∧ T <=> p
– p ∨ F <=> p

• Domination
– p ∨ T <=> T
– p ∧ F <=> F

• Idempotent
– p ∨ p <=> p
– p ∧ p <=> p

Important logical equivalences


• Double negation
– ¬(¬p) <=> p

• Commutative
– p ∨ q <=> q ∨ p
– p ∧ q <=> q ∧ p

• Associative
– (p ∨ q) ∨ r <=> p ∨ (q ∨ r)
– (p ∧ q) ∧ r <=> p ∧ (q ∧ r)
Important logical equivalences
• Distributive
– p ∨ (q ∧ r) <=> (p ∨ q) ∧ (p ∨ r)
– p ∧ (q ∨ r) <=> (p ∧ q) ∨ (p ∧ r)

• De Morgan
– ¬( p ∨ q ) <=> ¬p ∧ ¬q
– ¬( p ∧ q ) <=> ¬p ∨ ¬q

• Other useful equivalences


– 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
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

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
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

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
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


• Equivalences can be used in proofs. A proposition or its part
can be transformed using equivalences and some conclusion
can be reached.

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


• Alternative proof:

p q p∧q (p ∧ q)→p
T T T T
T F F T
F T F T
F F F T
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 2: Show (p → q) <=> (¬q → ¬p)


Proof:
• (p → q) <=> (¬q → ¬p)
• <=> ?

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 2: Show (p → q) <=> (¬q → ¬p)


Proof:
• (p → q) <=> (¬q → ¬p)
• <=> ¬(¬q) ∨ (¬p) Useful
• <=> ?
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 2: Show (p → q) <=> (¬q → ¬p)


Proof:
• (p → q) <=> (¬q → ¬p)
• <=> ¬(¬q) ∨ (¬p) Useful
• <=> q ∨ (¬p) Double negation
• <=> ?

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 2: Show (p → q) <=> (¬q → ¬p)


Proof:
• (p → q) <=> (¬q → ¬p)
• <=> ¬(¬q) ∨ (¬p) Useful
• <=> q ∨ (¬p) Double negation
• <=> ¬p ∨ q Commutative
• <=> ?
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 2: Show (p → q) <=> (¬q → ¬p)


Proof:
• (p → q) <=> (¬q → ¬p)
• <=> ¬(¬q) ∨ (¬p) Useful
• <=> q ∨ (¬p) Double negation
• <=> ¬p ∨ q Commutative
• <=> p → q Useful
End of proof

You might also like