Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

CONTENTS i

Contents

1 Mathematical Logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 What is Logic? 1

1.2 Propositions 1

1.3 Compound Proposition 2

1.4 Connectives 2

1.5 Important Connectives 3

1.6 Statement Formula or Well Formed Formula 7

1.7 Tautology 8

1.8 Contradiction 8

1.9 Equivalence Formulas 10

1.10 Duality Law 12

1.11 Tautological Implications 13

1.12 Inverse, Converse and Contrapositive 15

1.13 Other Connectives 16

1.14 Two-state Devices and Statement of Logic 18


1

1 Mathematical Logic
1.1 What is Logic?
Logic may be defined as the science of reasoning. But logic is not an empirical
(i.e., experimental or observational) science like Physics, Biology, or Psychology.
Rather, logic is a non-empirical science like Mathematics. Logic provides rules
and techniques for determining whether a reasoning is valid or not. Logical
arguments are the essence of Mathematics. Logical methods are used to
prove theorems in Mathematics. In Computer Science, they are used to verify
the correctness of programs. In Natural Science and Physical Science, they
are used to draw conclusions from experiments. One component of logic is
Propositional Calculus.

1.2 Propositions
A declarative sentence that is either true or false is called a proposition or a
statement.
A proposition which cannot be further broken into simpler propositions is called
atomic proposition or simple proposition.
A proposition has two possible values called truth values. The two truth values
are true and false. They are denoted by T and F. These values are also denoted
by 1 and 0.

Illustration 1.1 1. 4 + 7 = 9

2. Thiruvananthapuram is the capital of Kerala.

3. The integer 5 is a prime number.

4. It is raining.

5. I am hungry.
2 Mathematical Logic

6. God exists.
The truth value of (1) is false and the truth values of (2) and (3) are true.

No. Statement Truth Value


1 India is a country True
2 Kollam is the capital of Kerala False
3 3 + 4 = 10 False

Illustration 1.2

Illustration 1.3
The following are not propositions.

1. Open the door. (command)

2. x+4=7. (x is unknown)

3. Nehru was a great Prime Minister of India. (comparison)

Simple propositions are represented by letters p, q, r, . . .. These letters are


known as propositional variables or statement variables.

1.3 Compound Proposition


Two or more simple propositions can be combined to form a new proposition.
The new proposition thus formed is called compound proposition.

1.4 Connectives
The words and phrases used to combine two or more simple propositions are
called connectives.
1.5 Important Connectives 3

1.5 Important Connectives

1.5.1 Conjunction
Let p and q be two propositions. The conjunction of p and q is denoted by p ∧ q.
It is read as p and q. The conjunction is formed by combining the propositions
using the connective ‘and’. p ∧ q has a truth value T whenever both p and q
have a truth value T. In other cases it has a truth value F.
The truth table for p ∧ q is shown in the Table 1.1.

p q p∧q
T T T
T F F
F T F
F F F

Table 1.1: Table for (p ∧ q)

Illustration 1.4 1. p : I am rich.


q : I am happy.
p ∧ q : I am rich and happy.

2. p : I will drive my car.


q : I will be late.
p ∧ q : I will drive my car and I will be late.

3. p: 2 is an even integer.
q: 4 is an even integer.
p ∧ q 2 is an even integer and 4 is an even integer.

1.5.2 Disjunction
Let p and q be two propositions. The disjunction of p and q is denoted by p ∨ q.
It is read as p or q. The disjunction is formed by combining the propositions
4 Mathematical Logic

using the connective ‘or’. p ∨ q has a truth value F whenever both p and q have
a truth value F. In other cases it has a truth value T.
The truth table for p ∨ q is shown in the Table 1.2.

p q p∨q
T T T
T F T
F T T
F F F

Table 1.2: Table for (p ∨ q)


Illustration 1.5 1. p : I am rich.
q : I am happy.
p ∨ q : I am rich or happy.

2. p : I will drive my car.


q : I will be late.
p ∨ q : I will drive my car or I will be late.

3. p: 2 is an even integer.
q: 4 is an even integer.
p ∨ q: 2 is an even integer or 4 is an even integer.

1.5.3 Negation
Let p be a proposition. The negation of p is not the case of p. It is denoted by
∼ p or ¬p. It is read as negation of p. The truth table for ¬p is shown in the
Table 1.3.
Illustration 1.6 1. p : I am rich.
¬p : I am not rich.
Or
¬p : It is not the case that I am rich.
p ¬p
T F
F T

Table 1.3: Table for (¬p)


1.5 Important Connectives 5

2. p : I will drive my car.


¬p : I will not drive my car.

Or
¬p : It is not the case that I will drive my car.

3. p : 2 + 7 > 7
¬p :2 + 7 ≤ 7.

1.5.4 Implication
Let p and q be two propositions. p and q can be combined to form ‘if p then q’.
Such a statement is called implication. The implication of p and q is denoted by
p → q. It is read as ‘p implies q’. p → q has a truth value F when p has a truth
value T and q has a truth value F. In other cases it has a truth value T.
The truth table for p → q is shown in the Table 1.4.

Illustration 1.7 1. p : I am rich.


q : I am happy.
p → q : If I am rich then I am happy.

2. p : I will drive my car.


q : I will be late.
p → q :If I drive my car then I will be late.

3. p: 2 is an even integer.
q: 4 is an even integer.
p q p→q
T T T
T F F
F T T
F F T

Table 1.4: Table for (p → q)


6 Mathematical Logic

p → q: If 2 is an even integer then 4 is an even integer.

The statement p → q can be read in one of the following ways:

• If p, then q

• If p, q

• p implies q

• p only if q

• q if p

• p is sufficient for q

• q is necessary for q

1.5.5 Biconditional
Two propositions p and q can be combined using the connective ‘if and only if’.
The statement thus formed is called biconditional statement. It is writern as
p ↔ q The statement p ↔ q is true if both p and q have the same truth value. In
all other cases it has a truth value F.

Illustration 1.8 1. p : I am happy.


q : I am rich.
p ↔ q :I am happy if and only if I am rich.
p q p↔q
T T T
T F F
F T F
F F T

Table 1.5: The truth table for p ↔ q


1.6 Statement Formula or Well Formed Formula 7

2. p : I will drive my car.


q : I will be late.
p ↔ q : I will drive my car if and only if I will be late.

3. p: 2 is an even integer.
q: 4 is an even integer.
p ↔ q: 2 is an even integer if and only if 4 is an even integer.

1.6 Statement Formula or Well Formed Formula


A statement formula is an expression which is a string that consists of statement
variables, parenthesis and connective symbols. This string is generated by
finitely many applications of the following steps.

1. The statement variable itself is a well-formed formula.

2. If p is a well-formed formula, then ¬p.

3. If p and q are well-formed formulas then ¬p, (p ∧ q), (p ∨ q). p → q and


p ↔ q are well formed formulas.

4. A string of symbols containing the statement variables, connectives and


parentheses is a well-formed formula if it can be obtained by finitely many
applications of rules 1,2 and 3.

The following are well-formed formulas:

(a) ¬(p ∧ q)

(b) ¬(p ∨ q)

(c) p → (p ∧ q)

(d) ((p ∧ q) ∨ (p ∨ q)) ↔ (p ∨ (qo))

The following are not well formed formulas.


8 Mathematical Logic

1. (p → q) → (∧q) (∧q is not a well formed formula.

2. ∧p is not a well-formed formula.

1.7 Tautology
A statement formula which is always true, regardless of the truth value of its
components, is called a tautology.

Illustration 1.9
p ∨ ¬p is a tautology.

Illustration 1.10
(p ∨ q) ∨ ¬p is a tautology. (p ∨ q) ∨ ¬p is always true regardless of the truth
value of its components. So it is a tautology.

1.8 Contradiction
A statement formula which is always false, regardless of the truth values of its
components, is called a contradiction.

Illustration 1.11
p ∧ ¬p is a contradiction.

Illustration 1.12
(¬q ∧ p) ∧ q is a contradiction (¬q ∧ p) ∧ q is always false. So (¬q ∧ p) ∧ q is a
contradiction.
p ¬p p ∨ ¬p
T F T
F T T

Table 1.6: Truth table for p ∨ ¬p


1.8 Contradiction 9

p q (p ∨ q) ¬p (p ∨ q) ∨ ¬p
T T T F T
T F T F T
F T T T T
F F F T T

Table 1.7: Truth table for (p ∨ q) ∨ ¬p

p ¬p p ∧ ¬p
T F F
F T F

Table 1.8: The truth table for p ∧ ¬p


(p ∧ q) ∧ q is always false. So p ∧ ¬p is a contradiction.

p q ¬q ¬q ∧ p (¬q ∧ p) ∧ q
T T F F F
T F T T F
F T F F F
F F T F F

Table 1.9: The truth table for (¬q ∧ p) ∧ q


10 Mathematical Logic

1.9 Equivalence Formulas


Let A and B be two statement formulas. If A and B have the same truth value for
every possible set of truth values of its components, then A and B are said to be
equivalent. If A and B are equivalent, then A↔B is a tautology. ‘A is equivalent
to B’ is denoted by A⇔B.

Illustration 1.13
¬(p ∨ q) ⇔ ¬p ∧ ¬q
¬(p ∨ q) and ¬p ∧ ¬q have the same truth value. so ¬(p ∨ q) ⇔ ¬p ∧ ¬q

Equivalent formulas:

1. Idempotent Laws

• p∨p ⇔ p
• p∧p ⇔ p

2. Associate laws

• (p ∨ q) ∨ r ⇔ p ∨ (q ∨ r)
• (p ∧ q) ∧ r ⇔ p ∧ (q ∧ r)

3. Commutative laws

• p∨q ⇔ q∨p
• p∧q ⇔ q∧p

4. Distributive laws
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 F F T F

Table 1.10: Truth table for ¬(p ∨ q) ⇔ ¬p ∧ ¬q


1.9 Equivalence Formulas 11

• p ∨ (q ∧ r) ⇔ (p ∨ q) ∧ (p ∨ r)

• p ∧ (q ∨ r) ⇔ (p ∧ q) ∨ (p ∧ r)

5. Absorption laws

• p ∨ F ⇔ p, p ∧ F ⇔ F

• p∨T ⇔ T, p∧T ⇔ p

6. Demorgan’s laws

• ¬(p ∨ q) ⇔ ¬p ∧ ¬q

• ¬(p ∧ q) ⇔ ¬p ∨ ¬q

Illustration 1.14
show that p → (q → r) ⇔ p → (¬q ∨ r) ⇔ (p ∧ q) → r.
Solution :

q → r ⇔ ¬q ∨ r
p → (q → r) ⇔ ¬p ∨ (¬q ∨ r)
⇔ (¬p ∨ ¬q) ∨ r
⇔ ¬(p ∧ q) → r

Illustration 1.15
Show that (¬p ∧ (¬q ∧ r)) ∨ (q ∧ r) ∨ (p ∧ r) ⇔ r
Solution :
(q ∧ r) ∨ (p ∧ r) ⇔ (q ∨ p) ∧ r Using Distributive law.
12 Mathematical Logic

(¬p ∧ (¬q ∧ r)) ∨ (q ∧ r) ∨ (p ∧ r)


⇔ (¬p ∧ (¬q ∧ r)) ∨ ((q ∨ p) ∧ r)
⇔ ((¬p ∧ ¬q) ∧ r) ∨ ((q ∨ p) ∧ r)
⇔ ((¬p ∧ ¬q) ∨ (q ∨ p)) ∧ r
⇔ (¬(p ∨ q) ∨ (q ∨ p)) ∧ r(Distributive Law)
⇔ T ∧r Since (¬p ∨ p) ⇔ T )
⇔r (Since (p ∧ T ) ⇔ p

1.10 Duality Law


Let A and B be two statement formulas. A and B are said to be duals of each
other if one can be obtained from the other by replacing ∧ by ∨ and ∨ by ∧.
The connectives ∧ and ∨ are also called duals of each other. If the statement
formula A contains truth values T or F, then its dual B is obtained by replacing
T by F and F by T, in addition to the above interchanges.

Illustration 1.16 1. (p ∧ q) ∨ p. The dual is (p ∨ q) ∧ p

2. ¬(p ∧ q) ∨ (p ∧ ¬(q ∨ ¬s)). The dual is ¬(p ∨ q) ∧ (p ∨ ¬(q ∧ ¬s))

3. (p ∧ q) ∨ T . The dual is (p ∨ q) ∧ F

Theorem 1.1
Let A and A∗ be dual formulae. If p1 , p2 , . . . , pn are all atomic variables that occur
in A and A∗ , then

¬A(p1 , p2 , . . . , pn ) ⇔ A∗ (¬p1 , ¬p2 , . . . ¬pn )


A(¬p1 , ¬p2 , . . . ¬pn ) ⇔ ¬A∗ (p1 , p2 , . . . , pn )
1.11 Tautological Implications 13

Proof :
¬(p1 ∨ p2 ∨ . . . ∨ pn ) ⇔ (¬p1 ∧ ¬p2 ∧ . . . ∧ ¬pn )

taking negations on both sides

¬¬(p1 ∨ p2 ∨ . . . ∨ pn ) ⇔ ¬( ¬p1 ∧ ¬p2 ∧ . . . ∧ ¬pn )


(p1 ∨ p2 ∨ . . . ∨ pn ) ⇔ ¬( ¬p1 ∧ ¬p2 ∧ . . . ∧ ¬pn )also
(p1 ∧ p2 ∧ . . . ∧ pn ) ⇔ ¬( ¬p1 ∨ ¬p2 ∨ . . . ∨ ¬pn )
A(p1 , p2 , . . . , pn ) ⇔ ¬A∗ (¬p1 , ¬p2 , . . . ¬pn )

taking negations on both sides

¬A(p1 , p2 , . . . , pn ) ⇔ A∗ (¬p1 , ¬p2 , . . . ¬pn )

Similarly,

A(¬p1 , ¬p2 , . . . ¬pn ) ⇔ ¬A∗ (p1 , p2 , . . . , pn )

1.11 Tautological Implications


A statement A is said to tautologically imply a statement B, if and only if A → B
is a tautology. This is denoted by A ⇒ B which is read as A tautologically
implies B.

1.11.1 Methods of Proving Tautological Implications


Method 1: Using truth table.
To prove A⇒ B, show that A→ B is a tautology.

Illustration 1.17
Prove that p ∧ q ⇒ p
(p ∧ q) → p is a tautology. Therefore (p ∧ q) ⇒ p
14 Mathematical Logic

p q p∧q (p ∧ q) → p
T T T T
T F F T
F T F T
F F F T

Table 1.11: Truth table for (p ∧ q) → p


Method 2: In the formula A→B, A is called antecedent and B is called consequent.
To prove A⇒ B, assign truth value T to the antecedent of A→B, then prove that
the consequent has a truth value T.
Otherwise, assume that the consequent B has a truth value F and prove that
the antecedent A has also a truth value F.

Illustration 1.18

1. Prove (p ∧ q) ⇒ (p → q)
The antecedent is p ∧ q. Assume p ∧ q is true. Both p and q are true. If p
and q are true, then p → q is true. Therefore (p ∧ q) ⇒ (p → q)

2. Prove that (p ∧ (p → q)) ⇒ q


Here the antecedent is p ∧ (p → q). Assume p ∧ (p → q) is true. Then p is
true and p → q is true. Since p is true, and p → q is true, q is also true.
Therefore (p ∧ (q → q)) ⇒ q.

Tautological Implications

1. p ∧ q ⇒ p

2. p ∧ q ⇒ q

3. p ⇒ p ∨ q

4. ¬p ⇒ p → q

5. q ⇒ p → q

6. ¬(p → q) ⇒ p
1.12 Inverse, Converse and Contrapositive 15

7. ¬(p → q) ⇒ ¬q

8. p ∧ (p → q) ⇒ q

9. ¬q ∧ (p → q) ⇒ ¬p

10. ¬p ∧ (p ∨ q) ⇒ q

11. (p → q) ∧ (q → r) ⇒ p → r

12. (p ∨ q) ∧ (p → r) ∧ (q → r) ⇒ r

1.12 Inverse, Converse and Contrapositive


Let p and q be prepositions. Then the inverse of p → q is ¬p → ¬q
the converse of p → q is q → p, and
the contrapositive of p → q is ¬q → ¬p.

Illustration 1.19 1. p: 4ABC is equilateral


q: 4ABC is isosceles
p → q: If 4ABC is equilateral, then it is isosceles.
Converse: q → p: If 4ABC is isosceles, then it is equilateral.
Inverse: ¬p → ¬q: If 4ABC is not equilateral, then it is not isosceles.
Contrapositive: ¬q → ¬p: If 4ABC is not isosceles, then it is not equilateral.

2. p: 2 is an even integer
q: 4 is an even integer
p → q: If 2 is an even integer then 4 is an even integer.
Converse: q → p: If 4 is an even integer then 2 is an even integer.
Inverse: ¬p → ¬q: If 2 is not an even integer then 4 is not an even integer.
Contrapositive: ¬q → ¬p: If 4 is not an even integer, then 2 is not an even
integer.
16 Mathematical Logic

1.13 Other Connectives

1.13.1 Exclusive OR
Let p and q be any two statement formulas. Then p and q can be combined
¯ It has a truth value
using the connective exclusive OR. This is denoted by p∨q.
T whenever either p or q but not both have a truth value T .

1.13.2 NAND
The connective NAND is a combination of NOT and AND. Here NOT is for
negation and AND is for conjunction. It is denoted by ↑.

p ↑ q = ¬(p ∧ q)

1.13.3 NOR
NOR is the combination of NOT and OR. It is denoted by ↓

p ↓ q = ¬(p ∨ q)

1.13.4 Functionally Complete Set of Connectives


Let F be a set of connectives such that

1. every formula can be expressed in an equivalent form using the connectives


from F
p q p∨q ¯
T T F
T F T
F T T
F F F
¯
Table 1.12: The truth table for p∨q
1.13 Other Connectives 17

2. F does not contain any redundent connectives.

Then F is said to be a functionally complete set of connectives.

Illustration 1.20
Prove that the set F = {¬, ∨} is a functionally complete set of connectives.
Solution :
To prove that F is functionally complete set, we have to express all other
connectives in terms of the connectives in the set.

1. p ∧ q

p ∧ q ⇔ ¬¬(p ∧ q)
⇔ ¬(¬p ∨ ¬q)

2. p → q

p → q ⇔ ¬p ∨ q)

3. p ↔ q

p ↔ q ⇔ (p → q) ∧ (q → p)
⇔ (¬p ∨ q) ∧ (¬q ∨ p)
⇔ ¬¬((¬p ∨ q) ∧ (¬q ∨ p))
⇔ ¬(¬(¬p ∨ q) ∨ ¬(¬q ∨ p))

¯
4. p∨q

¯
p∨q ⇔ ¬(p ↔ q)
↔ ¬(¬(¬(¬p ∨ q)) ∨ ¬(¬q ∨ p))
18 Mathematical Logic

5. p ↑ q

p ↑ q ⇔ ¬(p ∧ q)
⇔ ¬p ∨ ¬q

6. q ↓ q

p ↓ q ⇔ ¬(p ∨ q)

We are able to express every other connectives in its equivalent form using
the connectives from the given set F. So the set F = {¬, ∨} is a functionally
complete set.

1.14 Two-state Devices and Statement of Logic

1.14.1 Switching Circuit


A switch is a device for opening and closing an electric circuit. So just like
proposition, a switch is also a two-state device. We shall consider electric
circuit that has only switches. They are referred to us switching circuits or
network. The simple network consists of a wire containing single switch x. If
the switch x is open, the value is defined to be 0. If the switch x is closed, then
the value is defined to be 1.

Illustration 1.21
Write the implications of the following propositions:

1. a p: There is flood.
q: The crops will be destroyed.
Solution :
p → q: If there is flood then the corps will be destroyed.
b p Ramu is rich.
q: Ramu is happy.
Solution :
p → q: If Ramu is rich then Ramu is happy.
1.14 Two-state Devices and Statement of Logic 19

Illustration 1.22
Which of the following are propositions?

(a) The earth is flat.

(b) Study Mathematics.

(c) If stock prices fall, then I will lose money.

(d) What a beautiful day!

(e) There will be snow in January.

Solution :
(a), (c) and (e) are statements (b) and (d) are not statements.

Illustration 1.23
Construct the truth table for (p ∨ q) ∧ (q ∨ r)
Solution :
The truth table for (p ∨ q) ∧ (q ∨ r)

Illustration 1.24
Write the negation of each of the following.

(a) 2 + 7 ≤ 11

(b) 4 is an even integer and 8 is an odd integer.

(c) If you drive, then I will not walk.

(d) If he studies, then he will pass the examination.

Solution :

(a) 2 + 7 > 11

(b) 4 is not an even integer or 8 is not an odd integer.


20 Mathematical Logic

p q r p∨q q∨r (p ∨ q) ∧ (q ∨ r)
T T T T T T
T T F T T T
T F T T T T
F T T T T T
T F F T F F
F F T F T F
F T F T T T
F F F F F F

Table 1.13: Table for (p ∨ q) ∧ (q ∨ r)


(c) You drive and I will walk. The statement is of the form p → q.

p → q ⇔ ¬p ∨ q
¬(p → q) ⇔ ¬(¬p ∨ q)
⇔ p ∧ ¬q

(d) He studies and he will not pass the examination.

Illustration 1.25
Write the negation of each of the following.

(a) n < 10 or n is odd.

(b) a2 + b2 = c2 and a > 0.

(c) x + y = 6 or 2x + 3y < 3.

Solution :

(a) n ≥ 10 and n is not odd.

(b) a2 + b2 , c2 or a ≤ 0.

(c) x + y , 6 and 2x + 3y ≥ 3.
1.14 Two-state Devices and Statement of Logic 21

Illustration 1.26
Construct the truth table for ¬(p ∧ q) ↔ (¬p ∨ ¬q).
Solution :
Let x = ¬(p ∧ q) ↔ (¬p ∨ ¬q).

Illustration 1.27
Construct the truth table for (q → p) → (p ∨ q).
Solution :

Illustration 1.28
Assuming p is true, q is false and r is true, find the truth value of each of the
following

1. (p ∧ q) → r

2. (p ∨ q) → r

3. p ∧ (q → r)

4. p → (q → r)

Solution :

p = T , q = F, r = T

1. (p ∧ q) → r
Since p is true and q is false p∧q is false, r is true. Therefore (p∧q) →
r is true.
p q p ∧ q ¬(p ∧ q) ¬p ¬q ¬p ∨ ¬q x
T T T F F F F T
T F F T F T T T
F T F T T F T T
F F F T T T T T

Table 1.14: Table for ¬(p ∧ q) ↔ (¬p ∨ ¬q)


22 Mathematical Logic

p q q→p (p ∨ q) (q → p) → (p ∨ q)
T T T T T
T F T T T
F T F T T
F F T F F

Table 1.15: Table for (q → p) → (p ∨ q)


2. (p ∨ q) has a truth value T, r has a truth value F. So (p ∨ q) → r is false.

3. q → r has a truth value T and p has a truth value T. So p ∧ (q → r) is


true.

4. q → r has a truth value T. So p → (q → r) has a truth value .

Illustration 1.29
Assuming p and r are false and that of q and s are true, find the truth value of
the each of the following propositions:

1. (s → (p ∧ ¬r)) ∧ (p → (r ∨ q)) ∧ s

2. ((p ∧ ¬q) → (q ∧ r)) → (s ∨ ¬q)

Solution :

p = F, r = F, q = T , s = t

1. ¬r is true.
(p ∧ ¬r) has a truth value F.
s → (p ∧ ¬r) has a truth value F. Therefore the given expression (s →
(p ∧ ¬r)) ∧ (p → (r ∨ q)) ∧ s has the truth value F.

2. (p ∧ ¬q) has a truth value F.


q ∧ r has a truth value F.
(p ∧ ¬q) → (q ∧ r) is True.
s ∨ ¬q) has a truth value F.
So the expression ((p ∧ ¬q) → (q ∧ r)) → (s ∨ ¬q) has the truth value T.
1.14 Two-state Devices and Statement of Logic 23

Illustration 1.30
p: It is below freezing point, and q: It is snowing. What ate the following
statements in symbolic form?

1. It is below freezing point and snowing.

2. It is not below freezing point and it is not snowing.

3. It is either snowing or below freezing point.

4. ‘It is below freezing point’ is the necessary and sufficient condition for it
to be snowing.

Solution :

1. p ∧ q

2. ¬p ∧ ¬q

3. p ∨ q

4. p → q

Illustration 1.31
Formulate the following symbolic expressions in words using
p: Today is Monday.
q: It is raining.
r: It is hot.

1. p ∨ q

2. ¬p ∧ (q ∨ r)

3. ¬(p ∨ q) ∧ r

Solution :
24 Mathematical Logic

1. Today is Monday or it is raining.

2. Today is not Monday and either it is raining or it is hot.

3. It is hot and it is not the case that today is Monday or it is raining.

Illustration 1.32
p: It is below freezing point and q: It is snowing. What ate the following
statements in symbolic form?

1. It is below freezing point and snowing.

2. It is not below freezing point and it is not snowing.

3. It is either snowing or below freezing point.

4. ‘It is below freezing point’ is the necessary and sufficient condition for it
to be snowing.

Solution :

1. p ∧ q

2. ¬p ∧ ¬q

3. p ∨ q

4. p → q

Illustration 1.33
Formulate the following symbolic expressions in words using
p: Today is Monday.
q: It is raining.
r: It is hot.

1. p ∨ q

2. ¬p ∧ (q ∨ r)
1.14 Two-state Devices and Statement of Logic 25

3. ¬(p ∨ q) ∧ r

Solution :

1. Today is Monday or it is raining.

2. Today is not Monday and either it is raining or it is hot.

3. It is hot and it is not the case that today is Monday or it is raining.

Illustration 1.34
Indicate which ones are tautologies or contradiction:

(a) (p → ¬q) → ¬p

(b) p → (p ∨ q)

(c) p → (q → p)

Solution :

(a) (p → ¬p) → ¬p is a tautology.

(b) p → (p ∨ q) is a tautology.

(c) p → (q → p) is a tautology.

Illustration 1.35
Show that the following statements are true.

1. ¬(p ∨ q) ⇔ (¬p ∧ ¬q)

2. ¬(p ∧ q) ⇔ (¬p ∨ ¬q)


p ¬p (p → ¬p) (p → ¬p) → ¬p
T F F T
F T F T

Table 1.16: Table for (p → ¬p) → ¬p


26 Mathematical Logic

p q p∨q p → (p ∨ q)
T T T T
T F T T
F T T T
F F F T

Table 1.17: Table for p → (p ∨ q)

p q q→p p → (q → p)
T F T T
T T T T
F T F T
F F T T

Table 1.18: Table for p → (q → p)


3. (p → q) ⇔ (¬p ∨ q)

Solution :
:

1. x = ¬(p ∨ q) ↔ (¬p ∧ ¬q) is a tautology. ∴ ¬(p ∨ q) ⇔ (¬p ∧ ¬q)

2. x = ¬(p ∧ q) ↔ (¬p ∨ ¬q) is a tautology. ∴ ¬(p ∧ q) ↔ (¬p ∨ ¬q)

3. (p → q) ↔ (¬p ∨ q) is a tautology. ∴ (p → q) ⇔ (¬p ∨ q)

Illustration 1.36
Without using truth table prove
p → (q → p) ⇔ ¬p → (p → q).
p q p∨q ¬p ¬q ¬(p ∨ q) ¬p ∧ ¬q x
T T T F F F F T
T F T F T F F T
F T T T F F F T
F F F T T T T T

Table 1.19: Table for¬(p ∨ q) ↔ (¬p ∧ ¬q)


1.14 Two-state Devices and Statement of Logic 27

p q p∧q ¬p ¬q ¬(p ∧ q) ¬p ∨ ¬q x
T T F F F F F T
T F F F T T T T
F T F T F T T T
F F F T T T T T

Table 1.20: Table for ¬(p ∧ q) ↔ (¬p ∨ ¬q)

p q p→q ¬p ¬p ∨ q (p → q) ↔ (¬p ∨ q)
T T F T T T
T F F F F T
F T T T T T
F F T T T T

Table 1.21: Table for (p → q) ↔ (¬p ∨ q)


Solution :
We know that p → q ⇔ ¬p ∨ q. Therefore q → p ⇔ ¬q ∨ p

p → (q → p) ⇔ ¬p ∨ (¬q ∨ p)
⇔ ¬p ∨ ¬q ∨ p
⇔ (¬p ∨ p) ∨ ¬q
⇔ T ∨ ¬q (¬p ∨ p = T )
⇔ T. (T ∨ p = T ) (1.1)
Also, ¬p → (p → q) ⇔ ¬¬p ∨ (¬p ∨ q)
⇔ p ∨ ¬p ∨ q
⇔ (p ∨ ¬p) ∨ q
⇔ T ∨ ¬q
⇔ T (1.2)

From 1.1 and 1.2 p → (q → p) ⇔ ¬p → (p → q)

Illustration 1.37
With out using truth table prove that
p → (q ∨ r) ⇔ (p → q) ∨ (¬p ∨ r)
28 Mathematical Logic

Solution :

p → (q ∨ r) ⇔ ¬p ∨ (q ∨ r)(p → q = ¬p ∨ q)
⇔ ¬p ∨ q ∨ r (1.3)
(p → q) ∨ (¬p ∨ r) ⇔ (¬p ∨ q) ∨ (¬p ∨ r) (1.4)
⇔ (¬p ∨ ¬p) ∨ (q ∨ r) (Associative rule)
⇔ ¬p ∨ q ∨ r(p ∨ p ⇔ p) (1.5)

From 1.3 and 1.5, p → (q ∨ r) ⇔ (p → q) ∨ (¬p ∨ r)

Illustration 1.38
Prove that q ⇒ (p → q)
Solution :
Method 1: Using truth table.
To prove q ⇒ (p → q) we have to prove q → (p → q) is a tautology. q → (p →
q) is a tautology. Therefore q ⇒ (p → q)

p q p→q q → (p → q)
T T T T
T F F T
F T T T
F F T T

Table 1.22: Truth table for q → (p → q)

You might also like