0% found this document useful (0 votes)
0 views

Lecture 2

The document covers truth tables for various logical expressions, including negations and the use of 'OR' in both inclusive and exclusive senses. It explains logical equivalence, tautologies, contradictions, and De Morgan's Laws, providing examples and exercises for clarification. Additionally, it outlines laws of logic such as commutative, associative, and distributive laws.

Uploaded by

maheennizamani9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Lecture 2

The document covers truth tables for various logical expressions, including negations and the use of 'OR' in both inclusive and exclusive senses. It explains logical equivalence, tautologies, contradictions, and De Morgan's Laws, providing examples and exercises for clarification. Additionally, it outlines laws of logic such as commutative, associative, and distributive laws.

Uploaded by

maheennizamani9
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Lecture No.

2 Truth Tables

Truth Tables for:

1. ~p q
2. ~ p (q ~ r)
3. (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
USAGE OF “OR” IN ENGLISH
In English language the word OR is sometimes used in an inclusive sense (p or q or
both).

Example: I shall buy a pen or a book.


In the above statement, if you buy a pen or a book in both cases the statement is true and
if you buy both pen and book, then statement is again true. Thus we say in the above
statement we use or in inclusive sense.

The word OR is sometimes used in an exclusive sense (p or q but not both). As in the
below statement

Example: Tomorrow at 9, I’ll be in Lahore or Islamabad.


Now in above statement we are using OR in exclusive sense because if both the
statements are true, then we have F for the 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

TRUTH TABLE FOR EXCLUSIVE OR:

p q p q

T T F

T F T
F T T

F F F

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

Double Negative Property ~(~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

Different truth values in row 2 and row 3


DE MORGAN’S LAWS

1) The negation of an AND statement is logically equivalent to the OR statement in


which each component is negated.

Symbolically ~ (p ∧ q) ≡ ~ p ∨ ~ q

2) 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 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

Same truth values


APPLICATION:

Give negations for each of the following statements:


a) The fan is slow or it is very hot.
b) Akram is unfit and Saleem is injured.

Solution:
a) The fan is not slow and it is not very hot.
b) Akram is not unfit or Saleem is not injured.

INEQUALITIES AND DEMORGAN’S LAWS:

Use DeMorgan’s Laws to write the negation of


-1 < x ≤ 4 for some particular real number x
Here, -1 < x ≤ 4 means x > –1 and x ≤ 4
The negation of ( x > –1 and x ≤ 4 ) is ( x ≤ –1 OR x > 4 ).

We can explain it as follows:


Suppose p : x > –1
q: x≤4
~ p : x ≤ –1
~q: x>4
The negation of x > –1 AND x ≤ 4
≡ ~(p∧q)
≡ ~p ∨~q by DeMorgan’s Law,
≡ x ≤ –1 OR x > 4

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

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

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

LOGICAL EQUIVALENCE INVOLVING CONTRADICTION

Show that p ∧ c ≡ c

p c p∧c

T F F
F F F

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

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

6) Double Negation Law


∼( ∼p) ≡ p

7) Idempotent Laws
p∧p≡p
p∨p≡p

8) DeMorgan’s Laws
~ ( p ∧ q ) ≡ ~p ∨ ∼q
~ ( p ∨ q ) ≡ ~p ∧ ∼q

9) Universal Bound Laws


p∨t≡t
p∧c ≡c
10) Absorption Laws
p∨(p ∧q) ≡p
p∧(p ∨q) ≡p

11) Negation of t and c


~t≡c
~c≡t

You might also like