0% found this document useful (0 votes)
32 views19 pages

Discrete Mathematics - L03

The document discusses logic and conditional statements. It defines conditional, negation of conditional, contrapositive, converse and inverse of conditional statements. Truth tables are used to show logical equivalences. The biconditional is also introduced along with examples of using truth tables to prove logical equivalences.

Uploaded by

Mahmoud Hashem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views19 pages

Discrete Mathematics - L03

The document discusses logic and conditional statements. It defines conditional, negation of conditional, contrapositive, converse and inverse of conditional statements. Truth tables are used to show logical equivalences. The biconditional is also introduced along with examples of using truth tables to prove logical equivalences.

Uploaded by

Mahmoud Hashem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Faculty of Engineering

Computer Engineering Department

CE171 : Discrete Mathematics

Lecture 3
Date: 28/10/2020

27-Oct-20 PUA - CE171 - Discrete Mathematics 1


PREVIOUSLY:
The Logic of Compound Statements
1. Logical form and logical equivalence
❑ Negation ~
❑ Conjunction Λ
❑ Disjunction V
❑ Showing equivalence and non-equivalence
❑ De Morgan’s Laws
❑ Tautologies and Contradictions
❑ Theorem: Logical Equivalence

27-Oct-20 PUA - CE171 - Discrete Mathematics 2


I- THE LOGIC OF
COMPOUND
STATEMENTS
2. CONDITIONAL
STATEMENTS

27-Oct-20 PUA - CE171 - Discrete Mathematics 3


CONDITIONAL STATEMENTS
DEFINITION
If p and q are statement variables, the conditional of q by p is
“If p then q” or “p implies q” and is denoted p → q
It is false when p is true and q is false, and is true otherwise.
p is called the hypothesis
q is called the conclusion
p q p→q
T T T
Truth table for p → q
T F F
F T T
F F T

27-Oct-20 PUA - CE171 - Discrete Mathematics 4


CONDITIONAL STATEMENTS
Example:
Construct the truth table for ~ p V q

Truth table for ~ p V q


p q ~p ~p V q
T T F T
T F F F
F T T T
F F T T
p → q ≡ ~p V q
27-Oct-20 PUA - CE171 - Discrete Mathematics 7
CONDITIONAL STATEMENTS
Example:
Construct the truth table for (p V ~q) → ~p

Truth table for (p V ~q) → ~p


p q ~q (p V ~q) ~p (p V ~q) → ~p
T T F T F F
T F T T F F
F T F F T T
F F T T T T

27-Oct-20 PUA - CE171 - Discrete Mathematics 8


LOGICAL EQUIVALENCES INVOLVING →
Example:
Show that (p V q) → r ≡ (p → r) Λ (q → r)
p q r pVq p→r q→r p V q→r (p→r)Λ(q→r )
T T T T T T T T
T T F T F F F F
T F T T T T T T
T F F T F T F F
F T T T T T T T
F T F T T F F F
F F T F T T T T
F F F F T T T T

27-Oct-20 PUA - CE171 - Discrete Mathematics 9


THE NEGATION OF A CONDITIONAL
STATEMENT
DEFINITION
The negation of “If p then q” is logically equivalent to
“p and not q”
Symbolically: ~ (p → q) ≡ p Λ ~q
Proof:
start by: p → q ≡ ~p V q
~ (p → q) ≡ ~ (~p V q)
≡ ~ ~p Λ ~q De Morgan’s laws
≡ p Λ ~q Double negative law

27-Oct-20 PUA - CE171 - Discrete Mathematics 10


THE CONTRAPOSITIVE OF A
CONDITIONAL STATEMENT
DEFINITION
The contrapositive of a conditional statement of the form
“If p then q” is “If not q then not p”
Symbolically:
The contrapositive of p → q is ~q → ~p
Fact:
A conditional statement is logically equivalent to
its contrapositive: p → q ≡ ~q → ~p
Prove!

27-Oct-20 PUA - CE171 - Discrete Mathematics 11


WRITING THE CONTRAPOSITIVE
Example: Write each of the following statements
in its equivalent contrapositive form.
1. If Omar can swim across the lake, then
Omar can swim to the island.
2. If today is Easter, then tomorrow is Monday.

Solution:
1. If Omar can not swim to the island, then
Omar can not swim across the lake.
2. If tomorrow is not Monday, then today is not
Easter.

27-Oct-20 PUA - CE171 - Discrete Mathematics 12


THE CONVERSE AND INVERSE OF
A CONDITIONAL STATEMENT
DEFINITION
Suppose a conditional statement of the form “If p then q” is given.
The converse is “If q then p”
The inverse is “If ~p then ~q”

Symbolically:
The converse of p → q is q → p
The inverse of p → q is ~p → ~q

27-Oct-20 PUA - CE171 - Discrete Mathematics 13


SUMMARY OF CONDITIONAL
STATEMENT

p → q ≡ ~p V q Conditional

~(p → q) ≡ p Λ ~q Negation

~q → ~p ≡ q V ~p Contrapositive

q → p ≡ ~q V p Converse

~p → ~q ≡ p V ~ q Inverse

27-Oct-20 PUA - CE171 - Discrete Mathematics 18


THE BICONDITIONAL
DEFINITION
Given statement variables p and q, the biconditional of p and q is “ p If and only if q”
and is denoted p ↔ q
It is true if both p and q have the same truth values and is false if p and q have
opposite truth values.
The words if and only if are abbreviated iff.
Truth table for p ↔ q
p q p↔q
T T T
T F F
F T F
F F T
27-Oct-20 PUA - CE171 - Discrete Mathematics 20
ORDER OF OPERATIONS

1.
~
2.
V,Λ
3.
→,↔

27-Oct-20 PUA - CE171 - Discrete Mathematics 21


THE BICONDITIONAL
Example:
Prove, using a truth table that p ↔ q is logically equivalent to
(p → q) Λ (q → p):

Truth table
p q p→q q→p p↔q (p → q)Λ(q → p)
T T T T T T
T F F T F F
F T T F F F
F F T T T T

Same truth values and so


p↔q≡(p→q)Λ(q→p)

27-Oct-20 PUA - CE171 - Discrete Mathematics 22


THE BICONDITIONAL
Example: Rewrite the following statement as a
conjunction of two if-then statements:
The computer program is correct iff,
it produces the correct answer for all possible
sets of input data.
Solution:
If this program is correct, then it produces
the correct answers of all possible sets of
input data; and
if this program produces the correct answers
for all possible sets of input data, then it is
correct.
27-Oct-20 PUA - CE171 - Discrete Mathematics 23
THE BICONDITIONAL
Exercise:
Write p ↔ q in terms of V , Λ
Solution:
It is proved that p → q ≡ ~p V q
Since p ↔ q ≡ (p → q) Λ (q → p)
Then p ↔ q ≡ (~p V q) Λ (~q V p)

27-Oct-20 PUA - CE171 - Discrete Mathematics 24


THE BICONDITIONAL
DEFINITION
p and q are statements:
“if p then q”
p is a sufficient condition for q
“if q then p”
p is a necessary condition for q
“p ↔ q”
p is a necessary and sufficient condition for q

27-Oct-20 PUA - CE171 - Discrete Mathematics 25


NEXT LECTURE:

❑ The Logic of Compound Statements


Valid and Invalid Arguments
❑ Test arguments for validity
❑ Valid Argument Forms
❑ The Logic of Quantified Statements
Predicates and Quantified Statements

27-Oct-20 PUA - CE171 - Discrete Mathematics 26

You might also like