0% found this document useful (0 votes)
15 views41 pages

Discrete Structure 4

Uploaded by

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

Discrete Structure 4

Uploaded by

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

Discrete Structures

Lecture # 4

PMAS- Arid Agriculture University,


Rawalpindi
Recap
Exclusive Or with Examples

Logical Equivalence with Examples

De-Morgan’s Law with Examples

Tautology with Examples

Contradiction with Examples

Laws of Logic (Homework)!


Today’s Topics
Conditional Statement (Implication)

Examples with Exercise

Implication equivalence

Converse, Inverse, and Contrapositive for


Implication with examples
Conditional Statements

• “If you earn an A in Math, then I’ll buy a


computer.”

p: “You earn an A in Math,”


and
q: “I will buy you a computer.”
Conditional Statements
• The original statement is then saying:
if p is true, then q is true
Or
If p, then q

We can also phrase this as p implies q, and we


write p q.
Conditional Statement or Implication

• 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.
Conditional Statement or Implication

• The arrow “ “ is the conditional operator

p is called the hypothesis (or antecedent)

q is called the conclusion (or consequent)


Truth Table for Implication
pq
p q pq
T T T
T F F
F T T
F F T

p → q (p implies q) (if p then q) is the proposition that is false when p is true


and q is false and true otherwise
Examples
Alternative Ways of Expressing
Implications

• “If p then q”
• “p implies q”
• “if p, q”
• “p only if q”
• “p is sufficient for q”
• “not p unless q”
• “q follows from p”
• “q if p”
• “q whenever p”
• “q is necessary for p”
Exercise

a) Your guarantee is good only if you bought


your CD less than 90 days ago.
if your guarantee is good, then you must have
bought your CD player less than 90 days ago.

b) To get tenure as a professor, it is sufficient to


be world-famous.
If you are world-famous, then you will get
tenure as a professor.
Exercise

c) That you get the job implies that you have the
best credentials.
If you get the job, then you have the best
credentials.

d) It is necessary to walk 8 miles to get to the top


of the peak.
If you get to the top of the peak, then you must
have walked 8 miles.
Translating English Sentences To
Symbols
• Let p and q be propositions:
p = “you get an A on the final exams.”
q = “you do every exercise in this book.”
r = “you get an A in this class.”

• To get an A in this class it is necessary for you to get an A


on the final.

Solution: p r
Translating English Sentences To
Symbols

You do every exercise in this book and You get A on the


final, implies, you get an A in the class.

Solution:
Translating English Sentences To
Symbols

Getting an A on the final and doing every exercise in this


book is sufficient for getting an A in the class.

Solution:
Translating English Sentences To
Symbols
Let p, q, and r be the propositions:

p = “you have the flu”


q = “you miss the final exam”
r = “you pass the course”
If you have flu, then you will miss the final exam.

If you don’t miss the final exam, then you will pass
the course.

If you neither have flu nor miss the final exam,


then you will pass the course.
Hierarchy of Operations for Logical Connectives
Truth Table -- Example 1
Truth Table -- Example 1
Truth Table -- Example 1
Truth Table -- Example 2
Truth Table -- Example 2
Truth Table -- Example 2
Truth Table -- Example 3
Implication Law -- Truth Table -- Example 4
Negation of a Conditional Statement
Example 1

1) If Ali lives in Pakistan then he lives in Lahore.


2) If my car is in the repair shop, then I cannot get to class.
3) If x is prime then x is odd or x is 2.
4) If n is divisible by 6, then n is divisible by 2 and n is
divisible by 3.

Solutions:

5) Ali lives in Pakistan and he does not live in Lahore.


6) My car is in the repair shop and I can get to class.
3) x is prime but x is not odd and x is not 2.
4) n is divisible by 6 but n is not divisible by 2 or by 3.
Inverse of a Conditional Statement

For instance; for an implication p  q,

Its inverse is: ¬ p  ¬ q


Inverse of a Conditional Statement
Writing Inverse of a Conditional Statement

1. If Today is Friday, Then 2+3 = 5.


• If today is not Friday, Then 2 + 3 ≠ 5

2. If it Snows today, I will ski tomorrow


• If it does not snow today, I will not ski tomorrow.

3. If P is a square, then P is a rectangle.


• If P is not a square, then P is not a rectangle.

4. If my car is in the repair shop, then I can get to class.


• If my car is not in the repair shop, then I shall get
to the class.
Converse of a Conditional Statement

For instance; for an implication p  q,

Its converse is: q  p


Converse of a Conditional Statement
Writing Converse of a Conditional Statement

1. If Today is Friday, Then 2+3 = 5.


• If 2 + 3 = 5, Then today is Friday.

2. If it Snows today, I will ski tomorrow


• I will not ski tomorrow If it does snow today.

3. If P is a square, Then P is a rectangle.


• If P is a rectangle, Then P is not a square.

4. If my car is in the repair shop, Then I can get to class.


• If I cannot go to class, Then my car is in the repair
shop.
Contrapositive of a Conditional
Statement

For instance; for an implication p  q,

Its contrapositive is: ¬ q  ¬ p


Writing Contrapositive of a Conditional
Statement
1. If Today is Friday, Then 2+3 = 5.
• If 2 + 3 ≠ 5, Then today is not Friday.

2. If it Snows today, I will ski tomorrow


• I will not ski tomorrow only If it does not snow
today.

3. If P is a square, then P is a rectangle.


• If P is not a rectangle, then P is not a square.

4. If my car is in the repair shop, then I can get to class.


• If I get to the class, then my car is not in the repair
shop.
Converse, Inverse, Contrapositive

Some terminology, for an implication p  q


• Its converse is: q p
• Its inverse is: ¬p ¬q
• Its contrapositive is: ¬ q  ¬ p

SAME
Example of Converse, Inverse, Contrapositive

Write the converse, inverse and contrapositive of the


statement

“if x ≠ 0, then John is a programmer”

Note: The negation operation (¬) is different from the


inverse operation.
Example of Converse, Inverse, Contrapositive

“if x ≠ 0, then John is a programmer”

• Converse: “if John is a programmer, then x ≠ 0”

• Inverse: “if x = 0, then John is not a programmer”

• Contrapositive: “if John is not a programmer,


then x = 0”
Takeaway

1. An implication is logically equivalent to it’s


contrapositive.

2. The inverse of an implication are logically equivalent.

3. An implication is not equivalent to it’s converse.


• A contrapositive statement occurs
when you switch the hypothesis and
the conclusion in a statement and
negate both statements. In this
example, when we switch the
hypothesis and the conclusion, and
negate both, the result is: If it is not a
polygon, then it is not a triangle.
• In logic and mathematics, the
converse of a categorical or
implicational statement is the result
of reversing its two constituent
statements. For the implication P →
Q, the converse is Q → P.

You might also like