Proposition,
Proposition
Equivalences
Discrete Structures
MUHAMMAD UMAR NASIR
LECTURER
FACULTY OF COMPUTING, RIPHAH INTERNATIONAL UNIVERSITY LAHORE
Logic 2
• Crucial for mathematical reasoning
2003
Spring
• Important for program design
• Used for designing electronic circuitry
CMSC 203 - Discrete Structures
• (Propositional )Logic is a system based on propositions.
• A proposition is a (declarative) statement that is either true
or false (not both).
• We say that the truth value of a proposition is either true
(T) or false (F).
• Corresponds to 1 and 0 in digital circuits
The Statement/Proposition 3
Game
“Elephants are bigger than mice.”
2003
Spring
CMSC 203 - Discrete Structures
Is this a statement? yes
Is this a proposition? yes
What is the truth
value true
of the proposition?
The Statement/Proposition 4
Game
“520 < 111”
2003
Spring
CMSC 203 - Discrete Structures
Is this a statement? yes
Is this a proposition? yes
What is the truth
value fals
of the proposition? e
The Statement/Proposition 5
Game
“y > 5”
2003
Spring
CMSC 203 - Discrete Structures
Is this a statement? yes
Is this a proposition? no
Its truth value depends on the value of
y, but this value is not specified.
We call this type of statement a
propositional function or open
sentence.
The Statement/Proposition 6
Game
“Today is January 27 and 99 < 5.”
2003
Spring
CMSC 203 - Discrete Structures
Is this a statement? yes
Is this a proposition? yes
What is the truth
value fals
of the proposition? e
The Statement/Proposition 7
Game
“Please do not fall asleep.”
2003
Spring
CMSC 203 - Discrete Structures
Is this a statement? no
It’s a request.
Is this a proposition? no
Only statements can be propositions.
The Statement/Proposition 8
Game
“If the moon is made of cheese,
2003
Spring
then I will be rich.”
CMSC 203 - Discrete Structures
Is this a statement? yes
Is this a proposition? yes
What is the truth
value probably true
of the proposition?
The Statement/Proposition 9
Game
“x < y if and only if y > x.”
2003
Spring
Is this a statement? yes
CMSC 203 - Discrete Structures
Is this a proposition? yes
… because its truth value
does not depend on
specific values of x and
y.
What is the truth
value true
of the proposition?
Combining Propositions 10
2003
Spring
As we have seen in the previous examples,
one or more propositions can be combined
CMSC 203 - Discrete Structures
to form a single compound proposition.
We formalize this by denoting propositions
with letters such as p, q, r, s, and
introducing several logical operators or
logical connectives.
Logical Operators 11
(Connectives)
2003
Spring
We will examine the following logical operators:
• Negation (NOT, )
CMSC 203 - Discrete Structures
• Conjunction (AND, )
• Disjunction (OR, )
• Exclusive-or (XOR, )
• Implication (if – then, )
• Biconditional (if and only if, )
Truthtables can be used to show how these operators can
combine propositions to compound propositions.
Negation (NOT) 12
2003
Spring
Unary Operator, Symbol:
CMSC 203 - Discrete Structures
P P
true (T) false (F)
false (F) true (T)
Conjunction (AND) 13
Binary Operator, Symbol:
2003
Spring
CMSC 203 - Discrete Structures
P Q P Q
T T T
T F F
F T F
F F F
Disjunction (OR) 14
Binary Operator, Symbol:
2003
Spring
CMSC 203 - Discrete Structures
P Q PQ
T T T
T F T
F T T
F F F
Exclusive Or (XOR) 15
Binary Operator, Symbol:
2003
Spring
CMSC 203 - Discrete Structures
P Q PQ
T T F
T F T
F T T
F F F
Implication (if - then) 16
Binary Operator, Symbol:
2003
Spring
CMSC 203 - Discrete Structures
P Q PQ
T T T
T F F
F T T
F F T
Biconditional (if and only if) 17
Binary Operator, Symbol:
2003
Spring
CMSC 203 - Discrete Structures
P Q PQ
T T T
T F F
F T F
F F T
Statements and Operators 18
Statements and operators can be combined
2003
Spring
in any way to form new statements.
CMSC 203 - Discrete Structures
P Q P Q (P)(Q)
T T F F F
T F F T T
F T T F T
F F T T T
Statements and Operations 19
Statements and operators can be combined in
2003
Spring
any way to form new statements.
CMSC 203 - Discrete Structures
P Q PQ (PQ) (P)(Q)
T T T F F
T F F T T
F T F T T
F F F T T
Exercises 20
• To take discrete mathematics, you must have taken calculus
or a course in computer science.
2003
Spring
• When you buy a new car from Acme Motor Company, you
CMSC 203 - Discrete Structures
get $2000 back in cash or a 2% car loan.
• School is closed if more than 2 feet of snow falls or if the
wind chill is below -100.
Exercises 21
• To take discrete mathematics, you must
2003
Spring
have taken calculus or a course in
computer science.
CMSC 203 - Discrete Structures
P: take discrete mathematics
Q: take calculus
R: take a course in computer science
• PQR
• Problem with proposition R
What if I want to represent “take CMSC201”?
Exercises 22
• When you buy a new car from Acme Motor
2003
Spring
Company, you get $2000 back in cash or a
2% car loan.
CMSC 203 - Discrete Structures
P: buy a car from Acme Motor Company
Q: get $2000 cash back
R: get a 2% car loan
• PQR
• Why use XOR here? – example of ambiguity of natural
languages
Exercises 23
• School is closed if more than 2 feet of
2003
Spring
snow falls or if the wind chill is below -100.
CMSC 203 - Discrete Structures
P: School is closed
Q: 2 feet of snow falls
R: wind chill is below -100
• QRP
• Precedence among operators:
, , , ,
Equivalent Statements 24
P Q (PQ) (P)(Q) (PQ)(P)(Q)
2003
Spring
T T F F T
CMSC 203 - Discrete Structures
T F T T T
F T T T T
F F T T T
The statements (PQ) and (P) (Q) are logically equivalent, since they
have the same truth table, or put it in another way, (PQ) (P) (Q) is
always true.
Tautologies and Contradictions 25
A tautology is a statement that is always true.
2003
Spring
Examples:
R(R)
CMSC 203 - Discrete Structures
(PQ) (P)( Q)
A contradiction is a statement that is always
false.
Examples:
R(R)
((P Q) (P) (Q))
The negation of any tautology is a contradiction,
and the negation of any contradiction is a
tautology.
Equivalence 26
Definition: two propositional
2003
Spring
statements S1 and S2 are said to be
(logically) equivalent, denoted S1
CMSC 203 - Discrete Structures
S2 if
They have the same truth table, or
S1 S2 is a tautology
Equivalence can be established by
Constructing truth tables
Using equivalence laws (Table 5 in Section 1.2)
Logical Equivalence 27
Equivalence Names
p T p Identity laws
p F p
p T T Domination laws
p F F
p p p Idempotent laws
p p p
( p) p Double negation law
p q q p Commutative laws
p q q p
(p q) r p (q r) Associative laws
(p q) r p (q r)
p (q r) (p q) (p r) Distributive laws
p (q r) (p q) (p r)
(p q) p q De Morgans laws
(p q) p q
p (p q) p Absorbtion laws
p (p q) p
p p T Negation laws
p p F
Logical Equivalence 28
Logical Equivalence Involving Conditional
29
Statements
p → q ≡ p ∨q
p→ q≡ q→ p
p ∨q ≡ p → q
p q ≡ (p → q)
(p → q) ≡ p q
(p → q) (p → r) ≡ p → (q r)
(p → r) (q → r) ≡ (p ∨ q) → r
(p → q) ∨ (p → r) ≡ p → (q ∨ r)
(p → r) ∨ (q → r) ≡ (p q) → r
Logical Equivalence Involving Biconditional
30
Statements
2003
Spring
CMSC 203 - Discrete Structures
p ↔ q ≡ (p → q) (q → p)
p ↔ q ≡ p ↔ q
p ↔ q ≡ (p q) ∨ ( p q)
(p ↔ q) ≡ p ↔ q
Exercises 31
• Show that P Q P Q: by truth table
2003
Spring
CMSC 203 - Discrete Structures
Exercises 32
2003
Spring
Show that (p ∨ ( p q)) and p q are logically equivalent by developing a series
Example:
CMSC 203 - Discrete Structures
of
(p ∨ ( p q)) ≡ p ∧ ( p q) by the second De Morgan law
logical equivalences.
≡ p [ ( p)∨ q]
≡ p (p ∨ q)
by the first De Morgan law
≡ ( p p) ∨ ( p q)
by the double negation law
≡ F ∨ ( p q)
by the second distributive law
because ¬ p p ≡ F
≡ ( p q) ∨ F by the commutative law for disjunction
Consequently (p ∨ ( p q)) and p q are logically equivalent.
≡ p q by the identity law for F
Exercises 33
2003
Spring
Show that (p q) → (p ∨ q) is a tautology.
Example:
CMSC 203 - Discrete Structures
(p q) → (p ∨ q) ≡ (p ∧ q) ∨ (p ∨ q) by Example 3
≡ ( p ∨ q) ∨ (p ∨ q)
≡ ( p ∨ p) ∨ ( q ∨ q)
by the first De Morgan law
≡ T ∨T
by the associative and commutative laws for disjunction
by Example 1 and the commutative law for disjunction
≡ T by the domination law