Class3 - CSC510

Download as pdf or txt
Download as pdf or txt
You are on page 1of 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

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy