Week 3 Discerete
Week 3 Discerete
SIMPLIFYING A STATEMENT:
“You will get an A if you are hardworking and the sun shines, or you are hardworking
and it rains.” Rephrase the condition more simply.
Solution:
Let p = “You are hardworking’
q = “The sun shines”
r = “It rains” .
The condition is (p q) (p r)
Using distributive law in reverse,
(p q) (p r) p (q r)
EXERCISE:
Use Logical Equivalence to rewrite each of the following sentences more simply.
CONDITIONAL STATEMENTS:
Introduction
Consider the statement:
"If you earn an A in Math, then I'll buy you a computer."
This statement is made up of two simpler statements:
p: "You earn an A in Math"
q: "I will buy you a computer."
TRUTH TABLE:
p q pq
T T T
T F F
F T T
F F T
18
3-Laws of Logic
EXERCISE:
Write the following statements in the form “if p, then q” in English.
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.
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.
2. You do every exercise in this book; You get an A on the final, implies,
you get an A in the class.
SOLUTION pqr
3. Getting an A on the final and doing every exercise in this book is sufficient
For getting an A in this class.
SOLUTION pqr
2. ~q r
19
3-Laws of Logic
If you don’t miss the final exam, you will pass the course.
3. ~p ~q r
If you neither have flu nor miss the final exam, then you will pass the course.
HIERARCHY OF OPERATIONS
FOR LOGICAL CONNECTIVES
•~ (negation)
• (conjunction), (disjunction)
• (conditional)
p q ~ ~p p ~q p~q~p
q
T T F F T F
T F T F T F
F T F T F T
F F T T T T
20
3-Laws of Logic
p q ~q ~p pq ~q ~p
T T F F T T
T F T F F F
F T F T T T
F F T T T T
IMPLICATION LAW
pq ~pq
p q pq ~p ~pq
T T T F T
T F F F F
F T T T T
F F T T T
Thus the negation of “if p then q” is logically equivalent to “p and not q”.
Accordingly, the negation of an if-then statement does not start with the word if.
EXAMPLES
21
3-Laws of Logic
SOLUTIONS:
1. Ali lives in Pakistan and he does not live in Lahore.
2. 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.
p q pq ~p ~q ~p ~q
T T T F F T
T F F F T T
F T T T F F
F F T T T T
A conditional and its converse are not equivalent. i.e., is not a commutative operator.
22
p q pq qp
T T T T
T F F T
F T T F
F F T T
EXERCISE:
1. Show that pq ~ q ~ p ( Use the truth table. )
23