Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 24

Discrete Structures

BSCS (3 Credit Hour)

Lecture # 02
Truth tables
 Truth tables for:
~pq
~ p  (q  ~ r)
(p  q)  ~ (p  q)
Truth table for the statement form ~ p  q

p q ~p ~pq
T T F F

T F F F

F T T T

F F T F
Truth table for ~ p  (q  ~ r)
p q r ~r q~r ~p ~ p  (q  ~ r)
T T T F T F F
T T F T T F F
T F T F F F F
T F F T T F F
F T T F T T T
F T F T T T T
F F T F F T F
F F F T T T T
Truth table for (p  q)  ~ (p  q)
p q p  q p  q ~ (pq) (p  q)  ~ (p  q)
T T T T F F
T F T F T T
F T T F T T
F F F F T F
Double Negative Property ~(~p)  p
p ~p ~(~p)
T F T
F T F
Example:
 “It is not true that I am not happy”
 Prove it double negation property for the above statement
~ (~p)  p
 Solution:
Let p = “I am happy”
Then ~p = “I am not happy”
and ~(~ p) = “It is not true that I am not happy”
Since ~ (~p)  p
Hence the given statement is equivalent to:
“I am happy”
~ (p  q) and ~p  ~q are not logically
equivalent

p q ~p ~q pq ~(pq) ~p  ~q
T T F F T F F
T F F T F T F
F T T F F T F
F F T T F T T
DE MORGAN’S LAWS:
 The negation of an and statement is logically equivalent
to the or statement in which each component is negated.
Symbolically: ~(p  q)  ~p  ~q.

 The negation of an or statement is logically equivalent to


the and statement in which each component is negated.
Symbolically: ~(p  q)  ~p  ~q.
Truth Table for ~(p  q)  ~p  ~q

p q ~p ~q p  q ~(p  q) ~p  ~q
T T F F T F F
T F F T T F F
F T T F T F F
F F T T F T T
Application of De morgan’s Law using
statements:
 Give negations for each of the following statements:
The fan is slow or it is very hot.
Akram is unfit and Saleem is injured.

 Solution:
The fan is not slow and it is not very hot.
Akram is not unfit or Saleem is not injured.
Exercise:
Associative Law

 Are the statements (p  q)  r  p  (q  r)?


 Are the statements (p  q)  r  p  (q  r) logically
equivalent?
TAUTOLOGY:
 A tautology is a statement form that is always true
regardless of the truth values of the statement variables.
 A tautology is represented by the symbol “T”..

 EXAMPLE:
The statement form p  ~ p is tautology
p ~p p~p
T F T
F T T

p  ~p  t
CONTRADICTION:
 A contradiction is a statement form that is always false
regardless of the truth values of the statement variables.
 A contradiction is represented by the symbol “c”.

 Note:
So if we have to prove that a given statement form is
CONTRADICTION we will make the truth table for the
statement form and if in the column of the given statement
form all the entries are F ,then we say that statement form
is contradiction.
EXAMPLE:
 The statement form p  ~ p is a contradiction.

p ~p p~p
T F F
F T F

 Since in the last column in the truth table we have F in all


the entries so is a contradiction
p  ~p c
REMARKS:
 Most statements are neither tautologies nor contradictions.
 The negation of a tautology is a contradiction and vice versa.
LOGICAL EQUIVALENCE INVOLVING
TAUTOLOGY
 Show that p  t  p

p t pt
T T T
F T F

 Since in the above table the entries in the first and last
columns are identical so we have the corresponding
statement forms are Logically Equivalent that is
ptp
LOGICAL EQUIVALENCE INVOLVING
CONTRADICTION
 Show that p  c  c
p c pc
T F F
F F F

 Same truth values in the indicated columns so pc  c


EXERCISE:
 Use truth table to show that (p  q)  (~p  (p  ~q)) is a
tautology.

 Use truth table to show that (p  ~q)  (~p  q) is a


contradiction.
INEQUALITIES AND DEMORGAN’S
LAWS
 Use De-Morgan’s Laws to write the negation of
-1 < x  4
-1 < x  4 means x > –1 and x  4

By DeMorgan’s Law, the negation is:


x > –1 or x  4
Which is equivalent to: x  –1 or x > 4
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 Law: 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

 De Morgan’s Laws: ~(p  q)  ~p  ~q


~(p  q)  ~p  ~q
 Universal Bound Law: ptt
pcc

 Absorptions Laws: p  (p  q)  p
p  (p  q)  p

 Negation of t and c: ~tc


~ct

You might also like