DS Lecture02
DS Lecture02
LOGICAL EQUIVALENCES
LAWS OF LOGIC
Solution:
p [~(~p q)] p [~(~p) (~q)] DeMorgan’s Law
p [p(~q)] Double Negative Law
[p p](~q) Associative Law for
p (~q) Indempotent Law
Which is the simplified statement form.
EXAMPLE
~ (~ p q) (p q) p
SOLUTION
Consider
~(~p q) (pq)
(~(~p) ~q) (p q) DeMorgan’s Law
(p ~q) (pq) Double Negative Law
p (~q q) Distributive Law
pc Negation Law
p Identity Law
Hence the logical equivalence has been shown. 2
SIMPLIFYING A STATEMENT
EXERCISE
p q pq
T T T
T F F
F T T
F F T
5
PRACTICE WITH CONDITIONAL STATEMENTS
• “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”
6
EXERCISE
7
1. To get an A in this class it is necessary for you to get an A on the
final.
SOLUTION pr
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
1. ~(negation)
2. (conjunction), (disjunction)
3. (conditional)
EXAMPLE
p q ~q ~p p ~q p~q~p
T T F F T F
T F T F T F
F T F T F T
F F T T T T
In the above table we use the hierarchy of operations to complete the truth
table.
That’s why we have column for ~q and then for ~p after the columns of p
and q then we have the column for p ~q because order of operation as
given below and at the end we have column for the statement form which
involve implication that is p ~ q ~ p.
9
EXAMPLE
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
10
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
In the above table as you note that the entries in the third and last
columns are same so these statement forms are logically equivalent.
This is very important logical equivalence shows that the implication
can be replaced by using ~ and .
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.
You should see yourself that the Negation of implication and implication
are not Logically equivalent.
11
EXAMPLES
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
12
WRITING INVERSE
p q pq qp
T T T T
T F F T
F T T F
F F T T
Now since the entries in the last two columns are not same so the
corresponding statement forms are not logically equivalent. That is
conditional statement and its converse are not logically equivalent
13
WRITING CONVERSE
p q pq ~q~p
T T T T
T F F F
F T T T
F F T T
Note that the entries in the last two columns are same .Hence the
corresponding statement forms are logically equivalent. Also note that in the
above table we did not made the columns for ~ q and ~ p. But you should
made these columns also.
14
WRITING CONTRAPOSITIVE
REASONING EXERCISES
15
LECTURE # 3
Implication: pq
Inverse: ~p ~q
Converse: qp
Contrapositive: ~q ~p
NOTE
1. An implication is logically equivalent to it’s contrapositive.
2. The converse and inverse of an implication are logically equivalent.
3. An implication is not equivalent to it’s converse.
We have already seen that pq is not the same as q p. It may
happen, however, that both p q and q p are true. For example, if p=
“1+1= 2" and q=“2+2 = 4," then p q and q p are both true because p
and q are both true.
Similarly, if p= “1+1= 3" and q=“2+2 = 5," then p q and q p are
both true because p and q are both false.
EXAMPLE
TRUTH TABLE
p q p q
T T T
T F F
F T F
F F T
From the Truth Table of pq it is quite clear that pq have F where both
p and q have different values and where both p and q have the same values
we have T in the column of pq. That is biconditional is true when p and q
have same truth value.
17
EXAMPLES
True or false?
1. “1+1 = 3 if and only if earth is flat”
The above biconditional has truth value TRUE. Because The both the
statements have the same truth value, that is 1+1 = 3 is false as well as
earth is flat. So their biconditional is has Truth value True.
(Remember that biconditional is true when both statements have the
same truth values)
2. “Sky is blue iff 1 = 0”
The above biconditional has truth value FALSE because both
statements have different truth values. Sky is blue has truth value T
and 1 = 0 has truth value F.
3. “Milk is white iff birds lay eggs”
TRUE
4. “33 is divisible by 4 if and only if horse has four legs”
FALSE
5. “x > 5 iff x2 > 25”
FALSE
18
pq (pq)(qp)
REMARK
For the phrasing "p if and only if q,", remember that "p if q“ means qp
while "p only if q" means p q.
That’s why pq is logically equivalent to (pq)(qp) and
this also justifies the name of the operator as biconditional.
REPHRASING BICONDITIONAL
19
English.
1.If it is hot outside you buy an ice cream cone, and if
you buy an ice cream cone it is hot outside.
2.For you to win the contest it is necessary and
sufficient that you have the only winning ticket.
3.If you read the news paper every day, you will be
informed and conversely.
4.It rains if it is a weekend day, and it is a weekend
day if it rains.
5.The train runs late on exactly those days when I
take it.
6.This number is divisible by 6 precisely when it is
divisible by both 2 and 3
p q p ~ ~ ~ q ~ (pq) (~ q
q q p p ~ p)
T T F F
T F T F
F T F T
F F T T
20
EXERCISE
3. If you read the news paper every day, you will be informed and
conversely.
Sol You will be informed if and only if you read the news paper every day.
4. It rains if it is a weekend day, and it is a weekend day if it rains.
Sol It rains if and only if it is a weekend day.
5. The train runs late on exactly those days when I take it.
Sol The train runs late if and only if it is a day I take the train.
6. This number is divisible by 6 precisely when it is divisible by both
2 and 3.
Sol This number is divisible by 6 if and only if it is divisible by both 2 and
3.
21
TRUTH TABLE FOR
(pq) (~ q ~ p)
p q pq ~q ~p ~ q ~ p (pq) (~ q ~ p)
T T T F F T T
T F F T F F T
F T T F T T T
F F T T T T T
Here in the above table note that all the values in the columns
of (pq) and(~ q ~ p) are the same so in their biconditional we have
T and we can say that the statement form (pq) (~ q ~ p) is a
tautology. But it does not mean that all the biconditional statements are
Tautologies as in the next example we have (pq)(rq) is not a
tautology as shown by the Truth table below.
1. ~(negation)
2. (conjunction), (disjunction)
3. (conditional), (biconditional)
In the next table we will use the hierarchy of operations
TRUTH TABLE FOR
p ~r qr
T F T F F T F
T F F T T F F
F T T F F T F
F T F T F T F
F F T F F T F
F F F T F F T
From the last column of the table we can easily see that (pq)(rq) is
not a Tautology.(Remember the definition of tautology, a statement is
tautology if it has only its Truth values as “True” regardless the values of its
constituents statements.) 23
LOGICAL EQUIVALENCE
INVOLVING BICONDITIONAL
p q ~p ~q ~pq p~q
T T F F F F
T F F T T T
F T T F T T
F F T T F F
EXERCISE
Now note that the entries in the last two columns are same hence the
corresponding statement forms are Logically equivalent.
24
LAWS OF LOGIC
2. Implication Laws: p q ~p q
~(p ~q)
3. Exportation Law: (p q)r p (q r)
4. Equivalence: p q (p q)(q p)
5. Reductio ad absurdum p q (p ~q) c
Suppose that p and q are statements so that pq is false. Find the truth
values of each of the following:
1. ~p q
2. pq
3. qp
27
SOLUTION
1.TRUE
2.TRUE
3.FALSE
28