You are on page 1of 29

CSC102:Discrete Structure

Instructor: Khurram Iqbal

Department of Computer Science


COMSATS University, Islamabad
Recap

Lecture No 3

Department of Computer Science 2


How to determine truth value of implication

 A conditional statement denoted as p  q is


 

defined as: It is false when p is true and q is


false; otherwise it is true.

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

Department of Computer Science 3


Conclusion

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.

Department of Computer Science 4


Truth Table of Bi-conditional Statement

p q p q

T T T

T F F

F T F

F F T

Department of Computer Science 5


Lecture No 4

Department of Computer Science 6


Today Covered

1. How to prove LOGICAL EQUIVALENCE


using:
• Truth Table
• Laws of Logic
2. What is consistent statements and how to
determine whether a set of statements is
consistent?
3. How to deduce conclusion from given
statement?
Department of Computer Science 7
Logical Equivalence

 The statements:
 “6 is greater than 2”
 “2 is less than 6”
 are two different ways of saying the same
thing.
 Compound propositions that have the same
truth values in all possible cases are called
logically equivalent.
 The logical equivalence of statement forms P
and Q is denoted by writing P  Q.

Department of Computer Science 8


Testing Whether Two Statement Forms P and Q Are Logically Equivalent

 We can prove logical equivalence by using :


 Truth Table
 Laws of Logic

Department of Computer Science 9


Testing Logically Equivalence using Truth Table

Department of Computer Science 10


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

same truth values


Department of Computer Science 11
Your Turn
Are the statements (p  q)  r and p  (q  r) logically equivalent?

p q r pq q  r (p  q)  r p (q  r)
T T T T T T T
T T F T F F F
T F T F F F F
T F F F F F F
F T T F T F F
F T F F F F F
F F T F F F F
F F F F F F F

Same truth values

Department of Computer Science 12


Testing Logically Equivalence using Laws

Department of Computer Science 13


Testing Logically Equivalence using Laws

Department of Computer Science 14


Testing Logically Equivalence using Laws

Department of Computer Science 15


Applying Laws of Logic

Rewrite the statement forms without using the symbols  or 


1. p~qr 2. (pr)(q r)
SOLUTION
1. p~qr  (p~q)r order of operations
~(p~q)  r implication law

2. (pr)(q r)  (~p  r)(~q  r) implication law


 [(~p  r) (~q  r)]  [(~q  r) (~p  r)]
equivalence of
biconditional
 [~(~p  r)  (~q  r)]  [~(~q  r)  (~p 
r)]
Department of Computer Science 16
Your Turn

Rewrite the statement form ~p  q  r  ~q to a logically equivalent


form that uses only ~ and 
SOLUTION
STATEMENT REASON
~p  q  r  ~q Given statement form
 (~p  q)  (r  ~q) Order of operations
 ~[(~p  q)  ~ (r  ~q)] Implication law pq  ~(p~ q)
 ~[~(p  ~q)  (~r  q)] De Morgan’s law

Department of Computer Science 17


Argument and Rule of Inference

 Consider the following sequence of


propositions.
 The bug is either in module 17 or in module 81.
 The bug is a numerical error.
 Module 81 has no numerical error.
 Assuming that these statements are true
 It is reasonable to conclude
 The bug is in module 17
 This process of drawing a conclusion from a
sequence of propositions is called deductive
reasoning.
Department of Computer Science 18
Argument and Rule of Inference

 The given propositions are called hypotheses


or premises, and the proposition that follows
from the hypotheses is called the conclusion.

Department of Computer Science 19


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.

Department of Computer Science 20


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.

Department of Computer Science 21


An interesting teacher keeps me awake. I stay awake in Discrete
Structure class. Therefore, my Discrete Structure teacher is
interesting.
Is the above argument valid?

Department of Computer Science 22


How to show/prove validity of an argument

 We can always use a truth table to show


that an argument form is valid.
 We do this by showing that whenever the
premises are true, the conclusion must
also be true.
 Identify the premises and conclusion of the argument
form.
 Construct a truth table showing the truth values of all
the premises and the conclusion.
 Identify a critical row (a row of the truth table in which
all the premises are true).
 if the conclusion in every critical row is true, then
Departmentthe argument
of Computer Science form is valid. 23
Example

If I got an Eid bonus, I’ll buy an iPhone.


If I sell my motorcycle, I’ll buy an iPhone.
If I get an Eid bonus or I sell my motorcycle, then I’ll buy an iPhone.
SOLUTION:
Let e = I got an Eid bonus
i = I’ll buy an iPhone
m = I sell my motorcycle
The argument is
ei
mi
 emi

Department of Computer Science 24


premises conclusion

e s m e i m i em em i
T T T T T T T
T T F T T T T
T F T F F T F
T F F F T T F critical
rows
F T T T T T T
F T F T T F T
F F T T F T F
F F F T T F T
The argument is valid
Department of Computer Science 25
How to show/prove validity of an argument

 Proving that an argument is valid using


truth table can be a tedious approach.
 We can use rules of inference(relatively
simple argument forms) to prove validity
of complex argument.

Department of Computer Science 26


How to show/prove validity of an argument

Department of Computer Science 27


How to show/prove validity of an argument

 Proving that an argument is valid using


truth table can be a tedious approach.
 We can use rules of inference(relatively
simple argument forms) to prove validity
of complex argument.

Department of Computer Science 28


How to as questions related to Rule of Inference

 What rule of inference is used in each of


these arguments?
 For each of these sets of premises, what
relevant conclusion or conclusions can be
drawn? Explain the rules of inference
used to obtain each conclusion from the
premises.

Department of Computer Science 29

You might also like