Mathematical Logic
Mathematical Logic
2.1 Introduction
Logic is the study of general patterns of reasoning, without reference to
particular meaning or contexts. If an object is either black or white, and if it is
not black, then logic leads us to the conclusion that it must be white.
Observe that logical reasoning from the given hypotheses cannot reveal
what ‘black’ or ‘white’ mean, or why an object can not be both.
Logic can find applications in many branches of sciences and social
sciences. Logic, in fact, is the theoretical basis for many areas of computer
science such as digital logic circuit design, automata theory and artificial
intelligence.
In this chapter, we shall learn about statements, truth values of a statement,
compound statements, basic logical connectives, truth tables, tautologies,
logical equivalence, duality, algebra of statements, use of Venn diagrams in
logic and finally, some simple applications of logic in switching circuits.
Objectives:
At the end of the unit you would be able to
explain the ideas in Mathematical Logic
apply the concept of Mathematical Logic in circuits
2.2 Statement
A statement is a sentence which is either true or false, but not both
simultaneously.
Note: A sentence which is both true and false simultaneously is not a
statement, rather, it is a paradox.
Example 1:
(a) Each of the following sentences:
i) New Delhi is in India.
ii) Two plus two is four.
iii) Roses are red.
iv) The sun is a star.
v) Every square is a rectangle.
is true and so each of them is a statement.
(b) Each of the following sentences:
i) The earth is a star.
ii) Two plus two is five.
iii) Every rectangle is a square.
iv) 8 is less than 6.
v) Every set is a finite set.
is false and so each of them is a statement.
Example:
a) Each of the sentences:
i) Open the door.
ii) Switch on the fan.
iii) Do your homework.
cannot be assigned true or false and so none of them is a statement.
In fact, each of them is a command.
b) Each of the sentences:
i) Did you meet Rahman?
2.4 Conjunction
If two simple statements p and q are connected by the word ‘and’, then the
resulting compound statement “p and q” is called a conjunction of p and q
and is written in symbolic form as “p q“.
Example: Form the conjunction of the following simple statements:
p : Dinesh is a boy.
q : Nagma is a girl.
Solution: The conjunction of the statement p and q is given by
p q : Dinesh is a boy and Nagma is a girl.
Example: Translate the following statement into symbolic form
“Jack and Jill went up the hill.”
(D1) : T T = T
(D2): T F = F T = F F = F
Example: Write the truth value of each of the following four statements:
i) Delhi is in India and 2 + 3 = 6.
ii) Delhi is in India and 2 + 3 = 5.
iii) Delhi is in Nepal and 2 + 3 = 5.
iv) Delhi is in Nepal and 2 + 3 = 6.
Solution: In view of (D1) and (D2) above, we observe that statement (i) has
the truth value F as the truth value of the statement “2 + 3 = 6” is F. Also,
statement (ii) has the truth value T as both the statement “Delhi is in India”
and “2 + 3 = 5” has the truth value T. Similarly, the truth value of both the
statements (iii) and (iv) is F.
2.5 Disjunction
If two simple statements p and q are connected by the word ‘or’, then the
resulting compound statement “p or q” is called disjunction of
statements p and q and is written in symbolic form as “p q”.
Example: Form the disjunction of the following simple statements:
p : The sun shines.
q :It rains.
Solution: The disjunction of the statements p and q is given by
p q : The sun shines or it rains.
Regarding truth value of disjuction of statements, We have
(D3): T T = T F = F T = T
(D4): F F = F
2.6 Negation
An assertion that a statement fails or denial of a statement is called the
negation of the statement. The negation of a statement is generally formed
by introducing the word “not” at some proper place in the statement or by
prefixing the statement with “It is not the case that” or “It is false that”.
The negation of a statement p in symbolic form is written as “~ p”.
Example: Write the negation of the statement
p :New Delhi is a city.
Solution: The negation of p is given by
~ p :New Delhi is not a city
or ~ p : It is not the case that New Delhi is a city.
or ~ p : It is false that New Delhi is a city
Example: Write the negation of the following statements:
p : I went to my class yesterday.
q:2+3=6
r : All natural numbers are integers.
Solution: Negation of the statement p is given by
~ p : I did not go to my class yesterday.
or
It is not the case that I went to my class yesterday.
or
It is false that I went to my class yesterday.
or
~ ( p q) = ~ p v ~ q
Example: Write the negation of each of the following conjunctions:
a) Paris is in France and London is in England.
b) 2 + 3 = 5 and 8 < 10.
Solution:
(a) Write p : Paris is in France and q :London is in England.
Then, the conjunction in (a) is given by p q.
Now ~ p :Paris is not in France, and
~ q :London is not in England.
Therefore, using (D7), negation of p q is given by
~( p q) = Paris is not in France or London is not in England.
(b) Write p : 2+3 = 5 and q :8 < 10.
Then the conjunction in (b) is given by p q.
Now ~ p : 2 + 3 ≠ 5 and ~q:8 10
Then, using (D7), negation of p q is given by
~ (p q) = 2 + 3 ≠ 5 or 810 .
p ~p
T F
F T
Step 2: Using (D5) and (D6), enter the truth values of ~ p in the second
column of the truth table (Table 2.3).
Table 2.3
p ~p p (~ p)
T F
F T
Step 3: Finally, using (D2) enter the truth values of p (~ p) in the last
column of the truth table (Table 2.4)
Table 2.4
p ~p p (~ p)
T F F
F T F
Table 2.5
P q pq
T T
T F
F T
F F
Then, in view of (D1) and (D2) above, enter the truth values of the compound
statement p q in the truth table (Table 2.6) to complete the truth table.
Solution:
Table 2.7: Truth table for p q.
P q pq
T T T
T F T
F T T
F F F
Solution: In view of (D3) and (D4) above, recall that the compound
statement p q has the truth value F if and only if both p and q have the
truth value F; otherwise p q has truth value T. Thus, the truth table for
p q is as given in Table 2.7.
2.9 Tautologies
A statement is said to be a tautology if it is true for all logical possibilities. In
other words, a statement is called tautology if its truth value is T and only T
in the last column of its truth table. Analogously, a statement is said to be a
contradiction if it is false for all logical possibilities. In other words, a
statement is called contradiction if its truth value is F and only F in the last
column of its truth table. A straight forward method to determine whether a
given statement is tautology (or contradiction) is to construct its truth table.
Example: The statement p (~p) is a tautology since it contains T in the
last column of its truth table (Table 2.11)
Table 14.11: Truth table for p (~p)
p ~p p (~p)
T F T
F T T
T F T F T
F T T T T
F F F T T
Since the truth table for (p q) (~ p) contains only T in the last column,
it follows that (p q) (~ p) is a tautology.
b) Recall Table 2.9 which is the truth table for (p q) (~ p) and observe
that it contains only F in the last column. Therefore, (p q) (~ p) is a
contradiction.
T F F T T F F T T
F T F T F T T F T
F F F T F F T T T
Now, observe that the entries (truth values) in the last column of both the
tables are same. Hence, the statement ~(p q) is equivalent to the
statement (~ p) (~q).
Example: Let
p : The South-West monsoon is very good this year and
q :Rivers are rising.
Give verbal translation of ~ [(~p) (~q)].
Solution: we have
~(p q) ≡ (~ p) (~q)
Therefore, the statement ~ [(~p) (~q)] is the same as the negation of the
statement ~(p q) which is the same as the conjunction p q. Thus, the
verbal translation for ~ [(~p) (~q)] is
“The South-West monsoon is very good this year and rivers are rising”
T T F T F T T F F
T F T T F T F F F
F T F F T F T T T
F F T T F F F T F
p q ~p ~q (~ p) q p (~ q) ~ [( ~ p) q]
T T F F F T T
T F F T F T T
F T T F T F F
F F T T F T T
p ~p ~(~p)
T F T
F T F
2.11 Applications
The logic that we have discussed so far is called two-value logic because
we have considered only those statements which are having truth values
True or False. A similar situation exists in various electrical and mechanical
devices. Claude Shannon, in late 1930’s, was first to notice an analogy
between the operations of switching devices and the operations of logical
connectives. He used this analogy with great success to solve problems of
circuit design.
Observe that an electric switch which is used for turning ‘on’ and ‘off’ an
electric light is a two-state device. We shall now explain various electric
networks with the help of logical connectives. For this, first we discuss how
an electric switch works. Observe that, in Fig. 2.22, we have shown two
positions of a simple switch.
Fig. 2.22
In (a) when switch is closed (i.e. on), current can flow from one terminal to
the other. In (b), when the switch is open (i.e. off), current can not flow.
Let us now consider the example of an electric lamp controlled by switch.
Such a circuit is given in Fig. 2.23
Fig. 2.23
Observe that when the switch s is open, no current flows in the circuit and
therefore, the lamp is ‘off’. But when switch s is closed, the lamp is ‘on’.
Thus the lamp is on if and only if the switch s is closed.
If we denote the statements as
p : The switch s is closed
l : The lamp l is ‘on’
then, by using logic, the above circuit can be expressed as p ≡ l.
Next, consider an extension of the above circuit in which we have taken two
switches s1and s2 in series as shown in Fig. 2.24.
Fig. 2.24
Here, observe that the lamp is ‘on’ if and only if both the switches s1 and
s2are closed.
If we denote the statements as:
p : the switch s1 is closed.
q : the switch s2 is closed.
l : the lamp l is ’on’.
then the above circuit can be expressed as p q l.
Manipal University Jaipur Page No: 42
Foundation of Mathematics Unit 2
Fig. 2.25
If we denote the statements as:
p : the switch s1 is closed.
q : the switch s2 is closed.
l : the lamp l is ’on’.
then the above circuit can be expressed as p q l.
SAQ 2: Express the following circuit in Fig. 2.26 in symbolic form of logic.
Fig. 2.26
2.12 Summary
In this unit we studied the truth values of statements. The different basic
logical connectives are discussed in detail with some standard examples.
Compound statements and the negation are explained . The concept of
Tautology, Contradiction and Logical Equivalence is discussed in detail with
example wherever necessary. The applications of mathematical logic to
switching circuits is dealt with examples.
2.14 Answers
Self Assessment Questions
1. a) The truth table of ~ [p (~p)] is given by
Table 2.27: Truth table for ~ [p (~p)]
p ~p p (~p) ~ [p (~p)]
T F T F
F T T F
Since it contains only F in the last column of its truth table, it follows
that ~ [p (~ p)] is a contradiction.
b) The truth table of ~ [p (~ p)] is given by
p ~p p (~ p) ~ [p (~ p)]
T F F T
F T F T
Since it contains only T in the last column of its truth table, it follows
that ~ [p (~ p)] is a tautology.
2. Observe that the lamp is ‘on’ if and only if either s1 ands2 both are closed
or s1 and s2 both are open or only s1 is closed.
If we denote the statements as
p : The switch s1 is closed
q : The switch s2 is closed
l : The lamp l is ‘on’
then