Académique Documents
Professionnel Documents
Culture Documents
2.1 Introduction
2.2 Logic
2.3 Statements
2.7 Contradiction
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:
Here are some examples, which are not logical statements as it is not possible to say TRUE or
FALSE for these ordinary statements.
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:
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
q is the statement “
p q is the statement
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”.
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
q
p
T T
T F
F T
F F
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
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
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
Example:
p: “ A square is a rectangle”
q: “ A rectangle is a quadrilateral”
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
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.
Example:
Then p q: If two straight lines intersect then the opposite angles are equal. This is a
true compound.
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).
p: x=3
q: x2-5x+6=0
Therefore p q
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
33
Example
State the inverse, converse and contrapositive of the following statements:
Solution:
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
34
P q p↔q
T T T
T F F
F T F
F F T
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:
Therefore p↔q: Two lines are perpendicular if and only if they intersect at right angle.
Example:
p: An integer is divisible by 2
(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
(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
(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
(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
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
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
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
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
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
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)
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
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
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
(i) (p q) ( p q)
(ii) (ii) q p
(iii) p ( p q)
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
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)
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
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
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
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:
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:
p q
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