Lecture 7-8
Lecture 7-8
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
2003
Spring
CMSC 203 - Discrete Structures
Is this a statement? yes
2003
Spring
CMSC 203 - Discrete Structures
Is this a statement? yes
2003
Spring
CMSC 203 - Discrete Structures
Is this a statement? yes
Is this a proposition? no
2003
Spring
CMSC 203 - Discrete Structures
Is this a statement? yes
2003
Spring
CMSC 203 - Discrete Structures
Is this a statement? no
It’s a request.
Is this a proposition? no
2003
Spring
then I will be rich.”
2003
Spring
Is this a statement? yes
2003
Spring
As we have seen in the previous examples,
one or more propositions can be combined
2003
Spring
We will examine the following logical operators:
• Negation (NOT, )
2003
Spring
Unary 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
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
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
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
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.
2003
Spring
any way to form new statements.
2003
Spring
• When you buy a new car from Acme Motor Company, you
2003
Spring
have taken calculus or a course in
computer science.
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.
2003
Spring
snow falls or if the wind chill is below -100.
2003
Spring
T T F F T
2003
Spring
Examples:
R(R)
2003
Spring
statements S1 and S2 are said to be
(logically) equivalent, denoted S1
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 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)
(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
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:
≡ 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
2003
Spring
Show that (p q) → (p ∨ q) is a tautology.
Example:
≡ T ∨T
by the associative and commutative laws for disjunction
by Example 1 and the commutative law for disjunction
≡ T by the domination law