Lecture 2
Lecture 2
2 Truth Tables
1. ~p q
2. ~ p (q ~ r)
3. (p q) ~ (p q)
p q ~p ~p q
T T F F
T F F F
F T T T
F F T F
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
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
USAGE OF “OR” IN ENGLISH
In English language the word OR is sometimes used in an inclusive sense (p or q or
both).
The word OR is sometimes used in an exclusive sense (p or q but not both). As in the
below statement
While defining a disjunction the word OR is used in its inclusive sense. Therefore, the
symbol means the “inclusive OR”
EXCLUSIVE OR:
When OR is used in its exclusive sense, The statement “p or q” means “p or q but not
both” or “p or q and not p and q” which translates into symbols as (p q) ~ (p q)
It is abbreviated as p q or p XOR q
p q p q
T T F
T F T
F T T
F F F
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
Note: Basically
p q ≡ (p ∧ ∼ q) ∨ (~ p ∧ q)
≡ [p ∧ ~ q) ∨ ~ p] ∧ [(p ∧ ~ q) ∨ q]
≡ (p ∨ q) ∧ ∼ (p ∧ q)
≡ (p ∨ q) ∧ (∼ p ∨ ~ q)
LOGICAL EQUIVALENCE
If two logical expressions have the same logical values in the truth table, then we say that
the two logical expressions are logically equivalent. In the following example, ~ (~ p ) is
logically equivalent p. So it is written as ~(~p) ≡ p
p ~p ~(~p)
T F T
F T F
Example
Rewrite in a simpler form:
“It is not true that I am not happy.”
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”
Example
Show that ~ (p∧q) and ~ p ∧ ~ q are not logically equivalent
Solution:
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
Symbolically ~ (p ∧ q) ≡ ~ p ∨ ~ q
Symbolically ~ (p ∨ q) ≡ ~ p ∧ ~ q
Truth Table of ~ (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
Solution:
a) The fan is not slow and it is not very hot.
b) Akram is not unfit or Saleem is not injured.
EXERCISE:
1. Show that (p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
2. Are the statements ( p ∧ q ) ∨ r and 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”.
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”.
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 it is a
contradiction i.e. p ∧ ~ p ≡c
REMARKS:
– Most statements are neither tautologies nor contradictions.
– The negation of a tautology is a contradiction and vice versa.
– In common usage we sometimes say that two statement are contradictory.
By this we mean that their conjunction is a contradiction: they cannot both
be true.
LOGICAL EQUIVALENCE INVOLVING TAUTOLOGY
1. 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
Show that p ∧ c ≡ c
p c p∧c
T F F
F F F
EXERCISE:
Use truth table to show that ( p ∧ q ) ∨ (~ p ∨ ( p ∧ ~q )) is a tautology.
SOLUTION:
Since we have to show that the given statement form is Tautology, so the
column of the above proposition in the truth table will have all entries as T. As clear from
the table below
p q p∧q ~p ~q p∧~q ~ p∨ (p ∧ ~q) (p ∧ q) ∨
(~p ∨ (p ∧ ~q))
T T T F F F F T
T F F F T T T T
F T F T F F T T
F F F T T F T T
Hence ( p ∧ q ) ∨(~ p ∨( p ∧ ~ q )) ≡ t
EXERCISE:
Use truth table to show that (p ∧ ~q) ∧(~p∨q) is a contradiction.
SOLUTION:
Since we have to show that the given statement form is Contradiction, so its
column in the truth table will have all entries as F. As clear from the table below.
p q ~q p∧~q ~p ~p∨q ( p ∧ ~ q ) ∧( ~ p ∨ q )
T T F F F T F
T F T T F F F
F T F F T T F
F F T F T T F
LAWS OF LOGIC
1) Commutative Laws
p∧q ≡q∧ p
p∨q ≡q∨ p
2) Associative Laws
(p ∧ q ) ∧ r ≡ p∧(q ∧r)
(p∨ q ) ∨r ≡ p∨(q ∨r)
3) Distributive Laws
p∧( q∨r) ≡(p∧q ) ∨ ( p∧ r)
p∨(q ∧r) ≡(p∨q ) ∧( p∨r)
4) Identity Laws
p∧t ≡p
p∨c≡p
5) Negation Laws
p ∨ ∼p ≡ t
p ∧ ∼p ≡ c
7) Idempotent Laws
p∧p≡p
p∨p≡p
8) DeMorgan’s Laws
~ ( p ∧ q ) ≡ ~p ∨ ∼q
~ ( p ∨ q ) ≡ ~p ∧ ∼q