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

Week 2

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

Week 2

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

LOGICAL EQUIVALENCES

LAWS OF LOGIC

Given any statement variables p, q and r, a tautology t and a contradiction c,


the following logical equivalences hold:

Commutative Laws: pqqp


pqqp
Associative Laws: (p  q)  r  p  (q  r)
(p  q)  r  p  (q  r)
Distributive Laws: p  (q  r)  (p  q)  (p  r)
p  (q  r)  (p  q)  (p  r)

Identity laws: ptp


pcp
Negation laws: p~pt
p~pc
Double negation law: ~ (~ p)  p
Idempotent laws: ppp
ppp
DeMorgan’s laws: ~ (p  q)  ~ p  ~ q
~ (p  q)  ~ p  ~ q
Universal bound laws: ptt
pcc
Absorption laws: p  (p  q)  p
p  (p  q)  p
Negations of t and c: ~tc
1
~ct
Note that all these laws can be proved by using truth tables

APPLYING LAWS OF LOGIC

Using law of logic, simplify the statement form p  [~(~p  q)]

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

Using Laws of Logic, verify the logical equivalence

~ (~ p  q)  (p  q)  p

SOLUTION
Consider
~(~p  q)  (pq)
 (~(~p)  ~q) (p  q) DeMorgan’s Law
 (p  ~q)  (pq) Double Negative Law
 p  (~q  q) Distributive Law
pc Negation Law
p Identity Law
Hence the logical equivalence has been shown. 2
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," and
q: "I will buy you a computer."
The original statement is then saying :
if p is true, then q is true, or, more simply, if p, then q.
We can also phrase this as p implies q, and we write p  q.
EXPLANATION

Suppose for the sake of argument that the statement


"If you earn an A in Math, then I'll buy you a computer," is true.
This does not mean that you will earn an A in Math;
all it says is that if you do so, then I will buy you a computer. Thinking of
this as a promise, the only way that it can be broken is if you do earn an A
and I do not buy you a computer. In general, we use this idea to define the
statement p  q. 3
CONDITIONAL STATEMENTS OR IMPLICATIONS

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; otherwise it is true.
The arrow " " is the conditional operator, and in p  q the statement p is
called the hypothesis (or antecedent) and q is called the conclusion (or
consequent).

TRUTH TABLE FOR p  q

p q pq

T T T
T F F

F T T
F F T

NOTE: p  q is false only when p is true and q is false and in order to


assign truth values in the column of p  q first we have to find out the rows
where p is T ,then we will see the value of q corresponding to these values
of p where the q has F we will write F in the column of and in all other
values are T. Note that if hypothesis in this case) is false then we write T in
the column of p  q.

4
PRACTICE WITH CONDITIONAL STATEMENTS

Determine the truth value of each of the following conditional statements:


1. “If 1 = 1, then 3 = 3.” TRUE
2. “If 1 = 1, then 2 = 3.” FALSE
3. “If 1 = 0, then 3 = 3.” TRUE
4. “If 1 = 2, then 2 = 3.” TRUE
5. “If 1 = 1,then 1 = 2 and 2 = 3.” FALSE
6. “If 1 = 3 or 1 = 2 then 3 = 3.” TRUE

ALTERNATIVE WAYS OF EXPRESSING IMPLICATIONS

The implication p  q could be expressed in many alternative ways


as:

• “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”

5
TRANSLATING ENGLISH SENTENCES TO SYMBOLS

Let p and q be propositions:


p = “you get an A on the final exam”
q = “you do every exercise in this book”
r = “you get an A in this class”
Write the following propositions using p, q,and r and logical connective

6
1. To get an A in this class it is necessary for you to get an A on the
final.
SOLUTION pr

2. You do every exercise in this book; You get an A on the final, implies,
you get an A in the class.
SOLUTION pqr

3. Getting an A on the final and doing every exercise in this book is


sufficient for getting an A in this class.
SOLUTION pqr

TRANSLATING SYMBOLIC PROPOSITIONS TO ENGLISH


Let p, q, and r be the propositions:
p = “you have the flu”
q = “you miss the final exam”
r = “you pass the course”
Express the following propositions as an English sentence.
1. pq
If you have flu, then you will miss the final exam.
2. ~q  r
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. 7
HIERARCHY OF OPERATIONS
FOR LOGICAL CONNECTIVES

1. ~(negation)
2.  (conjunction),  (disjunction)
3.  (conditional)

EXAMPLE

Construct a truth table for the statement form p  ~ q  ~ p


SOLUTION
According to the order of operations for logical
connectives, p  ~ q  ~ p means (p  (~ q))  (~ p)

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.
8
EXAMPLE

Construct a truth table for the statement form (pq)(~ p r)


SOLUTION

p q r pq ~p ~pr (pq)(~ p r)


T T T T F T T
T T F T F T T
T F T F F T F
T F F F F T F
F T T T T T T
F T F T T F F
F F T T T T T
F F F T T F F

LOGICAL EQUIVALENCE INVOLVING IMPLICATION

Use truth table to show pq  ~q  ~p

p q ~q ~p pq ~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

9
IMPLICATION LAW
pq  ~pq

p q pq ~p ~pq
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  .

NEGATION OF A CONDITIONAL STATEMENT

We have shown in the above table that pq  ~pq. Now


pq  ~pq therefore
~ (p  q)  ~ (~ p  q)
 ~ (~ p)  (~ q) by De Morgan’s law
 p~q by the Double Negative law

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.

10
EXAMPLES

Write negations of each of the following statements:


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
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.

INVERSE OF A CONDITIONAL STATEMENT

The inverse of the conditional statement p  q is ~p  ~q


A conditional and its inverse are not equivalent as could be seen from the
truth table.

p q pq ~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
11
WRITING INVERSE

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 cannot get to class.
If my car is not in the repair shop, then I shall get to the class.

CONVERSE OF A CONDITIONAL STATEMENT

The converse of the conditional statement p  q is q  p


A conditional and its converse are not equivalent. That is  is not a
commutative operator.

p q pq qp
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
12
WRITING CONVERSE

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 ski tomorrow only if it snows today.
3. If P is a square, then P is a rectangle.
If P is a rectangle then P is a square.
4. If my car is in the repair shop, then I cannot get to class.
If I cannot get to the class, then my car is in the repair shop.

CONTRAPOSITIVE OF A CONDITIONAL STATEMENT

The contrapositive of the conditional statement p  q is ~ q  ~ p.


A conditional and its contrapositive are equivalent.
Symbolically, p  q  ~q  ~p as shown by the truth table below.

p q pq ~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.
13
WRITING CONTRAPOSITIVE

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 cannot get to class.
If I get to the class, then my car is not in the repair shop.

14
CONVERSE, INVERSE, AND CONTRAPOSITIVE

Implication: pq
Inverse: ~p  ~q
Converse: qp
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 pq 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

If you work hard you get good grades.


w = “You work hard”, g = “You get good grades.
w  g = If w then g
= “If you work hard you get good grades”
g  w = if g then w = g only if w
= “You get good grades only if you work hard” 15
BICONDITIONAL

If p and q are statement variables, 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 false if p and q have
opposite truth values.
The words if and only if are sometimes abbreviated iff.
The double headed arrow " " is the biconditional operator.
NOTE: The biconditional of two statements is false only when both p and q
have different Truth Values. That is one have truth value T and other have
Truth value F. Equivalently we can say that biconditional of two statements
p and q is True only when both p and q have same Truth Values.

TRUTH TABLE

p q p q
T T T
T F F
F T F
F F T

From the Truth Table of pq it is quite clear that pq 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 pq. That is biconditional is true when p and q
have same truth value.

16
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

17
pq  (pq)(qp)

p q pq pq qp (pq)(qp)


T T T T T T
T F F F T F
F T F T F F
F F T T T T

same truth values

REMARK

For the phrasing "p if and only if q,", remember that "p if q“ means qp
while "p only if q" means p q.
That’s why pq is logically equivalent to (pq)(qp) and
this also justifies the name of the operator  as biconditional.

REPHRASING BICONDITIONAL

pq is also expressed as:


“p is necessary and sufficient for q”
“if p then q, and conversely”
“p is equivalent to q”
Notice that pq is logically equivalent to qp, so we can reverse p and q
in the phrasings above.

18
EXERCISE

Rephrase the following propositions in the form “p if and only if q” in


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.
Sol You buy an ice cream cone if and only if it is hot outside.
2. For you to win the contest it is necessary and sufficient that you
have the only winning ticket.
Sol You win the contest if and only if you hold the only winning ticket.

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.

19
HIERARCHY OF OPERATIONS
FOR LOGICAL CONNECTIVES

1. ~(negation)
2.  (conjunction),  (disjunction)
3.  (conditional), (biconditional)
In the next table we will use the hierarchy of operations
TRUTH TABLE FOR
p  ~r qr

Here p  ~ r q  r means (p  (~ r)) (q  r)

p q r ~r p~r qr p  ~r qr


T T T F F T F
T T F T T T T

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 (pq)(rq) 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.) 20
LOGICAL EQUIVALENCE
INVOLVING BICONDITIONAL

Show that ~pq and p~q are logically equivalent

p q ~p ~q ~pq 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

Show that ~(pq) and pq are logically equivalent


Remember the logical connective  which we call “Exclusive or”.
Exclusive or has false truth value when both statements are true or when
both has truth value false.

p q pq ~(pq) pq


T T F T T
T F T F F
F T T F F
F F F T T

Now note that the entries in the last two columns are same hence the
corresponding statement forms are Logically equivalent.

21
EXAMPLE

An interesting teacher keeps me awake.


I stay awake in Discrete Mathematics class.
Therefore, my Discrete Mathematics teacher is interesting.
Is the above argument valid?
Now we define what is an argument.

ARGUMENT

An argument is a list of statements called premises (or assumptions or


hypotheses) followed by a statement called the conclusion.
P1 Premise

P2 Premise

P3 Premise

. . . . .. . . . .
Pn Premise

______________
C Conclusion
NOTE The symbol  read “therefore,” is normally placed just before the
conclusion.
But not always ,sometimes we use thus, so etc instead of therefore.

22
VALID AND INVALID ARGUMENT

An argument is valid if the conclusion is true when all the premises are true.
Alternatively, an argument is valid if conjunction of its premises imply
conclusion.
That is (P1 P2  P3  . . .  Pn)  C is a tautology.

An argument is invalid if the conclusion is false when all the premises are
true.
Alternatively, an argument is invalid if conjunction of its premises does not
imply conclusion.

REMARK:
A valid argument may have true premises and a true
conclusion, or false premises and a false conclusion, or false premises
and a true conclusion but it cannot have all true premises and yet a false
conclusion.
It is not part of logic to determine the truth or falsity of the premises
of arguments.
Arguments should never be described as true or false; and statements
should never be described as valid or invalid.

23
EXAMPLE

Show that the following argument form is valid:


pq
p
 q
SOLUTION
We will construct the truth table for premise and the conclusion.

p q pq p q
T T T T T
T F F T F
F T T F T
F F T F F

Now first row is such that both the premises have truth value T and
hence that row is the critical row and the conclusion also have truth
value T so the argument is valid.

EXERCISE

Show that the following argument form is invalid:


pq
q
 p
SOLUTION
First of all we will construct the truth table for premises
and conclusion.
24
p q pq q p
T T T T T
T F F F T
F T T T F
F F T F F

Now in the above table first and third rows are critical because both of our
premises are true in these rows. But the argument is invalid because in the
third row our conclusion is false.

EXAMPLE

Use truth table to determine the argument form


pq
p  ~q
pr
 r
is valid or invalid.

SOLUTION:
First of all note that in our argument there are three
statements are involved namely p , q and r , and we have three premises so
our table will have eight rows (means as there are 3 variables, so total no of
combinations are 8) and seven columns (note these seven columns does not
have the column for ~q). Now the truth table for the arguments and
conclusion is given below
25
p q r pq p~q pr r
T T T T F T T
T T F T F F F
T F T T T T T
T F F T T F F
F T T T T T T
F T F T T T F
F F T F T T T
F F F F T T F

In the above table we note that there are three critical rows and conclusion

It has truth value F against one critical row(which is 6th row) consequently our
argument is invalid.

WORD PROBLEM
If Tariq is not on team A, then Hameed is on team B.
If Hameed is not on team B, then Tariq is on team A.
 Tariq is not on team A or Hameed is not on team B.
SOLUTION
Let
t = Tariq is on team A
h = Hameed is on team B
Then the argument is
~th
~ht 26
~t~h
t h ~t  h ~h  t ~t ~h
T T T T F
T F T T T
F T T T T
F F F F T

Argument is invalid. Because there are three critical rows


( Remember that the critical rows are those rows where the premises
have truth value T) and in the first critical row conclusion has truth
value F. (Also remember that we say an argument is valid if in all
critical rows conclusion has truth value T)

EXERCISE

If at least one of these two numbers is divisible by 6, then the product of


these two numbers is divisible by 6.
Neither of these two numbers is divisible by 6.
The product of these two numbers is not divisible by 6.
SOLUTION
Let d= at least one of these two numbers is divisible by 6.
p= product of these two numbers is divisible by 6.
Then the argument become in these symbols
dp
~d
 ~p
We will made the truth table for premises and conclusion as given below
27
d p dp ~d ~p
T T T F F
T F F F T
F T T T F
F F T T T

The Argument is invalid

28
EXERCISE

An interesting teacher keeps me awake. I stay awake in Discrete


Mathematics class. Therefore, my Discrete Mathematics teacher is
interesting.
Solution:
t: my teacher is interesting a: I stay awake
m: I am in Discrete Mathematics class
the argument to be tested is t  a,
am
Therefore mt

t a m ta am mt


T T T T T T
T T F T F F
T F T F F T
T F F F F F
F T T T T F
F T F T F F
F F T T F F
F F F T F F

Argument is not valid

29

You might also like