Vous êtes sur la page 1sur 24

Chapter 2 Mathematical Logic

2.1 Introduction

2.2 Logic

2.3 Statements

2.4 Truth Table

2.5 Equivalent statements


2.6 Tautology

2.7 Contradiction

2.8 Algebra of propositions

2.9 Electronic Circuit

2.1 Introduction
In this chapter some of the basic concepts of mathematical logic will be discussed in brief. The concept of
mathematical logic was proposed by George Boole (1815-1875). In 1854, he published his famous work
“An Investigation of the Laws of Thought” on which are founded the mathematical theories of Logic and
Probability.

A mathematical system or structure is the result of the application of the postulational method
of logic to a set of elements, relations and operations. The choice of postulates determines the
mathematical system completely. The postulates help to understand the real world
observations and defined and undefined motives in a better way.

2.2 Logic
Logic helps us to systemize the principles of valid reasoning, studies the forms of valid
arguments and different types of propositions. These logics may be used to judge the
correctness of a chain of reasoning. These logics may be expressed in terms of sentences, which

24
are used extensively in modern mathematics and economical real world problems. In computer
also, we use the concept of logic as the digital computers are based on two digits 1 and 0 and
mathematical logic is also based on two values TRUE and FALSE as described in the next section
in more details. The binary code and logical circuits used in computers employ signals of TRUE or
FALSE, which can be related to the two stable states of an electric switching circuits ON and OFF.

2.3 Statements
A statement (a proposition or a declarative sentence) is an assertion that can be determined to
be true or false but not both. The statement economics is a science that has a truth value. The
truth value of a statement is T if it is true and F if it is false. For example, the statement ``2 + 3 =
5'' has truth value T. Some examples of simple logical statements are given below:

Noida is the capital of India.


The multiplication of 0 with any number is 0.
Lal Quila is at New Delhi.

Here are some examples, which are not logical statements as it is not possible to say TRUE or
FALSE for these ordinary statements.

In which class you are studying.


He is the leader of opposition party.
5x is a natural number.

Statements that involve one or more of the connectives “and”, “or”, “not”, “if …then…” and “… if
and only if …” are compound statements (otherwise they are simple statements). For example,
“It is not the case that 2 + 3 = 5” is the negation of the statement above. Of course, it is stated
more simply as “2 + 3 5''. Other examples of compound statements are:

If you finish your homework then you can watch T.V.


This is a question if and only if this is an answer.
I have read this and I understand the concept.

Note that the connective “or” in logic is used in the inclusive sense (not the exclusive sense as in
English). Thus, the logical statement

25
“It is raining or the sun is shining” means

“it is raining, or the sun is shining or it is raining and the sun is shining.“

If p is the statement

“The wall is red'' and

q is the statement “

“The lamp is on'', then

p q is the statement

“The wall is red or the lamp is on (or both)”

where as q p is the statement

“If the lamp is on then the wall is red”.

The statement p q translates to

“The wall isn't red and the lamp is on”.

Statements given symbolically have easy translations into English but it should be noted that
there are several ways to write a statement in English. For example, with the examples above,
the statement p q directly translates as “If the wall is red then the lamp is on”. It can also be
stated as “The wall is red only if the lamp is on” or “The lamp is on if the wall is red”. Similarly,
q p directly translates as “The wall is red and the lamp is not on” but it would be preferable to
say “The wall is red but the lamp is off”.

2.4 Truth Table


A truth table is a two-dimensional array with n+1columns. The first n columns correspond to the
possible values of n inputs, and the last column to the operation being performed. The rows list
all possible combinations of inputs together with the corresponding outputs.

26
The most difficult parts of constructing truth tables are the initial set-up of the table, and
remembering the truth tables for the different logical connectives.
A simple statement can only have two possible truth values - It can be true, or it can be false.
This means that there are only two possible truth-values for any given statement. When dealing
with Compound statements (simple statements whose truth value is altered by one or more
logical connectives) it is essential to know how many simple statements are involved. If only one
simple statement is being modified, then only two rows are needed (as in negation). If two
simple statements are involved, then four rows will be needed to exhaust all of the possible
combinations of truth and falsity. Here are two truth tables, which (hopefully) will illustrate the
difference between all of the possible combinations of truth and falsity for a simple statement
and two simple statements:

p
T

Truth Table1: For One simple statement

q
p
T T

T F

F T

F F

Truth Table2: For Two simple statements

If three simple statements are being combined using logical connectives, then eight rows
will be involved in order to capture all of the possible combinations of truth and falsity
for those simple statements. In general the minimum number of rows required in a case of
n simple statements will be 2n. Here is an example of such a Table having three
statements:

27
p q r

T T T

T T F

T F T

T F F

F T T

F T F

F F T

F F F

Truth Table3: For Two simple statements

Notice that the pattern of the combinations of truth and falsity from the table for two simple
statements appears in the columns under Q and R for the first four rows, and then repeats itself
for the second four rows (5-8). Likewise, in the table for two simple statements, the pattern for
the combinations of truth and falsity for one statement are repeated twice in the column under
Q. Once you know how to set them up, you can then concentrate on remembering the truth
tables for each of the logical connectives.

2.4.1 Negation:

Negation is the contradiction of the statement, which may either be an assertion or denial. For
example, if p is a true statement then the truth value of p is F. Similarly, if p has truth value F,
then the statement p has truth value T. These rules are summarized in the following truth
table.

p
p
F T

T F

28
Truth Table4: For negation of a statement

2.4.2 Compounding
The truth value of a compound statement is determined from the truth-values of its simple
components under certain rules. Compound statement can be formed by combining into two or
more statements. The most common connectives to form a compound statement are OR, AND
and NOT. The truth value of compound statement will depend upon the truth values of the
individual statements which form the compound statement. There are some more connectives,
which are briefly explained in the next section.

2.4.3 Conjunction
If p and q are statements, then the truth value of the statement p q (Conjunctions) is F except
when both p and q have truth value T. The table for the conjunction of two statements is given
below.

p q p and q (p q)

T T T

T F F

F T F

F F F

Truth Table5: For Conjunctions of p and q

Example:

p: “ A square is a rectangle”

q: “ A rectangle is a quadrilateral”

Then p q will be “ A square is a rectangle and a rectangle is a quadrilateral”. It is clear from the
case that this compound statement is a true compound statement.

Example:

p: 3+5=8

29
q: 9 is divisible by 2

Then p q: 3+5=8 and 9 is divisible by 2. Clearly this will be a false compound statement.

Note that the truth table of p q will be same the truth table of q p.

2.4.4 Disjunction
The disjunction of two statements p and q is the statement p q (Disjunction) which is read as p
or q and has the truth value F in all cases except if both p and q are true which is T. The truth
table of disjunction is given here.

p Q p or q

T T T

T F T

F T T

F F F

Truth Table6: For Disjunction (p q)

Example:

p: “ A square is a rectangle”

q: “ A rectangle is a quadrilateral”

Then p q will be “ Either a square is a rectangle or a rectangle is a quadrilateral”. It is clear from


the case that this compound statement is a true compound statement as both the individual
statements are true.

Example:

p: 3+5=8

q: 9 is divisible by 2

30
Then p q: Either 3+5=8 or 9 is divisible by 2. As in disjunction case if any one of the two
statements is true then compound statement will also be true, so this will be a true compound
statement, as p is true.

Note that the truth table of p q will be same the truth table of q p.

2.4.5 Conditional
The conditions of truth and falsity for conditionals is the hardest of all the compound
statements to understand. Perhaps it is best to remember that a conditional is a hypothetical
statement - such that it is asserting that IF...some state of affairs were true, THEN.... some other
state of affairs would be true. The tricky thing about this is that if the antecedent of the
conditional is false, then just about anything follows from it. So, for example, the statement, "if
today is Wednesday then tomorrow is Tuesday" would be true today (Monday) but false the day
after tomorrow.

This is correct (in a sense) IF you are considering the truth value of the entire conditional. IF it
was true that "today is Wednesday" on any given Monday, Then time would be so screwed up
that tomorrow could be Tuesday. What throws most people off the track is that they are
confusing the truth value of the conditional statement with the truth value of the simple
statements which make it up. In essence, anything can be true if a contradiction can be true. The
truth table for the conditional statement will be as given under:

p q P q

T T T

T F F

F T T

F F T

Truth Table7: For Conditionals (p q)

Summarily we can say that p q is false when p is true and q is false. Otherwise it is true.
Consider the following statements:

31
I am going to quit if I don’t get a hike in my salary.
If I pass the exam then I will become a software professional.
I will be going to movie provided that I have sufficient money in my pocket.

All these statements are conditional, they can be fit into the form if condition, then action. For
example, the first statement can be rewritten as “If I don’t get a hike in my salary then I am
going to quit”. Some more example of conditional statements are given here.

Note that p q may not be the same as q p

Example:

P: Two straight lines intersect.

Q: The opposite angles are equal.

Then p q: If two straight lines intersect then the opposite angles are equal. This is a
true compound.

Example: p: I study very hard

Q: I shall top the University

Then p q: If I study very hard then I shall top the University.

Converse

The implication q p (i.e. if q then p) is called the converse of the implication p q (i.e. if p
then q).

Inverse
The implication p q(i.e. if not p then not q) is called the inverse of the implication p q
(i.e. if p then q).

32
Contrapositive
The implication q p(i.e. if not q then not p) is called the contrapositive of the implication p
q (i.e. if p then q).

Example: If x=3 then x2-5x+6=0

This can be symbolized as follows:

p: x=3

q: x2-5x+6=0

Therefore p q

Converse: q p: If x2-5x+6=0 then x=3

Inverse: p q: If x 3 then x2-5x+6 0

Contrapositive: q p: If x2-5x+6 0 then x 3

A truth table showing all these (conditional, converse, inverse and contrapositive) is given as

p q p q p q q p p q q p

T T F F T T T T

T F F T F T T F

F T T F T F F T

F F T T T T T T

Truth Table8: For Conditional, Converse, Inverse and Contrapositive

33
Example
State the inverse, converse and contrapositive of the following statements:

(i) If x is an integer then 2x is an even integer.


(ii) If x=3 then x2-5x+6=0
(iii) If x2=3x then x=3 or x=0

Solution:

(i) Inverse: If x is not an integer then 2x is not an even integer.

Converse: If 2x is an even integer then x is an integer.

Contrapositive: If 2x is not an even integer then x is not an integer.

(ii) Inverse: If x 3 then x2-5x+6 0

Converse: If. x2-5x+6=0 then x=3

Contrapositive: If x2-5x+6 0 then x 3.

(iii) Inverse: If x2 3x then x 3 or x 0

Converse: If. x=3 or x=0 then x2=3x

Contrapositive: If x 3 or x 0 then x2 3x.

2.4.6 Biconditional
The conditional statements are of the type “if p then q” i.e. p q. The biconditional statements
are of the type “if p then q and if q then p” i.e. p q and q p written together as p↔q.
These are also called as double implications. The essential features of this relationship are

p if and only if q
q if and only if p
p is an essential condition for q and
q is an essential condition for p

The truth table of biconditional statement is as follows:

34
P q p↔q

T T T

T F F

F T F

F F T

Truth Table9: For Conditionals (p↔q)

This is clear from the truth table that the biconditional statement is true when both p and q are
true and when both p and q are false. The biconditional statement is false when p is true and q
is false and vice versa.

Example:

p: Two lines are perpendicular

q: They intersect at right angle

Therefore p↔q: Two lines are perpendicular if and only if they intersect at right angle.

Example:

p: An integer is divisible by 2

q: The integer n is even

Therefore p↔q: An integer n is divisible by 2 if and only if it is even.

Exercise: Construct the truth table for the following

(i) (p q) (p q)
(ii) (p q) (p r)
(iii) p ( p q)

Solution:

35
(i)

p q p q p q (p q) (p q)

T T T T T

T F T F F

F T T F F

F F F F T

Truth Table9: For (p q) (p q)

(ii)

p Q r p q p r (p q) (p r)

T T T T T T

T T F T F F

T F T F T F

T F F F F F

F T T T T T

F T F T T T

F F T T T T

F F F T T T

Truth Table10: For (p q) (p r)

(iii)

p q p q ( p q) p ( p q)

36
T T F F F F

T F F T T T

F T T F T F

F F T T T F

Truth Table11: For p ( p q)

2.5 Equivalent statements


Two statements (simple or compound) statements are said to be logical equivalent statements if
their truth tables are the same. Some examples of equivalent statements are given here:

(i) p ( p) (ii) (p q) ( p q)

(iii) (p p) p (iv) (p q) (q p)

(v) (p p) p (vi) (p q) (q p)

(vii) p (q r) (p q) (p r)

(viii) p (q r) (p q) (p r)

(ix) (p q) ( p q) q

The truth table of (viii) logical statements is given here

p q R q r p q r (p q) (p r) (p q) (p r)

T T T T T T T T

T T F F F T F F

T F T F F F T F

T F F F F F F F

37
F T T T T T T T

F T F F T T T T

F F T F T T T T

F F F F T T T T

Truth Table12: For p (q r) (p q) (p r)

The truth table of (ix) is given in table 13.

p q p P q ( p q) (p q) ( p q)

T T F T F T

T F F F F F

F T T F T T

F F T F F F

Truth Table13: For (p q) ( p q) q

2.6 Tautology
A compound statement is a tautology if it is true regardless of the truth values assigned to its
component atomic statements. Equivalently, in terms of truth tables: A compound statement is
a tautology if there is a T beneath its main connective in every row of its truth table. Following
are the some examples of tautologies.

(i) p (p q) (ii) (p q) ↔ ( p) ( q)

(iii) p p (iv) p q p

(v) q (p q) (vi) p q ↔ (q p)

38
An example of tautology is given here

p q p (p q) p (p q)

T T F T T

T F F T T

F T T T T

F F T F T

Truth Table14: For p (p q)

As the truth table of p (p q) have the truth value T for all the four cases, hence it is a
tautology.

Similarly the truth table of (p q) ↔ ( p) ( q) is given below which again have all its truth
values T and hence a tautology.

p q p q p q (p q) ( p) ( q) (p q) ↔ ( p) ( q)

T T F F T F F T

T F F T F T T T

F T T F F T T T

F F T T F T T T

Truth Table15: For (p q) ↔ ( p) ( q)

39
One more example of tautology is given below.

p q p q p q (p q) ( p) p q ((p q) p) ( p q)

T T F F T F F T

T F F T T F T T

F T T F F F T T

F F T T F F T T

Truth Table16: For ((p q) p) ( p q)

2.7 Contradiction
A compound statement is a contradiction if it is false regardless of the truth values assigned to
its component atomic statements. Equivalently, in terms of truth tables: A compound statement
is a contradiction if there is an F beneath its main connective in every row of its truth table.
Following are some examples, which are contradictions.

(i) p p (ii) (p q) ( p) ( q)

(iii) (p q) ( p) (iv) (p q) ( p q)

(v) p ((p q) q)

The truth table of (p q) ( p) ( q) is given in table 16.

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

40
F F T T F T F

Truth Table17: For (p q) ( p) ( q)

All the rows in (p q) ( p) ( q) are false in the truth table. Hence it is a contradiction.
Similarly for p ((p q) q), the truth table is shown in table 17 and again it has false value
for every row, so is a contradiction.

p q p q p q (p q) q p ((p q) q)

T T F F T T F

T F F T T F F

F T T F F F F

F F T T T F F

Truth Table18: For p ((p q) q)

Some compound statements may be neither a tautology nor a contradiction. For such
statements a mixed collection of rows having T and F values will be obtained. For example (p
q) (p r) is neither a tautology nor a contradiction. Its truth table is shown in table 18

P q R q r p q r (p q) (p r) (p q) (p r)

T T T T T T T T

T T F F F T F F

T F T F F F T F

T F F F F F F F

F T T T T T T T

F T F F T T T T

41
F F T F T T T T

F F F F T T T T

Truth Table19: For p (q r) (p q) (p r)

Similarly the following statements are neither a tautology nor a contradiction.

(i) (p q) ( p q)
(ii) (ii) q p
(iii) p ( p q)

2.8 Algebra of propositions


We have considered several basic laws concerning statements in logic. Given here is a summary
of the same.

Let p, q and r be the given statements.

1. Idempotent Law: This indicates that the truth value of the statement will remain same
by conjunction with another statement in certain circumstances
i.e. p p = p and p p=p

2. Associative Law: This rule says that


p (q r) = (p q) r

and p (q r) = (p q) r

3. Commutative Rule: This indicates that order of the statements is not important as
shown below:
p q=q p

and p q=q p

4. Distributive Law: Deals with the statement having different connectives inside and
outside the bracket as shown below::

42
p (q r) = (p q) (p r)

and p (q r) = (p q) (p r)

5. DeMorgan’s Law: A statement will not change if we change AND by OR and OR by AND
provided that we have the inverse of the constituent statements.
(p q) = ( p) ( q)

(p q) = ( p) ( q)

2.9 Electronic Circuit


The truth tables described above help in designing and testing the electronic circuit to perform a
given operation based on a certain relation.

An electronic circuit is a connection of a finite number of switches. For any switch, there are two mutual
exclusive states, one allowing the current to pass, called the closed state or on state and another not
allowing the current to pass called as open state of off state. Generally closed state or on state is denoted by
1 while open state is denoted by 0. These values are called the transmitted or flow values of the switches.

Let p and p’ denotes the switches with the property that if one is on the other is off and vice
versa. There are two simple networks, one is called basic series network and other a basic
parallel network. The two switches p and q can be shown as given below.

p q

Their series and parallel combination will be represented as follows:

Series Combination Parallel Combination

43
The series combination may be obtained by using conjunction denoted by p q, while
parallel combination may be obtained by p q. For p q circuit there are four possible states
for the two switches p and q.

(i) p is on, q is on
(ii) p is on, q is off
(iii) p is off, q is on
(iv) p is off, q is off.

In this case, the current will flow only in that case when both the switches p and q are closed
(on), otherwise no current flows. This flow of current can be described by using the truth table
as shown:

P q p q

1 1 1

1 0 0

0 1 0

0 0 0

Truth table20: For series combination

For parallel (p q) circuit in which current will flow only in that case when at least one of the
two switches p or q is closed (on), otherwise no current will flow. This also can be represented in
terms of a truth table.

p q p q

1 1 1

1 0 1

44
0 1 1

0 0 0

Truth table21: For parallel combination

Similarly we can prepare the circuit diagram and the corresponding truth table for other
complicated circuits also.

Example:
Draw the circuit diagram and the truth table for p (q r).
Solution:

The circuit will be represented as

The truth table for the above circuit will be as

p q r q r p (q r)

1 1 1 1 1

1 1 0 1 1

1 0 1 1 1

1 0 0 0 0

0 1 1 1 0

0 1 0 1 0

0 0 1 1 0

45
0 0 0 0 0

Only for the first three cases, the current will flow in the circuit otherwise not.

Example:

Draw the circuit for (p q) r and also prepare the truth table.

Solution:

The circuit diagram will be as follows

p q

The truth table for this circuit will be as follows

p q r p q (p q) r

1 1 1 1 1

1 1 0 1 1

1 0 1 0 1

1 0 0 0 0

0 1 1 0 1

0 1 0 0 0

0 0 1 0 1

0 0 0 0 0

46
Summary
Every logical statement can be expressed by its truth-value, either true or false.
Truth table is a tabular representation of truth-values of these statements.
AND, OR, Conditional and Biconditional operations can be used for compound statements.

A statement is a Tautology for which all truth-values are true. Contradiction has all its
truth-values false.
Equivalent statements are those statements having same truth-values.

47

Vous aimerez peut-être aussi