Discrete Mathematics Structures
Discrete Mathematics Structures
intentionally left
blank
Copyright © 2009, 2002 New Age International (P) Ltd., Publishers
Published by New Age International (P) Ltd., Publishers
This edition is a revision of 2002 edition of the book. Considerable attention has been given to improve
the first edition. As far as possible efforts were made to keep the book free from typographic and other
errors. Most of the changes were made at the suggestions of the individuals who have used the first
edition of the book and who were kind enough to send their comments. Enhancements to the material
devoted to mathematical logic methods of proof, combinations and graph theory are designed to help
the readers master the subject.
I am thankful to the chief editor and the editors of New Age International (P) Limited, Publishers
for the interest and cooperation during the production of the second edition of the book.
The author would like to express his appreciation to Sri Saumya Gupta, Managing Director, New
Age International (P) Limited, for his encouragement.
Any suggestions for future improvements of this book will be gratefully received
G. SHANKER RAO
This page
intentionally left
blank
PREFACE ix
This book explains some of the fundamental concepts in discrete structures. It can be used by the students
in mathematics and computer science as an introduction to the fundamental ideas of discrete mathematics.
The topics mathematical logic, sets, relations, function, Boolean algebra, logic gates, combinations,
algebraic structures, graph theory and finite state machines have been discussed in this book. Throughout
I have made an extensive use of worked examples to develop the general ideas.
Chapter 1 deals with mathematical logic. Propositions, logical equivalence, tautologies, fallacies,
quantifiers, and methods of proof were briefly discussed in this chapter.
Chapter 2 is devoted to set theory.
Chapter 3 deals with relations. Reflexive, symmetric and transitive relations, have been discussed.
Chapter 4 deals with functions and recurrence relations.
Chapter 5 covers Boolean algebra. Lattices, Boolean functions, karnaugh maps, canonical forms have
been discussed in this chapter.
Chapter 6 covers logic gates.
Chapter 7 deals with Elementary combinatorics. Permutation combinations and Binomial theorem have
been discussed in this chapter.
Chapter 8 deals with graph theory. Isomorphism, colouring of graphs, trees, spanning trees have been
explored in this chapter.
Chapter 9 covers Algebraic Structures. Groups, rings and fields, their properties have been briefly
discussed in this chapter.
Chapter 10 explains finite state machines.
I am much indebted to Sri Siva Kumar, Manager, New Age International (P) Limited, Publishers
Hyderabad Branch, whose suggestions and criticism helped me in writing the book. I am thankful to
Sri Arvind Mishra of New Age International (P) Limited, Publishers.
G. SHANKER RAO
This page
intentionally left
blank
CONTENTS xi
Contents
1.21 Quantifiers 28
1.22 Methods of Proof 31
Exercise 1.4 42
3. Relations 69–89
3.1 Concept of Relation 69
3.2 Properties of Relations 70
CONTENTS xiii
Bibliography 435
Index 436–440
MATHEMATICAL LOGIC 1
Mathematical Logic
1.1 INTRODUCTION
In this chapter we shall study mathematical logic, which is concerned with all kinds of reasoning.
Mathematical logic has two aspects. On one hand it is analytical theory of art of reasoning whose goal is
to systematize and codify principles of valid reasoning. It may be used to judge the correctness of
statements which make up the chain. In this aspect logic may be called ‘classical’ mathematical logic.
The other aspect of Mathematical logic is inter-related with problems relating the foundation of
Mathematics. G. Frege (1884–1925) developed the idea, regarding a mathematical theory as applied
system of logic.
Principles of logic are valuable to problem analysis, programming and logic design.
1.2 STATEMENTS
A statement is a declarative sentence which is either true or false but not both. The truth or falsity of a
statement is called its truth value. The truth values ‘True’ and ‘False’ of a statement are denoted by T
and F respectively. They are also denoted by 1 and 0.
Example 1: Bangalore is in India.
Example 2: 3 + 7 = 9.
Example 3: Roses are red.
Statements are usually denoted by the letters p, q, r, .... The capital letters A, B, C, ..., P, Q, ... with
the exception of T and F are also used.
T T T
T F F
F T F
F F F
Example 3: Construct a Truth Table for the conjunction of “n > 3” and “n < 10” when n ∈ N .
Solution: When n > 3 and n < 10 are true, the conjunctive statement “n > 3 and n < 10” is true. The
Truth Table is given below:
Table 1.2
n>3 n < 10 n > 3 and n < 10
T T T
T F F
F T F
F F F
1.4.4 Disjunction
Any two simple statements can be combined by the connective “or” to form a statement called the
disjunction of the statements; i.e., if p and q are simple statements, the sentence “p or q” is the disjunction
of p and q.
The disjunction of p and q is denoted symbolically by p ∨ q
p ∨ q is read as “ p or q”
If p is ‘True’ or q is ‘True’ or both p and q are ‘True’, then p ∨ q is true, otherwise p ∨ q is false.
The truth table of p ∨ q is given below:
T T T
T F T
F T T
F F F
Table 1.4
p ~p
T F
F T
1.5 PROPOSITION
If p, q, r, s, ... are Simple Statements then the Compound Statement P ( p, q, r, s, ...) is called a Proposition.
The statement p, q, r, ... are called the Sub-statements or Variables of P.
The truth value of proposition P depends on the truth values of the variables, p, q, r, .... If the truth
values of the variables are known to us, then we can find the truth value of the proposition P. A truth
table is a simple way to show this relationship.
Example: Find the truth table of the Proposition ~p ∧ q
Solution: The truth table of ~p ∧ q is:
T T F F
T F F F
F T T T
F F T F
Example 2: Let p be “He is tall” and let q be “He is Handsome”. Write each of the following statements
in symbolic form using p and q.
(i) He is tall and handsome.
(ii) He is neither tall nor handsome.
Solution: (i) p ∧ q (ii) ~p ∧ ~q
Example 3: Write the disjunction of:
Roses are red. Violets are blue.
Solution: Let p: Roses are red
q: Violets are blue then the disjunction of p and q is p ∨ q: Roses are red or violets are blue.
Example 4: Determine the truth value of each of the following statements (Propositions):
(i) 3 + 5 = 8 or 2 +1 = 9
(ii) 4 +3 = 7 and 5 + 2 = 7
(iii) Agra is in England or 1 + 9 = 8
Solution: (i) Let p: 3 + 5 = 8, q: 2 + 1 = 9
p is true, q is false
hence p ∨ q is true
i.e., Truth Value of p ∨ q is T
(ii) Let p: 4 + 3 = 7, q: 5 + 2 = 7
p is true and q is true ⇒ p ∧ q is true (T)
(iii) Let p: Agra is in England
q: 1 + 9 = 8
p is false; q is false ⇒ p ∨ q is false.
Example 5: Construct a truth table for p ∧ ~p.
Solution: The truth table for p ∧ ~p is given below:
Table 1.6
p ~p p ∧ ~p
T F F
F T F
T T F T
T F T T
F T F F
F F T T
6 DISCRETE MATHEMATICAL STRUCTURES
Table 1.8
p q r q ∨ r p ∧ (q ∨ r)
T T T T T
T T F T T
T F T T T
T F F F F
F T T T F
F T F T F
F F T T F
F F F F F
Table 1.9
p ~p ~ (~p)
T F T
F T F
E X E R C I S E 1.1
T T T F
T F T F
F T T F
F F F T
(b)
p q ~q p ∨ ~q ~(p ∨ ~q)
T T F T F
T F T T F
F T F F T
F F T T F
8 DISCRETE MATHEMATICAL STRUCTURES
(c)
p q p ∧ q (p ∧ q) ∨ (p ∧ q)
T T T T
T F F F
F T F F
F F F F
(d)
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
(e)
p q ~p ~q ~p ∨ ~q ~(~p ∨ ~q)
T T F F F T
T F F T T F
F T T F T F
F F T T T F
(f)
p q q ∧ p p ∧ (p ∧ q)
T T T T
T F F F
F T F F
F F F F
(g)
p q p ∧ q ~(p ∧ q) p ∧ ~(p ∧ q)
T T T F T
T F F T T
F T F T F
F F F T T
(c) 3 + 3 = 7
(or It is not the case that 3 + 3 = 7)
4. (a) ~p ∧ q (b) ~p ∧ ~q (c) p ∨ ~q (d) ~p ∨ (p ∧ ~q)
5. (a) It is not cold (b) It is cold and raining
(c) It is cold or it is raining (d ) It is not cold and it is not raining.
6. (a) p ∨ ~p (b) p ∧ ~q (c) ~p ∨ ~q (d ) ~p ∧ q
7. (a) It is raining and it is snowing
(b) 4 + 7 = 11 and 2 × 4 = 7
8. (a) p ∧ q (b) ~p ∧ ~q (c) ~p ∧ ~q
T T T
T F F
F T T
F F T
1.7.2 Biconditional
A statement of the form “p if and only if q” is called a Biconditional statement. It is denoted by p q
(or by p ↔ q).
A Biconditional statement contains the connective “if and only if ” and has two conditions. If p and
q have the same truth value, then p ↔ q is true. The truth values p ↔ q are given in Table 1.11.
10 DISCRETE MATHEMATICAL STRUCTURES
T T T
T F F
F T F
F F T
T T T T
T F F T
F T T F
F F T T
T T F F T
T F F T T
F T T F F
F F T T T
MATHEMATICAL LOGIC 11
T T F F T
T F T F F
F T F T T
F F T T T
1.9 TAUTOLOGY
A statement formula that is true for all possible values of its propositional variables is called a Tautology.
Example 1: (p ∨ q) ↔ (q ∨ p) is a tautology.
Example 2: p ∨ ~p is a tautology.
1.10 CONTRADICTION
A statement formula that is always false is called a contradiction (or absurdity).
Example: p ∧ ~p is an absurdity.
1.11 CONTINGENCY
A statement formula that can either be true or false depending upon the truth values of its propositional
variables is called a contingency.
Example: (p → q) ∧ (p ∧ q) is a contingency.
Solution:
Table 1.15
p q ~p q → p ~p → (q → p)
T T F T T
T F F T T
F T T F F
F F T T T
Table 1.16
p ~p p ∧ ~p
T F F
T F F
Table 1.17
p ~p (p ∨ ~p)
T F T
T T T
p ∨ ~p is always true.
Hence p ∨ ~p is a tautology.
Example 6: Show that (p ∧ q) → p is tautology.
Solution: Let us construct the truth table for the statement (p ∧ q) → p
Table 1.18
p q p ∧ q (p ∧ q) → p
T T T T
T F F T
F T F T
F F F T
14 DISCRETE MATHEMATICAL STRUCTURES
In Table 1.18, we notice that the column (4) has all its entries as T. Hence (p ∧ q) → p is a
tautology.
Example 7: Show that ~(p → q) ≡ ( p ∧ ~q)
Solution: Let us construct the truth table for the given propositions:
Table 1.19
p q p → q ~(p → q) ~q p ∧ ~q
T T T F F F
T F F T T T
F T T F F F
F F T F T F
From the truth table it is clear that the truth values of ~(p → q) and p ∧ ~q are identical.
Hence ~(p → q) ≡ p ∧ ~q.
Solution: (i) p ∨ (p ∧ q) = (p ∨ t) ∧ (p ∨ q)
= p ∧ (t ∨ q) (t: tautology)
=p ∧ t
=p
(ii) (p ∨ q) ∧ (~p ∧ q)
= (~p ∧ ~q) ∨ (~p ∧ q)
= ~p ∧ (~q ∨ q)
= ~p ∧ t (t: tautology)
= ~p
Example 4: Show that (p ∧ q) → (p ∨ q) is a tautology.
Solution: Let us construct the truth table:
Table 1.20
p q p ∧ q p ∨ q p ∧ q → p ∨ q
T T T T T
T F F T T
F T F T T
F F F F T
All the entries in the last column of the truth table are True (T). Hence given proposition is a
tautology.
Example 5: Show that
~(p → q) ≡ p ∧ ~q
Solution: We construct the truth table for given propositions:
Table 1.21
p q p → q ~(p → q) ~q p ∧ ~q
T T T F F F
T F F T T T
F T T F F F
F F T F T F
From the truth table it is clear that the truth values of ~(p → q) and p ∧ ~q are identical.
Hence
~(p → q) ≡ p ∧ ~q
Example 6: Show that
~(p ↔ q) ≡ ~p ↔ q ≡ p ↔ ~q
Solution: We prove the equivalence by means of a truth table.
MATHEMATICAL LOGIC 17
Table 1.22
p q p ↔ q ~(p ↔ q) ~p ~p ↔ q ~q p ↔ ~q
T T T F F F F F
T F F T F T T T
F T F T T T F T
F F T F T F T F
The truth values of columns (4), (6) and (8) are alike; which proves the equivalence of the formulas
~(p ↔ q), ~p ↔ q, and p ↔ ~q.
Example 7: There are two restaurants next to each other. One has a sign that says “Good food is not
cheap”, and the other has the sign that says “cheap food is not good”.
Are the signs saying the same thing?
If so verify.
Solution: Let p: food is good
q: food is cheap
Then we have, ~p: food is not good
~q: food is not cheap
Therefore, the given statements are
p → ~q: Good food is not cheap
q → ~p: Cheap food is not good
The truth table for the statements is given below:
Table 1.23
p q ~p ~q p → ~q q → ~p
T T F F F F
T F F T T T
F T T F T T
F F T T T T
From the table, it is clear that both the signs say the same thing.
Definition 1.2: A proposition P ( p1, p2, ...) is said to logically imply a proposition Q ( p1, p2, ...) if one
of the conditions in Theorem 1.1 holds.
If P ( p1, p2, ...) logically implies Q ( p1, p2, ...) then we symbolically denote it by writing
P ( p1, p2, ...) ⇒ Q ( p1, p2, ...)
Example 1: (p ∧ q) ∧ ~(p ∨ q) is a contradiction.
Hence p ∧ q ⇒ p ∨ q
Example 2: (p → q) ∧ (q → r) → (p → r) is a tautology.
Hence (p → q) ∧ (q → r) ⇒ (p → r)
Theorem 1.2: The relation in propositions defined by
P (p1, p2, ...) ⇒ Q (p1, p2, ...)
is reflexive, anti-symmetric and transitive.
Note: The symbols →, ⇒ are not the same ⇒ is not a connective nor P ⇒ Q is a statement formula
(proposition). P ⇒ Q defines a relation in composite propositions P → Q. The symbol → is a connective and
note that P → Q is just a proposition.
(P ↓ P) ↓ (Q ↓ Q) ↔ ~ P ↑ ~ Q ↔ P ∧ Q
The connective * is commutative, but not associative, i.e.
P ↓ Q ⇔ Q ↓ P but (P ↓ Q) ↓ Q ↔ (P ∨ Q) ∧ ~ R
P ↓ (Q ↓ R) ↔ ~ P ∧ (Q ∨ R)
Therefore the connective ↓ is not associative.
The connectives ∧, ∨, ~ can be expressed in terms of the connective ↓ as follows:
(i) ~ p ≡ p ↓ p (ii) ~ q ≡ q ↓ q
(iii) p ∧ q ≡ (p ↓ p) ↓ (q ↓ q) (iv) p ∨ q ≡ (p ↓ q) ↓ (p ↓ q)
Let us verify the above by means of the following truth tables:
Table 1.24
p q ~p P↓ p
T T F F
T F F F
F T T T
F F T T
Table 1.25
p q p ∧ q p ↓ p q↓ q (p ↓ p) ↓ (q ↓ q)
(1) (2) (3) (4) (5) (6)
T T T F F T
T F F F T F
F T F T F F
F F F T T F
The identical truth values of columns (3) and (6) reveal that
p ∧ q ≡ (p ↓ p) ↓ (q ↓ q)
In order to verify (iv) we construct the truth table
20 DISCRETE MATHEMATICAL STRUCTURES
Table 1.26
p q p ∨ q p↓ q (p ↓ q) ↓ (p ↓ q)
(1) (2) (3) (4) (5)
T T T F T
T F T F T
F T T F T
F F F T F
The truth values of columns (3) and (5) are alike, which proves the equivalence
p ∨ q ≡ (p ↓ q) ↓ (p ↓ q)
⇔ ( p ∨ ~ p ) ∧ (q ∨ ~ p ) ∧ ( p ∨ r ) ∧ (q ∨ r )
⇔ ( q ∨ ~ p ∨ ( r ∧ ~ r )) ∧ ( p ∨ r ∨ ( q ∧ ~ q )) ∧ ( q ∨ r ∨ ( p ∧ ~ p ))
⇔ (q ∨ ~ p ∨ r ) ∧ (q ∨ ~ p ∨ ~ r ) ∧ ( p ∨ r ∨ q )
∧ ( p ∨ r ∨ ~ q ) ∧ (q ∨ r ∨ p ) ∧ (q ∨ r ∨ ~ p )
⇔ (~ p ∨ q ∨ r ) ∧ (~ p ∨ q ∨ ~ r ) ∧ ( p ∨ q ∨ r ) ∧ ( p ∨ ~ q ∨ r )
E X E R C I S E 1.2
1. The following statement is of the form p ∨ q. Write out the contradictory statement in the form
~p ∧ ~q:
“Either he is a fool or he has some evil design.”
2. Let p: A triangle is equilateral
q: It is equiangular
then write p → q the conditional p → q
3. The converse of a statement is given. Write the inverse and contrapositive statements.
“If he is considerate of others, then a man is a gentleman.”
4. The converse of a statement is: If a steel rod or stretcher, then it has been heated:
Write inverse and contrapositive statements.
5. The contrapositive of a statement is given as
“If x < 2, then x +4 < 6”
Write the converse and inverse.
MATHEMATICAL LOGIC 23
6. Let p: It is cold and q: It is raining. Give a simple verbal sentence which describes each of the
following statements:
(a) p ∧ ~(q) (b) q → p (c) p ↔ ~q
7. Write an equivalent formula for p ∧ ( q ↔ r ) ∨ ( r ↔ p ) which does not contain biconditional.
8. Show that
(a) ~ ( p ∧ q ) → ( ~ p ∨ ) ( ~ p ∨ q ) ⇔ ~ p ∨ q
(b) ( p ∨ q ) ∧ (~ p ∧ (~ p ∧ q )) ⇔ ( ~ p ∧ q )
(c) p → q ⇔ ~ p ∨ q
9. By means of a truth table prove that
p ∧ q ≡ ( p ↓ q ) ↓ (q ↓ p ) ≡ ~ p ↓ ~ q
10. Show that p ↔ q ≡ ( p → q ) ∧ ( q → p )
11. Show that ( p ∧ q ) ∧ ~ ( p ∨ q ) is a contradiction.
12. Show that ~ ( p ∨ q ) ↔ ( ~ p ∧ ~ q ) is a tautology.
13. By means of a truth table prove that
(a) p ∧ ( q ∨ r ) ≡ ( p ∧ q ) ∨ ( q ∧ r )
(b) p → ( q ∨ r ) ≡ ( p → q ) ∨ ( p → r )
14. Let p be “He is rich” and let q be “He is honest”. Write each of the following statements in
symbolic forms using p and q:
(a) To be poor is to be honest.
(b) It is necessary to be poor in order to be honest.
(c) He is poor only if he is dishonest.
(d ) If he is poor if he is dishonest.
15. Prove that
(a) p → q ≡ ~ p → ~ q (b) p → q ≡ ~ p ∨ q
16. Write the contradiction of each of the following disjunction statements:
(1) x = 2 or x = 4 (2) x > 3 or x < 3
17. Show that p ↔ ~ q does not logically imply that p → q
18. Prove the following:
(a) p ∨ ~(p ∧ q) is a Tautology.
(b) (p ∧ q) ∧ ~ (p ∨ q) is a Contradiction.
(c) (p ∧ q) → (p ∨ q) is a Tautology.
19. Show that p ∧ q logically implies p ↔ q.
20. Decide whether each of the following is true or false:
(a) p ⇒ p ∧ q (b) p ⇒ p ∨ q (c) p ∧ q ⇒ p
(d) p ∨ q ⇒ p (e) q ⇒ p → q
24 DISCRETE MATHEMATICAL STRUCTURES
21. Write the disjunction, the conjunction, and two implications involving the two statements. I like
cats. I like dogs.
22. If
A: The Eiffel Tower is in Australia
B: Australia is below the Equator
C: The Eiffel Tower is in Paris
D: Paris is in France
E: France is in Australia
Prove the following:
(1) The argument (A ∧ B) → is valid
(2) (C ∧ D) → is invalid
(3) (A ∨ E) → is invalid
23. Simplify the following compound propositions
(a) ( p ∨ q) ∧ : [( : p ∨ q]
(b) : [ : {( p ∨ q ) ∧ r} ∨ : q]
24. Show that [( r → s) ∧ {( r → s ) → (t → u )}] → [ : t ∨ u ] is a tautology
Answers:
1. Either the man is born free or he is nowhere in chains.
2. If a triangle is equilateral, then it is equiangular.
3. Inverse: If a man is not a gentleman, then he is not considerate of others.
Contrapositive: If he is not considerate of others, then the man is not a gentleman.
4. Inverse: If a steel rod is not heated, then it does not stretch.
Contrapositive: If a steel rod does not stretch, then it has not been heated.
5. Converse: If x > 2, then x + 4 > 6
Inverse: If x + 4 > 6, then x > 2
6. p → ~q: It is cold, then it is not raining.
q ↔ p: It is raining if and only if it is raining.
p ↔ ~q: It is cold if and only is it is not raining.
7. p ∧ (q → r) ∧ (r → q) ∨ (r → p) ∧ (p → r)
14. (a) ~p ↔ ~q (b) q → ~p
(c) ~p → ~q (d ) ~p ∧ q
16. (1) x ≠ 2 and x > ≠ 4 (2) x > 3 and x = 3
20. (a) False (b) True (c) True (d) False (e) True
21. (1) I like cats or I like dogs.
(2) I like cats and I like dogs.
(3) If I like cats then I like dogs.
(4) I like cats if I like dogs.
23. (a) p ∧ ( : q) (b) q∧r
MATHEMATICAL LOGIC 25
E X E R C I S E 1.3
(b) : ( p ↑ q) ( : p ↓ : q)
18. For any proposition p, q, r prove the following:
(a) p ↑ (q ↑ r ) : p ∨ (q ∧ r )
(b) p ↓ (q ↓ r ) : p ∧ (q ∨ r ).
1.21 QUANTIFIERS
In this section we introduce, two logical notions called quantifiers. So far we have discussed the
propositions in which each statement has been about a particular object. In this section we shall see how
to write propositions that are about whole classes of objects.
In grammar a predicate is the word in a sentence which expresses what is said of the object. It is a
part of a declarative sentence describing the properties of an object or relation among objects (The word
‘Predicate’ and property will be used to mean the same thing) for example ‘is a cricket player’, ‘is a
teacher’ ‘is short’ are predicates. In logic the word predicate has a broader role than in grammar. The
basis for this is the observation that a predicate is supplemented by, including a variable x as a place
holder, for the intended subject, the result behaves as ‘a statement function’, in the sense that for each
value of x a statement results. Consider the statement
p : x is an even number
The truth value of p depends on the value of x. p is true when x = 4, and false when x = 11. The
statement p is not a proposition. In this section we extend the system of logic to include such statements.
In grammar ‘Rajan loves’ is not a predicate. If ‘x’ is introduced as a place holder for the object, then
we get the result as
‘Rajan loves x’.
which is a statement function. Thus we can define, a predicate p(x) as an expression having the quality
that on an assignment of values to the variable x, from an appropriate domain, a statement results.
Definition 1.7: Let P (x) be a statement involving variable x and a set D. We call P a propositional
function if for each x in D, P (x) is a proposition. The set D is called the domain of discourse (or universe
of discourse) of P. It is the set of all possible values which can be assigned to variables in statements
involving predicates.
For example the domain of discourse for P (x): “x is a cricket player” can be taken as the set of all
human beings and the statement.
x2 – 3x – 7 = 0
is a propositional function. The domain of discourse is the set of real numbers.
1.21.1 Universal Quantifier
Consider the proposition
‘All odd prime numbers are greater than 2’. The word ‘all’ in this proposition is a logical quantifier.
The proposition can be translated as follows:
MATHEMATICAL LOGIC 29
(∃ an integer x) ( x ≤ 8)
i.e., the negated proposition is: There is an integer less than or equal to 8.
In the negation a proposition ‘for all’ becomes ‘there is’ and ‘there is’ becomes ‘for all’ i.e., the
symbol ∀ becomes ∃ and ∃ becomes ∀.
Example 4: The negated proposition of
(∃ an integer x) (0 ≤ x ≤ 8) is
(∀ integers x) (x < 0 or x > 8)
The following table gives us the equivalences involving quantifiers.
Rules of inference for addition and deletion of quantifiers are given by the following table:
R1 Universal instantiation.
∀ x P ( x)
∴ P (k )
k is some element of the universe.
R2 Existential instantiation
∃ x P (x)
∴ P (k )
k is some element for which P (k) is true. Contd.
MATHEMATICAL LOGIC 31
R3 Universal generalization
P (x)
∀ x P ( x)
R4 Existential generalization
P (k )
∴ ∃ x P (x)
k is some element on the universe.
a − 3 = 0 ⇒ a = 3, a − 4 = 0 ⇒ a = 4
Hence a = 3 or a = 4
Example 4: Prove that if |x| > |y| then x2 > y2, by direct method.
Solution: Since |x| > |y| then |x|2 > |y|2
Now |x|2 = x2 and |y|2 = y2, hence x2 > y2
1.22.2 Method of Contraposition
Indirect Proof: This method of proof is very useful and is powerful at all levels of the subject
mathematics. Indirect method follows from the Tautology ( p → q ) ↔ ((~ q ) → (~ p )). This states that
the implication p ⇒ q is equivalent to ~ q ⇒ ~ p. To prove p ⇒ q indirectly, we assume that q is
false and then show that p is false.
Example 1: For any integer n > 2, prove that n Prime ⇒ n odd.
Solution: Let p: n Prime
q: n odd
then ~ q: n even
~ p: n not prime
If n is an even number greater than 2, then n = 2m for some integer m > 1. Thus n is divisible by 2
and n ≠ 2, therefore n cannot be prime thus we have ~ q ⇒ ~ p i.e., if n is any number bigger than 2,
then n cannot be prime.
Example 2: Prove: If α 2 is an even integer, then α is an even integer.
Solution: Let p: α 2 is an even integer
q: α is an even integer
let ~ q be true then, α is not an even integers therefore α must be odd. α is of the form
α = 2m +1 for some integer m.
α = 2m + 1
⇒ α 2 = (2 n + 1)2
= 4n2 + 4n + 1
= 2 (2m2 + 2m) + 1
α 2 is of the form α 2 = 2 n + 1 where n = (2m2 + 2m)
i.e., α 2 is odd
Thus, we have ~ q ⇒ ~ p
Hence by contraposition α is even.
1.22.3 Proof by Contradiction
In this method of proof, we assume the opposite of what we are trying to prove and get a logical
contradiction. Hence our assumption must have been false. Therefore what we were originally required
to prove must be true. To prove p → q is true, in this the proof can be constructed as follows:
MATHEMATICAL LOGIC 33
a1 + a2 + a3 ≥ 15 ⎫
or a2 + a3 + a4 ≥ 15 ⎪⎪ ... (1)
⎬
M ⎪
or a10 + a1 + a2 ≥ 15⎪⎭
a1 + a2 + a3 < 15
a2 + a3 + a4 < 15
M
a10 + a1 + a2 < 15
a1 + a2 + a3 ≤ 14
a2 + a3 + a4 ≤ 14
M
a10 + a1 + a2 ≤ 14
⇒ p2 = 2 q2
⇒ p 2 is even
⇒ p is even
⇒ p = 2m for some integer m.
⇒ (2 m) 2 = 2 q 2
⇒ 4 m2 = 2 q 2
⇒ q 2 = 2 m2
⇒ q is even
Hence p and q have common factor of 2, which is a contradiction to the statement that a and b
have no common factors.
Hence our assumption that 2 is rational leads to a contradiction. Thus 2 is irrational.
Definition 1.8: A collection of statements is consistent if the statements can all be true simultaneously.
A set of formulas H1, H2, H3, ..., Hn is said to be consistent if their conjunction H1 ∧ H 2 ∧ ... ∧ H n
has the truth value T for some assignment of the truth values to the atomic variables appearing in H1, H2,
..., Hn. And a set of formulae H1, H2, ..., Hn is inconsistent if their conjunction H1 ∧ H 2 ∧ ... ∧ H n
implies a contradiction, that is H1 ∧ H 2 ∧ ... ∧ H n ⇒ S ∧ ⎤ S (a contradiction) where is S is any formula.
We use the notion of inconsistency in a method of proof called proof by contradiction (or indirect
proof) we now begin our discussion by stating the following two rules of inference.
Rule P: A premise may be introduced at any point in the derivation.
Rule T: A formula S may be introduced in a derivation if S is tautologically implied by any one or more
of true preceding formulas in the derivation.
1.22.6 Rules of Inference
The following tables give us the rules of inference:
Table 1.29
Implications:
I1 P ∧ Q ⇒ P (Simplification)
I 2 P ∧ Q ⇒ Q (Simplification)
I 3 P ⇒ P ∨ Q (Addition)
I 4 Q ⇒ P ∨ Q (Addition)
I5 ⎤ P ⇒ P → Q
I6 Q ⇒ P → Q
I7 ⎤ ( P → Q ) ⇒ P
I8 ⎤ ( P → Q ) ⇒ ⎤ Q
I 9 P, Q ⇒ P ∧ Q
I10 ⎤ P, P ∨ Q ⇒ Q (Disjunctive syllogism)
I11 P, P → Q ⇒ Q (Modus Ponens)
I12 ⎤ Q, P → Q ⇒ ⎤ P (Modus Tollens)
I13 P → Q, Q → R ⇒ P → R (Hypothetical syllogism)
I14 P ∨ Q, P → R, Q → R ⇒ R (Dilemma)
Equivalences:
E1 ⎤ ⎤ P ⇔ P (Double negation)
E2 P ∧ Q ⇔ Q ∧ P (Commutative law)
E3 P ∨ Q ⇔ Q ∨ P (Commutative law)
E4 ( P ∧ Q ) ∧ R ⇔ P ∧ ( Q ∧ R ) (Associative law)
Contd.
36 DISCRETE MATHEMATICAL STRUCTURES
E5 ( P ∨ Q ) ∨ R ⇔ P ∨ (Q ∨ R ) (Associative law)
E6 P ∧ ( Q ∨ R ) ⇔ ( P ∧ Q ) ∨ ( P ∧ R ) (Distributive law)
E7 P ∨ (Q ∧ R ) ⇔ ( P ∨ Q ) ∧ ( P ∨ Q ) (Distributive law)
E8 ⎤ ( P ∧ Q ) ⇔ ⎤ P ∨ ⎤ Q (De Morgan’s law)
E9 ⎤ ( P ∨ Q ) ⇔ ⎤ P ∧ ⎤ Q (De Morgan’s law)
E10 P ∨ P ⇔ P
E11 P ∧ P ⇔ P
(
E12 R ∨ P ∧ ⎤ P ⇔ R )
E13 R ∧ ( P ∨ ⎤ P)⇔ R
E14 R ∨ ( P ∨ ⎤ P )⇔ T
E15 R ∧ (P ∧ ⎤ P) ⇔ F
E16 P → Q ⇔ ⎤ P ∨ Q
E17 ⎤ ( P → Q ) ⇔ P ∧ ⎤ Q
E18 P → Q ⇔ ⎤ Q → ⎤ P
E19 P → (Q → R ) ⇔ ( P ∧ Q ) → R
E20 ⎤ (P Q) ⇔ P ⎤ Q
E21 P Q ⇔ ( P → Q ) ∧ ( Q → P )
(
E22 (P Q) ⇔ ( P ∧ Q ) ∨ ⎤ P ∧ ⎤ Q )
The rules ‘Modus Ponens’ and ‘Hypothetical Syllogism’ are known as the fundamental rules of inference.
De Morgan’s laws and the law of contraposition are the other fundamental rules, from which other
rules follow. Modus Ponens is also called the rule of detachment. It can be stated as follows:
Whenever the statements p and ( p → q ) are accepted as true, then we must accept the statement q
as true.
The tabular form of the rule is given below
p
p→q
∴q
In the above tabular presentation p and ( p → q ) , which are above the horizontal line are the Premises
(Hypotheses). The assertion q which below the Horizontal line is the conclusion.
The rule of Hypothetical Syllogism is also known as the transitive rule. It can be stated as follows:
MATHEMATICAL LOGIC 37
p→q
q→r
∴p→r
p→q
q→r
r→s
∴p→s
p1 → p2
p2 → p3
p3 → p4
M
pn –1 → pn
∴ p1 → pn
Most of the arguments are based on the two fundamental rules of inference. In an argument premises
are always taken to be true. Whereas the conclusion may or may not be true. The conclusion is true only
when the argument is true. To list the validity of an argument we can also employ the laws of logic,
logical equivalences and tautologies
Modus Tollens is a rule of denying. It can be stated as follows:
If p → q is true and q is false, then p is false.
The tabular form of the rule is gives below:
p→q
:q
∴: p
Rule of Disjunctive Syllogism, States that if p ∨ q is true and p is false, then q is true.
In tabular form, the rule can be written as follows:
p∨q
:q
∴: q
38 DISCRETE MATHEMATICAL STRUCTURES
1.22.7 Fallacies
Faulty inferences are know as fallacies. There are three forms of fallacies:
1. The fallacy of affirming the consequent
2. The fallacy of denying the antecedent
3. The non Sequitur fallacy
The fallacy of affirming the consequent has the following tabular form:
p→q
q
(fallacy)
∴p
p→q
: p
(fallacy)
∴: q
Fallacies of assuming converse and all logical errors are Special Cases of the non Sequitur fallacy.
It can be presented as follows.
p
∴q
(a) p→r
q→r
∴ ( p ∨ q) → r
(b) p → r
: p→q
q→s
∴: r → s
p → (q → r )
:q→: p
p
∴r
Solution: Consider [ p → (q → r )] ∧ ( : q → : p ) ∧ p
We have
[ p → (q → r )] ∧ (: q → : p) ∧ p
⇔ [( p → (q → r )) ∧ p ] ∧ ( : q → : p)
⇒ ( q → r ) ∧ (: q → : p ) (by the rule of Modus Ponens)
⇔ ( q → r ) ∧ ( : : p → : : q) (by contraposition)
⇔ ( q → r ) ∧ ( p → q)
⇔ p→r (by the rule of Syllogism)
⇔r (since p is true)
[ p → (q → r ) ∧ [ : q → : p ) ∧ p and r are logically equivalent. Therefore the given argument is
valid
Example 3: Text the validity of the argument:
If I drive to work, then I will arrive tired
I am not tired
∴ I do not drive to work
40 DISCRETE MATHEMATICAL STRUCTURES
Solution:
Let p: I drive to work
q: I arrive tired
The argument has the following Symolic form
p→q
:q
∴: p
p→q
q→r
∴p→r
by the law of hypothetical; Syllogism, (i.e., transitive rule) the argument is valid
Example 5: Prove ⎤ Q, P → Q ⇒ ⎤ P
Solution: A formal proof is as follows:
1. P → Q P
2. ⎤ Q → ⎤ P T, (1) and E18
3. ⎤ Q P
4. ⎤ P T, (2), (3) and I11
Example 6: ( )
Show that ⎤ P follows, logically from ⎤ P ∧ ⎤ Q , ⎤ Q ∨ P, ⎤ R.
Solution: A formal proof is as follows:
(
1. ⎤ P ∧ ⎤ Q ) P
2. ⎤ P ∨ Q Q ⎤ (P ∧ Q) ⇔ ⎤ P ∨ ⎤ Q
3. P → Q Q P →Q ⇔ ⎤P ∨ Q
4. ⎤ Q ∨ R P
MATHEMATICAL LOGIC 41
5. Q → R
6. P → R (3), (5)
7. ⎤ R P
8. ⎤ P ⎤ Q, P → Q ⇒ ⎤ P
We now introduce another rule of inference called rule CP or rule of conditional proof.
Rule CP: If we can derive S from R and a set of premises, then we can derive R → S from the set of
premises alone.
The above rule is also called deduction theorem.
Example 7: Show that R → S can be derived from the premises P → ( P → S ), ⎤ R ∨ P, and Q.
Solution: We include R as an additional premise and show S, so that R → S can be derived.
1. ⎤R ∨ S P
2. R P (assumed premises)
3. P T, (1), (2) and I10
4. P → (Q → S ) P
5. Q→S T, (3), (4) and I11
6. Q P
7. S T, (5), (6) and I11
8. R→S CP
We shall now give an example to prove inconsistency in the given set of formula.
Example 8: Show that ( R → ⎤ Q), R ∨ S , S → ⎤ Q, P → Q ⇔ ⎤ P are inconsistent.
Solution: A formal proof is:
1. P (assumed)
2. P → Q Rule P
3. Q (1) and (2)
4. S → ⎤ Q P
5. Q → ⎤ S P → Q ⎤Q → ⎤ P
6. 7S (3), (5)
7. R ∨ S P
8. ⎤ R → S P → Q ⎤ P ∨ ⎤Q
9. ⎤ S → R P → Q ⎤Q → ⎤ P
10. R (6), (9)
11. R → ⎤ Q P
12. ⎤ Q (10), (11)
13. Q ∧ ⎤ Q (3), (12)
Inconsistent
42 DISCRETE MATHEMATICAL STRUCTURES
E X E R C I S E 1.4
1. If a real number x is such that |x| > 5, then x2 > 25 (give the proof by cases).
2. Prove the statement by contradiction: “In a room of 15 people, 2 or more people have their
birthday in the same month.
3. Prove deductively that all right angles are equal.
4. Prove by using direct method: If an integer a is such that a – 2, is divisible by 3, then a2 – 1 is
divisible by 3.
5. Prove by using contrapositive method: If x2 is an odd integer, then x is an odd integer.
6. Prove by using direct method:
(i) Sum of two even integers is an even integer.
(ii) The sum of an even integer and an odd integer is an odd integer.
(iii) The product of an even integer and an odd integer is an even integer.
7. Disprove the proposition (by counter example) for every integer x there is an integer y where
y2 = x.
8. Prove that 5 is not a rational number (prove by contradiction).
9. Prove that if x2 – 4 = 0, then n ≠ 0 by the method of contradiction.
10. Prove by direct method:
If x and y are rational numbers then n + y is rational.
11. Find a counter example:
If a > b then a2 > b2
12. Give a direct proof that if a and b are odd integers then a + b is even.
13. Prove using contrapositive that if x2 – 4 < 0, then –2 < x < 2.
14. Rewrite the following propositions using the symbols ∀ and ∃.
(a) There is a cat without a tail.
(b) There is an integer between 2 and 15 inclusive.
(c) All odd prime numbers are bigger than 2.
(d) All elephants have trunks.
(e) All cats like cream.
(f) All students are clever.
(g) Every clever student is successful.
(h) There are some successful students who are not clever.
15. Negate the following propositions:
(a) (∀ a > 0) (∃ b > 0) a + b is prime.
(b) ( ∀ integers m) (∃ an integer n) (m2 = n).
(c) All good students study hard.
(d) All fish swim.
(e) (∃ an integer x) (5 ≤ x < 25) .
MATHEMATICAL LOGIC 43
Set Theory
2.1 INTRODUCTION
The notion of a set is elementary to all of Mathematics and every branch of mathematics can be considered
as a study of sets of objects of one kind or another. Cantor was the founder of the theory of sets. The
word set is a primitive term and is regarded as one of the basic undefined ideas of mathematics. But we
must have an Intuitive idea of what we mean by a set. Let us now consider the idea of a set.
Example 1:
(i) {3, 6, 9, 12, 15}
(ii) {a, b, c, d}
This method of listing the elements of the set is also known as ‘Tabulation’. In this method the order
in which the elements are listed is immaterial, and is used for small sets.
(ii) Another method of defining particular sets is by a description of some attribute or characteristic of
the elements of the set. This method is more general and involves a description of the set property.
A = {x | x has the property P}
Designates “the set A of all objects ‘x’ such that x has the property P”. This notation is called Set-
Builder notation. The vertical bar | is read as “such that”.
Example 2:
(i) A = {x | x is a positive Integer greater then 100}.
This is read as “the set of all x is a positive Integer less than 25”.
(ii) B = {x | x is a complex number}.
Note: Repetition of objects is not allowed in a set, and a set is collection of objects without ordering.
⎧1 if x ∈ A
μ A(x) = ⎨
⎩0 if x ∉ A
(iv) In another method we describe the set by a recursive formula:
2.3 SUBSETS
Definition 2.2: A set A is a subset of the set B if and only if every element of A is also an element of B.
We also say that A is contained in B, and use the notation A ⊆ B .
Symbolically: If x ∈ A ⇒ x ∈ B, then A ⊆ B .
If A ⊆ B , it is possible that A = B, to emphasize this fact we write A ⊆ B .
If A is contained in B, then we may also state that B contains A and write B ⊇ A.
2.5 SINGLETON
Definition 2.5: A set having only one element is called a singleton.
Example: (i) A = {8}, (ii) {φ}
Theorem 2.1: Two sets A and B are equal if and only if A ⊆ B and B ⊆ A .
Proof: If A = B, every member of A is a member of B and every member of B is a member of A.
Hence A ⊆ B and B ⊆ A
Conversely let us suppose that A ≠ B, then there is either an element of A that is not in B or there is
an element of B that is not in A. But A ⊆ B , therefore every element of A is in B and B ⊆ A , therefore
every element of B is in A. Therefore, our assumption that A ≠ B leads to a contradiction, hence A = B.
Theorem 2.2: If φ and φ ′ are empty sets, then φ = φ ′ .
Proof: Suppose φ ≠ φ ′ . Then one of the following statements must be true:
1. There is an element x ∈ φ such that x ∉ φ ′
2. There is an element x ∈ φ ′ such that x ∉ φ .
But both these statements are false, since neither φ nor φ ′ has any elements. If follows that φ = φ ′ .
SET THEORY 47
Note: A set is never equal to its power set. In the programming language Pascal, the notion power set is used to
define data type in the language.
2.11.2
If A ⊆ B, and B ⊆ C then A ⊆ C where A, B and C are sets
Proof: Let x ∈ A . Then
x ∈ A ⇒ x ∈ B ( A ⊆ B)
⇒ x ∈ C (A ⊆ C)
if x ∈ A then x ∈ C , therefore A ⊆ C .
(ii) B ⊆ ( A ∪ B )
(iii) A ∪ U = U where U is the universal set.
Proof:
(i) Let x ∈ A . Then
x ∈ A ⇒ x ∈ A or x ∈ B
⇒ x ∈ ( A ∪ B)
Thus A ⊆ A ∪ B
(ii) Let x ∈ B
Then x ∈ B ⇒ x ∈ A or x ∈ B
⇒ x ∈ ( A ∪ B)
Hence B ⊆ A ∪ B
2.13.2
If A is any set then (i) A ∪ φ = A (ii) A ∪ A = A
Proof:
(i) Clearly A ⊆ ( A ∪ φ ) … (1)
Conversely, let x ∈ A ∪ φ
x ∈ A ∪ φ ⇒ x ∈ A or x ∈ φ
⇒ x∈ A
Thus A ∪ φ ⊂ A … (2)
from (1) and (2), we have
A ∪φ = A
(ii) Clearly A ⊆ A ∪ A … (1)
Now let x ∈ A ∪ A
x ∈ A ∪ A ⇒ x ∈ A or x ∈ A
⇒ x∈ A
Thus A ∪ A ⊆ A … (2)
Combining (1) and (2), we get
A∪ A= A
(iii) In order to prove that A ∪ U = U we have to prove that ( A ∪ U ) ⊆ U and U ⊆ ( A ∪ U )
Every set is a subset of the universal set.
i.e., (A ∪ U ) ⊆ U … (1)
also U ⊆ (A ∪ U) … (2)
50 DISCRETE MATHEMATICAL STRUCTURES
2.13.3
Union of sets is commutative, i.e., If A and B are any sets, then A ∪ B = B ∪ A
Proof: Let x ∈ A ∪ B , then
x ∈ A ∪ B ⇒ x ∈ A or x ∈ B … (1)
⇒ x ∈ B or x ∈ A
⇒ x ∈ ( B ∪ A)
Hence ( A ∪ B ) ⊆ ( B ∪ A) ... (1)
Conversely, let x ∈ ( B ∪ A) , then
x ∈ ( B ∪ A) ⇒ x ∈ B or x ∈ A
⇒ x ∈ A or x ∈ B
⇒ x ∈ ( A ∪ B)
Thus ( B ∪ A) ⊆ ( A ∪ B ) … (2)
From (1) and (2) we have
A ∪ B = B ∪ A.
n
∩ Ai = {x | x ∈ Ai for every i (i = 1, 2, ..., n)}
i =1
2.15.2
If A is any set then
(i) A ∩ φ = φ , (ii) A ∩ A = A , (iii) A ∩ U = A , where U is the universal set.
52 DISCRETE MATHEMATICAL STRUCTURES
Proof:
(i) φ is a subset of every set, therefore
φ ⊆ A∩φ ... (1)
and A∩φ ⊆φ
from (1) and (2) we have A∩φ =φ … (2)
(ii) Clearly A ∩ A ⊆ A … (1)
Let x be a member of A, then
x ∈ A ⇒ x ∈ A and x ∈ A (by the repetition of the statement)
⇒ x∈ A ∩ A
Thus A⊆ A∩ A … (2)
Combining (1) and (2), we get
A∩ A= A
(iii) Clearly A ∩ U ⊆ A
Let x be any member of A, then
x ∈ A ⇒ x ∈U (∴ A ⊆ U )
⇒ x ∈ A and x ∈ U
⇒ x∈ A ∩U
Hence A ⊆ A ∩U … (2)
Combining (1) and (2), we get
A ∩U = A
⇒ x ∈ A and ( x ∈ B or x ∈ C )
⇒ x ∈ A and x ∈ ( B ∪ C )
⇒ x ∈ A ∩ (B ∪ C )
Hence ( A ∩ B) ∪ ( A ∩ C ) ⊆ A ∩ (B ∪ C ) … (2)
From (1) and (2), we have
A ∩ (B ∪ C ) = ( A ∩ B ) ∪ ( A ∩ C )
2.16.2
Union of sets is distributive over the intersection, i.e., if A, B and C are any three sets, then
A ∪ (B ∩ C ) = ( A ∪ B ) ∩ ( A ∪ C )
Conversely x ∈U ⇒ x ∉U
⇒ x ∈φ
Hence U ⊆φ
SET THEORY 55
Now φ ⊆ U and U ⊆ φ
⇒U =φ
Proof: (2) Let x ∈ φ , then
x ∈φ ⇒ x ∉φ
⇒ x ∈U
Thus φ ⊆U
Conversely let x ∈ U , then
x ∈U ⇒ x ∉φ
⇒ x ∈φ
Hence U ⊆φ
Therefore φ ⊆ U and U ⊆ φ ⇒ φ = U
The properties (3) and (4) are very simple and follow immediately from the definition of complement,
we prove the remainig.
Hence x ∈ ( A) ⇒ x ∉ A
⇒ x∈ A
Thus (A) ⊆ A … (1)
Conversely, let x ∈ A , then
x∈ A ⇒ x∉ A
⇒ x ∈ ( A) … (2)
Hence A ⊆ ( A )
Therefore from (1) and (2)
( A) = A
Proof: (6) We have A ⊆ B
Let x ∈ B , then
x∈B ⇒ x∉B
⇒ x∉ A (∴ A ⊆ B )
⇒ x∈ A
Hence B ⊆ A
Proof: (7) Let x ∈ ( A ∩ B ) ; then
x ∈ ( A ∩ B) ⇒ x ∉ ( A ∩ B)
56 DISCRETE MATHEMATICAL STRUCTURES
⇒ x ∉ A or x ∉ B
⇒ x ∈ A or x ∈ B
⇒ x∈ A ∪ B
Hence ( A ∩ B) ⊆ A∪B … (1)
Conversely, let x ∈ A ∪ B , then
x ∈ ( A ∪ B ) ⇒ x ∈ A or x ∈ B
⇒ x ∉ A or x ∉ B
⇒ x ∉ ( A ∩ B)
⇒ x ∈ ( A ∩ B)
Thus A ∪ B ⊆ (A ∩ B) … (2)
From (1) and (2), we have
( A ∩ B) = A∪B
x ∈ ( A ∪ B) ⇒ x ∉ A ∪ B
⇒ x ∉ A and x ∉ B
⇒ x ∈ A and x ∈ B
⇒ x∈ A∩ B
Hence A ∩ B ⊆ (A ∪ B) … (1)
Conversely, let x ∈ A ∩ B , then
x ∈ A ∩ B ⇒ x ∈ A and x ∈ B
⇒ x ∉ A and x ∉ B
⇒ x ∉ ( A∪ B )
⇒ x ∈ ( A ∪ B)
Thus A ∩ B ⊆ ( A ∪ B) … (2)
Combining (1) and (2), we have ( A ∪ B) = A ∩ B
The above properties of union and intersection of sets are called set Identities.
Note: We can also find the symmetric difference by using the identity.
A Δ B = ( A − B ) ∪ ( B − A)
In the above example, we have A – B = {1, 2, 5, 6, 7};
and B – A = {p, q, r, s}
Hence A Δ B = ( A − B ) ∪ ( B − A) = {1, 2, 5, 6, 7, p, q, r, s}
A ∩B =φ A ∩ (B ∪ C ) (A ∪ B ) (Shaded)
A ∩ (B ∩ C ) = φ (A ∩ B ) ∪ (A ∩ C ) (Shaded part)
(A ∪ B ) ∩ C (Shaded) A ∩ B = A if A ⊆ B
Example 2: ( )
Show that ⎡⎣ A ∩ B ∪ A ⎤⎦ ∪ B = B
Solution: ⎡ A ∩ ( B ∪ A )⎤ ∪ B = (( A ∩ B ) ∪ ( A ∩ A)) ∪ B
⎣ ⎦
= (( A ∩ B ) ∪ φ ) ∪ B
= (A ∩ B) ∪ B = B
Example 3: ( )
Give that φ is an empty set, find P (φ ) , P ( P (φ )) , P P ( P (φ ))
Solution: P (φ ) = {φ}
P ( P (φ )) = {φ , (φ )}
( ) {
P P ( P (φ )) = φ , {φ}, {{φ}}, {φ , {φ}} }
E X E R C I S E 2.1
5. ( A ∪ B) = A ∩ B
6. ( A ∪ B) ∩ B = A ∩ B
7. A ∪ (A ∩ B) = A ∪ B
8. A ∩ ( A ∪ B) = A
(b) 1. A ⊆ B ⇔ A ∪ B = B (MCA, OSM, 1999)
{ }
Ak = a / a ≤ 1 + 1/ k ; k = 1, 2 , ...
∞
Π = A0 (MCA, OSM, 1999)
k =1
k=1
6. Show that P ( A) ∪ P ( B ) ⊆ P ( A ∪ B ) where P(X) is the power set of set X
(MCA, OSM, 1998)
7. Let A be a set with k elements and P(A) its power set show that the cardinclity of P (A) is 2k.
II
1. A = {1, 2}, B = {1, 2, 4, 5} and C = {5, 7, 9, 10} find
(a) A ∪ B (b) A ∩ B (c) ( A ∪ B ) ∪ C
(d) ( A ∩ B ) ∩ C (e) ( A ∪ B ) ∩ C (f) ( A ∩ B ) ∪ C
2. If A = {a, b, c, d}, B = {c, d, e} and C = {e, f, g, h} state the elements of the sets.
(a) A ∪ C (b) B ∩ A
(c) B ∩ ( A ∪ C ) (d) ( B ∩ A) ∪ ( B ∩ C )
3. If U = {x ∈ Z | − 5 < x < 5} and A = ( x ∈ Z | − 2 < x < 3) state the elements of the sets.
A , A ∩ A , A ∩ U , A ∪ U {Z is the set of integers}
4. If U = {1, 2, 3, 4, … 10}, A = {x ∈ U | x is a prime} , B = { x ∈ U | x is odd} Show that
A ∩ B = ( A ∪ B)
5. U = {a, b, c, d, e, f, g}, A = {a, b, c, d}, B = {a, b, c, d, e, f} and C = {a, b, g} find A, B , C ,
A – B, B – C, A ∩ B ( A ∪ B ) and B ∩ C .
6. If A = {a, b, c, e, f,}, B = {b, e, f, r, s} and C = {a, t, u, v} find A ∩ B , A ∩ C and B ∩ C .
SET THEORY 61
⎛ 3 ⎞ 3 ⎛ 3 ⎞ 3
(a) B ∪ ⎜ ∩ Ai ⎟ = ∩ ( B ∪ Ai ) (b) B ∪ ⎜ ∪ Ai ⎟ = ∪ ( B ∩ Ai )
⎝i =1 ⎠ i =1 ⎝i =1 ⎠ i =1
11. If A1 = {{1, 2}, {3}}, A2 = {{1}, {2, 3}}, and A3 = {1, 2, 3} these show that A1, A2, A3 are
mutually disjoint.
12. If A and B are two given sets then, prove that A ∩ ( B − A ) = φ
13. If A = {1, 3, 5, 7, 8, 9} and B = {3, 5, 8} then verify:
( A − B ) ∪ ( B − A) = ( A ∪ B ) − ( A ∩ B )
14. If A = {1, 2, 3, 4}, B = {2, 3, 4, 5}and C = {1, 3, 4, 5, 6, 7} verify
A ∩ (B ∪ C ) = ( A ∩ B ) ∪ ( A ∩ C )
15. If A ⊕ denotes the symmetric difference of two sets A and B, then find A ⊕ B for the
following:
(a) A = {a, b}, B = {a, c} (b) A = {a, b}, B = {b, c}
16. If A = (1, 3, 5, 7, 9} and B = {3, 5, 8} then find A Δ B (symmetric difference of the sets A
and B).
17. Prove (or disprove) by Venn diagram or otherwise that
( A ∪ B ) ∩ (B ∪ C ) ⊂ ( A ∩ B ) (MCA, OSM, 1997)
18. A and B are two independent events. The Probability that both A and B occur is 1/12. The
Probability that neither A nor B occures is 1/2. Find the values of P(A) and P(B).
(
19. A and B are two events such that P(A) = 0.3, P(B) = 0.4 and P ( AB ) = 0.5 find P B | ( A ∪ B ) . )
20. A die of 6 faces is thrown 4 times. What is the probability that the minimul value is not less
than 2 and the maximum value is not grater than 5
21. Define a partition of a set.
22. Define a power set. Illustrate with an example.
Answers:
II 1. (a) {1, 2, 4, 5}; (b) {1, 2}; (c) {1, 2, 4, 5, 7, 9, 10}; (d) φ ; (e) {5}; ( f ) {1, 2, 5, 7, 9, 10}
2. (a) {a, b, c, d, e, f, g, h}, (b) {c, d}, (c) {c, d, e}, (d) {c, d, e}
3. A = {x ∈ Z | − 5 < x < − 2 ∪ 3 < x < 5}
A∩ A = U
A ∩ U = A, A ∪ U = U
62 DISCRETE MATHEMATICAL STRUCTURES
(c) B = {b , c , d , f , g }
(d) {a, c , e, f , g}
9. (a) P(A) = {{f}, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, A}
(b) {f, {a}, {a}, {b}, {c}, {a, b}, {a, c}, {a, d}, {b, c}, {b, d}, {c, d}, {a, b, c}, {a, b, d}, {a, c, d}
{b, c, d}{a, b, c, d}}
15. (a) {b, c}, (b) {a, c}
16. A Δ B = {1, 7, 8, 9}
1 1
18. ,
4 3
1
19.
4
16
20.
81
(c) The rational integers are the members of the set Z, where
Z = {… – 3, – 2, – 1, 0 , 1, 2, 3, 4 …}
(d ) The rational numbers are the members of the set.
Q = { p / q | p ∈ Z , q ∈ Z , and q ≠ 0}
(e) The irrational numbers are the members of the set of all real numbers that cannot be expressed
as the quotient p/q of two integers.
SET THEORY 63
2.26 CARDINALITY
2.26.1 Finite Set
Definition 2.18: A set A is called a finite set if it has n distinct members (elements) where n ∈ N
(refer 1.5).
2.26.2 Cardinality of a Set
Definition 2.19: If A is finite set with n distinct elements, then n is called the cardinality of A. The
cardinality of A is denoted by |A| [or by n (A)].
Example: Let A = {a, b, c, d}, then A is a finite set and |A| = 4
2.26.3 Cardinality of Union of Two Sets
Number of elements in A ∪ B : (Cardinality of union) If A and B are any two finite sets then, the
numbers of elements in A ∪ B , denoted by | A ∪ B | is given by | A ∪ B | = | A | + | B | − | A ∩ B |
| A| + | B | + |C | − | A ∩ B | − | B ∩ C | − | C ∩ A| + | A ∩ B ∩ C |
=5+4+4–3–3–2+2
=7= |A∩ B ∩C|
Example 3: Out of 30 students in a dormitory, 15 take an art course, 8 take a biology course and 6 take
a chemistry course. It is known that 3 students take all the three courses. Show that 7 or more students
take none of the courses.
Solution: Let A be the set of students taking an art course
B be the set of students taking a biology course
C be the set of students taking a chemistry course
Then we have
| A| = 15, | B | = 8, | C | = 6, | A ∩ B ∩ C | = 3
| A ∪ B ∪ C | = | A| + | B | + | C | − | A ∩ B | − | B ∩ C | − | C ∩ A| + | A ∩ B ∩ C |
= 15 + 8 + 6 − | A ∩ B | − | B ∩ C | − | C ∩ A| + 3
= 3 2 − | A ∩ B | − | B ∩ C | − | C ∩ A| ... (1)
But | A ∩ B | ≥ | A ∩ B ∩ C |, | B ∩ C | ≥ | A ∩ B ∩ C |, | C ∩ A| ≥ | A ∩ B ∩ C |
Therefore, | A ∩ B | + | B ∩ C | + | C ∩ A| ≥ 3 | A ∩ B ∩ C |
From (1), we have
| A ∪ B ∪ C | ≥ 32 − 3 | A ∩ B ∩ C | = 32 − 3 × 3
Hence | A ∪ B ∪ C | ≥ 23
The number of students taking atleast one course ≥ 23 . The students taking none of the courses
≥ 30 − 23 = 7.
Hence, seven or more students take none of the courses.
2.26.5 Comparable Sets
Definition 2.20: Two sets A and B are said to be comparable if A ⊂ B or B ⊂ A
2.26.8 Multiplicity
Definition 2.23: Let S be a multiset and x ∈ S . The multiplicity of x is defined to be the numbers of
times the element x appears in the multiset S.
Example 1: Let S = {a, a, b, b, b, d, d, d, e}
Then Multiplicity of a is 2
Multiplicity of b is 3
Multiplicity of d is 3
Multiplicity of e is 1
If A and B are multisets then A ∪ B and A ∩ B are also multisets. The multiplicity of an element
x ∈ A ∪ B is equal to the maximum of the multiplicity of x in A and B.
The multiplicity of x ∈ A ∩ B is equal to the minimum of the multiplicities of x in A and in B.
Example 2: Let A = {a, a, a, b, b, c, c, d, d}
and B = {a, a, b, b, c, d}
Then A ∪ B = {a, a, a, b, b, c, c, d , d }
A ∩ B = {a, a, b, c, d}
Note: If A and B are both the set of real numbers then A × B is the cartesian plane. The cartesian product of sets
can also be represented by tree diagrams.
2.27.3
If A, B, C are sets then
(i) A × ( B ∪ C ) = ( A × B ) ∪ ( A × C )
(ii) A × ( B ∩ C ) = ( A × B ) ∩ ( A × C ) (V.T.U., B.E., 2000)
Proof: (i) A × ( B ∪ C )
= { ( x , y ) : x ∈ A , y ∈B ∪ C }
= { ( x , y ) : x ∈ A and y ∈ B or y ∈C }
= { ( x , y ) : x ∈ A , y ∈ B or x ∈ A , y ∈C }
= { ( x , y ) : ( x , y ) ∈ A × B or ( x , y ) ∈ A × C }
= (A × B) ∪ (A × C )
(ii) A × ( B ∩ C )
= {( x , y ): x ∈ A, y ∈ B ∩ C}
= {( x, y ): x ∈ A and y ∈ B and y ∈ C}
= {( x, y ): x ∈ A, y ∈ B and x ∈ A, y ∈ C }
= {( x, y ) : ( x, y ) ∈ A × B and ( x, y ) ∈ A × C}
= (A × B) ∩ (A × C )
2.27.4
If A, B, and C are non-empty sets then
A ⊆ B ⇒ A× C ⊆ B × C
Proof: Let (a, b) be any element A × C, then
⇒ a ∈ B and b ∈ C (3 A ⊆ B )
⇒ (a , b ) ∈ B × C
Hence A×C ⊆ B×C
E X E R C I S E 2.2
Relations
Definition 3.8: A relation R defined on a set A is asymmetric if whenever aRb, then bRa.
Example: Let A = {a, b, c} and R = {(a, b), (b, c)} be a relation on A. Clearly R is a symmetric.
by symmetry, [ x]R ⊆ [ y ]R
∴ [ x]R ⊆ [ y ]R and [ y ]R ⊆ [ x ]R ⇒ [ x ]R ⊆ [ y ]R
If xRy, then it is shown that [x]R = [y]R. If xRy , then we must show that [x]R and [y]R are disjoint. To
prove that, let us assume that, there is atleast one element
say z ∈ [ x ]R ∩ [ y ]R
now, xR z and yR y
⇒ xR z and yR y
⇒ xR y [by Transitivity]
which is a contradiction
Hence xR y ⇒ [ x ]R ∩ [ y ]R = ∅
RELATIONS 75
From the above it is clear that each element of A generates an R-equivalence class which is
non-empty. The R-equivalence classes generated by any two elements are either equal or disjoint, and
the union of R-equivalence classes generated by the element of A is the set A. Hence the R-equivalence
classes generated by the elements of A defines a partition of A.
Note: The family of equivalence classes generated by the elements of A is denoted by A/R and is called quotient
set of A and R. Each element of A/R is a set.
Example: Let Z be the set of integers and let R be the relation called “congruent modulo 5” defined by
R = {( x , y ) | x ∈ Z , y ∈ Z and (x – y) is divisible by 5}
Determine the equivalence classes generated by the element of Z.
Solution: The equivalence classes are
[0]R = { … … –10, –5, 0, 5, 10, 15, …}
[1]R = { … … –9, –4, 1, 6, 11, 16, …}
[2]R = { … … –8, –3, 2, 7, 12, 17, …}
[3]R = { … … –7, –2, 3, 8, 13, 18, …}
[4]R = { … … –6, –1, 4, 9, 14, 19, …}
∴ Z/R = {[0]R’ [1]R’ [2]R’ [3]R’ [4]R}
Fig. 3.1
For example: Let A = {1, 2, 3, 4} and R = {(1, 1), (1, 2), (2, 2), (1, 4), (2, 4), (3, 2), (4, 3)} be a
relation on A
The tabular form of the relation R is given below:
Fig. 3.2
The check marks in the cells represent the elements (the ordered pairs) of R. If the cells in the main
diagonal of table contain check marks then R is reflexive. For example: Let A = {1, 2, 3, 4} and
R = {(1, 1), (1, 4), (2, 2), (2, 4), (3, 3), (4, 4)}
The tabular form of R is:
Fig. 3.3
The cells in the main diagonal of the table contain check marks. Thus R is a reflexive relation in A.
If the relation R is a symmetrical relation in a set A, then the check marks will be symmetrical with
respect to the main diagonal in the table. For example, consider the relation
R = {(1, 2), (1, 4), (2, 1), (2, 3), (3, 2), (3, 4), (4, 1), (4, 3), (4, 4)}
Defined on the set A = {1, 2, 3, 4}
The table given below represents R:
Fig. 3.4
The check marks are in cells that are symmetric with respect to the main diagonal. Therefore R is
symmetric.
RELATIONS 77
Fig. 3.5
R is shown in Fig. 3.5 (a) and R1 is shown in Fig. 3.5 (b). Note that the ordered pairs in R1 which are
not in R are marked with heavy check marks.
R + = R ∪ R1 ∪ R2 ∪ ... ∪ Ri ∪ Ri +1 ∪ ....
R+ is the smallest transitive relation containing R.
Example: Let A = {1, 2, 3, 4} and R = {(1, 2), (2, 3), (3, 4), (2, 1)}
Then R+ = {(1, 1), (1, 2), (1, 3), (1, 4), (2, 1), (2, 2), (2, 3), (2, 4), (3, 4)} is the transitive closure of R.
Theorem 3.2: Let R be a relation from A to B and let A1 and A2 be two subsets of A, then
(i) A1 ⊆ A2 ⇒ R ( A1 ) ⊆ R ( A2 )
(ii) R ( A1 ∪ A2 ) = R ( A1 ) ∪ R ( A2 )
(iii) R ( A1 ∩ A2 ) ⊆ R ( A1 ) ∩ R ( A2 )
Proof: (i) Let y ∈ R ( A1 )
y ∈ R ( A1 ) ⇒ xR y for some x ∈ A1
⇒ x ∈ A2 [Since A1 ⊆ A2 ]
∴ R ( A1 ) ⊆ R ( A2 )
78 DISCRETE MATHEMATICAL STRUCTURES
and R ( A2 ) = {b , d , e , f }
Hence R ( A1 ) ∪ R ( A2 ) = {a , b , c , d , e , f }
and R ( A1 ) ∩ R ( A2 ) = {b}
now R ( A1 ∪ A2 ) = R ( A) = {a , b , c , d , e , f }
R ( A1 ) ∪ R ( A2 )
⇒ R ( A1 ∩ A2 ) ⊆ R ( A1 ) ∩ R ( A2 ) holds.
Example 2: Let A = {1, 2, 3, 4} and B = {a, b, c, d, e, f} consider the relation
R = {(1, a), (1, c), (1, e), (2, b), (2, d), (2, f), (3, c), (3, d), (4, a), (4, f)}
Let A1 = {1, 4} A2 = {1, 3, 4} then A1 ⊂ A2
and R (A1) = {a, c, e, f }
R (A2) = {a, c, d, e, f }
RELATIONS 79
Clearly R ( A1 ) ⊆ R ( A2 )
Thus A1 ⊆ A2 ⇒ R ( A1 ) ⊆ R ( A2 )
( )
⎧0 if ai , b j ∉ R
⎪
mij = ⎨
( )
⎪⎩1 if ai , b j ∈ R
Where mij is the element in the ith row and jth column. MR can be first obtained by first constituting
a table, whose columns are preceded by a column consisting of successive elements of A and where rows
are headed by a row consisting of successive elements of B. If (ai’ bi) ∈ R, then we enter 1 in the ith row
and jth column and if (ak’ al) ∉ R, then we enter zero in the kth row and ith column.
Example 1: Let A = {1, 2, 3} and R = {(x, y) | x < y}, find MR.
Solution: We have, R = {(1, 2), (1, 3), (2, 3)}
The table and corresponding relation Matrix for the R are given below
1 2 3
1 0 1 1
⎛ 0 1 1⎞
MR = ⎜ 0 0 1 ⎟
2 0 0 1 ⎜0 0 0⎟
3 0 0 0 ⎝ ⎠
Fig. 3.6
Example 2: Let A = {1, 4, 5} and {(1, 4), (1, 5), (4, 1), (4, 4), (5, 5)}, find MR.
Solution: Given that R = {(1, 4), (1, 5), (4, 1), (4, 4), (5, 5)}
The relation Matrix of R is
⎡0 1 1 ⎤
M R = ⎢⎢1 1 0⎥⎥
⎣⎢0 0 1 ⎥⎦
Note: If A and B are two finite sets with |A| = m; and |B| = n, then a m × n matrix, whose entries are zeros and
ones determine a relation from A to B.
⎡1 0 1⎤
⎢ ⎥
and MSOR = ⎢1 1 1⎥ = MR MS can easily be verified
⎢⎣0 1 1⎥⎦
If
⎡1 1 1 0⎤ ⎡0 0 1 1⎤
⎢0 0 0 0 ⎥ ⎢ 0 ⎥⎥
MR = ⎢ ⎥ and M = ⎢0 0 1
⎢0 1 0 0 ⎥ S
⎢1 0 0 0⎥
⎢ ⎥ ⎢ ⎥
⎣⎢0 0 0 0 ⎦⎥ ⎢⎣1 0 0 0 ⎦⎥
and the relational Matrices of the relation R and S defined on a set A = {1, 2, 3,4} for which
We know that
MSoR = MR . Ms
⎡1 1 1 0⎤ ⎡0 0 1 1⎤ ⎡1 0 1 1⎤
⎢0 0 0 0⎥⎥ ⎢0 0 1 0⎥⎥ ⎢⎢0 0 0 0 ⎥⎥
Therefore M SoR =⎢ ⎢ =
⎢0 1 0 0⎥ ⎢1 0 0 0⎥ ⎢0 0 1 0⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎢⎣0 0 0 0⎥⎦ ⎢⎣1 0 0 0⎥⎦ ⎢⎣0 0 0 0 ⎥⎦
Hence MSoR = {(1, 1), (1, 3), (1, 4), (3, 3)}
then we connect the vertices ai and aj by means of an arc and put an arrow in the direction from ai to aj.
If ( ai , a j ) ∈ R and ( a j , ai ) ∈ R then we draw two arcs between ai and aj (sometimes by one arc which
starts from node ai and relatives to node xi (such an arc is called a loop). When all the nodes corresponding
to the ordered pairs in R are connected by arcs with proper arrows, we get a graph of the relation R. If R
is reflexive, then there must be a loop at each node in the graph of R. If R is symmetric, then ( ai , a j ) ∈ R
implies ( a j , ai ) ∈ R and the nodes ai and aj will be connected by two arcs (edges) one from ai to aj and
the other from aj to ai.
Example 1: Let A = {a, b, d} and R be a relation on A given by
R = {(a, b), (a, d), (b, d), (d, a), (d, d)}
Construct the digraph of R.
Solution: The digraph of R is as shown in Fig. 3.7.
Fig. 3.7
Fig. 3.8
82 DISCRETE MATHEMATICAL STRUCTURES
Fig. 3.9
1 2
4 3
Fig. 3.10
RELATIONS 83
Hence R ∞ = {(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 3), (2, 4), (2, 5), (3, 4), (3, 5), (4, 5)}
Example 2: Give an example of a non-empty set and a relation on the set that satisfies each of the
following combinations of properties: draw a digraph of the relation:
(1) Symmetric and reflexive but not transitive
(2) Transitive and reflexive; but not anti-symmetric
(3) Anti-symmetric and reflexive, but not transitive.
Solution: (1) Let A = {a, b, c} and R = {(a, a), (b, b), (c, c), (a, b), (a, c), (b, a), (c, b)} clearly R is
symmetric and reflexive but not transitive. The digraph of R is given below:
Fig. 3.11
Fig. 3.12
84 DISCRETE MATHEMATICAL STRUCTURES
Example 3: Let A = {a, b, c} and R = {(a, b), (b, b), (c, c), (a, b), (b, c)}
The relation on A is symmetric and reflexive but not transitive. Figure 3.13 illustrates the relation.
Fig. 3.13
Example 4: For the following digraph which of the special properties are satisfied by digraph’s relation?
Fig. 3.14
E X E R C I S E 3.1
1. Let A = {1, 2, 3, 4}, determine whether the relations are reflexive, symmetric, anti-symmetric or
transitive.
1. R = ∅
2. R = {(1, 1), (2, 2), (3, 3)}
3. R = {(1, 3), (1, 1), (3, 1), (1, 2), (3, 3), (4, 4)}
4. R = {(1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4)}
5. R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (3, 4), (4, 3), (4, 4)}
6. R = {(1, 3), (4, 2), (2, 4), (3, 1), (2, 2)}
7. R = A × A
8. R = {(1, 2), (1, 3), (3, 1), (1, 1), (3, 3), (3, 2), (1, 4), (4, 2), (3, 4)}
2. Write down the relations in the square of the set {1,2, 4, 8, 16, 32, 64}.
86 DISCRETE MATHEMATICAL STRUCTURES
3. The following relations in N, the set of natural numbers. Give their domains and ranges.
(i) {(1, 1), (16, 2), (81, 3), (256,}
(ii) {(2, 1), (4, 2), (10, 5), (18, 9), (20, 10)}
4. Determine the domain and range of relation R, on set of Integers
R = {(x, y) | x is a multiple of 3 and y is a multiple of 5}.
5. Tabulate the element of the following relations from A to B:
(a) A = {1, 2, 3, 4}, B = {1, 2, 3, 4, 5, 6, 7} and
R = {(x, y) | y = x2 + 3x + 3}
(b) A = {1, 2, 3}, B = {1, 2, 3, 4, 5} and
R = {(x, y) | 5x + 2 y is a prime number}
6. Let f on a mapping of a set X onto a set R. Then if we define ( a , b ) ∈ R , for a , b ∈ X provided
f (a) = f (b). Prove that R is an equivalence relation.
7. Determine whether the relation
R = {(1, 1), (2, 2), (3, 3), (4, 4), (1, 3), (3, 1), (1, 4), (4, 1)} is an equivalence relation in
{1, 2, 3, 4}
8. Let R be the relation in the natural numbers N = {1, 2, 3, …}
Define by “x + 2y = 10” i.e., let R = {( x , y ) | x ∈ N , y ∈ N , x + 2 y = 10} .
Find (a) The domain and range of R (b) R–1
9. Let A = {1, 2, 3, 4, 5, 6}, construct pictorial descriptions of the relation R on A for the following as:
(a) R = {(j, k) | j is a multiple of k}
(b) R = {(j, k) | ( j − k ) ∈ A }
2
19. Let A = {1, 2, 3} determine whether the relation R whose matrix MR is given is an equivalence
relation:
⎡1 0 0⎤ ⎡1 0 1 ⎤
(a) M R = ⎢0 1 1 ⎥ (b) M R = ⎢0 1 0 ⎥
⎢ ⎥ ⎢ ⎥
⎢⎣0 1 1 ⎥⎦ ⎢⎣1 0 0⎥⎦
20. Determine whether the relation whose digraph is given below (Fig. 3.15) is an equivalence relation.
Fig. 3.15
⎡1 0 1 ⎤ ⎡1 0 0⎤
M R = ⎢⎢1 1 1 ⎥⎥ M S = ⎢⎢0 1 1 ⎥⎥
⎢⎣0 1 0 ⎥⎦ ⎢⎣0 1 1 ⎥⎦
88 DISCRETE MATHEMATICAL STRUCTURES
⎡1 0 1 ⎤
Show that M SoR = ⎢⎢1 1 1 ⎥⎥
⎢⎣0 1 0⎥⎦
20. No.
⎡1 0 0 1⎤
⎢0 1 1 0⎥⎥
21. ⎢
⎢0 1 1 0⎥
⎢ ⎥
⎣⎢1 0 0 1 ⎦⎥
R oS oR = {( x , 2 x ) | x ∈ I }
27. The different partitions of A are
{{1, 2, 3}}, {{1}, {2, 33}}, {{2}, {1, 33}}, {{3}, {1, 3}}, {{13, 52}, {3}}
28. Number of different partitions on A is 15.
90 DISCRETE MATHEMATICAL STRUCTURES
4.1 INTRODUCTION
The concept of relation was defined very generally in the preceding chapter. We shall now discuss a
particular class of relations called Functions. They are widely used in Mathematics and the concept is
basic to the idea of computation.
4.2 FUNCTION
Definition 4.1: Let A and B be any two sets. A relation f from A to B is called function if for every
a ∈ A there is a unique element b ∈ B , such that ( a , b ) ∈ f .
If f is a function from A to B, then f is a function from A to B such that
(i) Domain f = A
(ii) Whenever ( a , b ) ∈ f and ( a , c ) ∈ f , then b = c
The notation f: A → B, means f is a function from A to B.
Functions are also called Mappings or Transformations. The terms such as “correspondence” and
“operation” are used as synonyms for “function”.
Given any function f: A → B, the notation f(a) = b means ( a , b ) ∈ f . It is customary to write b = f
(a). The element a ∈ A is called an argument of the function f, and f (a) is called the value of the
function for the argument a or the image of a under f.
Example 2: Consider the sets A = {a1, a2, a3} and B = {b1, b2, b3}.
Let f = {(a1, b1), (a2, b2), (a3, b3)} every element of A is related to exactly one element of B.
Hence f is function (see Fig. 4.2).
Fig. 4.2
If f: A → B is a function, then A is called the Domain of f and the set B is called the codomain of f.
The range of f is defined as the set of all images under f.
It is denoted by f (A) = {b | for some a in A, f (a) = b} and is called the image of A in B. The Range
f is also denoted by Rf.
If Df denotes the domain of f: A → B, and Rf denotes the Range of f, then Df = A and R f ⊆ B .
A function need not be defined by a formula. While defining the property, it is customary to identify
the function by a formula for example f (x) = x3 for x ∈ R represents the function f = {(x, x3): x ∈ R }.
Where R is the set of real numbers.
4.2.1 Restriction and Extension
Definition 4.2: If f: A → B and P ⊆ A , then f ∩ ( P × B ) is a function from P → B, called the
Restriction of f to P. Restriction of f to P is written as f | P: P → B is such that (f | P) = f ( a ) ∀ a ∈ P .
If g is a restriction of f, then f is called the extension of g.
The domain of f | P is P.
∧ ∧ ∧
If g is a restriction of f, then Dg I Df and g (a) = f (a) a I Dg and g I f .
We have I A = {( a , a ) : a ∈ A}
Note: In the above definition it is assumed that the range of the function f is a subset of B (the Domain of g), i.e.,
R f ⊆ Dg If R f ⊆ Dg , then gof is empty.
(i) The composition of functions is not commutative, i.e., fog ≠ gof where f and g are two functions.
(ii) gof is called the left composition g with f.
Proof:
Let a1, a2 ∈ A , then
(gof ) (a1) = (gof ) (a2) ⇒ g [f (a1)] = g [f (a2)]
⇒ f (a1) = f (a2) (Q g is one-one)
⇒ a1 = a2 (Q f is one-one)
Hence gof is one-to-one
Now, from the definition, gof: A → C is a function g: B → C is onto, then c ∈ C ⇒ There is some
element b ∈ B such that ⇒ c = g (b) and f: A → B is onto, then by definition there exists an element
a ∈ A , such that f (a) = b
We have c = g (b) = g [f (a)] = (gof ) (a)
⇒ (gof ): A → C is onto
Hence gof is both one-one and onto.
f −1 = {(b , a ) | ( a , b ) ∈ f }
94 DISCRETE MATHEMATICAL STRUCTURES
Note:
(i) In general the inverse f –1 of a function f: A → B, need not be a function. It may be a relation.
(ii) If f: A → B is a bijection and f (a) = b, then a = f –1 (b) where a ∈ A , and b ∈ B
Example:
(i) Let A = {a, b, c}, B = {1, 2, 3} and f = {(a, 1), (b, 3), (c, 2)} clearly f is both one-to-one and
onto
–1
∴ f = {(1, a), (2, c), (3, b)} is a function from B to A.
(ii) Let R be a set of real numbers and f: R → R be given by
f ( x ) = x + 5 ∀ x ∈ R , i.e., f = {( x , x + 5 ) | x ∈ R}
then f −1
= {( x + 5, x ) | x ∈ R} is a function from R to R.
Theorem 4.2: If f: A → B be both one-one and onto, then f –1: B → A is both one-one and onto.
Proof: Let f: A → B be both one-one and onto. Then there exist elements a1 , a2 ∈ A , and elements
b1 , b2 ∈ B such that
f (a1) = b, and f (a2) = b2
or a1 = f –1(b1) = and a2 = f –1(b2)
Now, let f –1(b2) = f –1(b2) then
f –1(b1) = f –1 (b2)
⇒ a1 = a2
⇒ f (a1) = f (a2)
⇒ b1 = b2
Thus f –1 is one-one
Again since f is onto, for b ∈ B , there is some element a ∈ A , such that f (a) = b.
Now f (a) = b
⇒ a = f –1 (b)
⇒ f –1 is onto
Hence f –1 is both one-one and onto
Theorem 4.3: The inverse of an invertible mapping is unique.
Proof: Let f: A → B
By any invertible mapping. If possible let
g: B → A
and h: B → A
be two different inverse mappings of f.
Let b ∈ B and
g (b) = a1 , a1 ∈ A
h (b) = a2 , a2 ∈ A
FUNCTIONS AND RECURRENCE RELATIONS 95
⎧1 if x ∈ A
ψ A (x) = ⎨
⎩0 if x ∉ A
is called a characteristic function of the set A.
4.11.1 Properties of Characteristic Functions
Let A and B be any two subsets of a universal set U. Then the following properties hold for all x ∈ U :
(1) ψ A ( x ) = 0 ⇔ A = ∅
(2) ψ A ( x ) = 1 ⇔ A = U
(3) ψ A ( x ) ⊆ ψ B ( x ) = ⇔ A ⊆ B
(4) ψ A ( x ) = ψ B ( x ) ⇔ A = B
(5) ψ A ∩ B ( x ) = ψ A ( x ) . ψ B ( x )
(6) ψ A ∪ B ( x ) = ψ A ( x ) + ψ B ( x ) − ψ A ∩ B ( x )
(7) ψ A ( x ) = 1 − ψ A ( x )
(8) ψ A− B ( x ) = ψ A ( x ) − ψ A ∩ B ( x )
The operations I, =, +, . and –, used above are the usual arithmetical operations.
The values of characteristic functions are always either 1 or 0. The properties (1) to (8) can easily be
proved using the definition of characteristic functions.
Set identities can also be proved by using the properties characteristic functions.
Solution: ψ ( A )( x ) = 1 − ψ ( A )( x )
= 1 − (1 − ψ A ( x ))
= ψ A ( x) ⇒ ( A) = A
4.12 SOLVED EXAMPLES
Example 1: On which sets A will identity function IA : A → A be (i) one-one (ii) an onto function.
Solution: A can be any set
(i) The identity function is always one-one and
(ii) The identity function is always onto.
Example 2: Can a constant function be (i) one-one (ii) onto.
FUNCTIONS AND RECURRENCE RELATIONS 97
1
x= ( y − b ) ∈ R , such that f ( x ) = y
a
this proves that f is onto
Hence f is one-one and onto
Hence f is invertible and
1
f(−y1) = ( y − b)
a
Example 4: Let U = {a, b, c, d, e, f } and A = {a, d, e} then find XA, where XA denotes the characteristic
function of A.
Solution:
XA = {(a, 1), (b, 0), (c, 0), (d, 1), (e, 1), (f, 0)}
Since a ∈ A ⇒ X A ( a ) = 1, d ∈ A ⇒ X A ( d ) = 1, and e ∈ A ⇒ X A (e ) = 1, b, c, f are not the
members of A,
Thus XA (b) = XA (c) = XA (f ) = 0
Example 5: Let A and B be subsets of a universal set U then prove X A ∩ B = XA XB .
Solution:
⇒ XA (a) = XB (a) = 1
⇒ XA (a) XB (a) = 1
98 DISCRETE MATHEMATICAL STRUCTURES
Let b ∈ ( A ∩ B )′ , then b ∉ A ∩ B ⇒ X A ∩ X B (b ) = 0
Now b ∈ ( A ∩ B )′ ⇒ X A ∩ X B (b ) = 0
also b ∈ ( A ∈ B ) ' ⇒ b ∈ ( A ' ∪ B ')
⇒ b ∈ A′ or b ∈ B′
⇒ XA (b) = 0 or XB (b) = 0
⇒ (XA XB) (b) = XA (b) XB (b) = 0
Hence by definition
XA ∩ B = XA XB .
E X E R C I S E 4.1
(i) A ⊂ B , then f ( A) ⊂ f ( B )
(ii) D ⊂ E , then f −1 ( D ) ⊂ f −1 ( E )
(iii) f ( A ∩ B ) ⊂ f ( A) ∩ f ( B )
9. A = {1, 2, 3}, B = {p, q}, C = {a, b, f: A → B and g: B → C are given by f = {(1, p), (2, q),
(3, q)}, g = {(p, b), (q, b)} show that: gof = {(1, b), (2, b), (3, b)}.
10. X = {1, 2, 3} and f, g and h are function from X to X given by f = {(1, 2), (2, 3), (3, 1)}, g = {(1, 2),
(2, 1), (3, 3)}, h = {(1, 1), (2, 2), (3, 1)} find f og, g of, f og of, h of, h oh, and g oh.
11. R is the set of real numbers, given that f (x) = x + 2, g (x) = x – 2, and h (x) = 3x ∀ x ∈ R .
Find g of, f og, f of, g og, f oh, h og, h of, and f ogoh
12. Let A = {1, 2, 3 …, n}, {n ≥ 2), and B = {a, b} find the number of subjections from A onto B.
13. Let f: R → R be defined by f (x) = 3x + 4, show that f is one-one and onto. Give a formula that
defines f –1.
x−2
14. Let A = R – {3}, and let f: A → B be defined by f ( x ) = , show that f is one-to-one and
x−3
onto. Find f 1.
15. Let the functions f: R → R and g: R → R be defined by f (x) = 2 x + 1, g (x) = x2 – 2. Find
formulas which define the functions g of and f og.
16. Let U = {a, b, c, d, e}, A = {c, d} and B = {a, d, e}, find (1) XA (2) XB.
17. Show that the functions f : N × N → N and g : N × N → N given by f ( x, y ) = x + y and
g(x, y) = xy are onto but not one-to-one. (OU Mar. 2002)
18. If x and y are finite sets, find a necessary condition for the existence of one-to-one mapping from
x to y. (OU Mar. 2001)
19. Let A = B = R, the set of real number. Let f : A → B be given by the formula f ( x) = 2 x 2 − 1 and
1 1
let g: B → A be given by g ( y ) = 3 y + . Show that f is a bijection between A and B and g
2 2
is a bijection between B and A. (OU Dec. 2000)
Answers:
3. f –1 (Y) = (Y –1)1/2.
4. (c)
5. (c)
6. f (A) = B = {–2, 0, 18, 28, 108}
10. f og = {(1, 3), (2, 2), (3, 1)}
g of = {(1, 1), (2, 3), (3, 2)}
f og of = {(1, 2), (2, 1), (3, 3)}
h of = {(1, 2), (2, 1), (3, 1)}
h oh = {(1, 1), (2, 2), (3, 1)}
g oh = {(1, 2), (2, 3), (3, 2)}
100 DISCRETE MATHEMATICAL STRUCTURES
11. g of (x) = x
f og (x) = kx
f of (x) = x + 4
go g (x) = x – 4
f oh (x) = 3x + 2
h og (x) = 3x – 6
h of (x) = 3x + 6
f ogoh (x) = 3x
12. 2n – 2.
y−4
13. f ( y ) =
1
3
2 − 3y
14. f ( y ) = 1 − 4
1
We get the set {0, 1, 2, 3, …}. Each element in the above set is a successor set of the previous
element, except for the element 0. (0 is not the successor of any element).
Now we consider recursion in terms of successor:
Let S denote the successor. We define
(i) x + 0 = x (ii) x + S (y) = S (x + y)
In this definition (i) is the basis, and it defines addition of 0. The recursive part defines addition of
the successor of y.
Example 1:
3 + 2 = 3 + S (1)
= S (3 + 1)
= S (S (3 + 0)) = S (S (3)) = S (4) = 5
Now we start with a set of three functions called basis functions or initial functions of:
1. Zero function: Z: Z (x) = 0
2. Successor function S: S (x) = x + 1
3. Projection function : ∪1n : ∪1n ( x1 , x2 , x3 , ...xn ) = x1 (or generalized identify function).
Example 2:
S (3) = 3 + 1 = 4, S (4) = 4 + 1 = 5,
∪12 ( x , y ) = x , ∪32 (α , β , r ) = β , ∪53 (1, 7 , 6 , 2 , 4 ) = 6 , ∪63 (9 , 3, 2 , 5, 6 , 8 ) = 2 , etc.
The initial functions are used in defining other functions by induction.
4.13.1 Sequences
The idea of a sequences is important to computer science. A sequence is defined as the list of objects in
order. There are several ways of representing a sequence. One way is to list first terms of the sequence
till the rule for writing down other terms is obtained.
For example: The sequence {2, 4, 6, 8, …} is a sequence whose nth terms in 2n. Another way is to
give a rule of writing the nth terms of the sequence.
The sequence {1, 4, 7, 10, …} can be written as
{Sn} where Sn = 3n + 1, n = 0, 1, 2, ...
We can represent a sequence by using a recursive relation:
The recurrence relation
an = an – 1 + 5, with a1 = 6, recursively defines the sequence 6, 11, 16, …
a1 = 6 is called the initial condition.
4.13.2 Strings
Definition 4.12: Let A be a non-empty set, which we refer to as the alphabet. A string on the set A is a
finite sequence of elements of A.
The set of all strings on A is denoted by A* (or by A+).
Example 1:
(i) a3 a2 a1 a4 is a string on A = {a1, a2, a3, a4}
(ii) 246107 is a string on the alphabet consisting of the ten digits {0, 1, 2, 3, … 9}
102 DISCRETE MATHEMATICAL STRUCTURES
Usually we write a string on A without using commas between the elements of the string.
If a1, a2, a3, …, an is a string then the length of the string is n.
Example 2: The length of the string 621708 is 6
If a1, a2, …, an is a segment string, then ar+1 ar+2 ... as where 1 < r < s < n is called a (proper) segment
of the string. If r = 0, then ar+1 ar+2 ...as is called an initial segment of the string.
Example 3: 537 is an initial segment of the string 537108 and 710 is a segment of the string 537108.
Let a1 a2 …, am and b1 b2 … bn be strings. There concatenation is a1 a2 and b1 b2 … bn. It is also
called the product or Join and is a length m + n. For example: 537 and 108 are two strings and their
catenation is the string 537108.
4.13.3 Floor and Ceiling Functions
Definition 4.13: Let x be any real number, then the greatest integer that does not exceed x is called the
Floor of x.
The FLOOR of x is denoted by ⎢⎣ x ⎥⎦
Examples:
⎢⎣5.14⎥⎦ = 5
⎢ 5⎥ = 2
⎣ ⎦
⎢⎣ −7.6⎥⎦ = − 8
⎣⎢6⎦⎥ = 6
⎣⎢ −3⎦⎥ = − 3
Definition 4.14: Let x be a real number, then the least integer that is not less than x is called the
CEILING of x.
The CEILING of x is denoted by ⎡⎢ x ⎤⎥
Examples:
⎡⎢ 2.15⎤⎥ = 3
⎡ 5⎤ = 3
⎢ ⎥
⎡⎢ −7.4⎤⎥ = − 7
⎡⎢ −2⎤⎥ = −2
Example:
INT (2.33) = 2, INT (–6.4) = –6
INT (9) = 9
Note: If x is a positive Integer then INT (x) = ⎢⎣ x ⎥⎦ and if x is a negative integer then INT (x) = ⎡⎢ x ⎤⎥ .
(
f ( x , y + 1) = S ∪33 ( x , y , f ( x , y )) )
If follows that f comes from Primitive recursion from ∪11 and ∪33 and so is f Primitive recursive
( ( (
μ ( x , y + 1) = f ∪33 x , y , μ ( x , y ) , ∪13 ( x , y , μ ( x , y )) )))
Where f is the addition function.
Example 3: Let x, y be positive integers and suppose Q is defined recursively as follows:
⎧0 if x < y
Q (x , y ) = ⎨
⎩ ( −
Q x y , y ) + if y ≤ x
1
find (i) Q (4, 7) (ii) Q (14, 6).
Solution:
(i) Q (4, 7) = 0 since 4 < 7
(ii) Q (14, 6) = Q (14 – 6, 6)
= Q (8, 6) + 1
= Q (8 – 6, 6) + 1 + 1
= Q (2, 6) + 2
FUNCTIONS AND RECURRENCE RELATIONS 105
=0+2
=2
Example 4: Compute (i) A (1, 1), (ii) A (1, 2), (iii) A (2, 1) where A: N2 → N, (called Ackerman’s
function) is defined by
A (0, y) = y + 1
A (x + 1, 0) = A (x, 1)
A (x + 1, y + 1) = A (x + 1, y)
Solution:
(i) A (1, 1) = A (0 + 1, 0 + 1)
= A (0, A (1, 0))
= A (0, a (0, 1))
= A (0, 1 + 1)
= A (0, 2)
=2+1=3
(ii) A (1, 2) = A (0 + 1, 1 + 1)
= A (0, A (1, 1))
= A (0, 3) = 3 + 1 = 4
(iii) A (2, 1) = A (1 + 1, 0 + 1)
= A (1, A (2, 0))
= A (1, A (1, 1))
= A (1, 3)
= A (0 + 1, 2 + 1)
= A (0, 4)
=4+1=5
The functions given below are Primitive recursive:
1. Sign function
The sign of x, denoted by Sg(x) is defined by
Sg(0) = 0
Sg(x) = 1 for x ≠ 0
or Sg (0) = Z(0)
( (
S g ( y + 1) = S Z ∪22 ( y , S g ( y ))))
Sign function is also called non-zero test function.
2. Zero test function:
It is denoted by S g and is defined as S g (0 ) = 1, S g ( y + 1) = 0
3. Predecessor function:
It is denoted by P, and is defined as
P (0 ) = 0, P ( y + 1) = y = ∪12 ( y , P ( y ))
106 DISCRETE MATHEMATICAL STRUCTURES
Dividing by 59, we get 30 as the remainder the record with account number 2614902 will be assigned
to the list 30
i.e., h(2614902) = 30
Folding: In this method of hashing, the key (customer record number) is divided in several parts. The
parts are then added to for another number in the required range.
For example: Consider the customer record number 37124865 (having 8-digit key). If 3-digit address
is to be obtained then h(37124865) = 371 + 248 + 65 = 684.
E X E R C I S E 4.2
1. Show that exponentiation defined by f (x, y) = xy is Primitive recursive.
2. Show that the function [x / 2] which is equal to the greatest integer which is < x / 2 is Primitive
recursive.
3. Show that the cosine of x, C ox defined by C 00 = 1, C ox = 0 for x > 0 is Primitive recursive.
4. Prove that the square function given by f (y) = y2 is primitive recursive.
5. Show that the Ackerman’s function A: N2 → N which is defined by:
A (0, y) = y + 1
A (x + 1, 0) = A (x, 1)
and A (x + 1, y + 1) = A (x + 1, y)
is not primitive recursive.
6. Show that the function
⎧ x / 2 when x is even
f (x) = ⎨
⎩( x −1) / 2 when x is odd
is primitive recursive.
i=0
r ≥ 0 and A ( z ) + B ( z ) = ∑
r=0
( ar + br ) z r
FUNCTIONS AND RECURRENCE RELATIONS 109
If k is a scalar then
k A (z) = k (a0 z0 + a1 z1 + … + ar zr + …)
α
=k ∑a r zr
r =0
∞
A(z) = ∑a
r=k
r z r = A ( z ) − a0 − a1 z − ... − ak −1 z k −1
112 DISCRETE MATHEMATICAL STRUCTURES
∞
A(z) = ∑a
r=k
r −1 z r = z ( A ( z ) − a0 − a1 z − ... − ak − 2 z k − 2 )
∞
A(z) = ∑a
r=k
r −2 z r = z 2 ( A ( z ) − a0 − a1 z − ... − ak −3 z k −3 )
∞
A(z) = ∑a
r=k
r −k z r = zk A ( z )
∑ ar z r − 7 ∑ ar − 1 z r + 10 ∑a r−2 zr = 0
r=2 r=2 r=2
replacing each infinite sum by the corresponding equivalent expression given above, we get
[A (z) –a0 – a1 z] – 7 z {A (z) – a0} – 10z2 A (z) = 0
Simplifying, we get
A (z) (1 –7z + 10 z2] = a0 +a1 z – 7a0 z
a0 + ( a1 − 7a0 ) z a0 + ( a1 − 7a0 ) z
or A(z) = =
1 − 7 z + 10 z 2
(1 − 2 z )(1 − 5 z )
Decomposing A (z) as a sum of partial fractions, we can write
>C
¥ ¥
å å5
c1 c2
A z = + = c, 2 r z r + c2 r
zr
1 - 2 z 1 - 5z r=0 r=0
The solution is ar = c1 2r + c2 5r
(iii) Method of characteristic roots
Now we explain the method of solving linear recurrence relation by the methods of characteristic
roots:
Consider
c0 ar + c1 ar – 1 + c2 ar – 2 + … + ck ar – k = 0 … (1)
Substituting A α r for ar in (1), we get
c0 Aα r + c1 Aα r −1 + c2 Aα r −2 + ... + ck Aα r −k = 0 … (2)
(the constant A is to be determined by the boundary conditions)
(2) Can be simplified as
c0 α k + c1 α k −1 + ... + ck = 0 … (3)
The equation (3) is called the characteristic equation of the difference equation.
FUNCTIONS AND RECURRENCE RELATIONS 113
Equation (3) is an equation of kth degree. It has k roots. Let α1 , α 2 , ... α k denote the roots. Let the
k roots be distinct. If α1 , α 2 , ... α k are called characteristic roots and
ar = A1 α1 + A2 α2 + ... + Ak αk
r r r
is a solution of the difference equation given by (i). The constants A1, A2, …, An are determined by
boundary conditions. Some roots of the characteristic equation may be multiple roots: Let a1 be a root of
multiplicity p, then the corresponding solution is given by
[A1 r p–1 + A2 r p–2 + … + Ar] a1r
where the constants Ai s are to be determined by boundary conditions.
Example 4: Solve ar – 7ar–1 + 12ar–2 = 0
Solution: The characteristic equation is
α 2 − 7α + 12 = 0
⇒ (α − 3) (α − 4 ) = 0
The characteristic roots are α = 3 and α = 4.
ar = A1 ⋅ 3r + A2 ⋅ 4r is the solution.
1
We get P=
6
1
The particular solution is ar ( ) =
p
6
(ii) f (r) may be polynomial in r and is of degree m. say. In this case the corresponding particular
solution is of the form
P1 rm + P2 rm – 1 + … + Pm+1
Example 2: Find the particular solution of
ar + 5ar – 1 + 6ar – 2 = 3r2
Solution: Let the form of the particular solution be P1 r2 + P2 r + P3 where P1, P2 and P3 are constants
to be determined. Substituting the expression into the left hand side of given difference equation, we get
P1 r2 + P2 r + P3 + 5P1 (r – 1)2 + 5 P2 (r – 1) + 5P3 + 6P1 (r – 2)2 + 6P2 (r – 1) + 6P3 = 3r2
Simplifying, we get
12P1 r2 – (34p1 – 12p2) r + (29P1 – 17P2 + 12P3) = 3r2
12P1 = 3 … (i)
34P1 – 12P2 = 0 … (ii)
29P1 – 17P2 + 12P3 = 0 … (iii)
solving we get
1 17 115
P1 = , P2 = , P3 =
4 24 288
The particular solutions is
1 2 17 115
ar ( p ) =
r + r+
4 24 288
(iii) When f (r) is of the form λ r , and λ is not a characteristic root of the recurrence relation, the
particular solution is of the form Pλ 2 further more when f (r) is of the form
(b r
1
m
)
+ b2 r m −1 + ... + bm +1 λ r , the corresponding particular solution is of the form
(P r
1
m
)λ ,
+ P2 r m−1 + ... + Pm +1 r
Where λ is not a characteristic root of the recurrence relation. When λ is a characteristic root with
multiplicity and f (r) is of the form
(b r 1
m
)
+ b2 r m −1 + ... + bm +1 λ r ,
the corresponding particular solution is of the form
(
r p −1 P1 r m + P2 r m −1 + ... + Pm +1 λ r .)
Example 3: Find a general expression for a solution to the recurrence relation
an − 5an − 1 + 6an − 2 = 4n , n ≥ 2. (OU Dec. 2000)
FUNCTIONS AND RECURRENCE RELATIONS 115
⎝ 3⎠
116 DISCRETE MATHEMATICAL STRUCTURES
E X E R C I S E 4.3
I. Solve the recurrence relations
(a) ar = 7ar–1 – 10ar–2, a0 = 4, a1 = 17
FUNCTIONS AND RECURRENCE RELATIONS 117
Boolean Algebra
5.1 INTRODUCTION
In this chapter, we study partially ordered sets, Lattices and Boolean algebras. George Boole in 1854
has introduced a new kind of algebraic system known as Boolean algebra. It is relatively very simple
and can be used to analyse and design completes circuits. Before we study Boolean algebra in this
chapter we consider ordering relations and Lattices.
Example 1: Let N be the set of positive integers ordered by divisibility. The elements 5 and 15 are
comparable. Since 5/15 on similarly the elements 7 and 21 are comparable since 7/21. The positive
integers 3 and 5 are non-comparable since neither 3/5 nor 5/3. Similarly the integers 5 and 7 are
non- comparable.
Example 2: Let A be a non-empty set with two or more elements and P (A) denote the power set of A.
Then P (A) is not linearly ordered.
Example 3: The set N of positive integers with the usual order ≤ (less than equal) is a linear order on
N. The set (N, ≤) is a totally ordered set.
24
12
3 4
Fig. 5.1
We avoid arrows in a Hasse diagram and draw lines to show that the elements are related. Hasse
diagrams can be drawn for any relation which is anti-symmetric and transitive but not necessarily reflexive.
Example 2: Let A = {1, 2, 3}, and ≤ be the relation “less than of equal to” on A. Then the Hasse
diagram of (A, ≤) is as shown in Fig. 5.2.
120 DISCRETE MATHEMATICAL STRUCTURES
Fig. 5.2
Example 3: Let A = {a}, and ≤ be the inclusion relation on the elements of P (A). The Hasse diagram
of (P (A), ≤), can drawn as shown in Fig. 5.3.
Fig. 5.3
Example 4: Draw the Hasse diagram representing the positive divisions of 36 (i.e., D36)
Solution: We have D36 = {1, 2, 3, 4, 6, 9, 12, 18, 36}
Let R denote the partial order relation on D36, i.e., a R b if and only a divides b. The Hasse diagram
for R is shown in Fig. 5.3 (a).
Note:
(i) Two unequal relations R1 and R2 may have the same Hasse diagram.
(ii) The Hasse diagram of Poset A need not be connected.
If (A, ≤) is partially ordered set, the Hasse diagram of (A, ≤) is not unique. For example, consider the
set A = {a, b}. The relation of inclusion (≤ ) on P (A) is a partial ordering. The Hasse diagrams of (P (A),
≤) are given in Fig. 5.4.
(a) (b)
The Hasse diagram which represent the partial ordered set (A, ≤) show that the Hasse diagram of a
poset is not unique.
If (A, ≤) is a poset, the Hasse diagram of (A, ≥) can be obtained by rotating the Hasse diagram of
(A, ≤) through 180o. So that the points at the top become the points at bottom. Some Hasse diagrams
may have a unique point which is above all the other points in the diagram and in some cases, the Hasse
diagrams have a unique point which is below all the other points.
Definition 5.6: A relation R on a set A is said to be connected if for every pair of distinct elements
a, b ∈ A, either aR b or bR a.
Definition 5.7: A partial ordering on a set A is said to be linear ordering if it is connected.
Salt F Seat
Mark F Mast
We can extend Lexicographic order to posets. If A is a partially ordered set and A* denotes the set
of all finite sequences of elements of A we can extend Lexicographic order to A* as follows:
Let α = a1 a2 ... am and β = b1 b2 ... bn belong to A* with m ≤ n., we say that α ∝ β if
(a1, a2, ... am) ∝ (b1, b2, ... bn) in An = A × A × ... × A (n factors) under the Lexicographic ordering
of An.
Example 2: Let A = {a, b, c, ... z) and let R be a simple ordering on A denoted by ≤, where
(a ≤ b ≤ c ... ≤ z)
Let S = A ∪ A2 ∪ A3
Then S consists of all words (strings) of three or fewer than 3 letters from A. Let F Denote the
lexicographic ordering on S. We have
Be F Bet
Leg F Let
Peg F Pet
Sea F See
...
Lexicographic ordering is used in sorting character data on a computer. The Lexicographic ordering
is also called dictionary ordering. We can use the names “Lexically less than” or “Lexically equal to” or
“Lexically greater then” to denote a lexicographic ordering.
Example 3: Let A = {a, b, c, ... z) with simple alphabetical order and let A2 = A × A, then
b q > a e, d f > a b and d y < e z.
Example 1: Let A = {1, 2, 3, 4, 5} and ≤ be the relation “less than or equal to” then the Hasse diagram
of (A, ≤) is as shown in Fig. 5.5.
From Fig. 5.5, it is clear that 1 is the least member and 5 is the greatest element in (A, ≤).
Example 2: Let A = {a, b} and P (A) denote the power set of A. Then P (A) = {∅ , {a}, {b}, {a , b}}.
Let ≤ be the inclusion relation on the elements of P (A). Clearly ∅ is the least member and A = {a, b}
is the greatest member in (P (A), ≤).
We now discuss certain elements which are of special importance.
Fig. 5.6
Fig. 5.7
124 DISCRETE MATHEMATICAL STRUCTURES
Distinct minimal members of a partially ordered set are incomparable and distinct maximal members
of a poset are also incomparable.
Fig. 5.8
If B = {4, 5} then
The upper bounds of B are 1, 2, 3
The lower bound of B is 6.
Example 2: Let A = {a, b, c} and (P (A) ≤) be the partially ordered set. The Hasse diagram of the
Poset be as pictured in Fig. 5.9.
Fig. 5.9
If B is the subset {a, c}, {c}. Then the upper bounds of B are {a, c} and A, while the lower bounds
of B are {c} and ∅.
From the above, it is clear that the upper and lower bounds of a subset are not unique.
5.10.1 Least Upper Bound (Supremum)
Definition 5.12: Set A be a partially ordered set and B a subset of A. An element m ∈ A is called the
least upper bound of B if M is an upper bound of B and M ≤ M ′ whenever M ′ is an upper bound of B.
A least upper bound of a partially ordered set if it exist is unique.
BOOLEAN ALGEBRA 125
Example: Let A = {a, b, c, d, e, f, g, h} denote a partially ordered set. Whose Hasse diagram is shown
in Fig. 5.10:
Fig. 5.10
If B = {c, d, e} then f, g, h are upper bounds of B. The elements f is least upper bound.
Fig. 5.11
(i) The least upper bound of a set is abbreviated as l ⋅ u ⋅ b or sup and the greatest lower bound is abbreviated
as “ g ⋅ l ⋅ b” or “inf”.
(ii) If A is a chain, then every subset S: has a supremum and an infimum.
(iii) Let N be the set of positive integers and let N by ordered by divisibility. If a and b are two elements of N,
then
126 DISCRETE MATHEMATICAL STRUCTURES
Theorem 5.1: Let (A, ≤) be a partially ordered set and S be a subset of A. Then
(i) The least upper bound of set, if it exists is unique.
(ii) The greatest lower bound of S, if it exists is unique.
i.e., S can have at most, one least upper bound and at most one greatest lower bound.
Proof: (i) If possible let there be two least upper bounds for S, say b1 and b2. Now b2 is supremum
and b1 is an upper bound of S ⇒ b2 ≤ b1. Similarly b1 is supremum and b2 is an upper bound of
S ⇒ b1 ≤ b2. S ⊆ A, therefore by symmetric property b2 ≤ b2, b1 ≤ b2 ⇒ b1 = b2. Hence, least upper
bound of S is unique.
(ii) Left as an exercise.
Theorem 5.2: Let A be finite non-empty poset with partial order ≤ . Then A has atleast, one maximal
element.
Proof: Let a ∈ A. If a is not the maximal element. Then we can find an element a1 ∈ A such that
a < a1 . It a1 is not a maximal element of A, then we can find an element a2 ∈ A such that a1 < a2 .
Continuing this argument we get a chain
a < a1 < a2 < a3 < ... ar –1 < ar
Since A is finite this chain cannot be extended and for any b ∈ A, we cannot have ar < b. Hence ar
is a maximal element of (A, ≤).
By the same argument, the dual poset (A, ≥) has a maximal element such that (A, ≤ ) has a minimal
element.
Theorem 5.3: If (A, ≤) and (B, ≤) are partially ordered sets, then (A × B, ≤) is a partially ordered set
with the partial order ≤, defined by ( a, b) ≤ ( a′, b′) if a ≤ a′ in A and b ≤ b′ in B.
Proof: a ≤ a′ in A and b ≤ b′ in B
and b ≤ b′ and b′ ≤ b ⇒ b = b′
(since B is a partially ordered set)
∴ ≤ is anti-symmetric in A × B
Also ( a, b) ≤ a′, b′ and ( a′, b′) ≤ ( a′′, b′′) in A × B where a, a′, a′′ ∈ A and b, b′, b′′ ∈ A implies
that
a ≤ a′ and a′ ≤ a′′
and b ≤ b′ and b′ ≤ b′′
by the transitive property of the partial orders in A and B, we have
a ≤ a ′, a ′ ≤ a ′′ ⇒ a ≤ a ′′
and b ≤ b ′, b ′ ≤ b ′′ ⇒ b ≤ b ′′
Hence ( a, b) ≤ ( a′′, b′′)
Therefore transitive property holds for partial order in A × B. Hence A × B is a partially ordered set.
Definition 5.16: Let { Ai : i ∈ I } be a collection of non-empty disjoint sets and let Ai ≤ X ∀ i. A function
f : { Ai } → × defined by
5.16 LATTICES
In this section, we introduce lattices which have important applications in the theory and design of
computers.
Definition 5.17: A lattice is a partially ordered set (L, ≤) in which every pair of elements a, b ∈ L
has a greatest lower bound and a least upper bound.
Example 1: Let Z + denote the set of all positive integers and let R denote the relation ‘division’ in Z +.
Such that for any two elements a, b ∈ Z + , aR b, if a divides b. Then (Z +, R) is a lattice in which the join
of a and b is the least common multiple of a and b, i.e. a ∨ b = a ⊕ b = LCM of a and b, and the meet
of a and b, i.e. a * b is the greatest common divisor (GCD) a and b i.e.,
a ∧ b = a * b = GCD of a and b
We can also write a + b = a ∨ b = a ⊕ b = LCM of a and b and a . b = a ∧ b = a * b = GCD of
a and b.
Example 2: Let S be a non-empty set and L = P (S); (P (S); ≤) i.e., (L, ≤) is a partially ordered set. If
A and B are two elements of L, then we have A ∪ B = A ∨ B and A ∩ B = A ∧ B
Hence the (L, ≤) is a Lattice.
Example 3: Let ∩ be a positive integer and Sn be the set of all divisors of n ... Sn. If n = 30,
S30 = {1, 2, 3, 5, 6, 10, 15, 30}. Let R denote the relation division as defined in example 1. Then (S30, R)
is a Lattice see Fig. 5.12.
Fig. 5.12
Different lattices can be represented by the same, Hasse diagram. If (L, ≤) is a lattice, then (L, ≥)
is also a lattice. The operations of meet and join on (L, ≤) become the operations of join and meet on
BOOLEAN ALGEBRA 129
(L, ≥ ). The statement involving the operations * and ⊕ and ≤ hold if we replace * by ⊕, ⊕ by * and
≤ by ≥ . The lattices (L, ≤) and (L, ≥) are duals of each other.
Example 4: Let A be a non-empty set and L = P (A). Then (L, ≤) is a lattice. Its dual (L, ≥) is also a
lattice.
Theorem 5.5: Let (L, ≤) be a lattice in which ‘’⋅ And ‘+’ denote the operations of meet and join
respectively. Then
a ≤ b ⇔ a ⋅ b = a ⇔ a + b = b ∀ a, b, c ∈ L
Proof: Let a ≤ b
We know that a ≤ a, therefore a ≤ a ⋅ b but from the definition we have a ⋅ b ≤ a
∴ a ≤ b ⇒ a⋅b =a
let us assume that a ⋅ b = a
but this is possible only if a ≤ b
i.e., a ⋅ b = a ⇒ a ≤ b
∴ a ≤ b ⇒ a ⋅ b = a and a ⋅ b = a ⇒ a ≤ b
combining these two, we get
a ≤ b ⇔ a⋅b =a
now let a ⋅ b = a, then we have
b + ( a ⋅ b) = b + a + a + b
but b + ( a ⋅ b) = b
Hence a + b = b
Similarly by assuming a + b = b we can show that a ⋅ b = a
Hence a ≤ b ⇔ a ⋅ b = a ⇔ a + b = b = a
130 DISCRETE MATHEMATICAL STRUCTURES
Fig. 5.13
132 DISCRETE MATHEMATICAL STRUCTURES
Definition 5.21: A lattice L is complemented if it is bounded and if every element in L has a complement.
Example: If S is non-empty set and L = P (S). Then each element of L has a unique complement in L.
Therefore L = P (S) is a complemented lattice.
Fig. 5.14
Definition 5.23: Let (L1, *, +) and ( L2 , ∧, ∨ ) be two lattices. The algebraic system (L1 × L2, ..., +) in
which the binary operation + and ‘’⋅ are on L1 × L2 defined as
( a1 , b1 ) ⋅ ( a2 , b2 ) = ( a1 ∗ a2 , b1 ∧ b2 )
( a1 , b1 ) + ( a2 , b2 ) = ( a1 ⊕ a2 , b1 ∨ b2 )
for all (a1, b1) and (a2, b2) ( a2 , b2 ) ∈ L1 × L2
is called the direct product of the lattices L1 and L2.
Example 4: Let L1 = {1, 2, 4} and L2 = {1, 3, 9}, clearly L1 and L2 are chains and division is a partial
ordering on L1 and L2 and L1 consists of divisors of 4 and L2 consists of divisor of 9. L1 × L2 consists of
36 where each node in the diagram of L1 × L2 is shown as (a, b) (instead of a b).
BOOLEAN ALGEBRA 133
Example 5: Let L1 and L2 be two lattices shown Fig. 5.16 (a) and (b) respectively. Then L1 × L2 is the
lattice shown Fig. 5.16. (c).
Fig. 5.16
We can use the direct product of lattices to construct larger lattices from the smaller ones. If L is a
lattice we can form lattices L × L, L × L × L, L × L × L × L, ... which are denoted L2, L3, L4, ...
respectively.
Example 6: If L = (0, 1) and (L, ≤) is a lattice, then (Ln, ≤ n ) is a lattice of n-tuples of 0 and 1. Any
element in the lattice (Ln, ≤ n ) can be written as (a1, a2, ... an) in which a1 is either 0 and 1 for
i = 1, 2, 3, ..., 4.
The partial ordering relation on Ln can be defined for any a, b in Ln as
a ≤ n b ⇔ ai, ≤ n bi for i = 1, 2, ..., n
where a = (a1, a2, ... an) and
b = (b1, b2, ..., bn)
In general the diagram of (L , ≤ n ) is an n-cube.
n
Definition 5.24: Let (L, ⋅, +, 0, 1) be a lattice L is said to complemented lattice if every element has
atleast one complement.
134 DISCRETE MATHEMATICAL STRUCTURES
Example 7: Let (L3, ≤ 3 ) be a lattice of 3-tuples of 0 and 1. The complement of an element of L3 can
be obtained by changing 1 by 0 and 0 by 1 in the 3-tuples representing the element.
The complement of (0, 1, 1) is (1, 0, 0), the complement of (1, 0, 1) is (0, 1, 0) and so an. The bounds
of (0, 0, 0) and (1, 1, 1).
Definition 5.25: A lattice (L, ⋅, +) is called a distributive lattice if for any a, b, c ∈ L
a ⋅ (b + c ) = ( a ⋅ b ) + ( a ⋅ c ) and
a + (b ⋅ c ) = ( a + b ) ⋅ ( a + c )
Fig. 5.17
Solution: The elements x, y, z and s are join irreducible. The elements x, y, p, r and s are meet irreducible.
Definition 5.28: The join irreducible elements of a lattice L, which immediately succeed 0 are called
atoms.
BOOLEAN ALGEBRA 135
Example 12: In the lattice shown in Fig. 5.18, 2 is the 0 element (lower bound) 3 succeeds 2, hence
atom of L is the element 3.
Fig. 5.18
E X E R C I S E 5.1
1. Define the terms
(a) Partially ordered set
(b) Linearly ordered set.
Give examples.
2. Let ≤ be a Partial ordering of a set S. Define the dual order on S. How is the dual order related to
the iverse of the relation ≤ .
3. Define Lenilographical order on A × B where A and B are two linearly ordered sets.
4. Define the terms ‘immediate predecessor’ and ‘immediate successor’ and show that each element
of a linearly ordered set can have at most one immediate predecessor.
5. What is meant by a ‘Hasse diagram’? Draw the Hasse diagram of the relation R on A where
A = {1, 2, 3, 4} and
R = {(1, 1), (1, 2), (2, 2), (2, 4), (1, 3), (3, 3), (3, 4), (1, 4), (4, 4)}.
6. Let n be a positive integer and Sn be the set of all divisors of n. Let D denote the relation of
‘division’ ‘ns, such that a D b’ iff a divides b. Draw the Hasse diagram for (Sn, D).
7. Let A = {1, 2, 3, 4, 6, 8, 9, 12, 24} be ordered by divisibility.
8. Determine the greatest and least elements, if they exist of the poset
A = {2, 4, 6, 8, 12, 18, 24, 36, 72} with the partial order of divisibility.
9. Which of the Hasse diagram in the figure given below represents lattices:
10. If (L1, ≤) and (L2, ≤) are two lattices, then show that (L1, × L2, ≤) is also a lattice.
136 DISCRETE MATHEMATICAL STRUCTURES
17. Consider the lattices D = {v, w, x, y, z} shown in the figure given below. Find all the sub lattices
with three or more elements.
25. If (L, ≤) is a lattice in which * and ⊕ denote the operations of meet and join respectively then
show that
a ≤ b ⇔ a*b= a ⇔ a ⊕b =b
∀ a, b, c ∈ L
26. Define Isomorphic lattices. Show that the lattices L and L1 given below are not isomorphic:
(a) (b)
Suppose that the complements are defined by 11 = 0 and 01 = 11, then B is a Boolean algebra.
Example 3: Let Bn denote the set of n-bit sequences. Let the operations of sum. Product and complement
in Bn defined as follows:
For all a, b ∈ Bn ... a + b contains 1 if a, b contains 1, a ⋅ b contains 1 if a and b contain: a and b
contains 1 if a contains 0, then Bn is a Boolean algebra.
Example 4: Let π 1 be the set of all propositions T1 is a Boolean algebra under the operations ∨ and
A with ~ being the complement. The contradiction f is the zero element and the taulogy T is unit element
of in π 1.
When ⋅ operations are performed before + operation the parentheses are not used, we use the letter
B to represent a Boolean algebra (B, +, ⋅, 1, 0, 1) and we often use the symbols ∨ and ∧ in the place of
+ and operation. The dual of any statement S in B is the statement obtained by interchanging the operations
+ and ⋅ and interchanging the identity elements 0 and 1, in the original statement S. Also the dual of any
theorem in B is also a theorem. We shall now prove some theorems.
Theorem 5.8: ∀ a ∈ B, a + a = 0
BOOLEAN ALGEBRA 139
Fig. 5.19
5.24 HOMOMORPHISM
Definition 5.32: Let (B, +, ⋅, ' , 0, 1) and (B1, +1, ⋅1 , –, 01, 11) be two Boolean algebras. A function
f : B → B, is called a Boolean algebra homomorphism, if f preserve the two binary operation and the
unary operation i.e., for all a, b ∈ B
f ( a + b) = f ( a) +1 f (b)
f ( a ⋅ b) = f ( a ) ⋅, f (b)
f ( a′) = f ( a )
f (0) = 01
and f (1) = 11
= (0 + 0)′
= 0′
=1
Definition 5.34: Two Boolean expression α (x1, x2, ..., xn) and β (x1, x2, ..., xn) are said to be equal
(or equivalent) if one can be obtained from the other by a finite number of application of the identities of
Boolean algebra.
Definition 5.35: A literal is defined to be a Boolean variable or its complement.
Example 1: x, and x′ are literals.
Definition 5.36: A literal or a product of two or more literals in which no two literals involve the same
variable is called a fundamental product.
2n −1
and + mi = 1
i =0
For i ≠ j the minterm mi and mj are not equal every Boolean expression except 0, can be expressed
in an equivalent form consisting of the sums of minterms. When an expression is written as a sum of
minterms, the equivalent form obtained is called a sum of products canonical form or a minterm expansion.
In a minterm expansion any particular minterm may or may not be present. The number of different sum
n
of products canonical forms is 22 . These include minterms expansion of 0, in which no minterm is
present in the sum, and also the minterm expansion of 1, where all the minterms are present in the sum.
n
Therefore, the set of Boolean expression can be partitioned into 2 2 equivalence classes. The set of
Boolean expression under the operation +, ⋅ and 1, form a Boolean algebra called a free Boolean algebra.
A Boolean expression can also be written as a product of sums of Maxterm, the equivalent expression
obtained is called a product sums canonical form or maxterm expansion. Each maxterm is the complement
of the corresponding minterm. In general, a maxterm of n variables is a sum of n literals in which each
variable appears exactly once in either true or complement form, but not both. The maxterm expansion
for an expression is unique.
The minterm expansion i.e., sum of products canonical form is called the disjunctive normal form
and the maxterm expansion or products of sums canonical form is called the conjunction normal form.
BOOLEAN ALGEBRA 145
Definition 5.38: Let (B, +, ⋅, ' , 0, 1) be a Boolean algebra. A function f : Bn → B which is associated
with a Boolean expression in n variables is called a Boolean function.
Every function from Bn to B, may n of be Boolean, and there are functions from Bn to B which are
not Boolean. Different expressions may determine the same Boolean functions. Absorption laws,
De Morgan’s laws, distributive laws and the other identities for Boolean algebras bring out the redundancy
of Boolean expression. To transform Boolean expression E into a sums-of-products form; we first use
De Morgan’s laws and involution law, to convert E into a form which contains only sum and products of
literals. We next use distributive law to transform E into a sums-of-products form. The next step is to
transform each product in E into 0 or a fundamental product. This done by using the commutative,
idempotent and complement laws. Finally, we use absorption law to get the sums-of-product form of E.
To obtain complete sum-of-product form of E. We involve all the variables in each product of the sum-
of-product form of E.
= [ x1 x2 + x3′ ] [ x1 x3′ + x2 x3 ]
= x1 x2 x3′ + x1 x2 x3 + x1 x3′ + 0
= x1 x3′ + x1 x2 x3 + x1 x2 x3′
= x1 ⋅ x2 ⋅ x3 + x1 ⋅ x2 ⋅ x3′ = m7 + m6
= m6 + m7
∴ x1 ⋅ x2 = m6 + m7
(ii) x1 ( x2′ x3 )′
= x1[ x2 + x′3 ]
= x1 x2 + x1 x3′
= m7 + m6 + m4
= m4 + m6 + m7
= + 4, 6, 7 = ∑ m (4, 6, 7)
= x1′ x′2 x3 x4 + x1′ x2′ x3′ x4 + x1′ x2′ x3 x4′ + x1′ x2′ x3′ x4′ + x1 x2 x3 x4 +
= m0 + m1 + m3 + m5 + m7 + m10 + m14
= ∑ m (0, 1, 3, 5, 7, 10, 14)
Example 8: f = ∑ m (0, 1, 2, 5) is a three input function. Transform f into its canonical sum-of-products
form.
Solution: Let x1, x2 and x3 denote the three inputs then
m0 = 000 = x1′ x2′ x3′
m3 = 101 = x1 x2′ x3
∴ Canonical sum-of-products form of the expression is
f = x1′ x2′ x3′ + x1′ x2′ x3 + x1′ x2 x3′ + x1 x2′ x3′
= ( x1 + x2 ) ⋅ ( x1 + x2′ ) ⋅ ( x1 + x2 ) ⋅ ( x1′ + x2 )
= ( x1 + x2 ) ⋅ ( x1 + x2′ ) ( x1′ + x2 )
= ( x1 + x2 + x3 ) ⋅ ( x1 + x2 + x3′ ) ⋅ ( x1 + x2′ + x3 )
= M 0 ⋅ M1 ⋅ M 2 ⋅ M 3 ⋅ M 4 ⋅ M 5
= ∏ M (0, 1, 2, 3, 4, 5)
Table 5.1
(0, 0) 0
(0, 1) 0
(1, 0) 1
(1, 1) 1
Definition 5.39: Let P1 and P2 be fundamental products such that exactly one variable say xi appears
in complemented form in one of the products P1 and P2 and uncomplemented in the other. The consensus
of P1 and P2 is the product of the literals P and the literals of P2 after deleting xi and x1i .
Consider the Truth table shown in Table 5.2 for a function Z of two variables. To convert the table
into its Karnaugh map, we begin by drawing 5.21 (a) (i.e., a blank map):
Table 5.2
A B Z
0 0 0
0 1 0
1 0 1
1 1 1
BOOLEAN ALGEBRA 151
If the top horizontal line represents A and A and the vertical line represents B and B, then the
Karnaugh map, can be drawn as shown in Fig. 5.23:
In the above Karnaugh map we observe that in every square a number is written. Each number is a
minterm. If the number 0 is given to a square means it represents the minterm m0. Similarly, a square
(cell) with the number 1 represents the minterm m1 a square with the number 2 represents m2 and so on.
The binary number in the Karnaugh map differ by only one place, when moving from left to right.
That is two adjust squares in Karnaugh map differ only by one variable.
152 DISCRETE MATHEMATICAL STRUCTURES
Table 5.3
A B Z
0 0 1
0 1 1
1 0 0
1 1 0
Fig. 5.24
Table 5.4
A B C Z
0 0 0 1
0 0 1 1
0 1 0 1
0 1 1 0
1 0 0 0
1 0 1 0
1 1 0 1
1 1 1 0
Solution: We first draw the blank map of Fig. 5.27 (a) output 1 appears A B C inputs of 000, 001, 010
and 110. The fundamental products for these conditions are A B C , A B C , A B C and A B C. Enter Is
for these products on the Karnaugh map (Fig. 5.27 (b)).
Finally enter 0S in the remaining spaces as shown in Fig. 5.27 (c).
(a) (b)
154 DISCRETE MATHEMATICAL STRUCTURES
(c)
Fig. 5.27
Figure 5.27 (c) represents the Karnaugh map for Table 5.4.
Pair in a Karnaugh Map
Consider the Karnaugh map shown in Fig. 5.28. The map contains a pair is which are adjust to each
other. The map represents the sum-of-products equation Z = A B C D + A B C D. Where the first
minterm represents the product A B C D and the second minterm stands for the product A B C D. The
variable D in the uncomplemented form goes to the complemented form and the variables A, B and C
remain uncomplemented. The variable D can be eliminated.
In a pair, the variable which changes its state from complemented to uncomplemented (or vise
versa) is removed. This rule is called pair reduction rule.
To draw a Karnaugh map for a truth table with don’t care conditions; we first treat the don’t conditions
as 1s and encircle actual 1s in the largest groups. The remaining don’t cares (which are not included in
the groups) are regarded by visualizing them as 0s.
Thus, A pair in a Karnaugh map eliminates are variable and its complement.
In the above expression Z = A B C D + A B C D can be factored as Z = A B C ( D + D).
Quads
In a Karnaugh map, a quad is a group of four 1s that are horizontally or vertically adjacent. The 1s in a
quad may be end-to-end or in the form of a square as shown in Fig. 5.29. A quad eliminates two
BOOLEAN ALGEBRA 155
variables and their complements. The rule is known as quad reduction rule. The quads in a Karnaugh
map are always encircled as shown in Fig. 5.29.
Octet
The octet in a Karnaugh map is a group of eight Is. An octet eliminates three variables and their
complements.
A B C F
0 0 0 1
0 0 1 X
0 1 0 0
0 1 1 1
1 0 0 0
1 0 1 0
1 1 0 X
1 1 1 1
Redundant Group
In a Karnaugh map, a group whose is are already used by others is called a redundant group (See
Fig. 5.31). The removal of a redundant group leads to much simpler expression.
In the Fig. 5.31 all the 1s of the quad are used by pairs of the map, therefore quad is redundant on
Fig. 5.31 and it can be eliminated as shown in Fig. 5.32.
Summary of the rules for simplifying Boolean expression:
1. Construct the truth table for the given expression.
2. Begin with empty Karnaugh map and enter a 1 in the Karnaugh map for each fundamental
product that produces a 1 output in the truth table. Enter 0s 1s elsewhere.
3. Encircle the octets, quads and pairs roll the Karnaugh map.
4. Eliminate redundant groups if any.
BOOLEAN ALGEBRA 157
5. Write the simplified Boolean expression by ORing the products corresponding to the encircled
groups.
Table 5.6
A B C Y
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
Fig. 5.33
158 DISCRETE MATHEMATICAL STRUCTURES
Fig. 5.34
Solution: Completing the given Karnaugh map by entering 0s in the empty square, we get the following
Karnaugh map (See Fig. 5.35):
Fig. 5.35
There are no pairs, no octets. There is a quad in the map. The quad consists of the minterms m1, m3,
m5 and m7. Moving horizontally from m1 to m3 i.e., X Y Z to X Y Z we observe that Y changes from
BOOLEAN ALGEBRA 159
Fig. 5.36
Example 5: Simplify
Y = Σ m (0, 1, 4, 5, 6, 8, 9, 12, 13, 14.)
Solution: The Karnaugh map can be constructed as shown in Fig. 5.37.
Fig. 5.37
There is one octet and a quad in the K-map. The quad is obtained by rolling vertically, such that the
left and right edges are joined and over lappings. A, B and D, are the variables eliminated by the Octet in
the map. Quad eliminated the variables A and C.
Octet gives C and quad gives B D.
Hence, the reduced expression is f = C + B D.
Example 6: Simplify the Boolean function f (A, B, C, D) = Σ m (1, 3, 7, 11, 15) + d (A, B, C, D) where
the don’t care conditions are given by d (A, B, C, D) = Σ m (0, 2, 5).
Solution: The Karnaugh map for f can be constructed as shown in Fig. 5.38 (b).
(a) (b)
Fig. 5.38
BOOLEAN ALGEBRA 161
The minterm for d may produce either 0 or 1 for f. The I S and X S are combined so as to endure
maximum number of adjustment squares. The remaining cells are marked 0 as shown in Fig. 5.38 (b).
There are two quads in Fig. 5.38 (a). The don’t care condition in cell 5 is left free; as it does not
contribute to any group in the map. The simplified expression in sum-of-products form is f = A B + C
D. Combining O S and X S in Fig. 5.38 (b). We get the simplified products-of-sums equation as
f = ( D + A C ) = D ( A + C ).
In this case, a variable can be taken for 0 and its complement is taken for 1.
E X E R C I S E 5.2
1. Define a Boolean algebra.
2. Define a sub algebra.
3. Define the dual of a statement S in a Boolean algebra.
4. Define an atom in a Boolean algebra B.
5. Define a Boolean expression and give examples.
6. Define a literal and a fundamental products and give examples.
7. What are idempotent laws for Boolean algebras?
8. What is involution law for Boolean algebras?
9. Write the dual of each statement:
(a) (x + y) (x + 1) = x + x y + y
(b) ( x + y) = x y
(c) x y = 0 if and only x y = x.
10. What is a minterm?
11. What is a maxterm?
12. Define a sum-of-products form.
13. Define a product-of-sums form.
14. Prove the following Boolean identities:
(i) a + ( a ⋅ b) = a + b
(ii) a ⋅ ( a + b) = a ⋅ b
(iii) ( a ⋅ b ⋅ c) + ( a ⋅ b) = a ⋅ b
15. Simplify the following Boolean expressions:
′ ′
(a) ( a ⋅ b) + ( a ⋅ b)
(b) ( a′ ⋅ b′ ⋅ c ) + ( a ⋅ b′ ⋅ c) + ( a ⋅ b′ ⋅ c′)
16. Write the following Boolean expressions in equivalent sum-of-products form in three variables:
(a) x1 x2 (b) x1 + x2
162 DISCRETE MATHEMATICAL STRUCTURES
(ii) X = A B C + A B C
(iii) X = A B C + A B C + A B C + A B C
(iv) X = A B C D + A B C D + A B C D + A B C D
(v) X = A B C D + A B C D + A B C D + A B C D
(vi) X = A B C D + A B C D + A B C D + A B C D + A B C D
22. Simplify the following Boolean function in product of sums form:
F (A, B, C, D) = ∑ (0, 1, 2, 5, 8, 9, 10)
LOGIC GATES 163
Logic Gates
6.1 INTRODUCTION
Boolean algebra can be applied to the solution of any electronic circuit involving two possible states.
We begin our study by examining switching circuits. The most elementary circuit is shown in the figure
given below (Fig. 6.1):
Fig. 6.1
The battery B, a single pole throw switch and an indicating lamp are connected in a simple switching
circuit. The electronic circuit is a two-state device. It is for turning ‘on’ and ‘off’ an electronic light in the
circuit. We can also construct a device which permit not only electric current but any quantity that can go
through such as water, information etc. For general discussion we replace the word ‘switch’ by the word
‘gate’.
Consider the switching circuit displayed in Fig. 6.2 (a). When the switch S is open there is no
current flowing in the circuit and the lamp L is off. This condition is indicated by the numeric value ‘0’.
When the switch is closed the lamp L is on. This condition is indicated by the numerical value ‘1’.
Therefore, the value 0 (or dark lamp) will show an open switch and the value 1 will show the closed
switch in the circuit (the value 1 indicated a glowing lamp). The condition tables is the truth table which
lists all the possible combinations of input binary variables is given in Fig. 6.2 (b):
Fig. 6.2
164 DISCRETE MATHEMATICAL STRUCTURES
We can express the above condition table in different form as shown in Table 6.1:
Table 6.1
Table 6.2
P(S) Q(L)
0 0
1 1
Now consider the circuit shown in Fig. 6.3. The circuit has the switches S1 and S2 which are connected
in parallel. When the switch S1 is closed, the current flows exclusively through the upper branch, and the
light (L) is on and when the switch S2 is closed the current flows exclusively through the lower branch
and the light is on. With both the switches closed the current divides equally between both branches still
permitting the lamp to glow. If both the switches S1 and S2 are open the circuit becomes an open circuit
and the light is off. This shows that an OR function can be obtained connected the switches in parallel.
The light is or when either S1 or S2 is closed.
(a) (b)
Fig. 6.3
Table 6.3
P Q Y
0 0 0
0 1 1
1 0 1
1 1 1
Fig. 6.4 (a) Contains the circuit in which two switches S1 and S2 are connected in ‘series’. If both the
switches S1 and S2 are closed then the circuit permits the flow of current in the circuit and the light is on.
In all other combination the circuit is open and the light is off, showing that ‘AND’ function is obtained
(See Fig. 6.4):
(a) (b)
Fig. 6.4
Table 6.4
P Q Y
0 0 1
0 1 1
1 0 1
1 1 1
known as logic gates. There are three basic logic gates, the OR-gate, the AND-gate and the NOT-gate.
Other logic gates that are derived from these three basic gates are NAND-gate, the NOR gate, the EX-
OR gate and the EX-NOR gate.
6.2.1 OR-Gate
An OR-gate is a logic circuit with two or more than two inputs and outputs. The output of an OR-gate is
‘0’ only when all of its inputs are at logic ‘0’. For all other input combinations the output is ‘1’. The
symbol for the OR-gate is shown in Fig. 6.5. along with the associated truth table.
(a) (b)
6.2.2 AND-Gate
An AND-gate is a logic circuit having two or more than two inputs and one output. The output of an
AND-gate is logic ‘1’, only when all of its inputs are in ‘1’ state. In all other possible combination the
output is ‘0’. Fig. 6.6 (a) shows the symbol of an AND-gate. The truth table is given in Fig. 6.6 (b). The
operation of an AND-gate is expressed by:
Y=A+B
(a) (b)
Fig. 6.6
LOGIC GATES 167
6.2.4 NOR-Gate
The NOR-gate has two or more input, but produces only are output. The NOR operations is symbolised
as Z = A ↓ B.
NOR action is illustrated in Fig. 6.8. The equivalent symbol is shown in Fig. 6.9.
(a) (b)
6.2.5 NAND-Gate
NAND-gate function is a composite function. In this case an AND function is complemented to produce
a NAND function placing an N in front of AND. The NAND-gate has two or more input signals but
only one output signal. The NAND-gate is a contraction of NOT AND. It can have many inputs as
desired. The symbol for NAND-gate along with the truth table is shown in Fig. 6.10.
168 DISCRETE MATHEMATICAL STRUCTURES
(a) (b)
(a) (b)
Fig. 6.12
LOGIC GATES 169
Sometimes it is convenient to use more than one representation for a given type of gate, Fig. 6.13
shows alternative symbols used for the logic gates.
We can use the above symbols to analyse and design complex digital systems. We can also apply
the techniques of Boolean algebra to electronic logic. Generally a logic gate network is drawn so that
the flow of information is from the left to right.
The inputs to a logic gate network will be formed on the left of schematic diagram and the outputs
will be found on the right, which makes it easier for us to find the algebraic equation of the total network,
Boolean algebra is useless unless it can be converted into hardware in the form of logic gates. Science of
Boolean algebra can be a useful technique for analysing circuits only if the hardware can be translated
into Boolean expression.
Example 1: For the logic circuit shown in Fig. 6.14. write the input-output Boolean expression.
Solution: The output Boolean expression is
( )
Z = (A + B) ⋅ A + C ⋅ (B + C).
170 DISCRETE MATHEMATICAL STRUCTURES
Fig. 6.14
Fig. 6.15
Fig. 6.16
Example 4: For the equation Z = X Y + W Y construct a gate structure and minimize it.
Solution: The gate structure for Z = X Y + W Y is shown in Fig. 6.17:
Fig. 6.17
Now consider Z = X Y + W Y
( )
The equation can be factored as Z = Y X + W . The gate structure of Z has only two input gates.
Fig. 6.18
172 DISCRETE MATHEMATICAL STRUCTURES
Solution: F = XY Z + ZY
= (X NAND (NOT Y) (AND Z) NAND (NOT C NAND B)
The circuit diagram for F can be drawn as shown in Fig. 6.21:
Fig. 6.21
LOGIC GATES 173
Example 7: Show that the combination circuits of Fig. 6.22 are equivalent:
(a) (b)
Fig. 6.22
Solution: The logic table for the circuit is shown in Fig. 6.22 (a) is:
Table 6.5
A B Y A B Y
1 1 0 1 1 0
1 0 0 1 0 0
0 1 0 0 1 0
0 0 1 0 0 1
(a) (b)
Table 6.5 (a) is logic table for the circuit Fig. 6.22 (a). The logic table for the circuit shown in
Fig. 6.22 (b) is given in Table 6.5(b).
The logic table for the circuits is shown in Fig. 6.22 (a) and Fig. 6.22 (b) are identical. Hence the
circuits are equivalent.
6.3 APPLICATIONS
Logic gates have several applications to the computers. They are used in the following:
1. Adders,
2. Encoder, and
3. Decoder
6.3.1 Adders
The application of binary bits consists the following elementary operations, namely
0 + 0 = 0, 0 + 1 = 1, 1 + 0 = 1, 1 + 1 = 10.
We observe that the left bit gives the carry. When the augend and addend numbers contain more
significant digits, the carry obtained from the addition of two bits is added to the next higher order pair
of significant digits.
174 DISCRETE MATHEMATICAL STRUCTURES
From the table, it is clear that half adder performs binary operation (electronically): at a faster rate.
Logic circuit for half adder is given in Fig. 6.23:
A1 B1 C1 C S
0 0 0 0 0
0 0 1 0 1
0 1 0 0 1
0 1 1 1 0
1 0 0 0 1
1 0 1 1 0
1 1 0 1 0
1 1 1 1 1
6.3.2 Decoder
A decoder is a combinational logic circuit that converts n input lines to a maximum of 2n unique output
lines. In a 3 to 8 lines decoder three inputs are decoded into 8 outputs where each output represents one
of the minterms of the 3 input variables. If the input variables represent a binary number then the outputs
will be digits of octal system (contain 8 digits). A 3 to 8 lines decoder can also be used for decoding any
3 bit code to provide 8 outputs. The following is the diagram of 3 to 8 decoder:
176 DISCRETE MATHEMATICAL STRUCTURES
Table 6.8
Inputs Outputs
A B C F0 F1 F2 F3 F4 F5 F6 F7
0 0 0 1 0 0 0 0 0 0 0
0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
0 1 1 0 0 0 1 0 0 0 0
1 0 0 0 0 0 0 1 0 0 0
1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1
LOGIC GATES 177
We observe that the outputs variables are mutually exclusive. A decoder with n input variables can
generate 2n minterms.
6.3.3 Encoder
A logical circuit which performs the inverse operation of a decoder is called an Encoder. Decimal to
binary encoder converts decimal numbers and a Hexadecimal to binary encoder converts Hexadecimal
number to its binary equivalent. An encoder with 2n input lines will have n output lines. The block
diagram for 24 to 4 encoder is given in Fig. 6.26.
Fig. 6.26
If a Boolean function F has n variables, we take n –1 of these variables and connect them to the
selection lines of a multiplexer. The remaining variable say X of the function F is used for the inputs of
the multiplexer. The inputs of the MUX are chosen to be either X or X´ or 1 or 0. We can implement F
with a MUX by choosing the four values X, X´, 1 and 0 for the inputs and by connecting the other
178 DISCRETE MATHEMATICAL STRUCTURES
variables to the selection lines. We now explain the method of implementing a Boolean function F of n
variables with 2n –1 to 1 multiplexer, with the help of an example.
Example: Implement
F = (a, b, c) = ∑ (0, 3, 6, 7)
With a multiplexer
Solution: We first express F in its sum of minterms form. The ordered sequence of variables chosen
for the minterms is a b c. Where a is the left most variable in the ordered sequences. Thus, we have
n = 3 (no of variables)
n–1=3–1=2
n –1 3 –1
we use 2 to 1, i.e. 2 to 1 i.e., 8 to 1 multiplexes for the implementation of F. The selected variable
a is in the highest order position in the sequences of variables m0, m1, m2, m3, m4, m5, m6, m7 are the
minterms. We list all the minterm in two rows as shown in Table 6.9. The singled out variable a will be
in the complemented form in the first row and will be in the uncomplemented form in the second row.
Table 6.9
I0 I1 I2 I3
a1 0 1 2 3
a 4 5 6 7
We circle the minterms of the function F and inspect each column separately: we apply the following
rules:
(i) If the two minterms in a column are not circle we apply 0 to the corresponding multiplexer
input.
(ii) If the two minterms are circled, then we apply 1 to the corresponding input of MUX.
(iii) If the bottom row minterm in a column is circled and the top minterm is not circled, apply a to
the corresponding multiplexer input.
(iv) If the minterm of top row is encircled and the bottom row minterm in a column is not encircled,
then we apply a1 to the corresponding multiplexer input applying the above rules we obtain
the values as shown in Table 6.10.
I0 I1 I2 I3
a1 0 1 2 3
a 4 5 6 7
1
a 0 a 1
The inputs I0, I1, I2, I3, are applied the values as shown below:
LOGIC GATES 179
Fig. 6.28
A1: Assign 2n –1 bits which are 0’s and 2n –1 bits which are 1s.
A2: Repeatedly assign 2n –2 bits which are 0’s followed by 2n –2 bits which are 1s.
A3: Repeatedly assign 2n –3 bits which are 0’s followed by 2n –3 bits which are 1s.
...
A1, A2, As, … are called special sequences. The complements of these special sequences can be
obtained by replacing 0 by 1 and 1 by 0, in the sequences.
Example 1: Suppose a logic circuit has n = 3, input devices A, B and C, write down the special
sequences for A, B and C and write their complements.
Solution: We have n = 3
There are 23 = 8 bit special sequences for A, B and C. They can be written as follows:
A = 00001111
B = 00110011
C = 01010101
180 DISCRETE MATHEMATICAL STRUCTURES
E X E R C I S E 6.1
I
1. What are logic gates? Name three basic logic gates.
2. What is an OR-gate? Explain in brief the function of an OR-gate.
3. What is an AND-gate.
4. What is an exclusive OR-gate? How does it differ from an OR-gate?
5. What is a NOT-gate? Explain its operations and draw its truth table.
6. Draw the circuit symbol of a NAND-gate.
7. Simplify:
1. P′ Q + P′ Q R′ S ′ + P Q R S ′
2. ( P ′ + Q ′ + R′) ( P ′ + Q ′ + R) (Q ′ + R) (P + R) (R + Q + R) ( P ′ + Q)
3. P Q R S + P′ R S + P Q S + P Q R S ′ + Q R′ S
II
1. Simplify the following expressions:
(a) Z = ( A ⋅ B + B ⋅ C ) ( B ⋅ C + C ⋅ D ) (C ⋅ D + A ⋅ B )
( )(
(b) Z = (A + B) ⋅ A + B ⋅ A + B )
2. What is the significant of Principle of duality. Write the duals of
(a) (X + Y) * (Y + Z) * (Z + X)
(b) A + (B + E) + B * (C + A) + C * (A + B)
LOGIC GATES 181
3. D70 = {1, 2, 5, 7, 10, 14, 35, 70} (the division of 70} we define
a + b = lcm (a, b)
a * b = gcd (a, b)
a′ = 70
a
show that D70 is a Boolean algebra with 1 as the zero element and 70 as the unit element.
4. Find the sum of products form (disjunctive normal form) of the Boolean expression E = (( xy )′ z )
(( n′ + z ) ( y ′ + z′))
5. A logic circuit L has n = 4 inputs A, B, C, D write the 16 bit special sequence for A, B, C, D.
6. Given five inputs A, B, C, D and E find the special sequences which give all the different possible
combinations of inputs bits.
7. For each of the following networks find the output:
(a)
(b)
182 DISCRETE MATHEMATICAL STRUCTURES
(c)
(d)
8. Simplify the Boolean expression and construct a network for the expression.
Z = A B C + A BC + A B C + A BC
9. Determine the output of the gate
10. If A = 11100111
B = 01111011
C = 01110011
and D = 11101110
Determine the output of the gate
(a) (b)
(ii)
(a) (b)
Elementary Combinatorics
7.1 INTRODUCTION
Combinatorics deals with counting and enumeration of specified objects, patterns or designs. Techniques
of counting are important in mathematics and computer science. In this chapter, we shall study basic of
counting. We also develop basic ideas of permutations, combinations, Binomial theorem, power sets
and pigeon hole principle. We begin our study with two basic counting principles.
(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1). These ordered pairs are distinct.
∴ There are 6 ways to obtain the sum 7.
Similarly the ordered pairs: (5, 6), (6, 5) are all distinct.
∴ The number of ways in which we get a sum 11 with the two dice is 2.
Therefore, we can get a sum 7 to 11 with two distinguishable dice in 6 + 2 = 8 ways.
Example 2: How many ways can we draw a club or a diamond from a pack of cards?
Solution: There are 13 clubs and 13 diamonds in a pack of cards.
The number of ways a club or a diamond may be drawn 13 + 13 = 26.
Example 3: In how ways can be drawn an ace or a king from an ordinary deck of playing cards?
Solution:
Number of Aces in a pack = 4
Number of kings in a pack = 4
Number ways an Ace or a king can be drawn from the pack = 4 + 4 = 8
7.2.2 Product Rule (The Principle of Sequential Counting)
If A1, A2, …, An are non-empty sets, then the number of elements in the Cartesian product A1 × A2 × …
n
× An is the product ∏ | Ai |
i =1
n
| A1 × A2 × ... × An | = ∏ | Ai |
i =1
Therefore, the number of license plates that can be printed, so that each plate contains two distinct
letters follower by three different digits 26 . 25 . 10 . 9 . 8 = 4,68,000.
E X E R C I S E 7.1
1. In how many ways can be draw a king or a queen from ordinary deck of playing cards?
2. How many ways can we draw a club or a spade from a pack of cards?
3. How many ways can we get a sum 6 or 9 when two distinguishable dice are rolled?
4. How many possible out comes are there when we roll a pair of dice, one yellow and one red?
5. In how many different ways are can answer all the questions of a true-false test consisting of 5
questions?
6. How many ways can we get a sum of 8 when two in distinguishable dice are rolled?
7. How many ways can we get a sum of 4 or 8 when two distinguishable dice are rolled? How many
ways can we get an even sum?
8. In how many ways can an organisations containing 26 members elect a president, a treasurer and
a secretary (assuming no person is elected to more than one position)?
9. In a railway compartment 6 seats are vacant on a bench. In how many ways can 3 passengers can
sit on them?
10. There are 10 buses plying between on a bench. In how many ways can 3 passengers can sit on
them?
11. Suppose a license plate contains two letters followed by three digits with the first digit not zero.
How many different plates can be printed?
12. Suppose a license plate contains 3 English letters followed by 4 digits:
(a) How many different license plates can be manufactured if repetition of letter and digits are
allowed?
(b) How many plates are possible if only the letters are repeated?
(c) How many are possible if only the digits can be repeated?
13. How many different license plates are there that involve 1, 2 or 3 letters followed by 4 digits?
14. There are 10 true-false questions on an examinations. How many sequences are possible?
15. Suppose that a state’s license plates consists of three letters followed by three digits. How many
different plates can be manufactures (if repetitions are allowed)?
16. If there are 12 boys and 16 girls in a class find the number of ways of selecting one student as
class representative.
Answers:
1. 8 2. 26 3. 9 4. 36 5. 32 6. 12 7. 8, 18 8. 15,600 9. 120
10. 90 11. 608400 12. 26 × 10 , 26 × 10 × 9 × 8 × 7, 26 × 25 × 24 × 104
3 4 3
13. (26 + 262 + 263) 104 14. 1024 15. 263 × 103 16. 28.
ELEMENTARY COMBINATORICS 187
Notation
In this chapter, we use {P1 a, P2 b, P3 c, P4 d} to indicate either:
(i) That we have P1 + P2 + P3 + P4 objects which include P1 a’s, P2 b’s, P3 c’s, P4 d’s.
(ii) That we have 4 objects a, b, c and d with the condition that:
a can be chosen at most P1 times.
b can be chosen at most P2 times.
c can be chosen at most P3 times.
d can be chosen at most P4 times.
The numbers P1, P2, P3 and P4 are called repetition numbers.
Example 2: The three permutations of {3 a, 1 b, 1 c} are aaa, aab, baa, aac, aca, abc, acb, bac, bca,
cab, cba, aba.
7.3.2 Factorial Function
Definition 7.2: If n is a natural number, then the product of all the natural numbers from 1 to n is
called “n-factorial”. It is denoted by the symbol n! The symbols and n(n) are also used.
From the definition.
n! = n (n – 1) (n – 2) … 3.2.1
The factorial function n! can also be defined recursively as follows:
0! = 1
(n + 1)! = n! (n + 1), n ≥ 0
From the above recursive definition, we get
1! = 0! (1) = 1
2! = 1!(2) = 1.2
3! = 2!(3) = 1.2.3
188 DISCRETE MATHEMATICAL STRUCTURES
The numbers Sr0 , S1r , Sr2 , ..., Srr are called the stirling numbers of the first kind.
Let n ≥ r the number of distributions of n distinct objects into r non-distinct, boxes, no box being
empty is denoted by S nr . It is called a stirling number of the second kind. We have the recurrence
formula.
S11 = 1, S nn = 1, S nr = 0 if r > n
n!
is p (n, r) = n (n – 1) (n – 2)…(n – r+1) = ( n – r )!
Proof: The first element in an r-permutations of n objects can be chosen in n different ways. Once the
first element has been selected, the second element can be selected in n–1 ways. We continue selecting
the elements, having selected (r – 1)th element. We select rth element i.e., the last element. The rth
element in the permutation can be selected in n – r +1 ways. By product rule, the number of r-permutations
of a set of n distinct objects is
P (n, r) = n (n – 1) (n – 2)…(n – r +1)
We may also write P (n, r) in factorial
ELEMENTARY COMBINATORICS 189
n ( n − 1) ... ( n − r + 1) ( n − r ) ... 2 ⋅ 1
P (n, r) = n (n – 1) (n – 2)…(n – r +1) =
( n – r ) ... 2 ⋅ 1
n!
=
(n – r )!
(n + 1)! (n + 1) n (n − 1) ... 3 ⋅ 2 ⋅ 1 n 1
= = +
n! n ( n − 1) ... 3 ⋅ 2 ⋅ 1
(n + 1)! ( n + 1) n!
or = = ( n + 1)
n! n!
n! 2 ⋅ n!
=2⋅ =
n − n + 2! 2!
= n! = P (n, n).
190 DISCRETE MATHEMATICAL STRUCTURES
Example 4: How many words of three distinct letters can be formed form the letters of the word
LAND?
Solution: The number of three distinct letter words that can be formed from the 4 letters of the word
4! 4!
LAND is P (4,3) = ( 4 − 3)! = 11 = 4! = 24
n!
We have x=
q1 ! q 2 ! ... qr !
n!
i.e., P (n q1, q2, …, qr) =
q1 ! q 2 ! ... qr !
Example: There are 4 black, 3 green and 5 red balls. In how many ways can they be arranged in a
row?
Solution: Total number of balls = 4 black + 3 green + 5 red = 12
The black balls are alike,
The green balls are, and the red balls are alike,
12 !
∴ The number of ways in which the balls can be arranged in a row = 4 ! 3 ! 5 ! = 27,720
Example 1: Suppose an urn contain 5 balls. Find the number of ordered sample of size 2.
(i) With replacement (ii) Without replacement
Solution:
(i) There are 5 balls, and each ball in the ordered sample can be chosen in 5 ways.
Hence, there are 5.5 = 25; samples with replacement.
(ii) The first ball in the ordered sample can be chosen in 5 ways and the next ball in the ordered
sample can be chosen in 4 ways (when the first drawn ball is not replaced).
There are 5 × 4 = 20, samples without replacement.
Example 2: In how many ways can one choose two cards in succession from a deck of 52 cards, such
that the first chosen card is not replaced.
Solution: There are 52 cards in the deck of cards since the chosen card is not replaced the first can be
chosen in 52 different ways and the second can be in 51 different ways.
∴ The number of ways in which the 2 cards are chosen = 52 × 51 = 2,652
Example 3: A box contains 10 light bulbs.
Find the number n of ordered samples of:
(a) Size 3 with replacement, and
(b) Size 3 without replacement.
Solution:
(a) n = 10r
= 103 = 10 × 10 × 10 = 1,000
and (b) P (10, 3) = 10 × 9 × 8 = 720
Fig. 7.1
Fig. 7.2
Solution: Since no two ladies are to sit together, they should, seat themselves in between gents (i.e., a
lady is to be seated in between two gents). The 5 gents can sit round the circular table in 5 positions
(marked G in the Fig. 7.2). They can be arranged in (5 – 1)! = 4! ways. The ladies can sit in the 4 out of
5 seats (marked X in Fig. 7.2). This can be done in P (5, 4) ways.
The required number of ways in which 5 gents and 4 ladies can sit round a table.
= 4! ⋅ P (5, 4 )
= ( 4 ⋅ 3 ⋅ 2 ⋅ 1) × (5 ⋅ 4 ⋅ 3 ⋅ 2 )
= 2,880
ELEMENTARY COMBINATORICS 193
Example 3: Twelve persons are made to sit around a round table. Find the number of ways they can sit
such that 2 specified are not together.
Solution: 12 persons can sit round a table in (12 – 1)! = 11! ways.
The total number of ways in which 2 specified persons are together is 2! 10!.
The required number of seating arrangements in which 2 specified persons are not together.
= 11! − 2! ⋅ 10!
= 11 ⋅ 10! − 2! ⋅ 10!
= 10 ! (11 – 2)
= 9 ⋅ 10!
E X E R C I S E 7.2
1. In how many ways can 5 Telugu, 3 English, 2 Hindi books arranged on a shelf, if the books of
each language are to be together?
2. Suppose a license plate contains two letters followed by three digits with the first digit not zero.
How many different license plates can be printed?
3. How many license plates can be formed involving 3 English letters and 4 non-zero digits, if all
the letters must appear either in the beginning or in the end.
4. From the digits 1, 2, 3, 4, 5, 6 how many three digit odd numbers can be formed, if the repetition
of digits is not allowed?
5. There are 10 true-false questions on an examinations. How many sequences are possible?
6. Suppose that a state’s license plates consists of three letter followed by three digits. How many
different plates can be manufactured (if repetitions are allowed)?
7. Suppose a license plate contain 1 or 2 letters followed 3 digits. How many different license plates
can be printed?
8. Suppose a license plate contains 3 English letters followed by 4 digits.
(a) How many different plates can be manufactured if repetition of letters and digits are allowed?
(b) How many plates are possible if only the letters are repeated?
(c) How many are possible if only the digits can be repeated?
(n + 2 )!
9. Solve for n in = 56
n!
(n + 1)! 12
10. Find n if =
(n − 1)!
11. A man wished to travel from one point in a city to a second point which is five blocks south and
six blocks east of his starting point. In how many ways he make the journey if be always travels
either south or east?
12. Find the number of ways of arranging the letter of the word TENNESSEE all at a time (a) if there
no restriction (b) if the first two letters must be E.
13. Suppose a license plate contains three distinct letters followed by four digits with first digit not
zero. How many different license plate can be printed?
194 DISCRETE MATHEMATICAL STRUCTURES
14. In how many ways can 52 playing cards be distributed to four digits giving 13 cards each?
15. Find the number of arrangements that can be made out of the letters of the following words:
(i) Accountant
(ii) Independent
(iii) Assassination.
16. How many five digit numbers can be formed with the digits 2, 3, 5, 7, 9 which are:
(a) Odd
(b) Even
(c) Greater then 30,000
(d) Lie between 30,000 and 90,000.
17. In how many ways 6 rings be worn on 4 fingers when (i) there can be only one ring on each
finger (ii) there can be any number of rings on each finger.
18. In how many ways 6 gents and 5 ladies dine at a round table, if no two ladies are to sit together?
19. If P (n, 4): P (n, 3) = 9: 1 find n.
20. In how many ways 7 ladies and 7 gents can be seated at a round table; if no two ladies are to sit
together?
21. In how many ways can 12 beads of which 3 are alike of one kind, 2 are alike of the another kind
and the rest are different be formed into a ring?
22. In how many ways can 4 men and 3 ladies be arranged at a round table if the 3 ladies (i) never sit
together (ii) always sit together?
23. How many words can be formed out of the letters of the word DAUGHTER, so that the vowels
always occur together?
24. Suppose repetitions are not permitted.
(a) How many ways three digit numbers can be formed from the six digits 2, 3, 4, 5, 7 and 9?
(b) How many of these numbers are less than 400?
(c) How many are even?
(d) How many are odd?
(e) How many are multiples of 5?
25. Find the number of ways that three Americans, four French men, four Danes and two Italians can
be seated in a row so that those of the same nationality sit together to solve the problem if they sit
at a round table.
26. Find the member n of permutations that can be formal from all the letters of the word MISSISSIPPI.
27. Find n if 2 P (n, 2) + 50 = P (2n, 2).
28. How many routes are there form the lower-left corner of an n × n square grid to the upper-right
corner if we are restricted to travelling only to the right or, upward?
29. How many of the different permutations of the letters of word ENGLISH will (i) start with E
(ii) start with E and end with N?
30. How many different numbers of six digits can be formed using the digits 0, 1, 2, 3, 4 and 5. How
many of these are divisible by 5?
31. Twelve persons are made to sit around a table. Find the number of ways; they can sit such that 2
specifies persons are not together.
ELEMENTARY COMBINATORICS 195
Answers:
1. 5! 3! 3! 2! 2. 608400 3. 2 × 263 × 94 4. 60 5. 1024 6. 263 × 103 7. (26 + 262) 103
8. 263 × 104, 263 × 10 × 9 × 8 7, 26 × 25 × 24 × 104 9. 6 10. 3 11. 924 12. (a) 3780 (b) 630
13. 14, 04, 00, 000 14. 52/(131)4 15. (i) 2,26,800, (ii) 7560 (iii) 10810800
16. (a) 96 (b) 24 (c) 96 (d) 72 17. 86, 200 18. 9 19. 3628800 20. 1663200 21. (i) 4320 (ii) 720
22. 4320 23. (a) 120 (b) 40 (c) 40 (d) 80 (e) 20
7.7 COMBINATIONS
Definition 7.7: A combination of n objects taken at a time is an unordered selection of r of the n
objects (r ≤ n).
A combination of n objects taken r at a time is also called r-combination of n objects.
Example 1: The two combinations of a, b, c, d taken two at a time are ab, ac, ad, bc, bd and cd.
Example 2: Consider the objects a, b, c from which the selections are to be made, by taking 2 objects
at a time.
Solution: The 2-combinations are ab, ac, bc.
Example 3: The 3-combinations of four objects a, b, c, d taken 3 at a time are abc, abd, acd, bcd.
The number of combinations of n objects taken r at a time is demoted by C (n, r). The symbols
()
n( r ) , ncr , nr and cn , r are also used to denote r-combinations of n objects.
Theorem 7.3: (Number of r-combinations without repetition). The number of r-combinations of n
objects taken r at a time is
P (n , r ) n!
C ( n1 r ) =
r !( n − r )! ; (
= 1 ≤ r ≤ n)
r!
Proof: r-Combination means a selection of r-objects from the n objects, in which order of the objects
does not matter. Each r-combination contains r-objects and these r objects can be arranged among
themselves in i! ways. Hence each r-combination gives rise to r! permutations. Therefore, c(n, r)
combinations will give rise to c (n, r). r! permutations. But the number of r-permutations of n objects is
P (n, r).
Hence C (n , r ) ⋅ r ! = P (n , r )
P (n , r )
or C (n , r ) =
r!
n! ⎛ n! ⎞
= ⎜⎜∴ P ( n , r ) = ⎟
r ! ( n − r )! ⎝ (n − r )! ⎟⎠
(1 ≤ r ≤ n )
Corollary 1:
n! n!
C (n , n ) = = =1
n ! ( n − n )! n ! 0! (Boundary condition)
196 DISCRETE MATHEMATICAL STRUCTURES
Corollary 2:
n! n!
C (n , 0 ) = = =1
0! ( n − 0 )! 0! n ! (Boundary condition)
7.7.1 r-Subset
Definition 7.8: Let A be a set containing n elements. An r-subset of A is a selection of r elements of A
without regard to the order.
Each r-subset is a r-combination and the number of r-subsets of A is
P (n , r )
C (n, r) =
r!
Combinationally C (n, r) represents, the number of ways of choosing r objects from n distinct
objects (i.e., number of ways of selecting r elements from the n elements of the set A).
7.8.3 Combinations when all the given things are not different
Suppose that out of m + n + p + …, things m are alike, and of one kind, n are alike and of second kind
and the rest are different, say they are k in number.
Out of m things we may take 0, 1, 2, … or m. Hence there (m + 1) ways of selecting the m things
similarly, n things which are alike may be selected in (n + 1) ways and, P things which are alike may be
selected in (P + 1) ways the remaing k different things may be selected in 2 k ways. These include the
case in which all are rejected.
∴ The total numbers of combinations
= (m + 1) (n + 1) (p + 1) 2k – 1
Since the set of r-combinations and the set of discarding of (n – r) objects are in one-one corresponding
we get
C (n, r) = C (n, n – r)
Method 2: See Corollary 3 of Theorem 7.
Example 2: (Pascal’s Identity)
Show that C (n, r) = C (n – 1, r – 1) + C (n – 1, r)
Solution:
Method 1: C (n, r) is the number of r-combinations of n objects. Let n be any one of the n objects. Fix
the object x the C (n, r) combinations can be grouped into:
(i) Those r-combinations that contain the objects x.
(ii) Those r-combinations that do not contain the object x.
Since the objects x is in all r-combinations of (i) we are to choose (r – 1) objects in each combinations
of (i) from the remaining (n – 1) objects, this can be done in C (n – 1, r – 1) ways.
The number of combinations that contain x, is
C (n – 1, r – 1)
To count the number of r-combinations of (ii) i.e., the number of r-combinations which do not
contain x, we omit the objects x from n objects and choose r objects from the remaining (n – 1) objects.
Therefore, the number r-combinations that do not contain x is C (n – 1, r).
Thus C (n, r) = C (n – 1, r – 1) + C (n – 1, r)
Method 2: Consider R.H.S.
C (n – 1, r – 1) + C (n – 1, r)
(n − 1)! (n − 1)!
= +
(r − 1)! (r − 1 − r + 1)! r ! (n − 1 − r )!
(n − 1)! ( n − 1)!
= +
(r − 1)! ( n − r )! r ! ( n − 1 − r )!
(n − 1)! (n − 1)!
= +
( r − 1)! (n − r ) (n − r − 1)! r (r − 1)! ( n − 1 − r )!
(n − 1)! ⎡ 1 1⎤
= ⎢ + ⎥
(r − 1)! (n − r − 1)! ⎣ n − r r ⎦
(n − 1)! ⎡r+n−r⎤
= ⎢ ⎥
(r − 1)! ( n − r − 1)! ⎢⎣ r ⋅ (n − r ) ⎥⎦
n ⋅ ( n − 1)!
=
r ⋅ ( r − 1)! ( n − r ) ⋅ ( n − r − 1)!
n!
= = c (n , r )
r ! ( n − r )!
Example 3: (Pascals row sum identity)
Show that C (n, 0) + C (n, 1) + … + C (n, n) = 2n
200 DISCRETE MATHEMATICAL STRUCTURES
Solution: This is equivalent to finding the number of subsets of a set A with n elements. The number
of subsets of A can be considered as follows:
The number of subsets having no elements (i.e., subsets with 0 elements is C (n, 0)
The number of subsets having 1 elements is C (n, 1) …
The number of subsets with n elements is C (n, n). Adding we get the number of elements in the
power set of A.
i.e., | (A) | = C (n, 0) + C (n, 1) + … + C (n, n)
but the number of elements in the power set of A is 2n.
Hence C (n, 0) + C (n, 1) + … + C (n, n) = 2n
Proof: Since the P1 objects going into A1 can be chosen in C (n, p1) ways, the P2 objects going into A2
can be chosen in C (n – p1, p2) ways, the P3 objects going into A3 can be chosen in (n – p1, – p2, p3) ways
…, and the Pr objects going into Ar can chosen in C (n – p1, – p2 – … – pr–1, pr) ways the total number of
partitions is
C (n, p1) C (n – p1, p2) C (n – p1, – p2, p3) C (n – p1, – p2 – …, pr-1, pr)
=
n!
⋅ ⋅
( )
(n − P1 )! (n − P1 − P2 )! ... n − P1 − P2 − ..., − Pr −1 !
P1 ! ( n − P1 )! P2 ! ( n − P2 )! P3 !( n − P3 )! Pr ! 0!
n!
=
P1 ! P2 ! ..., Pr !
Example 2: A farmer buys 4 cows, 2 goats and 5 ducks from a person who has 7 cows, 5 goats and 8
ducks. How many choices the farmer have:
Solution: The farmer can choose 4 cows from 7 cows in C (7, 4) ways, 2 goats from 5 goats in C (5,
2) ways and 5 ducks from 8 ducks in C (8, 5) ways.
∴ The farmer can choose 4 cows, 2 goats and 5 ducks in C (7, 4) C (5, 2) C (8, 5)
7⋅6⋅5⋅ 4 5⋅ 4 8⋅7⋅6
= ⋅ ⋅
1⋅ 2 ⋅ 3⋅ 4 1⋅ 2 1⋅ 2 ⋅ 3
= 19,600 ways.
Theorem 7.5: The number of combination of p1 + p2 + … + pr objects if p1 are alike of one kind, p2 are
alike of another kind …, pr are alike of rth kind is
(p1 + 1) (p2 + 1) … (pr + 1) – 1
Proof: Out of (p1, + p2 + … + pr) objects, any number of objects can be selected, and each combination
may contain any number of objects from 1 to (p1, + p2 + … + pr) objects.
Consider P1 objects out of the P1 like things, none or 1 or 2 or 3 … all of the P1 may be selected.
Therefore, the number of combinations with P1 like objects is (P1 + 1).
Similarly the number of possible combinations with P2 like objects is (P2 + 1) …, the number of
combinations of Pr objects is (Pr + 1).
∴ The total number of combinations with P1 + P2 + … + Pr objects is
(P1 + 1) (P2 + 1) … (Pr + 1)
but these combinations include the case in which all objects are rejected.
∴ The total number of combinations is
(P1 + 1) (P2 + 1) … (Pr + 1) – 1
Example 3: There are twelve students in a class. Find the number of ways that the twelve students
take three different tests if four students are to take each test.
Solution: We find the number of ordered partitions of twelve students into cells containing four students
12!
each. There are
4! 4! 4! = 34,650 such partitions.
The required number of ways, the students can write the take the tests is 34,650.
202 DISCRETE MATHEMATICAL STRUCTURES
Example 4: Find the number m of ways that a set X containing ten elements can be partitioned into
two cells.
Solution: Let A denote a subset of X each A divides X into two disjoint sets A and (complement of A).
Thus there are 210 such divisions of X. This number includes the case in which A = ∅ and A = X (i.e.,
improper subsets of X).
Hence the number of partitions ⎡⎣ A , A⎤⎦ of X is 210 – 2 = 1024 – 2 = 1022 since each unordered
partition determines two ordered partitions, we have
1022
m= = 511
2
Thus, there are 511 partition of X into two non-empty disjoint cells.
Solution: We have n = 4, r = 3
The number of 3-combinations of the given set is C (4 – 1 + 3, 3)
= C (6, 3)
= 20
Example 3: Find the number of non-negative integral solutions to n1 + n2 + n3 + n4 = 20
Solution: We have n = 4, r = 20
The number of non-negative integral solutions
= C (4 – 1 + 20, 20)
= C (23, 20) = 1,771
Example 4: Find the number of 4-combinations of 5 objects with unlimited repetitions.
Solution: We have n = 5, r = 4
The number of 4-combinations
= C (5 – 1 + 4, 4)
= C (8, 4)
= 70
Example 5: Find the number of ways of placing 8 similar balls in 5 numbered boxes.
Solution: The number of ways of placing similar balls in 5 numbered boxes is
= C (5 – 1 + 8, 8)
= C (12, 8) = 495
Example 6: Find the number binary numbers with five 1’s and three 0’s.
Solution: The number of binary numbers with five 1’s and three 0’s is
= C (5 + 3, 3)
= C (8, 3)
= 56
Example 7: How many integral solutions are there to x1 + x2 + x3 + x4 + x5 = 16, where each xi ≥ 2?
Solution: Let xi = yi + 2, where yi ≥ 0
We have x1 + x2 + x3 + x4 + x5 = 16
⇒ y1 + 2 + y2 + 2 + y3 + 2 + y4 2 + y5 + 2 = 16
⇒ y1 + y2 + y3 + y4 + y5 = 6
The number of integral solutions of x1 + x2 + x3 + x4 + x5 = 16 is the same as the number of integral
solution of y1 + y2 + y3 + y4 + y5 = 6.
∴ There are C ( 5 – 1 + 6, 6) = C (10, 6) such solutions.
Example 8: How many integral solutions are there of x1 + x2 + x3 + x4 + x5 = 30, where x1 ≥ 2, x2 ≥ 3,
x3 ≥ 4, x4 ≥ 2, x5 ≥ 0?
Solution: Let x1 = y2 + 2, x2 = y2 + 3, x3 = y3 + 4, x4 = y4 + 2, x5 = y5 + 0
x1 + x2 + x3 + x4 + x5 = 30
⇒ y1 + 2 + y2 + 3 + y3 + 4 + y4 2 + y5 + 0 = 30
⇒ y1 + y2 + y3 + y4 + y5 = 19
204 DISCRETE MATHEMATICAL STRUCTURES
E X E R C I S E 7.3
4. How many different seven-person can be formed each containing 3 women from the available
set of 20 women and 4 men from an available set of 30 men?
5. In how many ways can a person invite one or more of his seven friends to a party?
6. How many triangles can be formed by joining 12 points, 7 of which are in the same straight line?
7. In how many ways 5 white balls and 3 black balls can be arranged in a row so that no two black
balls may be together?
8. In how many ways can a committee of 6 men and 2 women be formed out of 10 men and 5
women?
9. A student is two answer out of 10 questions in an examination
(i) How many choices he has?
(ii) How many, if he must answer the first three questions?
(iii) How many, if he must answer atleast four of the five questions?
10. Out of 4 officers and 10 clerks in an office, a committee consisting of 2 officers and 3 clerks is to
be formed. In how many ways committee be done if:
(i) Any officers and any clerk can be included?
(ii) Are particular clerk must be on the committee?
(iii) Are particular officer cannot be on the committee?
11. If C (n, 15) = C (n, 27) find the value of C (n, 30).
12. If P (n, r) = 5040, and C (n, r) = 210, find n and r.
13. From 6 consonants and 4 vowels how many words can be made, each containing 4 consonants
and 3 vowels?
14. A committee of 8 is to be selected out of 6 males and 8 females. In how many ways can it be
formed so that the male way not be out numbered?
15. There are twelve points in a given plane, no three of them on the same time. How many lines are
determined by these points?
16. In how many ways can three or more persons be selected from twelve persons?
17. Which regular polygon has the same number of diagonals as sides?
18. Find the regular polygon which has twice as many diagonals as sides.
19. Find the number of triangles that can be formed by the vertices of an octagon.
20. Find the number of ways in which 9 toys can be divided evenly among three children.
21. Find the number of ways in which fourteen people can be partitioned into six committees, where
two of the committees contain three people each and the remaining four committees contain two
people each.
22. In how many ways can a cricket eleven be selected out of 14 players when the captain is always
to be included?
23. A box contains 2 white balls, 3 black balls and 4 red balls. In how many ways three balls be
drawn from the box if atleast are black ball is to be included in the draw?
24. How many different possible outcomes are possible by tossing 6 similar coins?
25. There are 5 true and false questions in an examination. How many sequences of answers are
possible?
206 DISCRETE MATHEMATICAL STRUCTURES
Solution: There are ten people and the number of days in a week is only seven. If each person (pigeon)
is assigned to the day of the week (pigeonhole) on which he or she is born, the pigeonhole principle tells
us that two more people must be assigned to the same day of the week.
In the above example, the people (objects) are taken as the pigeons and the days of the week as
taken as pigeonholes. In general, to apply pigeonhole principle, we must identify the pigeons i.e., the
objects and the pigeonholes i.e., categories of the desired characteristic. Also we must be able to count
the number of pigeons and pigeonholes.
Example 2: Show that if seven numbers from to 1 to 12 are chosen, then two of them will add upto 13.
Solution: Construct six different sets, each containing two numbers that add up to 13 as follows
x1 = {1, 12}, x2 = {2, 11}, x3 = {3, 10}, x4 = {4, 9}, x5 = {5, 8}, x6 = {6, 7}. Each of the seven numbers
belong to one of these six sets. Since there are six sets, the pigeonhole principle tells us that two of the
numbers chosen belong to the same set. These numbers add upto 13.
Theorem 7.7: (The extended pigeonhole principle)
If n pigeons are assigned to m pigeonholes, then one of the pigeonholes must contain atleast ⎢⎣ n/m⎥⎦ + 1
pigeons [ ⎢⎣ p/q ⎥⎦ denotes the largest integer less than or equal to the rational number p/q].
Proof: We prove the theorem by contradiction. Let each pigeonhole contain no more than ⎢⎣( n − m) /m⎥⎦
pigeons. Then, there are at most m ⋅ ⎢⎣( n − 1) /m ⎥⎦ pigeons in all but ⎢⎣( n − 1) /m⎥⎦ ≤ m ( n − 1) /m.
⇒ ⎢⎣( n − 1) /m⎥⎦ = n − 1
i.e., there (n – 1) pigeons in all. This contradicts our assumption. Hence one of the pigeonholes must
contain atleast ⎣⎢( n − 1) /m⎦⎥ + 1 pigeons.
Example 3: Show that if any 26 people are selected, then we may choose a subset of 4 so that all 4
were born on the same day of the week.
Solution: We assign each person to the day of the week on which she or he was born. Then the
number of pigeons (people) are to be assigned to 7 pigeonholes (days of the week). With n = 26 and
m = 7.
Therefore atleast ⎢⎣(26 − 1) /7 ⎥⎦ + 1 , that is 4 people must have been born on the same day of
the week.
Example 4: Show that there are atleast 6 different ways to choose 3 numbers from 1 to 10, so that all
choices have the some sum.
Solution: Three numbers can be choses from the 10 numbers in 10C3 = 120 ways
The least sum = 1 + 2 + 3 = 6
The largest sum that we can get from this numbers 1 to 10 is 8 + 9 + 10 = 27
We have 22 such sums inclusive of 6 and 27
Let A be the set of sums obtained by taking three numbers from 1 to 10, then
A = {6, 7, 8, ..., 27}
If each sum is taken as a pigeonhole, then atleast one of the pigeonhole must contain
208 DISCRETE MATHEMATICAL STRUCTURES
⎢ 120 − 1 ⎥
⎢ 22 ⎥ + 1 = 5 + 1 = 6 pigeons,
⎣ ⎦
i.e., one pigeonhole contains atleast 6 different ways of 3 numbers having the same sum.
E X E R C I S E 7.4
1. Show that if any five numbers from 1 to 8 are chosen, then two of them will add upto 9.
2. If eight people are chosen, in any way from a group show that, atleast two of them will have been
born on the same day of the week.
3. Show that if any 30 people are selected, then we may chose a subset of 5 so that all 5 were born
on the same day of the week.
4. Prove that if any 14 numbers from 1 to 25 are chosen, then one of them is a multiple of another.
5. Show that if any 11 numbers are chosen from the set {1, 2, …, 20}, then one of them will be a
multiple of another.
6. If 20 processors are interconnected, show that atleast two processors are directly connected to
the same number of processors.
( a + b) n = (14444
a + b )( a + b ) ... ( a + b )
244443
n − factors
the expansion results from selecting either a or a from each of the n factors. Multiplying the selection
together, and then summing all such products obtained. Let us consider the expansion of (a + b)3 as an
example:
(a + b)3 = (a + b) (a + b) (a + b)
= (a + b) [(a + b) (a + b)]
= (a + b) [(a + b) a + (a + b) b]
= (a + b) (aa + ba + ab + bb)
= a [aa + ba + ab + bb] + b [aa +ba + ab + bb]
= aaa + aba + aab + abb + baa + bba +bab + bbb
There are eight terms in the expansions of which some are alike. Each term is a product three
factors, the first being obtained from the first binomial; the second from the second binomial, and the
third from the third binomial in (a + b) (a + b) (a +b). All such possible selections are included in the
eight terms. Each of the eight terms is a product of three letters are selected from each of the binomial
factors. In the expansion a3 (i.e., aaa) appears only once; a2 b (i.e., aba, aab, bba) appears three times,
ab2 (i.e., abb, bba, bab) appears three times and b3 (i.e., bbb) appears only once.
Therefore, we can write
(a + b)3 = a3 + 3a2 b + 3ab2 + b3
ELEMENTARY COMBINATORICS 209
We observe that each term of this expansion is formed by selecting one and only one term from
each of the three binomial factors; multiplying these together, and adding like products. We can select
either none, one, two or three b’s. If we select one a from each of factor. This can be done in only C
(3, 0) one way. This gives the first term aaa i.e., a3. If we select one b, we can select it from any one of
the three factors. This can be done in C (3, 1) = 3 ways. For each of these selections. We must select one
a from each of the other two factors, and this can be done in only one way. Hence, we have three terms
each equal to a2 b giving the second term 3a2 b. We may how select two b’s from the three factors in C
(3, 2) = 3 ways, and an a must be selected in one way from the remaining factor. This gives the term
3ab2. Finally, we select three b’s in C (3, 3) = 1 way and obtain the term bbb = b3. Therefore, we can
write
(a + b)3 = C (3, 0) a3 + C (3, 1) a2 b + C (3, 2) ab2 + C (3, 3) b3
= a3 + 3a2 b + 3ab2 + b3
3
= ∑ C (3, r ) a
r =0
3− r
⋅ br
we now consider the expansion of (a + b)n where a and b are real numbers and n is a positive integer.
Theorem 7.8: (The Binomial theorem)
Let n be a positive integer then for all a and b.
(a + b)n = C (n, 0) an + C (n, 1) an-1 b + C (n, 2) an-2 b + … + C (n, r) an-r br + … + C (n, n) bn
n
= ∑ C (n , r ) a
r =0
n− r
⋅ br
Taking x = 1, we obtaining
1
∑ C (1, r ) ⋅ a
r =0
1− r
⋅ br = C (1, 0 ) a1 b0 + C (1, 1) a0 b1
=a+b
The theorem holds for x = 1, i.e., 1 ∈ S .
Assume that the theorem is true for n = k, i.e., K ∈ S , hence
k
(a + b )k = ∑ C (k , r ) a
r =0
k −r
⋅ br
Fig. 7.3
⎝ ⎠
the general term in the expansion is
Tr+1 = C (10, r) (x3)10–r (x–1)r
= C (10, r) x30–3r x–r
= C (10, r) x30–4r
212 DISCRETE MATHEMATICAL STRUCTURES
8
⎛ 2⎞
Example 3: Find the term containing a4 in the expansion of ⎜ a − ⎟ .
⎝ a⎠
Solution: The general term is
r
⎛ −2 ⎞
Tr +1 = C (8, r ) a 8− r ⎜ ⎟
⎝ a ⎠
( )
r
= C (8, r ) a8 −r −2a −1
(a )
r
= C (8, r ) a8− r ( −2 ) −1
r
∑ C (n , r ) x = (1 + x )
n
= r
r =0
r
(1 + x ) ∑ C (n , r ) x
n
Consider = r
r=0
replacing x by –x, we have
n n
(1 − x )n ∑ C (n , r ) (− x ) = ∑ C (n , r ) (−1)
r r
= xr
r =0 r =0
We know that the coefficients of the terms equivalent from the beginning and end are equal, therefore,
we can write
(1 + x)n = C (n, n) + C (n, n – 1) x + … + C (n, 0) xn … (ii)
multiplying (i) and (ii), we get
(1 + x)2n = [C (n, 0) + C (n, 1) x + … + C (n, n) xn ] x [ C (n, n) + C (n, n – 1) x + … + C (n, 0)] xn
from the right hand side, we see that the coefficients of xn is
C (n, 0)2 + C (n, 1)2 + … + C (n, n)2.
But the coefficient of xn in (1 + x)2n is given by
2 n! 2 n!
C (2n, n) = =
n! ⋅ n! (n !)2
2 n!
C02 + C12 + Cn2 =
( n !)2
Example 3: If (1 + x)n = C (n, 0) + C (n, 1) x + C (n, 2) x2 + … + C (n, n)xn.
Prove that C (n, 1) + 2 C (n, 2) + 3 C (n, 3) + … + n C (n, n) = n 2n – 1.
Solution:
C (n, 1) x + 2 C (n, 2) x2 + … + n C (n, n)xn
2 ( n − 1)
= nx + 2 ⋅ x2 + … + n xn
2 ⋅!
= nx + n (n – 1) x2 + … + n xn
= nx [1 + (n – 1) x + … + xn – 1]
= nx [C (n – 1, 0) + C (n – 1, 1)x + … + C (n – 1, n – 1)xn – 1]
= nx (1 + x)n – 1
Putting x = 1 on both sides, we get
C (n, 1) + 2 ⋅ C (n, 2) + … + n ⋅ C (n, n) = n ⋅ 2n – 1
Example 4: If C (n, 0), C (n, 1), C (n, 2), …, C (n, n) are the coefficients in the expansion of (1 + x)n,
prove that:
2 n!
C (n, 0) C (n, r) + C (n, 1), C (n, r + 1) + … + C (n, n – r) C (n, n) =
(n − r )! (n + r )!
Solution: We know that
(1 + x)n = C (n, 0) + C (n, 1) x + C (n, 2) x2 + … + C (n, r) xr + … +
C (n, n – 1) xn – 1 + C (n, n) xn … (i)
writing in the reverse order we get
(1 + x)n = C (n, n) x2 + C (n, n – 1) xn – 1 + … + C (n – 1) x + C (n, 0) … (ii)
Since C (n, r) = C (n, n – r)
we have C (n, n) = C (n, 0), C (n, n – 1) = C (n, 1)
we can therefore write
(1 + x)n = C (n, 0)xn + C (n, 1) xn – 1 + C (n, 2) xn – 2 + … + C (n, n –1) x +C (n, n) … (iii)
ELEMENTARY COMBINATORICS 215
multiplying (i) and (ii) and equating the coefficient of xn+r on both sides we get
C (n, 0) + C (n, r) + C (n, 1) + C (n, r + 1) + C (n, 2) C (n, r + 2) + … + C (n, n – r) C (n, n)
= Coefficient of xn+r in (1 + x)2n
= C (2n, n + r)
2 n!
=
(n + r )! (n – r )!
Example 5: Prove that
C ( n , 1) C ( n , 2) C ( n , 3) C ( n , n) n ( n + 1)
+2⋅ +3⋅ + ... + n =
C (n , 0) C ( n , 1) C (n , 2) C ( n , n − 1) 2
Solution: We know that
C ( n , 1) n
= = n,
C (n , 0) 1
2 ⋅ ( n − 1)
C (n , 2) 1⋅ 2 n ( n − 1)
2⋅ = = = n −1
C ( n , 1) n n
1
3 ⋅ n (n − 1)( n − 2 )
C ( n , 3) 1⋅ 2 ⋅3
3⋅ = =n−2
C (n , 2 ) n ( n − 1)
1⋅ 2
C (n , n ) 1
n =n⋅ =1
C ( n , n − 1) n
Adding, we get
C ( n , 1) C ( n , 2) C ( n , 3) C (n , n )
+2⋅ + 3⋅ + ... + n
C (n , 0) C ( n , 1) C (n , 2) C ( n , n −1)
= n + (n – 1) + (n – 2) + … + 1 ≤ 1 + 2 + 3 +… + (n – 1) + n
n ( n + 1)
=
2
where the summation extends over all sets of non-negative integers q1, q2, …, qt
where q1 + q2 + … + qt = n.
Proof: The coefficient of x1q1 x2 q2 ... xt qt is the number of ways of arranging n letters
{q1 x1, q2 x2, …, qt xt}
The coefficient of x1q1 x2 q2 ... xt qt is (n; q1, q2, …, qt)
Hence
(x1 + x2 + … + nt)n = ∑ P (x; q1, q2, …, qt) x1q1 x2 q2 ... xt qt
In the above expansion, x1q1 x2 q2 ... xt qt is a selecting of n objects with repetition from t distinct
types. The number of ways of selecting the objects is C (n + t – 1, n).
Therefore, the number of terms in the expansion of (x1 + x2 + … + nt)n is C (n + t – 1, n).
Example 1: Find the coefficients of x5 y10 z5 w5 in the expansion of (x + 7 y + 3 z + w)25.
Solution: We have n = 25, x1 = x1, x2 = 74, x3 = 3 z, and x4 = w
5 10 5 5 25
∴ The coefficients of x y z w in the expansion of (x + 7 y + 3 z + w) is
20!15 ⋅ 710 ⋅ 35 ⋅ 15
P (25, 5, 10, 5, 5) =
5!10! 5! 5!
Example 2: Find the number of terms in the expansion of (2x + 3y –5z)8.
Solution: We have n = 8, t = 3
Hence the number of terms is
C (n + t – 1, n) = C (8 + 3 – 1, 8)
= C (10, 8) = 45
E X E R C I S E 7.5
(1 + x )n + (1 − x )n
= C (n, 0) + C (n, 2) x2 + … + C (n, q) xq
2
where q = n if n is even
n – 1 if n is odd
12. Show that the product of r consecutive integers is divisible by r!.
13. State and prove Binomial theorem.
14. State Multinomial theorem.
45 x 2
15. In the expansion of (1 + px)n, the first three terms are 1, 5x, . Find the values of n and p.
4
16. Find the coefficient of x12 x3 x4 x54 in the expansion of (x1 + x2 + x3 + x4 + x5)10. Also find the
number of terms in the expansion.
17. Find the coefficient of x3 y3 z2 in the expansion of (2x – 3 y + 5 z)8.
n
⎛ 2 1 ⎞
18. In the expansion of ⎜ a − 3 ⎟ the fifth term in 10a– 4.
⎝ a ⎠
Find the value of n.
19. In the expansion of (ax + by)n the coefficients of the first three terms are 729, 486, and 135
respectively, if a > 0. Find the values of a, b and n.
20. Find the coefficient of x2 y3 z2 in (x + y + z)7.
Answers:
1760 1
1. 1 – 4x + 10x2 – 16x3 + 19x4 – 16x5 + 10x6 – 4x7 + x8. 2. 3.7920 15. P = , n = 10
x2 2
1
16. 12,600, 1001 17. (23) (–3)3 (5)2 (560) 18. n = 8 19. a = 3, b = , n = 6 20. 210.
3
218 DISCRETE MATHEMATICAL STRUCTURES
Graph Theory
8.1 INTRODUCTION
Graph theory is intimately related to many branches of mathematics. It is widely applied in subjects like,
Computer Technology, Communication Science, Electrical Engineering, Physics, Architecture,
Operations Research, Economics, Sociology, Genetics, etc. In the earlier stages it was called slum
Topology.
Euler, Cayley, Sir William Hamilton, Lewin, and Kirchoff, laid foundations to the graph theory.
Graph theory was born in 1736 with Euler’s paper on Konigsberg bridge problem. The Konigsberg
bridge problem is the best known example in graph theory. It was a long pending problem. Euler solved
this problem by means of a graph. Euler became father of graph theory. Kirchoff, Cayley, Mobius,
Hamilton and De Morgan have laid strong foundations and contributed much to the development of the
subject. In this chapter, basic concepts and terms of graph theory have been introduced.
8.2.1 Graph
Definition 8.1: A graph G is a pair of sets (V, E), where V is a non-empty set. The set V is called the set
of vertices and the set E is called the set of edges (or lines).
A graph may be represented by a diagram in which each vertex is represented by a point in the plane
and each edge is represented by a straight line (or curve) joining the points. The objects shown below
(see Fig. 8.1) are graphs.
Fig. 8.1
Note:
(i) In a graph G = (V, E), the sets V and E are assumed to be finite sets.
(ii) A vertex of a graph is called a node, a point; a junction or 0-cell. An edge of a graph is called a line, a
branch, a 1-cell or an arc.
GRAPH THEORY 219
(iii) If G = (V, E); {or (V (G), E (G))} is a graph, then the number of vertices in G is denoted by |V| (|V (G)|),
and the number of edges in a is denoted by |E| (or |E (G) |).
(iv) If {u, v} is an edge in a graph G, then the vertices u and v are said to be adjacent.
Fig. 8.2
Note: If e is an edge of a non-directed graph G, connecting the vertices u and v of G, then it is denoted by
e = {u, v}. The points u and v are called the end points of the edge e.
8.2.4 Self-Loop
Definition 8.4: An edge associated with the unordered pair {vi , vi } where vi ∈ V of a graph G = (V,
E) is called a self-loop in a graph G is an edge joining a vertex to itself.
In Fig. 8.4, there is a loop incident on the vertex v.
Fig. 8.4
220 DISCRETE MATHEMATICAL STRUCTURES
8.2.5 Multigraph
Definition 8.5: A graph which allows more than one edge to join a pair of vertices is called a Multigraph.
Fig. 8.5 (a) is a multigraph in which, we have
G = {{a, b}, {a, d}, 2 (a, c), (c, d)}
Fig. 8.5 (b) is a multigraph in which, we have
G = {{a, b}, {a, c}, 3 {b, d}, {c, d}, {a, d}}
Note: A finite graph with one vertex and no edges is called a trivial graph.
+
The indegree of a vertex v of G is denoted by deg G (v ) (or by indeg (v)).
Example: In the graph given below (Fig. 8.11) the indegree of the vertex V1 is 3:
Fig. 8.11
8.3.2 Outdegree
Definition 8.13: Let G be a directed graph and v be a vertex of G. The outdegree of v is the number of
edges beginning at v.
−
The outdegree of a vertex v in G is denoted by deg G (v ) (or by outdeg (v)).
In the Fig. 8.12, the outdegree of the vertex v1 is 2.
Fig. 8.12
Fig. 8.13
GRAPH THEORY 223
Example 2: In the graph of Fig. 8.14, we have deg (v1) = 3, deg (v2) = 4, deg (v3) = 2, deg (v4) = 3 or
d1 = 3, d2 = 4, d3 = 2, d4 = 3
Fig. 8.14
8.3.4
Minimum degree and maximum degree: For a graph G = (V, E), we introduce the following symbols:
δ (G) = Minimum of all the degrees of the vertices of a graph G.
Δ (G) = Maximum of all the degrees of the vertices of a graph G.
Thus
δ (G) = min {deg (vi ): vi ∈ V }
Fig. 8.16
Fig. 8.17
Note:
(i) In a complete graph, there is an edge between every pair of vertices.
(ii) Kn is called (n – 1)-regular graph.
Fig. 8.20
Fig. 8.21
Fig. 8.22
Fig. 8.23
GRAPH THEORY 227
∑ deg (v )
i =1
i = 2 |E|
∑ deg
i =1
−
G (vi ) = ∑ deg
i =1
+
G (vi )
i.e., ∑ deg
i =1
G ( vi ) = 2 | E |
(ii) Let G be digraph and e be an edge associated with a vertex pair (vp, vq). The edge e contributes one
to the outdegree of vp and one to the indegree of vq. This is true for all the edges in G.
n n
Hence ∑ i =1
degG+ (vi ) = ∑ deg
i =1
−
G (vi ) = | E |
Corollary 1: In a non-directed graph, the number of vertices of odd degree vertices is even.
Proof: Let G = (V, E) be a non-directed graph. Let W denote the set of odd degree vertices and U
denote the set of even degree vertices in G.
Thus each deg (vi) on R.H.S. is odd the number of summands must be even.
∴ The number of odd degree vertices in G is even.
Corollary 2: If K = δ (G ), is the minimum degree of the vertices of a non-directed graph G = (V, E)
then
K |V| ≤ 2 |E|
in particular, if G is a k-regular graph then
K |V| = 2 |E|
If G is a simple graph, then G is without parallel edges or self-loops. Let G be a simple graph with
one vertex. The number of edges in G is zero i.e., (1–1). The maximum degree of a vertex in a simple
graph G with one vertex is zero. If G is a simple graph with 2 vertices then the maximum degree of any
vertex in a is 1 = (2–1). In general it can be shown that the maximum degree of any vertex in a simple
graph with n vertices is (n–1). This can be stated in the form a theorem as follows:
Theorem 8.2: The maximum degree of any vertex in a simple with n vertices is n – 1.
Fig. 8.24
Example 2: Draw a graph representing the problem of three houses and three utilities say water, gas
and electricity.
Solution: Let H1, H2 and H3 denote the houses. The utilities, water, gas and electricity be denoted by
W, G and E respectively. The houses can be connected by the utilities as shown Fig. 8.25.
Fig. 8.25
GRAPH THEORY 229
Fig. 8.27
∑ deg (v ) = d
i 1 + d2 + d3 + d4 + d5
= 3 + 4 + 3 + 3 + 1 = 14
∴ ∑ deg (v ) = 14 = 2 × 7 = 2 |E|
i
Fig. 8.28
Example 6: A sequence d = (d1, d2, ... dn) is graphic, if there is a simple non-directed graph with the
degree sequence d. Show that the following sequences are not graphic:
(i) (2, 3, 4, 5, 6, 7) (ii) (2, 2, 4)
Solution: (i) The number of odd vertices in the degree sequence is 3 i.e., odd and the number of
vertices in G = 6.
Maximum degree of any vertex in a simple graph is = n – 1 = 6 – 1 = 5. But the maximum degree in
the given degree sequence is 7, therefore the given degree sequence is not graphic.
(ii) The graph contains 3 vertices. The maximum degree in the graph must be (3 – 1) = 2, but the
maximum degree in the sequence is 4. Hence, the given degree sequences is not graphic.
Example 7: Draw a picture of the following graph and state whether it is directed or non-directed and
whether it is simple:
G = (V, E) where
V = {a, b, c, d, e} and E = {(a, b), (a, c), (a, d), (a, e), (e, e), (c, d), (a, a), (b, c), (c, c)}.
Solution: The given graph G is a directed graph and is not simple:
Fig. 8.29
GRAPH THEORY 231
Example 8: Find the order and size of the graph G shown in Fig. 8.30:
Fig. 8.30
Solution:
|V| = order of G = 4
|E| = size of G = 8
Example 9: Give an example of:
(i) A Simple graph,
(ii) A Pseudo graph, and
(iii) A Multigraph.
Solution:
(i) Figure 8.31 (a) is a Simple graph.
(ii) Figure 8.31 (b) is a Pseudo graph.
(iii) Figure shown in 8.31 (c) is a Multigraph.
Fig. 8.31 (a) Simple Graph (b) Pseudo Graph (c) Multigraph
Example 10: Draw a non-simple graphs G with degree sequence (1, 1, 3, 3, 3, 4, 6, 7).
Solution: G is non-directed, therefore G permits self-loops in it. It be drawn as shown in Fig. 8.32.
232 DISCRETE MATHEMATICAL STRUCTURES
Fig. 8.32
Example 11: Show that every cubic graph has even number of vertices.
Solution: Let G be a cubic graph with p vertices.
The ∑ deg (v ) = 3 p
i ... (i)
L.H.S. of (i) is even, therefore R.H.S. i.e., 3p is even hence p is even.
2q
Example 12: If G = (V, E) is a (p, q) graph then show that δ ≤ ≤ Δ.
p
Solution: Let V = {v1, v2, ..., vp} then we have δ ≤ deg (vi ) ≤ Δ
p
or pδ ≤ ∑ deg (v ) ≤ p Δ
i =1
i
or pδ ≤2q≤ pΔ
2q
Hence δ ≤ ≤Δ
p
Example 13: Suppose G is a non-directed graph with 12 edges. If G has 6 vertices each of degree 3
and the rest have degree less than 3, what is the minimum number of vertices G can have?
Solution: Number of edges in G = 12
we have 6 vertices of degree 3. Let n denote the number of vertices each of whose degree is less than 3.
or 24 < 18 + 3x
or 3x > 6
or x>2
The least positive integer for which the inequality x > 2 holds is x = 3.
Hence, the minimum number of vertices G can have is 3 + 6 = 9.
GRAPH THEORY 233
Example 14: A non-directed graph G has 8 edges. Find the number of vertices, if the degree of each
vertex is 2.
Solution: Given |E| = 8
We have
∑ deg (v ) = 2 |E|
i
i =1
i.e., 2 |V| = 2 × 8
or |V| = 8
Thus number of vertices in G = 8
Example 15: Show that a simple graph of order 4 and size 7 does not exist.
Solution: Let G be a group with order 4 and size 7, we have |V | = n = 4 and | E | = number of edges =
7 Maximum number of edges in G
1
= n ( n − 1)
2
1
= 4(4 − 1)
2
=6
Maximum number of edges, G can have is 6
It is given that number of edges in G is 7
|E| = 7 > 6
which is contradiction
Hence, G cannot exist
i.e., there cannot be a Simple graph with order 4 and size 7.
E X E R C I S E 8.1
1. Define:
(a) Graph
(b) Self-loop
(c) Digraph
(d) Multigraph
(e) Pseudo graph
(f) Order of a graph
(g) Size of a graph
Give examples.
2. Draw a diagram for each of the following graphs:
(a) V = {(a, d), (a, f), (b, c), (b, f), (c, e)}
(b) V = {v1, v2, v3, v4, v5), E = {(v1, v1), (v2, v3), (v2, 4v), (v4, v5)}
234 DISCRETE MATHEMATICAL STRUCTURES
(c) V = {a, b, c, d, e}, E = {(a, a), ... (a, b), (b, c), (c, d), (c, e), (d, e)}
(d) V = {a, b, c, d}, E = {(a, a), (a, b), (b, c), (c, c), (c, d), (d, a)}
3. Describe the graph G, given below:
n ( n − 1)
9. Show that the maximum number of edges in a simple graph with n vertices is .
2
10. Nine members of a club meet each day for lunch at a round table. They decide to sit such that
every member has different neighbours at each lunch. How many days can this arrangement
last?
11. Show that every cubic graph has an even number of vertices (points).
12. Show that in any group of two or more people, there are always two with exactly the same
number of friends inside the group.
13. Construct a cubic graph on 10 vertices. Draw three different representations.
14. Give an example of a 3-regular graph (cubic graph) on 6 vertices.
P⋅m
15. Show that the size of m-regular (p, q) graph is .
2
16. Suppose you are married and you and your husband visited a party with 3 other married couples
no. one shakes hands with himself or his wife. How many hands you have shaken and how many
did your husband shake? Give limits.
17. What is the largest number of vertices in a graph with 35 edges, if all vertices are degree atleast
3?
18. Show that there exists a 4-regular graph on 6 vertices. Construct a graph as an example.
19. Let G be a (p, q) graph all of whose points have degree or k + 1. If G has k > 0 points of degree
k, show that t = p (k + 1) – 2q.
20. Is there a simple with the degree sequence:
(i) (1, 1, 3, 4, 6, 7)
(ii) (1, 2, 3, 3, 3, 4, 6, 7)
(iii) (1, 1, 2, 3)
(iv) (2, 3, 3, 4, 5, 6)
(v) (2, 2, 4, 8)
(vi) (6, 6, 6, 6, 4, 3, 3, 0)
(vii) (6, 6, 5, 4, 3, 3, 1)
21. Which of the following sequences are graphical? Construct a group in possible cases.
(i) 6, 5, 5, 4, 3, 3, 2, 2, 2
(ii) 5, 5, 4, 4, 3, 2, 2, 1, 1
(iii) 7, 6, 5, 4, 4, 3, 2, 1
(iv) 4, 4, 4, 4, 3, 3
(v) 3, 3, 3, 3, 3, 3, 3, 3
22. A graph G has 21 edges, 3 vertices of degree 4 and other vertices are of degree 3. Find the
number of vertices in G.
23. Show that there is no graph with the sequence (1, 1, 3, 3, 3, 4, 6, 7).
24. Find the indegree and out degree of each vertex of G.
236 DISCRETE MATHEMATICAL STRUCTURES
Answers:
7. Vertex: v1 v2 v3 v4 v5 v6 v7
Indegree: 0 2 2 4 1 1 2
Outdegree: 4 1 0 0 3 3 1
8. Order of G = 6
Size of G = 10
10. 4 days
13.
14.
GRAPH THEORY 237
15. 0 and 36
16. 23
17. 11
Fig. 8.33
8.8 ADJACENCY
In a graph G, if there is an edge e incident from the vertex u to the vertex v or incident on u and v, then
the vertices u and v are said to be adjacent.
In the graph of Fig. 8.34 (i) The vertices v1 and v2 are adjacent.
Two non-parallel edges in a graph G, are said to be adjacent, if they are incident on the same vertex.
In the graph of Fig. 8.34 (ii) The edges e1 and e2 are adjacent.
(i) (ii)
Fig. 8.34
238 DISCRETE MATHEMATICAL STRUCTURES
a e
a b c d e
a 0 1 0 1 0
b 1 0 0 1 1
G: d Adjacency matrix x; A (G) =
b c 0 0 0 1 1
d 1 1 1 0 1
e 0 1 1 1 0
c
(i) (ii)
Fig. 8.35
Example 2: The adjacency matrix of the graph G, shown Fig. 8.36 (a) is given in 8.36 (b):
(a) (b)
Fig. 8.36
A(G) = [aij]nxn
Where aij = 1 if there is an edge directed from vi to vj
= 0 otherwise.
Example 1: Consider the digraph shown in Fig. 8.37 (a)
The Adjacency matrix is given in 9.37 (b):
(a) (b)
Fig. 8.37
The adjacency matrix of a graph is also called the connection matrix. It has different names in
different disciplines.
In the adjacency matrix of a graph, every non-zero element on diagonal represents a self-loop at the
corresponding matrix. We can find the adjacency matrices of multigraph; but we avoid parallel edges in
the definition of A (G).
Example 2: Find the adjacency matrix or the graph shown in Fig. 8.38.
Solution: The adjacency matrix A (G) of the given multigraph is:
⎛1 3 1 0 0⎞
⎜ ⎟
3 0 0 1 1⎟
A (G ) = ⎜
⎜0 1 0 2 2⎟
⎜⎜ ⎟
⎝0 1 1 2 0 ⎟⎠
v1
v4
v3
v2
Fig. 8.38
240 DISCRETE MATHEMATICAL STRUCTURES
The incidence matrix contains only two elements 0 and 1. Each column in the incidence matrix of a
graph has exactly two 1’s appearing in that column. The sum of 1’s in each row represents the degree of
a vertex corresponding to the row. A row with all 0’s in the incidence matrix represents an isolated
vertex. Two identical columns in an incidence matrix correspond to parallel edges in the graphs G.
(a) (b)
Fig. 8.40
GRAPH THEORY 241
The graph G may equivalently defined by the table in 8.40 (b). Which shows that each vertex in a
followed by its list of adjacent vertices. Here the symbol φ is used to denote the empty list. The table
may also be presented in the form shown below:
G = [A: B, D; B: A, C, D; C: B, E; D: A, B; E: C; F: ∅]
Where a colon “:” seperates a vertex from its list of adjacent vertices and a semicolon “;” seperates
the different lists. The linked representation of a graph G, maintains G in the memory by using its
adjacency lists and will contain two files namely (i) Vertex file and (ii) Edge file. The vertex file will
contain the list of vertices of G, usually maintained by a linked list and the edge file will contain all the
edges of G. Each record of the edge file will correspond to a vertex in an adjacency list and hence,
indirectly to an edge of the graph G.
Example 1: Suppose a graph G is presented by the following table:
G = [A: D; B: C; C: E; D: B, D, E; E: A]
Draw the graph also find the number of vertices and edges in G.
Solution: The graph of G can drawn as shown in Fig. 8.41.
Fig. 8.41
Number of vertices in G = 5
Number of edges in G = 6
Fig. 8.42
242 DISCRETE MATHEMATICAL STRUCTURES
e1 e2 e3 e4 e5 e6 e7 e8
z1 ⎡1 1 1 0 0 0 0 0⎤
z2 ⎢0 1 0 1 1 1 0 0⎥⎥
⎢
z3 ⎢0 0 0 0 0 1 1 1⎥
z4 ⎢1 0 1 1 1 1 0 0⎥
⎥
⎢
z5 ⎢0 1 0 1 1 0 1 1⎥
z6 ⎢⎢1 ⎥
1⎥⎦
⎣ 0 1 1 1 0 1
Fig. 8.43
The distinct paths in the graph G between the vertices u and v are:
P1 : u – b – d –v
P2 : u – c – d – v
GRAPH THEORY 243
P3 : u – c – a – d – v
P4 : u – a – d – v
P5 : u – a – c – d – v
ua ub uc ue ac ad bd cd dv
p1 ⎡0 1 0 0 0 0 1 0 1⎤
p2 ⎢0 0 1 0 0 0 0 1 1⎥⎥
⎢
p3 ⎢0 0 1 0 1 1 0 0 1⎥
p4 ⎢1 0 0 0 0 1 0 0 1⎥
⎥
⎢
p5 ⎢1 0 0 0 1 0 1⎥⎦
⎣ 0 1
E X E R C I S E 8.2
(a)
(b)
(c)
244 DISCRETE MATHEMATICAL STRUCTURES
(d)
(e)
(f)
(g)
GRAPH THEORY 245
(i)
(ii)
(iii)
(iv)
246 DISCRETE MATHEMATICAL STRUCTURES
(v)
⎛0 1 0 1 0⎞ ⎛1 0 0 1⎞
⎜ ⎟ ⎜ ⎟
⎜1 0 0 1 1⎟ ⎜0 0 2 1⎟
(a) ⎜ 0 0 0 1 1⎟ (b) ⎜ 0 2 0 0⎟
⎜ ⎟ ⎜⎜ 1 ⎟
1 0 1 ⎟⎠
⎜1 1 1 0 1⎟ ⎝
⎜0 1 1 1 0 ⎟⎠
⎝
⎛0 1 1 1 0⎞
⎜ ⎟ ⎛1 1 1 2⎞
⎜1 0 0 1 0⎟ ⎜ ⎟
1 0 0 0⎟
(c) ⎜ 1 0 0 1 1⎟ (d) ⎜
⎜ ⎟ ⎜1 0 0 2⎟
⎜1 1 1 0 1⎟ ⎜⎜ 2 ⎟
2 ⎟⎠
⎜ ⎝ 0 2
⎝0 0 1 1 0 ⎟⎠
⎛0 0 0 1 0 1 0 0⎞
⎛0 1 0 1 0⎞ ⎜ ⎟
⎜ ⎟ ⎜0 0 0 0 1 1 1 1⎟
⎜0 0 2 0 0⎟
⎜0 0 0 0 0 0 0 1⎟
(a) X (G ) = ⎜ 0 0 0 0 0⎟ (b) ⎜ ⎟
⎜ ⎟ ⎜1 1 1 0 1 0 0 0⎟
⎜1 0 1 0 1⎟ ⎜0 0 1 1 0 0 1 0⎟
⎜0 0 1 1 0 ⎟⎠ ⎜⎜ ⎟
⎝ 1 0 0 0 0 0 0 ⎟⎠
⎝1
V. The adjacency structure of a graph G is given as
G = [A: B, E; B: A, E, F, G; C: D, G, H; D: C, H; E: A, B; F: G; G: B, C, F; H: C, D]
Answers Exercise 8.2:
I.
⎛0 2 0 1⎞ ⎛0 0 0 1⎞
⎜ ⎟ ⎜ ⎟
0 0 1 1⎟ 1 0 1 1⎟
(a) A(G ) = ⎜ (b) A(G ) = ⎜
⎜2 1 1 0⎟ ⎜1 0 0 1⎟
⎜⎜ 0 ⎟ ⎜⎜ ⎟
⎝ 0 1 1 ⎟⎠ ⎝1 0 1 0 ⎟⎠
GRAPH THEORY 247
⎛0 1 2 0⎞ ⎛1 1 1 2⎞
⎜ ⎟ ⎜ ⎟
(c) A(G ) = ⎜
1 0 1 1⎟
(d) A(G ) = ⎜1 0 0 0⎟
⎜2 1 0 0⎟ ⎜1 0 0 2⎟
⎜⎜ 0 ⎟ ⎜⎜ ⎟
⎝ 1 0 0 ⎟⎠ ⎝2 0 2 2 ⎟⎠
⎛0 1 1 1 1⎞ ⎛0 0 1 0 1⎞
⎜ ⎟ ⎜ ⎟
⎜1 0 1 0 0⎟
⎜0 1 0 1 1⎟
(e) A(G ) = ⎜1 1 0 1 1⎟ (f) ⎜ 1 0 0 1 0⎟
⎜ ⎟ ⎜ ⎟
⎜1 0 1 0 1⎟ ⎜0 1 1 0 2⎟
⎜1 0 1 1 0 ⎟⎠ ⎜1
⎝ ⎝ 1 0 2 0 ⎟⎠
⎛0 1 0 1 0⎞
⎜ ⎟
⎜1 0 1 0 1⎟
(g) A(G ) = ⎜ 0 1 0 1 0⎟
⎜ ⎟
⎜1 0 1 0 1⎟
⎜0 1 0 1 0 ⎟⎠
⎝
II.
⎛1 1 1 0 1 0 0 0⎞ ⎛1 1 0 0 0 0 0 0⎞
⎜ ⎟ ⎜ ⎟
⎜1 0 0 1 0 0 0 0⎟ ⎜0 0 1 1 1 0 0 0⎟
(i) ⎜ 0 0 1 1 0 0 1 1⎟ (ii) ⎜ 1 0 0 0 0 1 0 0⎟
⎜ ⎟ ⎜ ⎟
⎜0 0 0 0 1 1 0 1⎟ ⎜0 0 0 0 1 1 1 1⎟
⎜0 0 ⎟⎠ ⎜0 1 0 1 0 0 1 1 ⎟⎠
⎝ 1 0 0 0 1 1 ⎝
⎛1 0 0 0 0 0 1⎞ ⎛1 0 1 0 0 0⎞
⎜ ⎟ ⎜ ⎟
⎜1 1 1 0 0 0 0⎟ ⎜0 1 1 0 0 0⎟
⎜0 1 0 0 0 0 0⎟ ⎜1 1 0 0 0 0⎟
(iii) ⎜ ⎟ (iv) ⎜ ⎟
⎜0 0 1 1 1 0 0⎟ ⎜0 0 0 1 0 1⎟
⎜0 0 0 0 1 1 1⎟ ⎜0 0 0 1 1 0⎟
⎜⎜ ⎟ ⎜⎜ ⎟
⎝0 0 0 1 0 1 0 ⎟⎠ ⎝0 0 0 0 1 1 ⎟⎠
248 DISCRETE MATHEMATICAL STRUCTURES
⎛1 0 1 1 1 0⎞
⎜ ⎟
⎜0 1 1 0 0 0⎟
(v) ⎜ 0 0 0 0 1 0⎟
⎜ ⎟
⎜1 1 0 0 0 1⎟
⎜0 0 0 1 0 1 ⎟⎠
⎝
III.
(a)
(b)
(c)
GRAPH THEORY 249
(d )
IV.
(a)
(b)
V.
Fig. 8.44
Definition 8.34: A closed walk in which no vertex (except its terminal vertices) appear more than
once is called a circuit.
A circuit in a graph is a closed non-intersecting walk in which every vertex is of degree two (see
Fig. 8.45). A circuit with no other repeated vertices except its end points is called a cycle. The terms a
circuit and cycle or synonymous.
In the Fig. 8.46 (a) v3 – v4 – v5 – v3 is a cycle and in the Fig. 8.46 (b), v1 – v2 – v4 – v5 – v1 is a cycle.
Fig. 8.45
Fig. 8.46
chosen the vertices v1, v2, ... vi, where 1 ≤ i ≤ δ (G). We can find another vertex vi + 1 which is different
from the vertices v1, v2, ... vi, such that vi + 1 is adjacent to vi. Proceeding in this way. We can find a path
of length k in G.
We now state the following theorem without proof:
Theorem 8.5: A closed walk of odd length in a graph G contains a cycle.
8.14 SUBGRAPHS
Definition 8.35: Let G and H be two graphs. H is called a subgraph of G if V (H) is a subset of V (G)
and E (H) is a subset of E (G).
If H is a subgraph of G then
(i) All the vertices of H are in G.
(ii) All the edges of H are in G.
(iii) Each edge of H has the same end points in H as in G.
Example 1: In Fig. 8.47 the graph H is a subgraph of G.
Fig. 8.47
G: v5 v2 v5 v2
v4 v3 v4 v3
G:
Fig. 8.51
then G1 ∪ G2
Fig. 8.52
Example: If
Fig. 8.55
Example:
Fig. 8.56
The complement of H in G is denoted by H (or H (G)). In Fig. 8.58 (a) G is a given graph, and in
Fig. 8.58 (b): H is a subgraph of G. The complement of H in G is shown in Fig. 8.58 (c).
(a) (b) ( c)
8.20 PARTITIONS
Definition 8.47: Let G = (V, E) be a graph. A partition of the vertex set V(G) is a collection {Vi }1 ≤ i ≤ α
of non-empty subsets of V such that
(i) V1 ∪ V2 ∪ V3 ∪ ... ∪ Vα = V , (α ≠ 1)
and (ii) Vi ∩ V j = ∅ whenever i ≠ j
A partition of the edge set E(G) is a collection {Ei} of non-empty subsets of E such that 1 ≤ i ≤ β .
(i) E1 ∪ E2 ∪ E3 ∪ ... ∪ Eβ = E, ( β ≠ 1)
(ii) Ei ∩ E j = ∅ whenever i ≠ j
The partition of the edge set E is also called edge decomposition of G.
Example: Consider the graph shown in Fig. 8.60.
Fig. 8.60
V1 = {a, b, c}, V2 = {d, e, f, g}, V3 = {h, i} is a vertex partition of the vertex set V (G).
and E1 = {(a, c), (c, b)}, E2 = {(c, d), (d, e), (e, f)} E3 = {(e, g)}, E4 = {(g, h)}, E5 = {(g, i)}is an edge
decomposition of G.
Theorem 8.8: A graph G is connected if and only if for any partition of V into subsets V1 and V2 there
is an edge joining a vertex of V1 to a vertex of V2.
Proof: Let G be a connected graph and V = V1 ∪ V2 be a partition of V into two subsets.
Let u ∈ V1 and v ∈ V2 . Since the graph G is connected there exists a u – v path in G say u = v0, v1,
v2, ... vn = v. Let i be the least positive integer such that vi ∈ v2 . Then vi −1 ∈ V1 and the vertices vi −1 , vi
are adjacent. Thus there is an edge joining vi −1 ∈ V1 and vi ∈ V2 .
Conversely
Let G be a disconnected graph.
Then G contains atleast two components.
Let V1 be the set of all vertices of one component and V2 be the set of remaining vertices of G.
clearly V1 ∪ V2 = V and V1 ∩ V2 = ∅.
260 DISCRETE MATHEMATICAL STRUCTURES
The collection {V1, V2} is a partition of V and there is no edge joining any vertex of V1 to any vertex
of V2.
Hence the theorem.
Theorem 8.9: If G is a simple graph with n vertices and k components; then G can have at most
(n – k) (n + k + 1)/2 edges.
Proof: Let G be a simple graph with n vertices and G1, G2, G3, ... Gk be the k components of G. Let the
number of vertices in ith component Gi be ni.
Then
| V(G1) | + | V(G2) | + ... + | V(Gk) | = n1 + n2 + ... + nk = | V(G) | = n where ni > 1
ni (ni − 1)
and max | E (Gi )|≤
2
k
∴ | E (G )| ≤ ∑ max | E (G )|
i =1
i
k
ni (ni − 1)
= ∑ 2
i =1
1⎡ k 2 k
⎤
= ∑
⎢ ni −
2 ⎣⎢ i =1
∑ n ⎥⎦⎥
i =1
i
⎡ k 2 ⎤
∑
1
= ⎢ ni − n ⎥
2 ⎢⎣ i =1 ⎥⎦
1 ⎡ k 2 ⎤
i.e., | E (G ) | ≤ ∑
⎢ ni − n ⎥
2 ⎣⎢ i =1 ⎥⎦
... (1)
Now
k
∑ (n
i =1
i − 1) = (n1 – 1) + (n2 – 1) + ... + (nk – 1)
⎣⎢ i =1 ⎥⎦
k
or ∑ (n
i =1
i − 1) 2 + 2 (non-negative terms) = n2 + k2 – 2nk
k
or ∑ (n
i =1
i − 1) 2 = n2 + k2 – 2nk – 2 (non-negative terms)
GRAPH THEORY 261
or ∑ (n
i =1
i − 1) 2 ≤ n2 + k 2 − 2 n k
k k k
or ∑n
i =1
i
2
+ ∑1 − 2 ∑ n
i =1 i =1
i ≤ n2 + k 2 − 2 n k
or ∑n
i =1
i
2
+ k − 2n ≤ n2 + k 2 − 2 n k
or ∑n
i =1
i
2
− n ≤ n 2 − nk + n − nk + k 2 − k
= n (n – k + 1) – k (n – k + 1)
= (n – k) (n – k + 1)
k
i.e., ∑n
i =1
i
2
− n ≤ ( n − k ) ( n − k + 1)
... (2)
1
m> (n – 1) (n – 2)
2
Since G is a disconnected graph, G has at least two components. Therefore for k ≥ 2, we have
1
m≤ ( n – k ) ( n – k + 1)
2
1
Hence m≤ ( n – 2) ( n – 1)
2
Contradicting our assumption that
1
m> (n – 1) ( n – 2)
2
Therefore graph G is a connected graph.
262 DISCRETE MATHEMATICAL STRUCTURES
(a) (b)
Fig. 8.67
(a) (b) ( c)
Example 3: Find the number of connected graphs with four vertices and draw them.
Solution: There five connected graphs with four vertices (see Fig. 8.70):
Fig. 8.70
Fig. 8.71
8.26 ISOMORPHISM
Definition 8.54: Two graphs G and G ′ are isomorphism if there is a function f : V (G) → V (G′),
from the vertices of G to the vertices of G ′ such that
(i) f is one-one,
(ii) f is onto, and
(iii) For each pair of vertices u and v of G, {u , v} ∈ E (G ) if and only if { f (u ), f (v )} ∈ E (G ′) (i.e.,
f-preserves adjacency).
If f : G → G′ is an isomorphism, then G and G ′ are said to be isomorphic and if two graphs G and
G ′ are isomorphic then there may be several isomorphisms from G to G′.
If two graphs G and G ′ are isomorphic and f : G → G′ is an isomorphic then
(i) |V (G)| = |V (G′)|
(ii) | E (G )| = | E (G′)|
(iii) The degree sequences of G and G ′ are the same.
(iv) If v0 – v1 – v2 – ... – vk – 1 – v1 is a cycle of length G,
then f (v0) – f (v1) – f (v2) – ... – f (vk – 1) – f (v1) is a cycle in G ′.
266 DISCRETE MATHEMATICAL STRUCTURES
Two graphs G and G ′ may have same number of vertices and same degree sequence, but they may
not be isomorphic. The graphs shown in Fig. 8.72 have same degree sequence, send same number of
vertices. But are non-isomorphic.
(a) (b)
Usually we employ the adjacency matrix to check whether or not the given G and G ′ are isomorphic
suppose f : G → G ′ is a one-to-one onto function. Let v0 – v1 – v2 – ... – vn be the vertex ordering of G
and f (v0) – f (v1) – f (v2) – ... – f (vn) be the corresponding vertex ordering of G ′ . Let A (G) denote the
adjacency matrix for the vertex ordering v0 – v1 – ... – vn of G and A (G ′) denote the adjacency matrix for
the vertex ordering f (v0) – f (v1) – ... – f (vn) of G ′. If A (G ) = A (G ′); then we conclude that the graphs
G and G´ are isomorphic and if A (G ) ≠ A (G′) then f is not an isomorphism.
Theorem 8.12: Let G = (V, E) and G ′ = (V ′, E ′) be any two graphs and f : G → G′ an isomorphism.
If v ∈ V then deg (v) = deg f ( v).
Proof: Two points u1 and v1 of v are adjacent in the graph G if and only if f (u1) and f (v1) are adjacent
in G ′. Also f is one-to-one and onto. Therefore the number of vertices which are adjacent to v ∈ V is
equal to the number of vertices in v1 which are adjacent to f (v). Hence deg (v) = deg f (v).
Definition 8.55: An isomorphism of a graph G onto itself is called an automorphism of G.
Fig. 8.73
∅ (b) → c
1
GRAPH THEORY 267
∅ (c) → b
1
∅ (d) → f
1
∅ (e) → c
1
∅ (f) → g
1
∅ (g) → d
1
Example 2: Show that the graphs G and G ′ (in Fig. 8.74) are isomorphic.
(a) (b)
Fig. 8.74
f (a) = v1, f (b) = v2, f (c) = v3, f (d) = v4, f (e) = v5. The adjacency matrix of G for the ordering a,
b, c, d, e and the adjacency matrix of G ′ for the ordering.
a → v1, b → v2, c → v3, d → v4, e → v5 is the matrix.
⎛0 1 1 1 0⎞
⎜ ⎟
⎜1 0 1 0 0⎟
⎜1 1 0 1 0⎟
⎜ ⎟
⎜1 0 1 0 1⎟
⎜ 0 0 1 0 ⎠⎟
⎝0
i.e., A (G ) = A (G′)
Hence G and G ′ are isomorphic.
Example 3: Show that the graph G in Fig. 8.75 has a sub-graph isomorphic to K3, 3. Identify the
sub-graph.
268 DISCRETE MATHEMATICAL STRUCTURES
Fig. 8.75
Solution: Delete the edge {c, f} from G. We get a sub-graph of G whose vertex set can be partitional
into the sets.
A = {a, c, f}, B = {b, d, e} and the sub-graph obtained can be drawn as follows:
Fig. 8.76
Clearly the sub-graph obtained is K3, 3. Hence G has a sub-graph which is isomorphic to K3, 3.
We have | E (G) | = | E (G )|
GRAPH THEORY 269
m (m − 1)
or | E (G) | = | E (G )| =
2
m (m − 1)
or 2 | E (G) | =
2
m (m − 1)
i.e., | E (G )| =
4
m (m − 1)
is an integer and one of m or (m – 1) is odd.
4
i.e., m or (m – 1) is a multiple of 4.
Hence n is of the form 4n or 4n + 1.
Note: From the above it is clear that; a graph G with n vertices is isomorphic to its complement of n or n – 1) is a
n (n − 1)
multiple of 4 and number of edges in G = number of edges in
4
Fig. 8.78
Solution:
(i) Both the graphs G and G1 have same number of vertices i.e., |V (G)| = |V (G1)| = 6.
(ii) Both the graphs G and G1 have same number of edges i.e., |E (G)| = |E (G1)| = 9.
(iii) The degree sequences of G and G1 are same i.e., ( 3, 3, 3, 3, 3, 3).
But the graphs are not labeled. We label the vertices of the graphs as shown in Fig. 8.79:
270 DISCRETE MATHEMATICAL STRUCTURES
Fig. 8.79
Fig. 8.80
Fig. 8.81
Both the graphs G1 and G2 have same number of vertices and same number of edges, but adjacency
is not preserved.
The degree sequence of G1 is (1, 1, 1, 3)
The degree sequence of G2 is (1, 1, 2, 2)
Therefore, G1 and G2 are not isomorphic.
GRAPH THEORY 271
E X E R C I S E 8.3
1. A graph G has 16 edges and each vertex is of degree 2. Find the number of vertices in G.
2. Draw the following graphs:
(a) 2-regular graph
(b) 3-regular graph
(c) K2, 5 (d) K3, 3 (e) N5 (null graph having 5 vertices)
(f) W5 (g) K4 (h) K5
3. A graph G has 35 edges and each vertex of G has degree atleast 3. Show that maximum number
of (Possible) vertices that G can have is 23.
4. Draw the complement of the graph:
6. Show that the graphs G and G1 have the same degree sequence but are not isomorphic:
(b)
(c)
(d )
(e)
GRAPH THEORY 273
9. In the following graphs group those which are isomorphic to each other:
(O.U., MCA, 1991)
(i) (ii)
(iii) (iv)
10. Let Cn be a cycle graph with n vertices. Prove that C5 is the only cycle graph isomorphic to its
complement.
11. Prove that the following three graphs are isomorphic:
13. Show that every cubic (3-regular) graph has even number of points.
14. Prove that two graphs are isomorphic if and only if their complements are isomorphic.
(O.U., MCA, 1995)
15. G1 and G2 are two isomorphic graphs. Show that G2 is connected if G1 is connected.
16. If a graph of n vertices is isomorphic to its complement how many vertices must it have.
17. Prove that the cycle graph C5 is isomorphic to its complement.
18. Show that the graphs G and G1 are isomorphic.
( n − 1) ( n − 2)
19. Prove that a simple graph with n vertices must be connected if it has more than
2
edges.
20. Write down all possible non-isomorphic sub-graphs of the graph G. How many of them are
spanning sub-graphs?
21. Show that maximum number of lines among all p point graphs with no triangle is [P2/4].
22. Define isomorphic graph. Give example. (MKU, 2001)
8.28 FOREST
Definition 8.57: A graph is acyclic if it has no cycles. A forest is an acyclic graph.
Fig. 8.83
If v is a cut vertex of G, then the removal of the vertex v increase the number of components in G.
A cut vertex is also called a cut point.
Theorem 8.13: A vertex v in a connected graph G is a cut vertex if and only if there exist vertices u
and w distinct from v such that every path connecting u and w contains the vertex v.
Proof: Let v be a cut vertex in a connected graph G. Then G – v is disconnected and G – v contains
atleast two components say A and B. Let u be a vertex of A and W be a vertex of B. There is no path in
G –v connecting u and w. Since G is connected there exists a path P from u to w in G. If the path does not
contain v, then the removal of v from G will not disconnect the vertices u and w, which is a contradiction
to the fact that u and v lie is two different components of G – v.
Conversely; if every path from y to w contains the vertex v, then removal of v from the graph G
disconnects u and w. Hence u and w lie in different components of G. Which shows that G – v is a
disconnected graph. Thus v is a cut vertex of G.
Fig. 8.84
A cut set in a graph always breaks the graph G into two parts. Every edge in a tree is a cut set, since
the removal of any edge from a tree breaks the tree into two parts. In the graph shown in Fig. 8.85, the
set of edges {a, c, d, f} is a cut set.
Cut sets are of great importance in studying the properties of networks.
Fig. 8.85
A graph is called a weighted graph is each edge e is assigned a non-negative number w (e) called the
weight of e. The graph G in Fig. 8.88 is a weighted graph.
GRAPH THEORY 277
If G is weighted graph and P is path G, then the weight of the path P is the sum of weights of the
edges in the path.
8.34 CONNECTIVITY
Proof: If graph G is disconnected or trivial then k (G ) = λ (G) = 0. If G is connected and has a bridge
e, then λ = 1. In this case K = 1, since either G has a cut point incident with e or G is K2.
∴ k (G ) ≤ λ (G) when λ (G ) = 0 or 1, finally let us suppose that λ (G ) ≥ 2. The G has λ lines
whose removal disconnects G. Clearly the λ − 1 of these edges produces a graph with a bridge
e = {u, v}. For each of these λ − 1 edges select an incident point which is different from u or v. The
removal of these points (vertices) also removes λ − 1 edges and if the resulting graph is disconnected
then k ≤ λ − 1 < λ. If not the edge e = {u, v} is a bridge and hence the removal of u and v will result in
either a disconnected or a trivial graph. Hence k ≤ λ in each case and this completes the proof of the
theorem.
Thus, the vertex connectivity of a graph does not exceed the edge connectivity and edge connectivity
of a graph cannot exceed the minimum degree of G. Hence the theorem given below:
pk
Example 1: G is (p, q), prove that, if G is K-connected then q ≥ .
2
Solution: Let G be K-connected graph.
Then q ≤ δ (G )
∑ deg (v ) ≥ 2 p δ (G)
1 1
We have q≥ i
2
pk
or q≥
2
GRAPH THEORY 279
Example 2: Find the edge connectivity and the vertex connectivity of the graph in Fig. 8.90.
Fig. 8.90
Solution: The minimum number of edges removal disconnects the graph is 3 and the minimum number
of vertices required to disconnect the graph is 1.
∴ Edge connectivity λ (G ) = 3
Vertex connectivity k (G) = 1.
8.34.3 Girth, Circumference and Diameter
Let G be a graph. The length of the largest simple parts between any two vertices of G is called the girth of
G, while the length of the longest cycle between any two vertices in G is called the circumference of G.
The length of the longest path between any two vertices of a connected graph G is called the diameter of G.
If G is a cycle graph with n vertices (i.e. Cn), then the diameter of G is (n – 1) and the circumference
of G is n.
If G is a complete graph within vertices (i.e. kn), then the circumference of G is n and the diameter
of G is (n–1).
The girth of C3 is 2.
The circumference of C3 is 3 and diameter of C3 is 3/2.
The girth of k4, (complete graph with 4 vertices) is 3.
The circumference of k4 is 4 and the diameter of k4 is 2.
The girth of km, m (complete Bipartite graph) is 2m–1.
The circumference of km, m = 2m if m > 1
=0 if m = 1
The diameter of km, m = m if m > 1
=0 if m = 1
Example 1: The girth of k1, 1 is 1
The circumference of k1, 1 = 0
The radius of k1, 1 = 0
Example 2: The Girth of k3, 3 = 2 ⋅ 3 − 1 = 5
E X E R C I S E 8.4
1. Define
(a) The edge connectivity of a connected graph. (MKU, MCA, 2002)
(b) The vertex connectivity of a graph.
2. Prove that there is no 3-connected graph with 7 edges.
3. If a graph G is not connected then show that G is connected.
4. Let G be a connected graph and v is a point of G, then show that the following are equivalent:
(a) v is a cut point of G.
(b) There exists a partition V – {v} into subsets U and W such that for each u ∈ U and w ∈ W
the points v is on every u – w path.
(c) There exists two points u and w distinct from v such that v is on every v – w path.
5. If e is an edge of a connected graph. Show that the following statements are equal:
(a) e is bridge of G.
(b) There exists a partition of V into two subsets A and B such that for every point u ∈ A and
w ∈ B the edge e is on every u – w path.
(c) There exist two points, u and w such that the edge e is on every u – w path.
6. Show that every non-trivial connected graph has atleast two points which are not cut points.
7. Find the edge connectivity and vertex connectivity of the graph given below:
8. Prove that the vertex connectivity of a graph G can never exceed the edge connectivity of G.
9. Define a connected graph. (MKU, MCA, May 2002)
(a) (b)
If T is a tree, then it has a unique simple non-directed path between each pair of vertices. A tree with
only are vertex is called trivial tree. If T is a not a trivial tree then it is called a non-trivial tree. The vertex
set (i.e., the of nodes) of a tree is a finite set. In most cases the vertices of a tree are labeled.
Theorem 8.17: A simple non-directed graph G is a tree if and only if G is connected and has no cycles.
Proof: Let G be a tree. Then each pair of vertices of G are joined by a unique path, therefore G is
connected. Let u and v be two distinct vertices of G. Such that G contains a cycle containing u and v.
Then u and v are joined by atleast two simple paths, one along one portion of the cycle and the other path
completing the cycle. This contradicts our hypothesis that there is a simple unique path between u and v.
Hence tree has no cycle.
Conversely let G be a connected graph having no cycles. Let v1 and v2 be any pair of vertices of G
and let there be two different simple paths say P1 and P2 from v1 to v2. Then we can find a cycle in G as
follows: Since the paths P1 and P2 are different, there must be a vertex say u, which is on both P1 and P2
but its successor on P1 is not on P2. If u´ is the next point on P1 which is also on P2, the segments of P1
and P2 which are between P1 and P2 form a cycle in G. A contradiction. Hence there is atmost one path
between any two vertices of G, which shows that G is a tree.
Theorem 8.18: Any non-trivial tree has atleast one vertex of degree 1.
Proof: Let G be a non-trivial tree, then G has no circuits. Let v1 be any vertex of G. If deg (V1) = 1,
then the theorem is at once established. Let deg (v1 ) ≠ 1 move along any edge to a vertex V2 incident
with v1. If deg (v2 ) ≠ 1 then continue to another vertex say v3 along a different edge. Continuing the
process, we get a path v1 – v2 – v3 – v4 – ... in which none of the v1i s is repeated. Since the number of
vertices in a graph is finite, the path must end some where. The vertex at which the path ends is of
degree are, since we can enter the vertex but cannot leave the vertex.
Theorem 8.19: A tree T with n vertices has exactly (n – 1) edges.
Proof: The theorem will be prove by mathematical induction on the number of vertices of a tree. If
n = 1 then there are no edges in T. Hence the result is trivial.
If n = 2 then the number of edges connecting the vertices is one i.e., n –1. Hence the theorem is true
for n = 2. Assume that the theorem holds for all trees with fewer than n vertices. Consider a tree T with
n vertices. Let V be a vertex in T of degree 1 and let T ′ denote the graph obtained by removing the
vertex v and edge e associated with it from T. Consider T ′ = T – e.
282 DISCRETE MATHEMATICAL STRUCTURES
T ′ has n – 1, vertices and fewer edges than T. If v1 and v2 are any two vertices in T ′, then there is
a unique simple path from v1 to v2 which is not affected by the removal of the vertex and edge.
T ′ is connected and no edges in it, therefore T ′ is a tree. T ′ has n –1 vertices and n –1–1 = n –2
edges. T has are more edge than T ′.
∴ Number of edges in T = n – 2 + 1 = n – 1. Hence T has exactly n – 1 edges.
Theorem 8.20: Every non-trivial tree has atleast 2 vertices of degree 1.
Proof: Let m denote the number of vertices of degree 1 (i.e., pendant vertices) and n be the number of
vertices in the tree T (where n ≥ 2).
Let v1, v2, v3, ..., vm denote the m vertices of degree 1 in T. Then each of the remaining n – m vertices
vm+1, vm+2, ..., has degree atleast two.
Thus deg (vi) = 1 for i = 1, 2, ..., m
≥ 2 for i = m + 1, m + 2, ..., n
n
or 2(n – 1) ≥ 2n – m
or 2n – 2 ≥ 2n – m
or –2 ≥ – m
or m ≥ 2
Thus T contains atleast two vertices of degree 1.
Theorem 8.21: A graph G is a tree if and only if G has no cycled and |E| = |V| – 1.
Conversely, let G be a graph such that G has no cycles and |E| = |V| – 1. Clearly G is connected.
Let G1, G2, G3, ... Gk be k components of G where K > 1.
G has no cycles, therefore each Gi, is connected and each Gi has no cycle in it.
Number of edges in each Gi = |Vi| – 1
Hence number of edges in G
= |V1| – 1 + |V2| – 1 + ... + |Vk| – 1
= |V1| + |V2| + ... + |Vk| – K
= |V| – K
by hypothesis G has | V | – 1edges
Thus |V|–k=|V|–1
or K=1
The number of components in G is one and G is connected.
Hence G is a tree.
8.36 DISTANCE
If u and v are two vertices of a connected graph G, there may be more than one path joining u and v.
Various concepts can be defined based on the lengths of such paths between vertices of G. The simplest
is given below:
GRAPH THEORY 283
Definition 8.67: If G is connected graph and u and v are any two vertices of G, the length of the
shortest path between u and v is called the distance between u and v and is denoted by d (u, v).
The distance function on defined above has the following properties. If u, v and w are any three
vertices of a connected graph then.
(i) d (u, v) ≥ and d (u, v) = 0 iff u = v
(ii) d (u, v) = d (v, u)
and (iii) d (u, v) ≤ d (u, w) + d (w, v)
from the above, it is clear that distance in a graph is a metric.
Example 1: In the graph shown in Fig. 8.92.
Fig. 8.92
Definition 8.68: Let G be a connected graph. For any vertex v on G, the eccentricity of v denoted by
e (v) is
e (v) = max {d (u, v) : u, v ∈ v}
e (v) is the length of the longest path in G starting from the vertex v.
Example 2: In the graph shown in Fig. 8.93. e (v1) = 3
Fig. 8.93
Definition 8.69: The diameter of a connected r graph G is defined as the maximum eccentricity among
all vertices of the graph G. It is denoted by d.
Hence d = diameter of G = max {e (v ): v ∈ V }
Definition 8.70: The radius of a connected graph G is defined as the maximum eccentricity among all
vertices of the graph. It is denoted by r.
Thus r = radius of G = min {e (v ): v ∈ V }
Note: The radius of connected graph may not be half of its diameter.
284 DISCRETE MATHEMATICAL STRUCTURES
Fig. 8.94
Fig. 8.95
e (v1) = 4, e (v2) = 3, e (v3) = 2,
e (v4) = 3, e (v5) = 4, radius of G = i = 2.
Hence centre of G = {v3}.
Note:
(1) Let G be a connected graph and v1, v2, ..., vn be ‘n’ vertices of G e (v1), e (v2), ... e (vn) is called the
eccentricity sequence of G.
(2) The distance between two adjacent vertices of a connected graph G is 1.
(3) The maximum distance from each vertex of G occurs at a pendant vertices of G.
(4) If C (G) = V (G) then G is called self-centred graph.
(5) If P is a path of even length the P has only one vertex at the centre.
(6) If P is a path of odd length this centre of P contains two adjacent vertices.
Example 5: In the graph shown in Fig. 8.96:
Fig. 8.96
Centre of G = {v3, v4}
GRAPH THEORY 285
Fig. 8.97
Theorem 8.22: If r is the radius and d is the diameter of connected graph G then r ≤ d ≤ 2r.
Proof: From the definition of ‘r’ and ‘d’, we have r ≤ d ... (1)
Let u, v be the ends of a diametral path and w be the central vertex then
D = d (u, v) ≤ d (u, v) + d (w, v) ≤ r (Triangle inequality)
or d ≤ 2r ... (2)
From (1) and (2)
r ≤ d ≤ 2r
Fig. 8.98
286 DISCRETE MATHEMATICAL STRUCTURES
Example 2: Find all the spanning trees of the graph G shown in the Fig. 8.99.
Fig. 8.99
Fig. 8.100
Theorem 8.23: A non-directed graph G is connected if and only f G contains a spanning tree.
Proof: Let T be a spanning tree of G. There exists a path between any pair of vertices in G along the
tree T. G is connected.
Conversely let G be a connected graph and K be the number of cycles in G. If K = 0, then G has no
cycles and G is connected. Therefore G is a tree when K = 0.
Let us suppose that all connected graphs with fewer than K cycles have a spanning tree. Let G be a
connected graph with n cycles. Let e be an edges in one of the cycle. G – e is a connected graph and
G – e contains all the vertices of G.
∴ The spanning tree if G – e is also spanning tree for G.
Hence by mathematical induction the result holds for all connected graphs.
If G is a connected graph and T is a spanning tree of G. Edges of G present in T are called the
branches of G with respect to Tj and the edges of G which do not belong to T are called the chords of G
with respect to T. If G has n vertices and e edges then, the number of branches with respect to the
spanning tree T of G is n – 1 and the number of chords is e – n + 1.
The number of branches in a connected graph G is called the rank of G and the number of chords is
called the nullity of G. If G has k components then the rank of G is defined as the sum of ranks of the
components; i.e.,
GRAPH THEORY 287
k
rank (G) = ∑ rank (G )
i =1
i
k k k
= ∑ (n
i =1
i − 1) = ∑ n − ∑1
i =1
i
i =1
=n–k
where Gi, i = 1, 2, ..., K are K components of G.
k
= ∑ (e
i =1
i − ni + 1)
k k k
= ∑ e −∑
i =1
i
i =1
ni + ∑1
i =1
=e–n+1
8.37.1 Minimal Spanning Tree
Definition 8.73: Let G be a connected weighted graph. A minimal spanning tree of G is a spanning
tree of G whose total weight is as small as possible.
There are various methods to find a minimal spanning tree in connected weighted graph. Here we
consider algorithms for generating such a minimal spanning tree.
8.37.2 Algorithm
A connected weighted graph with n vertices.
Step 1: Arrange the edges of G in the order of decreasing weights.
Step 2: Proceed sequentially, and delete each edge of G, that does not disconnect the graph G until
n – 1 edges remain.
Step 3: Exit.
Example 1: Consider the graph G given below:
Fig. 8.101
288 DISCRETE MATHEMATICAL STRUCTURES
Number of vertices in G = n = 6.
We apply the algorithm given above.
We order the edged by decreasing weights and delete the edges of G until n – 1 = 6 – 1 = 5 edges
remain.
Edges (v2, v3) (v1, v6) (v1, v3) (v2, v5) (v3, v5) (v2, v6)
delete yes yes yes no no yes
Edges (v1, v5) (v4, v6) (v2, v4)
delete no no no
Fig. 8.102
Edges (v2, v4) (v1, v5) (v4, v6) (v2, v6) (v3, v5) (v1, v3) (v1, v6) (v2, v5) (v2, v3)
Weight 2 5 5 6 7 8 8 8 10
Add? Yes Yes Yes No Yes No Yes No No
GRAPH THEORY 289
Fig. 8.103
Selection of the edge (v2, v6) for the spanning tree results in a cycle. Therefore (v2, v6) is not selected
we consider the edge (v3, v5) selection of edge (v3, v5) does not result in a cycle. Hence (v3, c5) is selected.
Next we consider the edge (v1, v3) from the list. Selection of the edge (v1, v3) results in a cycle.
Therefore edge (v1, v3) is not selected. Consider the edge (v1, v6) selection of edge (v1, v6) does not result
in a cycle. Hence (v1, v6) is selected.
Number of edges selected is 5. We stop, and obtain the spanning trees as shown in Fig. 8.104 (e).
Fig. 8.105
We next consider the edges connecting a vertex {v3, v4} with the vertex of the set V – {v3, v4}. We
observe that e6 the edge with minimum weight.
Consider the edges connecting the vertices of the set {v 3 , v 4, v 6} with the vertices of
V – {v3, v4, v6}. The edge e2 has the minimum weight. The edge e2 is selected.
of the connecting the vertices of {v2, v3, v4, v6}; with the vertex set V – {v2, v3, v4, v6}, e4 has minimum
weight, therefore e4 is selected.
Fig. 8.106 (d )
e1, e5 are the edges remaining. e5 is the only edge connecting {v1, v2, v3, v4, v5, v6} and {v5} such that the
inclusion of e5 does not result in a cycle. Hence e5 is selected.
Since number of edges selected is 5 we stop.
The minimal spanning tree obtained is shown in Fig. 8.106 (e).
The level of a vertex in a rooted tree is the length of the path (number of edges) to v from the root.
If T is a rooted tree with designated root v0 and v0 – v1 – v2 – ... –vn – 1 – vn is a simple path in T, then vn – 1
is called the parent of Vn and v0, v1, v2, ..., vn – 1 are called the ancestors of vn.
v1 is a child of v0, v2 is a child of v1, ....
If T is a rooted tree with designated vertex v0 and u and v are two vertices (nodes) in T, then
(i) u is called a leaf of T, if it has no children (i.e., leaves of T are vertices of T with degree 1).
(ii) y is a descendant of u, if u is an ancestor of v.
(iii) Is an internal vertex of T, if v is not a leaf of T.
(iv) The sub-graph of T consisting of v and all its descendants with v as the designated root is a
sub-tree of T rooted at v.
If T is a rooted tree then the maximum vertex level of T is called the depth of the tree. We usually
adhere to the universal convention of representing the root of the tree as the top vertex (apex) of the tree.
Rooted trees are useful in enumerating all the logical possibilities of a sequence of events where each
event can occur in finite number f ways. If edges leaving each vertex of a rooted tree T are labeled, then
T is called an ordered rooted tree. The vertices of an ordered to rooted can be labeled as follows: we
assign 0 to the root of the tree. We next assign 1, 2, 3, 4, ... to the vertices immediately following the root
of T according as the edges were ordered. The remaining vertices can be ordered as follows: If p is the
label of a vertex v of T then p1, p2, p3, ... are assigned to the vertices immediately following v according
as the edges were ordered. The tree in Fig. 8.108 is an ordered rooted tree.
r is the root of the tree in Fig. 8.108. The vertices of T are labeled with their addresses. The system
is known as universal address system for an ordered rooted tree.
Fig. 8.109
The variables in the algebraic expression appear as the other vertices. In the polish prefix
representation, we place the binary operational symbol before the argument and avoid parentheses. The
expression (a – b)/((c × d) + e) can be expressed as /– ab + × cde.
Example: Write the following expression as a tree:
[(a × b) × c + (d + e) – (f – – (g × h))]
Solution: The arithmetic expression [(a × b) × c + (d + e) – (f – – (g × h))] can be represented as the
tree.
Fig. 8.110
decision-making. They are extensively used in the study of computer search methods, binary identification
problems and coding theory.
Definition 8.75: A tree in which there is exactly one vertex of degree two, and each of the remaining
vertices of degree one or three, is called a binary tree.
If T is a binary tree, the vertex of degree two which is distinct from all the other vertices of T serves
as a root of T. Thus every binary tree is a rooted tree. The vertices of degree one in a binary tree are
called external vertices and all the remaining vertices are called internal vertices. The number of internal
vertices in a binary tree is one less than the number of pendant vertices.
The leaves of binary tree are vertices of degree one. Usually the roots in graph theory are portrayed,
with the root and the leaves at the bottom. The direction from the root to leaves is taken as the down
direction and the direction from the leaves to the root is taken as the up direction. The number of internal
vertices in a binary tree is one less than the number of external vertices (pendant vertices). If vi is vertex
of a binary tree. vi is said to be at a level li if vi is at a distance li from the root of the binary tree. Thus the
root a binary tree is at level 0.
The maximum level occurring in a binary tree is called the height of the binary tree. A binary tree
with minimum height contains maximum number of vertices at each level. The root of a binary tree is at
level 0 and there can be only one vertex at 0 level. The maximum number of vertices at level is 21, at
level 2 is 22 and soon. By induction we can prove that the maximum number of vertices possible at level
k in a binary tree is 2k. We now state the following theorem on the minimum possible height of a binary
tree:
Theorem 8.24: The minimum height of a binary tree on n vertices is ⎡⎢log 2 ( n + 1) − 1⎥⎤ (where ⎢⎡ m ⎥⎤ is
n −1
the smallest integer > m) and maximum possible height is .
2
Proof: The root of T is at level 0. We know that every vertex of T at level k can have 2k. successors.
Therefore we have
296 DISCRETE MATHEMATICAL STRUCTURES
2 vertices at level 1
22 vertices at level 2
Hence the maximum number of vertices in the binary tree of height l is
1 + 2 + 22 + ... + 2l
but T has n vertices, therefore
1 + 2 + 22 + ... + 2l ≥ n
2l +1 − 1
or ≥n
2 −1
or 2l+1 – 1 ≥ n
or 2l+1 ≥ n + 1
Hence l ≥ log2 (n + 1) – 1
but l is an integer
The smallest possible value for 1 is
⎡⎢log 2 ( n + 1) − 1⎤⎥
The minimum possible height of a binary tree T is
⎡⎢log 2 ( n + 1) − 1⎤⎥
Now let denote the maximum possible height of T. We have the root of T at zero level, 2 vertices at
level, 2 vertices at level 2, ...
2 vertices at level l.
When T is of height l, we have atleast 1 + (2 + 2 + ...l times) vertices in T.
i.e., 1 + 2l vertices in T
Hence 1 + 2l ≤ n
⇒ 2l ≤ n – 1
n −1
⇒ l≤
2
but n is odd
n −1
is an integer. Hence
2
n −1
The maximum possible value of l is .
2
Thus, we have
min l = [log2 (n + 1) – 1]
n −1
and max l =
2
GRAPH THEORY 297
Fig. 8.113
n +1
Example 3: T is a binary tree on n vertices. Show that the number of pendant vertices in T is .
2
Solution: Let p denote the number of pendant vertices in T.
The number of edges in T is n – 1
The degree sum in T = 2 (n – 1)
Therefore P × 1 + (n – p – 1) + 2 = 2 (n – 1)
or P + 3n – 3p – 3 + 2 = 2n – 2
or n + 1 = 2p
n +1
Hence P=
2
Example 4: Find the maximum possible height of a binary with 13 vertices and draw graph of the tree.
Solution: We have n = 13
n − 1 13 − 1
Maximum possible height of the binary tree = =6
2 2
298 DISCRETE MATHEMATICAL STRUCTURES
If T is a complete binary tree with n vertices, then the vertices at any level l are given the label
numbers ranging from 2l to 2l + 1 – 1 or from 2l to n if n is less than 2l + 1 – 1.
h+3
1 ⎡1 + 5 ⎤
Theorem 8.25: There are atleast ⎢ ⎥ − 2 vertices in any height balanced binary tree
5 ⎣ 2 ⎦
with height h.
8.44 B-TREE
Definition 8.78: Let T be a directed tree of order k.
T is said to said to be a B-tree of order k, if
(i) all the leaves are at the same level;
(ii) every internal vertex, except possibility the root has atleast ⎡⎢ k /2⎤⎥ children (where ⎡⎢ x ⎤⎥ means
the least integer > x);
(iii) The root is a leaf or has atleast two children; and
(iv) no vertex has more than k children.
E X E R C I S E 8.5
13. Prove that there is one and only one path between every pair of vertices in a tree.
14. If in a graph G, there is one and only are path between every pair of vertices then show that G is
a tree.
15. Show that any connected graph with n vertices and n – 1, edges is a tree.
16. If two adjacent vertices of a tree are connected by adding an edge, then show that the resulting
graph is a cycle.
17. State Kruskal’s algorithm for find the minimal spanning tree. (O.U., MCA, 1998)
18. Define term (i) Connected graph (ii) Spanning tree prove that every connected graph has one
spanning tree. (O.U., MCA, 1991)
19. Prove that every non-trivial tree contain atleast 2 vertices of degree 1. (O.U., MCA,
1991)
20. Define a binary tree and desire a formula for the maximum possible height of a binary tree with
n vertices.
21. How many different non-isomorphic trees of order 4 are possible. Draw them. (O.U., MCA, 1994)
22. Prove that if a connected graph G has only are spanning tree, them G itself is a tree.
(O.U., MCA, 1995)
23. Draw a balanced binary tree of height 4 with minimum number of vertices.
(O.U., MCA, 1996)
24. Show that a simple non-directed graph G is a tree if and only if it is connected and has no cycles.
(O.U., MCA, 1998)
25. Let H be a subgraph of a connected graph G. Show that H is a subgraph of some spanning tree T
if H contains no cycles. (O.U., MCA, 1999)
26. Determine a railway network of minimal cost for the cities in the Figure given below:
27. Find the minimal spanning tree for the following graph:
GRAPH THEORY 303
If G is a graph, then we denote the embedding of G on a surface S by S (G). The vertices, edges and
faces of S (G) constitute a map on the surface S. If S is the plane ∏ then the vertices edges, and faces of
S (G) constitute a planar map. It is denoted by ∏ (G). In a planar embedding of ∏ (G), all faces except
one are bounded. The unbound face is called the exterior face (infinite face or outer face). Region in a
map which have atleast one common edge are called adjacent regions.
8.48.4 Polyhedral Graph
Definition 8.86: A plane connected graph in which each region has degree equal to or grater than 3
and each vertex has degree equal to or greater than 3 is called a polyhedral graph.
A planar graph may have different planar representations. The number of regions resulting from
each embedding is always the same. If G is a planar graph, then the number of vertices, number of edges
and the number of regions in G are inter-connected. The number of regions in G can be computed by
Euler’s formula.
8.48.5 Eulers Formula
Theorem 9.26: If G is a connected plane graph then
|V| – |E| + |R| = 2
Where |V| denotes the number of vertices in G
GRAPH THEORY 305
∴ |V | – | E | + | R | = |V ′ | – {| E ′ | – 1} + | R′ | – 1
= |V 1 | – | E ′ | + 1 + | R′ | – 1
= |V ′ | – | E ′ | + | R′ | = 2
By mathematical induction the result holds for all connected graphs.
Corollary: If G is a simple connected planar graph with |E| > 1, then
(i) |E| ≤ 3 |V| – 6
(ii) There is a vertex v of G such that , deg (v) ≤ 5.
Proof: of (i) G is a simple connected planar graph.
Therefore, each region of G is bounded by atleast three edges and each edge belongs exactly to two
regions.
i.e., 2 |E| ≥ 3 |R|
2
or |R| ≤ |E |
3
2
or |V| + |R| ≤ + | E|
3
by Euler’s formula
|V| – |E| + |R| = 2
or |V| + |R| = |E| +2
substituting in L.H.S. of (1) we get
2
|E| + 2 ≤ |V| + | E|
3
or 3 |E| + 6 ≤ |V| + 2 |E|
or |E| ≤ |V| – 6
306 DISCRETE MATHEMATICAL STRUCTURES
Then ∑ deg (v ) = 2 | E |
v ∈V
or 18 ≥ 20, a contradiction
Hence K3,3 in non-planar
Note: The graph K 5 is called Kuratowski’s first graph and K 3, 3 is called Kuratowski’s second graph
(see Fig. 8.120(a) and (b)).
Fig. 8.121
Example 4: Show that the graphs K2, 2, K2, 3 and K2, 4 are planar.
Solution: The graphs of K2, 2, K2, 3 and K2, 4 are shown in Fig. 8.122(a), (b) and (c) respectively.
a a b
b a b
c f
c d c d e d e
Fig. 8.122
The planar embeddings of K2, 2, K2, 3 and K2, 4 are shown in Fig. 8.123 in which can set that the edges
of the graphs can be drawn without crosso-vers.
308 DISCRETE MATHEMATICAL STRUCTURES
Fig. 8.124
Solution: The edges of G shown in Fig. 8.124 can be drawn without cross-overs. The planar embedding
of G is shown in Fig. 8.125:
Fig. 8.125
Example 6: Prove that no polyhedral graph with exactly 30 edges and 11 regions exists.
Solution: We have |E| = 30, |R| = 11
From Euler’s formula
|V| – |E| + |R| = 2
⇒ |V| = |E| – |R| + 2 = 30 – 11 + 2 = 21
If the graph is polyhedral,
Each vertex has degree equal to or greater then 3 and we must have 3 |V| ≤ 2 |E|.
GRAPH THEORY 309
Fig. 8.127
Solution: The dual of G is shown in Fig. 8.128 if the edges of G* are shown by dashed edges:
The dual of a graph depends on the embedding of the graph in the plane and the same graph may
have different geometric duals for different embeddings. All duals of a planar graph are 2-isomorphic.
Now we state the following theorem (without proof) which gives a criterion for a graph to be a planar
graph.
Theorem 8.27: A graph is planar if and only if it has a dual.
Let G be a planar graph and G* denote the dual of G. If G and G* are isomorphic to each other then
G is called a self-dual.
Fig. 8.131
E X E R C I S E 8.6
7. Show that there is no map of five regions in the plane such that every pair of regions are adjacent.
8. Give an example for a self-dual graph other than K4. (MKU, MCA, May 2002)
9. Give an example of a plane connected graph such that |E| = 3 |V| – 6.
10. Show that K3, 3 satisfies the inequality |E| ≤ 3 |V| – 6, but it is non-planar.
11. Count the number of vertices, the number of edges and the number of regions of each map and
verify Euler’s formula.
Fig. 8.132
The problem was to begin at any one of the four land areas (A, B, C, D in Fig. 8.132) walk across
each bridge exactly once and return the starting point. Many attempts were made to solve this problem.
Euler proved that a solution to this problem does not exists.
Euler represented, each land area by a point and joined two such points by a line. If a bridge existed
connecting the land areas. Fig. 8.133 shows this representation.
Each point in the graph represents a land area and each line in the graph represents a bridge.
Euler generalised the problem and developed a criterion for a given graph to be traversable satisfying
the given conditions.
8.52.1 Euler Path
Definition 8.93: Let G be a multigraph. An Euler path is G is a path that includes each edge of G
exactly once and intersects each vertex of G atleast once.
8.52.2 Traversable Graph
Definition 8.94: A graph G is said to be traversable, if it has a path.
Fig. 8.135
Note: An Euler graph need not connected. If G is connected Euler graph, then starting from any vertex say V0 of
G, entire graph G can be drawn without lifting the pen, ending at V0 and vice versa.
316 DISCRETE MATHEMATICAL STRUCTURES
Theorem 8.31: The following statements are equivalent for a connected multigraph G.
(1) G is Eulerian.
(2) Every point of G has even degree.
(3) The set of edges of G can be partitioned into cycles.
Proof:
(1) ⇒ (2) Let p be an Eulerian path in G. Each occurrence of a given vertex in P contributes two
to the degree of that vertex and since each of G appears exactly once in p, every vertex of G
must be of even degree.
(2) ⇒ G is connected and non-trivial, therefore degree of every vertex in G is atleast two and G
contains a cycle say Z1. The removal of the edges of Z1 results in a spanning subgraphs G1, in
which every vertex has even degree. If G1 has no edges, then all the edges of G form a cycle
and (3) holds otherwise the argument can be repeated until we obtain a totally disconnected
graph Gn.
G1, G2, G3, ... Gn contain the set of edges of G, which partition G into n cycles. Hence
proved.
(3) ⇒ (1). Let G be partitioned into cycles and Z1 be are of the cycles. If Z1 is the only cycle
graph, G is Eulerian otherwise, let Z2 be another cycle in G and V be a common vertex of Z1
and Z2. The walk beginning at V and consisting of cycles Z1 and Z2 in succession is a closed
trial containing all the edges of Z1 and Z2. Continuing this process we obtain a closed trial
which contains all the edges of G. Hence G is Eulerian.
Theorem 8.32: If a graph G has more than
(i) Two vertices of odd degree, then there can be no Euler path in G.
(ii) If G is connected graph and has exactly two vertices of odd degree, there is an Euler path in G.
Any Euler path in graph G must begin at vertex of odd degree and end at the other.
Proof:
(i) Let G be a graph having more than two vertices of odd degree and let v1, v2 and v3 be the
vertices of odd degree in G. If there is an Euler path in G, then it must leave (arrive) each of
the vertices. Let one of the vertices say v1, be the beginning of the Euler path in G and another
vertex say v2 be the end of the path. But this leaves the vertex v3 at one end of an untravelled
edge. Thus, there can be no Euler path in G.
(ii) Let u and V be two vertices of odd degree in G. By adding the edge {u, v} to G we can produce
a connected graph say G1, all of whose vertices are of even degree.
GRAPH THEORY 317
Since G ′ is a connected graph and every vertex of G ′ is of even degree, we can find an Euler
circuit C in G ′. Deleting the edge {u, v} from C, we get an Euler path that begins at u (or v) ends at v
(or u).
If G is a graph in which there are 0 two vertices of odd degree then G has Euler path and G is
traversable. If all the vertices are of even degree, then G has an Euler circuit and G is traversable. The
graphs shown in Fig. 8.137 are Eulerian.
Solved Examples
Example 1: Show that graph G (Fig. 8.138) is Eulerian and find an Eulerian circuit in G.
Fig. 8.138
Solution: Each vertex is of even degree in G (there 0 vertices of odd degree). Therefore, G is Eulerian.
A B C D E A C E B D A is an Eulerian circuit in G.
Example 2: Show that the graph G. Shown in Fig. 8.139 is not Eulerian.
Fig. 8.139
318 DISCRETE MATHEMATICAL STRUCTURES
Solution: There are four vertices of degree 5 in the graph, a, b, c, d are the vertices degree 5 in G.
Therefore, G is not Eulerian.
E X E R C I S E 8.7
(a) (b)
A Hamiltonian cycle in a graph of n vertices consists of exactly n edges usually we consider only
simple graphs which do not include self-loops of parallel edges. A given graph may contain more than
are Hamiltonian cycle.
Rules for constructing Hamiltonian paths, and cycles in a graph G.
Rule 1: If G is a graph with n vertices, then a Hamiltonian cycle in G will contain exactly n edges.
Rule 2: There cannot be more than three are more edges incident with one vertex in a Hamiltonian
cycle in G. Every vertex v in a Hamiltonian cycle (circuit) of G will contain exactly 2 edges incident on
v. If v is a vertex in G then a Hamiltonian path in G must contain atleast one edge incident on v at most
2 edges incident on v.
Rule 3: A Hamiltonian path or cycle constructed in G must contain all the vertices of G.
Rule 4: Let V be a vertex of G. Once a Hamiltonian circuit (cycle) we are constructing has passed
through v, then all the other unused edges incident on v can be deleted.
Example 1: Consider the graph G in Fig. 8.141
{a, b}, {b, c}, {c, d}, {d, e}, {e, f}, {f, g} is a Hamiltonian path in G.
Fig. 8.141
Theorem 8.33: In a complete graph with n vertices there are (n – 1)/2 edge-disjoint Hamiltonian
cycles, if n is an odd number ≥ 3.
n (n − 1)
Proof: Let G be a complete graph with n vertices where n is odd and n ≥ 3. Then G has
2
edges. A Hamiltonian cycle in G contains n edges. Therefore, the number of edge-disjoint Hamiltonian
cycle in G cannot exceed (n – 1)/2. We show that there cycles in G as follows.
The subgraph of G, shown in Fig. 8.142 is a Hamiltonian cycle.
Fig. 8.142
Keeping the vertices fixed on a circle, rotate the polygonal pattern clockwise by
360 2 ⋅ 360 (n − 3) 360
, , ⋅ degrees.
n –1 n −1 2 n −1
Observe that each rotation produces a Hamiltonian circuit that has no edge in common with any of
the previous ones. Thus, we have (n – 3)/2, new Hamiltonian cycles all edges disjoint from the one in
Fig. 8.141 and also edge disjoint among themselves. Therefore, the number of edge-disjoint Hamiltonian
cycles in G is
( n − 3) n −1
+1=
2 2
Hence proved.
Example 1: If G is a complete graph with 7 vertices (i.e., kn), then the number of edge disjoint
7 −1
Hamiltonian cycles is = 3.
2
Example 2: Show that the graph G in Fig. 8.143 is not Hamiltonian.
Fig. 8.143
322 DISCRETE MATHEMATICAL STRUCTURES
Solution: G has 21 edges and 10 vertices. Therefore any Hamiltonian cycle in G should have 16 edges
and Hamiltonian path in G must contain exactly 15 edges. In the graph G we have
deg (l) = deg (h) = deg (j) = 5
i.e., there an three vertices of degree, therefore atleast three edges on l cannot be included in any
Hamiltonian path. The same is true for the vertices h and j. There are 13 vertices of degree 3 in three
consider the vertices b, d, f and n. Each of there vertices is of degree three. Atleast one of the three edges
incident in each of there vertices cannot be included in any Hamiltonian path. Thus atleast 3 + 3 + 3 + 4
= 13 edges cannot be included in any Hamiltonian path. The number of remaining edges is 27 – 13 = 14.
But any Hamiltonian path it is not possible to construct a Hamiltonian with the remaining 14 edges.
Thus G has no Hamiltonian path in G and G is not Hamiltonian.
Example 3: Show that are graph shown in Fig. 8.144 has no Hamiltonian cycle. But the graph has a
Hamiltonian path.
Solution: G has 9 vertices
∴n=9
number of edge in any Hamiltonian cycle in G is 9. There are 3 vertices of degree two in G. Therefore
all the edges incident on the vertices d, e and f must be included in any Hamiltonian cycle. The edges {a,
d}, {d, g}, {b, e}, {c, f}, {f, i} must be included in constructing a Hamiltonian cycle. The degree of b is
3 when the edges given above are included and we include the edge {a, b} in the Hamiltonian cycle, we
delete the edge {b, c}. Then we must include {a, c} in the Hamiltonian cycle. Thus the degree of a
would be 3. Hence no Hamiltonian cycle exists in G. However, the exists a Hamiltonian path in G the
edges.
{a, d}, {d, g}, {g, h}, {e, b}, {b, c}, {c, f}, {f, i} when included will give us a Hamiltonian path in
G. i.e., a – d – g – h – e – b – c – f – i is a Hamiltonian path in G. It is shown in the Fig. 8.145.
Fig. 8.144
8.53.1 Diagonal
Definition 8.100: Let G be a plane Hamiltonian graph and C be a fixed Hamiltonian cycle in G. A
diagonal with respect to C is an edge of G that does not lie on G.
Theorem 8.34: Let G be a simple plane graph with n vertices and C be a Hamiltonian cycle in G. If ri
denotes the number of regions of G in the interior of C whose boundary contains exactly i edges and ri
denotes the number of regions of degree i in the exterior of C, then
n
∑ (i − 2) (r
i =3
i − ri1 ) = 0
Proof: G is a simple planar graph, therefore none of the edges of G intersect. We first consider the
interior of C. Suppose that exactly d diagonal occur in the interior of C. A diagonal splits the region
through which it passes into two parts. Each time a diagonal is inserted in the interior of C, the number
of regions in C is increased by 1. Hence
n n
∑
i =3
ri = d + 1 ⇒ d = ∑r − 1
i =3
i
N counts each diagonal twice and each edge of C exactly once, therefore
n
N= ∑i r = 2d + n
i =3
i
n
Hence ∑ (i − 2) r
i =3
i =n−2 ...(1)
∑ (i − 2) r ′ = n − 2
i =3
i ...(2)
∑ (i − 2) (r
i =3
i − ri′) = 0
324 DISCRETE MATHEMATICAL STRUCTURES
Example 1: Show that there are no Hamiltonian planar graphs with regions of degree 5, 8, 9 and 11
with exactly one region of degree 9.
Solution: From Grinberg’s theorem we have
(5 – 3) ( r5 – r5′) = 0, (8 – 2) ( r8 – r8′ ) = 0
(9 – 2) ( r9 – r9′) = 0, (11 – 2) ( r11 – r11′ ) = 0
Adding we get
2(r5 – r5′ ) + 6(r8 – r8′ ) + 7(r9 – r9′ ) + 9(r11 – r11′ ) = 0
There is exactly one region of degree 9, therefore, we get
3( r5 – r5′ ) + 6(r8 – r8′) + 7( ± 1) + 9(r11 – r11′ ) = 0
or 3( r5 – r5′ ) + 6(r8 – r8′) + 9(r11 – r11′ ) = ± 7
or 3[( r5 – r5′) + 2( r8 – r8′) + 3( r11 – r11′ )] = ± 7
i.e., 3 is divisor of ± 7 a contradiction.
Hence there cannot be Hamiltonian planar graphs with regions of degree 5, 8, 9 and 11 with exactly
one region of degree 9.
Example 2: Show that the graph G in Fig. 8.146 is not Hamiltonian.
Fig. 8.146
or ( r4 – r4′ ) + 2( r6 – r6′ ) = 0
or ( r4 – r4′ ) = – 2( r6 – r6′ )
Hence the difference between r4 and r4′ must be a multiple of 2 (i.e., even)
But ( r4 – r4′ ) = 3
The possibilities are 0, 3, and 1, 2. The difference between 0 and 3 is not even. Similarly, the
difference between 1 and 2 is also not even.
Hence there cannot be a Hamiltonian cycle in the graph.
E X E R C I S E 8.8
(b)
(c)
5. Are the graphs given below in Figures (i) and (ii) are Hamiltonian. If yes find the Hamiltonian
circuits. (O.U., MCA, 1991)
6. Show that there are no planar Hamiltonian graphs of degree 4, 5 and 8 with only one region of
degree 4.
7. In the graph shown below, prove that any H-cycle can include exactly two of the edges {a, h},
{c, d}, {i, j}. Further, if H-cycle includes {d, e}, {e, j} the H-cycle cannot include (a, h}.
8. Define Hamiltonian circuit and a Hamiltonian path. (MKU, MCA, May 2002)
GRAPH THEORY 327
9. Show that the graph G given below has a Hamiltonian cycle but no Euler circuit:
Fig. 8.147
Colours are usually represented by positive integers. Thus n-colouring of a graph G is a function f:
V (G) → (1, 2, ..., n)
328 DISCRETE MATHEMATICAL STRUCTURES
Fig. 8.148
Fig. 8.149
Which are at even distance from v have colour 1. Since T is connected and has atleast two vertices
it contains atleast are edge (and there is one and only one path between two vertices in T ) T is not 1-
colourable. Hence T can be property coloured with 2 colours. Therefore, chromatic number T is 2.
Theorem 8.39: It Δ (G ) denoted Max {deg G (V): u ∈ V }for any graphs G, then X (G) ≤ Δ (G ) + 1.
Theorem 8.40: A graph G containing atleast one edge is 2-chromatic if and it contains no odd cycles.
Proof: Let G be a connected graph with cycles of only even lengths. Consider a spanning tree T of G.
We know that T can be properly coloured with two colours. Now add edges (of G which are not in T )
one by one. Since G has no cycle of odd length the end vertices of every edge being replaced are
differently coloured in T. Thus G is properly coloured with two colours i.e., G is 2-chromatic.
Conversely, let G be a 2-coloured graph with atleast one edge. If G has a cycle of odd length, we
would need atleast three colours just for that cycle. But G is 2-chromatic, hence G contains no odd
cycles.
8.54.3 Five-Colour Theorem
We shall now show that every planar graph can be properly coloured with five colours.
Theorem 8.41: Every planar graph is 5-colourable.
Proof: We shall prove the theorem by induction on the number n of vertices. Since any planar graph
with 1, 2, 3, 4 or 5 vertices can be properly coloured with five colours, we assume that vertices of every
planar graph with n – 1 vertices can be properly coloured with five colours, and then prove that any
planar graph G with n vertices requires five colours for proper colouring.
Let G be a planar graph with n vertices. Since G is planar, it must have atleast one vertex of degree
five or less. Let v denote the vertex.
Let G ′ = G − v, then G ′ has n – 1 vertices and G ′ requires no more than 5 colours. Suppose that
the vertices of G ′ have been properly coloured and now we add the vertex v and all the edges incident
of v to G ′. If the degree of is 1, 2, 3 or 4, we can assign a colour to v so that the vertices of G are properly
coloured. We now consider the case in which the degree of v is 5 and all the five colours are used for
colouring the vertices of G adjacent to v. Let v1, v2, v3, v4 and v5 denote the vertices of adjacent to v in G
coloured with C1, C2, C3, C4 and C5 respectively.
Let H1 denote the subgraph of G generated by the vertices coloured C1 and C3. If v1 and v2 belong to
the different components of H1 interchange the colours C1 and C3 in the component containing v1 and
assign ten colour C3 to the vertices v1 and v3. We get the proper colouring of G by assigning colour C1 to
the vertex v.
If v1 and v3 are in the same component of H, then there exists a v1 – v3 path in G all of whose points
are coloured alternatively with the colours C1 and C3. (see Fig. 8.146). Since G is planar a similar path
between the vertices v2 and v4 coloured alternatively with colours C2 and C4 cannot exist. Let H2 denote
the subgraph generated by the vertices coloured C3 and C4 i then v2 and v4 belong to different components
of K. We can interchange the colours C2 and C4 in the component containing v2. When the vertices v2
and v4 are assigned the colour C4, we can choose the colour C2 to paint the vertex v and obtain a proper
colouring of G. This completes the proof.
8.54.4 Four-Colour Conjecture
So far we have discussed proper colouring of vertices and proper colouring of vertices of edges of a
graph. Now, briefly consider the proper colouring of regions in planar graphs such that no two adjacent
region receive the same colour.
The four-colour problem states that every plane map however complex, can be coloured with four
colours in such a way that two adjacent regions get different colours, fascinated mathematicians. This
GRAPH THEORY 331
problem was solved by Appel and Hanken in 1976. However, this problem is infact equivalent to the
statement of conjecture.
Four-colour conjecture: Every planar graph is 4-colourable.
Example: The graph K4 is a planar graph and K4 is 4-colourable (Fig. 8.150)
Fig. 8.150
Fig. 8.151
332 DISCRETE MATHEMATICAL STRUCTURES
Fig. 8.152
In the graphs of Fig. 8.152. {a, c, d} and {b, e} are independent sets.
Fig. 8.153
Definition 8.109: Let G be any graph. A subset V ′ of the vertex set V (G) is called a maximally
independent set of G if
GRAPH THEORY 333
Fig. 8.154
∑(
i =1
λ
i ) Ci
where each Ci has to evaluated individually for the given graph. If G is a graph with atleast one edge,
then G requires atleast two colours for proper colouring of G, therefore C1 = 0. If G has n vertices, then
can be properly coloured using in n! ways, therefore C1 = 0.
If G has n vertices; then can be properly coloured using n colours in n! ways. Therefore cn = n!
If G is a complete graph (Kn) on vertices, we have ei = 0 for i = 1, 2, 3, ..., n – 1 and cn = n! Therefore,
n
λ (λ − 1)(λ − 2) ... (λ − n + 1)
Pn (λ ) = ∑(
i =1
λ
i ) Ci =
n!
⋅ n!
= λ (λ − 1) (λ − 2) ... (λ − n + 1)
If G = K4 (i.e., complete graph on 4 vertices)
334 DISCRETE MATHEMATICAL STRUCTURES
We have C1 = C2 = C3 = 0 and C4 = 4!
Hence the chromatic polynomial of G is
λ (λ − 1)(λ − 2)(λ − 3)
P4 (λ ) = ⋅ 4!
4!
= λ ( λ − 1)( λ − 2)(λ − 3)
Solved Examples
Example 1: Show that the chromatic polynomial of a graph G is
λ (λ − 1) (λ − 2) ... (λ − n + 1)
if and only if G is a complete graph on n vertices.
Solution: With λ colours, the first vertex of a G can be coloured in λ ways. A second vertex can be
coloured in (λ − 1) ways, the third vertex can be coloured in λ − 3 ways if and only if the third vertex
is adjacent to first-two vertices.... and the nth vertex can be coloured in λ − n + 1 ways if and only if
every vertex is adjacent to every other, that is if and only if G is complete.
Example 2: Find the chromatic polynomials of the graph shown in Fig. 8.155.
Fig. 8.155
Solution: G has a triangle therefore G requires minimum 3 colours for proper colouring.
We have C1 = 0, C2 = 0
When we have three colours the vertices of the triangle formed by 3 points for example say V1, V2,
V3 can be properly coloured in 3! ways. The vertex V4 can be assigned the colour of V2 and V5 can be
assigned of the vertex V3. Thus C3 = 3! = 6.
When we have 4 colours, we can take any four vertices say V1, V2, V3 and V4 of G and properly be
coloured with the 4 colours in 4! ways. The fifth vertex can be assigned the colour the vertex V2 or of V3.
Thus C4 = 2.4! = 48 and we have C5 = 5!
Hence, the chromatic polynomial of G is
λ ( λ − 1) (λ − 2) λ ( λ − 1)( λ − 2) (λ − 3)
P5 (λ ) = 3! + 2 ⋅ 4! +
3! 4!
λ (λ − 1) (λ − 2)(λ − 3)(λ − 4)
5!
5!
= λ (λ − 1) (λ − 2) + 2 λ (λ − 1)(λ − 2)(λ − 3) +
λ (λ − 1) (λ − 2)(λ − 3) (λ − 4)
GRAPH THEORY 335
= λ (λ − 1) (λ − 2) [1 + 2(λ − 3) + (λ − 3) (λ − 4) ]
= λ (λ − 1) (λ − 2)[λ 2 − 5 λ + 7]
Theorem 8.42: Let u and v be two non-adjacent vertices of a graph G and G ′ be a graph obtained by
adding an edge between u and v. (i.e. G ′ = G + u v). Let G ′′ = G – u v. i.e., G ′′ be the simple graph
obtained from G by fusing the vertices u and v together and replacing sets of parallel edges with single
edges. Then
Pn (λ) of G = Pn (λ) of G′ + Pn −1 (λ) of G′′
Proof: The λ colouring of G is of two types:
(i) λ colouring if G assigning different colours to the vertices of u and v.
and (ii) λ colouring assigning the same colour to u and v.
Hence the number of ways of properly colouring G such that u and v have different colours.
= Number of ways of properly colouring G ′ and the number of ways of properly colouring G such
that u and v have same colour.
= Number of ways of properly colouring G ′′.
Pn (λ ) of G = Pn (λ ) of G′ + Pn −1 (λ ) of G ′′
Theorem 8.43: Is often used in evaluating the chromatic polynomial of a graph. For example, Fig. 8.156
illustrates how the chromatic polynomials of a graph G is expressed a sum of chromatic polynomials of
5 complete graphs.
Fig. 8.156
336 DISCRETE MATHEMATICAL STRUCTURES
= Pn (λ ) of K 5 = 3 Pn (λ ) of K 4 + Pn (λ ) of K 3
P5 (λ ) of G = P5 (λ ) of K 5 + 3 P4 (λ ) of K 4 + P3 (λ ) of K 3
Example 3: Sketch two non-isomorphic graphs which have the same chromatic polynomial.
Solution: Consider the groups G, and G2 as shown in Fig. 8.157.
Fig. 8.157
E X E R C I S E 8.9
(iii ) (iv )
GRAPH THEORY 337
(v ) (vi )
(vii )
(iii )
4. Show that the vertices of a planar graph with less than 30 edges is 4-colourable.
5. Show that a simple connected planar graph with 17 edges and 10 vertices cannot be 2-colourable.
6. Show that simple graph with 7 vertices each 4 is non-planar.
7. Show that a graph is dichromatic if and only if it has no odd circuits.
8. Find all maximal independent sets of the following graph:
9. Show that the regions of a planar graphs can be 2-coloured if each vertex has degree which is
even.
338 DISCRETE MATHEMATICAL STRUCTURES
12. Find the edge chromatic number for the graphs given below:
(a) (b )
8.55 DIGRAPHS
In this section, we consider digraphs (directed graphs), graphs in which edges have direction. Digraphs
are used to represent models of programmes. A city map showing only one-way street is an example of
digraph and there are many situations which require digraphs. The definition of a digraph was given
in 8.2.3.
Example 1: Let V = {a, b, c, d}, and
E = {(a, c), (a, d), (b, c), (d, b), (d, d)}
Then D = (V, E) is a digraph (see Fig. 8.158).
Fig. 8.158
GRAPH THEORY 339
If (u, v) an edge (arc) joining u to v in a digraph G1 the vertex u is called the initial vertex (Tail) and
v is called the terminal vertex (Head). We also say that u is adjacent to v and v is adjacent from u. The out
degree of a vertex v in a directed graph G is the number of points (vertices) adjacent from it, and the
degree of v is the number of points adjacent to v.
Two edges in a directed graph D are said to be parallel if they have same initial and same terminal
vertices. An edge with same initial and terminal vertices is called self-loop. If v is an isolated vertex of
D then in-degree of v is zero and the out degree of v is also zero. If the degree of v is one, then is called
a pendant vertex in G. An alternating sequence of points and edge v0 e1 v1 e2 ..., en vn in which the
ei = (vi–1, vi) is called a walk (directed walk). The number of edge occurring in the walk is called the
length of the walk. If the initial and terminal vertices of the walk coincide then the walk is called a
closed walk. If v0, e1, v1, e2, ..., en, vn is a walk then v1, v2, ..., vn – 1 are called the internal vertices of the
walk (v0 – vn walk).
If all the vertices of a walk in a directed graph D are distinct then the walk is called a path (directed
path). A cycle is a non-trivial closed path write all vertices distinct (except the first and last). A directed
graph that has no self-loop or parallel edges is called a simple digraph (see Fig. 8.159)
Fig. 8.159
If there is a path from a vertex u to another vertex v in a digraph D, then v is said to be reachable
from u, and the distance d (u, v) from u to v is the length of any shortest such path. A digraph is said to
be strongly connected if and only if every pair of vertices of it is reachable from one another. If for every
pair of points in a digraph D, atleast one is reachable from the other then D is said to be unilaterally
connected.
A semi-path in a digraph D is defined as a path in the underlying graph G is D.
A digraph D is said to be weakly connected if its corresponding undirected graph G is connected but
D is not strongly connected. If D is weakly connected then every two points of D are joined by a
semi-path.
A digraph is that is not even weak is called a disconnected graph.
Example 2: The graph shown in Fig. 8.160 (a) is strongly connected, the graph shown in Fig. 8.160 (b)
is unilateral and the graph shown in Fig. 8.160 (c) is a simple digraph.
Fig. 8.160
340 DISCRETE MATHEMATICAL STRUCTURES
Fig. 8.163
GRAPH THEORY 341
Example 2: Find the shortest spanning path in graph shown in Fig. 8.164:
Fig. 8.164
Fig. 8.165
Solution: Let M denote the matrix corresponding to the digraph G. The matrix M is given below:
Fig. 8.166
Fig. 8.167
342 DISCRETE MATHEMATICAL STRUCTURES
Solution: The matrix M is a 4 × 4 matrix hence the digraph G has 4 vertices. Let v0, v1, v2 and v3 denote
the vertices of G. The digraph G can be drawn as shown in Fig. 8.168:
Fig. 8.168
8.57 ARBORESCENCE
Definition 8.111: Let G be a directed graph. G is said to be an arborescence if:
(i) G contains no circuit—neither directed nor semi-circuit; and
(ii) G has exactly one vertex v of zero in-degree.
The vertex v of zero degree in G is called the root of the arborescence.
Fig. 8.169
From the definition, it is clear that on arborescence is a directed tree in which there is exactly one
vertex of in-degree zero. If G is an arborescence then every vertex of T is reachable, from the root, and
the root is not accessible from any other vertex of G. If v is a vertex of out-degree zero, in G then v is
necessarily a pendant vertex. An arborescence is sometimes referred to as an out-tree.
Theorem 8.44: An arborescence is a tree in which every vertex other than the root has an in-degree of
exactly one.
Proof: Let G be an arborescence with n vertices. G can have at most n – 1, edges, because of condition
(i) If v1, v2, ..., vn denote the vertices of G, then the sum of in degree of all vertices in G, i.e.,
d − (v1 ) + d − (v2 ) + L + d − ( vn ) ⋅ ≤ n − 1
exactly one of the terms on the left-hand side of the above equation is zero (by conditions (ii)) and the
remaining terms must all be positive integers, therefore each of the remaining terms must be 1. Now,
since there are exactly n – 1, vertices of in-degree one and one vertex of in-degree zero, G has exactly
n – 1 edges. Since G is without circuits, G must be connected. Hence G must be a tree, in which every
vertex other than the root has an in-degree of exactly one.
GRAPH THEORY 343
⎛0 1 0 0⎞
⎜ ⎟
1 0 1 0⎟
Then W0 = M n = ⎜
⎜0 0 0 1⎟
⎜⎜ ⎟
⎝0 0 0 0 ⎟⎠
344 DISCRETE MATHEMATICAL STRUCTURES
Consider the column 1 of w0. The second location (position) of the column 1 (c1) has we next
consider row 1 of w0. The second locations row 1 (R1) has 1.
Therefore, we put 1 in the position 2, 2 of w0, to form the matrix w1.
The matrix obtained can be written as follows:
⎛0 1 0 0⎞
⎜ ⎟
1 1 1 0⎟
W1 = ⎜
⎜0 0 0 1⎟
⎜⎜ 0 ⎟
0 0 0 ⎟⎠
⎝
in column 2 of w1, we find the locations 1 and 2 have 1’s. in row 2 the matrix w1 has 1’s in the position
1, 2 and 3. To obtain the matrix w2 we put 1’s in the position (1, 1), (1, 2), (1, 3), (2, 1) (2, 2) and (2, 3)
of w1. It can written as
⎛ 1 1 1 0⎞
⎜ ⎟
1 1 1 0⎟
W2 = ⎜
⎜0 0 0 1⎟
⎜⎜ ⎟⎟
⎝0 0 0 0⎠
The locations 1 and 2 of column 3 of w2 has 1’s and location 4 of row 3 of w2 has a 1. We put 1 in
the position (1, 4) and (2, 4) of w2 to form w3.
⎛1 1 1 1⎞
⎜ ⎟
1 1 1 1⎟
W3 = ⎜
⎜0 0 0 0⎟
⎜⎜ ⎟
⎝0 0 0 0 ⎠⎟
w3 has 1’s in the locations 1, 2, 3 of column 4 and no 1’s in row 4. Therefore no new 1’s are added to w3.
While forming w4.
⎛1 1 1 1⎞
⎜ ⎟
1 1 1 1⎟
W4 = ⎜
⎜0 0 0 1⎟
⎜⎜ ⎟
0 ⎠⎟
⎝0 0 0
E X E R C I S E 8.10
⎛0 1 1 0⎞
⎜ ⎟
⎜0 0 0 0⎟
⎜0 1 1 1⎟
⎜⎜ ⎟
⎝0 2 0 0 ⎟⎠
5. Find the out degree of each vertex in the digraph given below:
346 DISCRETE MATHEMATICAL STRUCTURES
⎛0 1 0 0⎞
⎜ ⎟
0 1 0 0⎟
M =⎜
⎜0 0 0 1⎟
⎜⎜ 2 ⎟
0 1 0 ⎟⎠
⎝
8. Construct the matrix corresponding to the digraph G (given below):
9. Let R be the relation whose digraph is given below. List all the paths of lengths 3 starting from
vertex a.
ALGEBRAIC STRUCTURES 347
Algebraic Structures
9.1 INTRODUCTION
In this chapter, we shall deal with some important algebraic structures—groups, rings, internal domains
and fields. We begin with one operational structure (system).
Notation: If * is a binary operation (binary composition) in a Set A then than for the * image of the
ordered pair (a, b) ∈ A × A, we write a * b (or * (a, b)).
Example 1: Addition (+) is a binary operation in the set of natural number N. Set of integers Z and set
of real numbers R.
Example 2: Multiplication (×) is a binary operation in N, Z, Q, R and C.
Example 3: Union, intersection and difference are binary operations in P (A), the power set of A.
Example 2: The operations of addition and multiplication over the natural numbers are associative.
348 DISCRETE MATHEMATICAL STRUCTURES
Definition 9.4: Let * be a binary operation on a set A. If there exists an element el ∈ A such that
el * a = a for every a ∈ A, then the element el is called the left identity with respect to *. Similarly, if
there exists an element er ∈ A such that a * er = a for every a ∈ A, the element er is called the right
identity in A with respect to *.
Definition 9.5: Let * be a binary operation on a non-empty set A. If there exists an element e ∈ A
such that e * a = a * e = a for every a ∈ A, then the element e is called identity with respect to * in A.
Example 3: Zero is the identity element in the set integers with respect to the binary operation addition
(i.e., +).
Definition 9.6: Let * be a binary operation on a non-empty set A and e be the identity element in A
with respect the operation *. An element a ∈ A is said to be invertible if there exists an element b ∈ A
such that
a*b=b*a=e
In which case a and b are inverses of each other. For the operation * if b is the inverses of a ∈ A
then we can write b = a–1.
9.3.1 Cancellation Laws
Definition 9.7: A binary operation denoted by * in a set A, is said to satisfy.
(i) Left cancellation law if for all a, b, c ∈ A,
a*b=a*c ⇒ b=c
(ii) Right cancellation law if for all a, b, c ∈ A
b*a=c*a ⇒ b=c
Definition 9.8: Let * and o be two binary operations inset A; if for all a, b, c ∈ A.
(i) (boc) * a = (b * a) o (c * a)
then we say that * is left distributive over o.
(ii) a * (boc) = (a * b) o (a * c)
then * is right distributive over o.
(iii) and distributive * is both left distributive and right distributive over o.
Example: In P (A), the power set of A, union is distributive over intersection and intersection is
distributive of union of sets.
Theorem 9.1: The identity elements of a binary operation * in a set A, if it exists and is unique.
Proof: If possible, let e′ and e′′ be two identity elements in A with respect to the binary operation *e′
is an identity element in A
⇒ e′ * e′′ = e′′ * e′ = e′′
and e′′ is an identity element in A
⇒ e′′e′ = e′ * e′′ = e′
ALGEBRAIC STRUCTURES 349
Theorem 9.2: If * is an associative binary operation in A, then the inverse of every invertible element
is unique.
Proof: Let a ∈ A, be an invertible element with respect to *. If possible let b and c be two distinct
inverses of the element a in A.
Let e be the identity elements in A with respect to *.
Then we have
b*a=a*b=e
and c*a=a*c=e
now (b *a) * c = b * (a * c) (3 * is associative in A)
⇒ e*c=b*e
⇒ c=b
This completes the proof of the theorem.
Theorem 9.3: If * is an associative binary operation in a set A, such every element is invertible, then
* satisfies the left as well as the right cancellation laws i.e.,
a*b=a*c ⇒ b=c
b * a = c * a ⇒ b = c ∀ a, b, c ∈ A
Proof: Let e be the identity element of A with respect to *. Every element in A is invertible ⇒ a ∈ A
is invertible.
Let a ′ denote the inverse of a in A then
a*b=a*c
⇒ a ′ * (a * b ) = a ′ * (a * c )
⇒ ( a ′ * a ) * b = ( a ′ * a) * c (3 * is associative)
⇒ e * b = e * c (3 a′ is the inverse of a)
⇒b=c
Similarly, we can prove that
b * a = c * a ⇒ b = c ∀ a, b, c ∈ A
E X E R C I S E 9.1
1. Show that division is a binary operation on R – {0} and C – {0}.
2. Show that addition is a binary operation in the set M of all m × n matrices.
3. Show that the least common multiple of two natural is a binary operation in the set of natural
numbers N.
350 DISCRETE MATHEMATICAL STRUCTURES
a
Show that the inverse of a ≠ 1 is a − 1 .
5. Define a ‘binary operation’. Mention the various properties binary composition and give examples
of each.
Example 3: If N denotes the set of natural numbers then (N, +) is an algebraic structure.
9.5.1 Groupoid
We have defined an algebraic structure. If * is a binary operation on a non-empty set A. Such that
a * b ∈ A for all a, b ∈ A then we say that A is closed under the operation.
Definition 9.11: A groupoid is an algebraic structure consisting of non-empty set A and a binary
operation *, which is such that A is closed under *.
Example 2: The set of real numbers is closed under addition, therefore (R, +) is a groupoid.
Example 3: If E denotes the set of even numbers then E is closed under addition. And (E, +) is a
groupoid.
Example 4: Let Z+ denotes the set of positive integers and * be a binary operation on Z+ defined as
follows
a * b = 3a + 4b ∀ a, b ∈ Z +
Clearly (Z+, *) is a groupoid.
9.6 SEMI-GROUP
Definition 9.12: Let S be a non-empty set and * be a binary operation on S. The algebraic (S, *) is
called a semi-group if the operation * is associative. In other words, the groupoid is a semi-group if
(a * b) * c = a * (b * c) for all a, b, c ∈ S
Thus, a semi-group requires the following:
(i) A sets.
(ii) A binary operation * defined on the elements of S.
(iii) Closure, a * b whenever a, b ∈ S.
(iv) Associativity i (a * b) * c = a * (b * c) for all a, b, c ∈ S .
Example 1: Let N be the set of natural numbers. Then (N, +) and (N, *) are semi-groups.
Example 2: X be a non-empty set and P (X) denote the power set of X. Then ( P ( x ), ∪) and ( P ( x ), ∩)
are semi-groups.
Example 3: Let Z be the set of integers and Zm be the set equivalence classes generated by the
equivalence relation “congruent modulo M” for any positive integers m. Then +m be defined integers of
+ on Z as follows:
For any [i], [ j] ∈ Z m
[i], +m [ j] = [(i + j) mod m]
The algebraic system (Zm, + m) is a semi-group.
9.9 MONOID
Definition 9.17: A semi-group (M, *) with an identity element with respect to the binary operation *
is called a monoid. In other words, an algebraic system (M, *) is called a monoid if:
ALGEBRAIC STRUCTURES 353
(i) (a * b) * c = a * (b * c) ∀ a, b, c ∈ M .
(ii) There exists an element e ∈ M such that e * a = a * e = a ∀ a ∈ M .
Example 1: Let Z be the set of integers (Z, +) is a monoid 0 is the identity element in Z with respect
to +.
Example 2: Let N be the set of natural numbers (N, X) is a monoid. 1 ei the identity element in N with
respect to the composition X.
Let (M, *) be a monoid. If the operation * is commutative then (M, *) is said to be commutative. If
ai , a j ∈ M , we have ai + j = ai * aj = aj * ai for all i, j ∈ M .
A monoid (M, *) is said to be cyclic if there exists an element a ∈ M . Such that every element of M
can be expressed as some power of a. If M is a cyclic monoid such that every element is some power of
a ∈ M , then a is called the generator of M. A cyclic monoid is commutative and a cyclic monoid is
commutative and a cyclic monoid may have more than one generator.
Example 3: The algebraic system (N, +) is a cyclic monoid generated by 1.
Example 4: If M = {–1, 1, i, –i}, where i = −1, then (M, *) is a cyclic monoid: The elements i and –
i are its generators.
9.11 GROUPS
Definition 9.19: A group is an algebraic structure (G, *) in which the binary operation * on G satisfies
the following conditions:
G – 1 for all a, b, c, ∈ G
a * (b * c) = (a * b) * c (associativity)
G – 2 there exists an elements e ∈ G such that for any a ∈ G
a * e= e * a = a (existence of identity)
354 DISCRETE MATHEMATICAL STRUCTURES
Table 9.1
C 1 –1 i –i
1 1 –1 i –i
–1 –1 1 –i i
–i i –i –1 1
–i –i i 1 –1
ALGEBRAIC STRUCTURES 355
From the above composition, it is clear that the algebraic structure (G, ⋅) is closed and satisfies the
following axioms:
Associativity: For any three elements a, b, c ∈ G ( a ⋅ b) ⋅ c = a ⋅ (b ⋅ c)
Since
1 ⋅ (−1 ⋅ i) = 1 ⋅ − i = − i
(1 ⋅ − 1) ⋅ i = − 1 ⋅ i = − i
⇒ 1 ⋅ (−1 ⋅ i ) = (1 ⋅ − 1) i
Similarly with any other three elements of G the properties holds.
∴ Associative law holds in (G, ⋅)
Existence of identity: 1 is the identity element (G , ⋅) such that 1 ⋅ a = a = a ⋅ 1 ∀ a ∈ G
Existence of inverse: 1 ⋅ 1 = 1 = 1 ⋅ 1 ⇒ 1 is inverse of 1
( −1) ⋅ ( −1) = 1 = ( −1) ⋅ ( −1) ⇒ –1 is the inverse of ( –1)
i ⋅ (−i ) = 1 = − i ⋅ i ⇒ –i is the inverse of i in G.
−i ⋅ i = 1 = i ⋅ ( −i) ⇒ i is the inverse of –i in G.
Hence inverse of every element in G exists.
Thus all the axioms of a group are satisfied.
Commutativity: a ⋅ b = b ⋅ a ∀ a , b ∈ G hold in G
1 ⋅ 1 = 1 = 1 ⋅ 1, − 1 ⋅ 1 = − 1 = 1 ⋅ − 1
i ⋅ 1 = i = 1 ⋅ i; i ⋅ − i = − i ⋅ i = 1 = 1 etc.
commutative law is satisfied
Hence (G , ⋅) is an abelian group.
Example 2: Prove that G = {1, ω , ω 2 } is a group with respect to multiplication where 1, ω , ω 2 are cube
roots of unity.
Solution: We construct the composition table as follows:
Table 9.2
C 1 ω ω2
1 1 ω ω2
ω ω ω2 ω 3 =1
ω2 ω2 ω 3 =1 ω4 =ω
356 DISCRETE MATHEMATICAL STRUCTURES
The algebraic system is (G , ⋅) where ω 3 = 1 and multiplication ‘’⋅ is the binary operation on G.
From the composition table; it is clear that (G, ⋅) is closed with respect to the operation multiplication
and the operation ‘’⋅ is associative.
1 is the identity element in G such that
1⋅ a = a = a ⋅1 ∀ a ∈G
Each element of G is invertible
1 ⋅ 1 = 1 ⇒ 1 is its own inverse.
Example 3: Prove that the set Z of all integers with binary operation * defined by a * b = a + b + 1
∀ a, b ∈ G is an abelian group.
Solution: Sum of two integers is again an integer; therefore a + b ∈ Z ∀ a, b ∈ Z
⇒ a + b + 1 ⋅ ∈ Z ∀ a, b ∈ Z
⇒ Z is called with respect to *
Associative law for all a, b, a, b ∈ G we have (a * b) * c = a * (b * c) as
(a * b) * c = (a + b + 1) * c
=a+b+1+c+1
=a+b+c+2
also
a * (b * c) = a * (b + c + 1)
=a+b+c+1+1
=a+b+c+2
Hence (a * b) * c = a * (b * c) ∈ a, b ∈ Z .
Example 4: Let S be non-empty set and P (S) be the collection of all subsets of S. Let the binary
operation Δ called the symmetric difference of sets be defined as
A Δ B = ( A − B) ∪ ( B − A) ∀ A, B ∈ P ( S )
then show that (P (S), Δ ) is an abelian group.
Solution: If A and B are any two subsets of S, then A Δ B is also a subset of S, therefore (P (S), Δ ) is
closed with respect to Δ.
Associativity: ∀ A, B, C ∈ P ( S )
( A Δ B ) Δ C = A Δ ( B Δ C ) can easily be verified.
ALGEBRAIC STRUCTURES 357
Existence of identity
∅ ∈ P ( S ) such that
AΔ∅= A=∅Δ A
⇒ ∅ is the identity in (P (S), Δ)
Existence of inverse: ∀ A ∈ P ( S )
A Δ A = ∅ ⇒ A is the inverse of A.
Commutative law ∀ A, B ∈ P ( S )
A Δ B = ( A − B ) ∪ ( B − A)
= ( B − A) ∪ ( A − B)
=BΔA
Hence (P (S), Δ) is an abelian group.
Example 5: Show that the set of four transformations f1, f2, f3 and f4 on the set of complex numbers be
defined by
f1 ( z ) = z, f 2 ( z ) = − z
1 −1
f3 ( z ) = , f4 ( z ) =
z z
Forms a finite abelian group with respect to the binary operation as the composition of product of
two functions.
Solution: Let G = {f1, f2, f3, f4} and ‘’⋅ denote the composition as the composite of two functions.
We have
f1, f1 = f1, f1, f2, = f2, f1, = f2
f1, f3, = f3, f1 = f1, f4 = f4, f1 = f4
f 2 f 2 ( z ) = − f 2 (− z ) = (− z ) = z = f1 ( z )
⇒ f 2 f 2 = f1
⎛1⎞ 1
f 2 f3 ( z ) = f 2 ( f3 ( z )) = f 2 ⎜ ⎟ = − = f 4 ( z )
⎝z⎠ z
⇒ f 2 f3 = f 4
Similarly, we can show that
f2 ⋅ f4 = f3, f3 ⋅ f2 = f4
f3 ⋅ f3 = f1, f3 ⋅ f4 = f2
f4 ⋅ f2 = f3, f4 ⋅ f3 = f2 and f4 ⋅ f4 = f1
358 DISCRETE MATHEMATICAL STRUCTURES
Table 9.3
C f1 f2 f3 f4
f1 f1 f2 f3 f4
f2 f2 f1 f4 f3
f3 f3 f4 f1 f2
f4 f4 f3 f2 f1
From the Table 9.3 , it is clear that all the entries are the elements of G and therefore closure
property holds good. The composite of functions is associative. f1 is the identity element of G with
respect to the given operation. The inverses of f1, f2, f3 and f4 are f1, f2, f3 and f4 respectively i.e., each
element in G is its own inverse.
Also, commutative law holds good in G. Therefore (G, ⋅) is an abelian group.
Table 9.4
+5 0 1 2 3 4
0 0 1 2 3 4
1 1 2 3 4 0
2 2 3 4 0 1
3 3 4 0 1 2
4 4 0 1 2 3
Since all the entries in the composition table are elements of G, the set G is closed with respect to
addition modulo 5.
Associativity: For any three element a, b, c ∈ G (a + b) + c and a + (b + c) leave the same remainder
when divided by 5.
i.e., (a +5 b) +5 c = a +5 (b +5 c)
We have (1 +5 3) +5 4 = 3 = 1 +5 (3 +5 4) etc.
Table 9.5
×5 1 2 3 4
1 1 2 3 4
2 2 4 1 3
3 3 1 4 2
4 4 3 2 1
From the above table, it is clear that G is closed with respect to the operation × 5 and the binary
composition × 5 is associative 1 is the identity element.
Each element in G has a inverse.
1 is its own inverse
2 is the inverse of 3
3 is the inverse of 2
4 is the inverse of 4, with respect to the binary operation × 5. Commutative law holds good in
(G, × 5). Therefore (G, × 5) is an abelian group.
9.16 CONGRUENCES
Consider the relation “Congruence modulo m” defined in 9.12. The relation congruence modulo ‘m’ is
an equivalence relation in the set of integers. The operation ‘Congruence modulo m’ Partitions Z into
disjoint equivalence classes called residue classes modulo m or congruence classes modulo m.
If a ∈ Z , then the residue class of a is denoted by a or [ a ] where a = [ a ] = {x : x ∈ Z , and x – a
is divisible by m}.
{0, 1, 2, …, m – 1} is called the set of residue modulo m.
ALGEBRAIC STRUCTURES 361
E X E R C I S E 9.2
1. Define (i) group (ii) abelian group.
2. Show that the following algebraic structures are groups.
(a) The set of real numbers under multiplication.
(b) The set of rational numbers under addition.
(c) The set of non-zero real numbers under multiplication.
(d ) The set of complex numbers under addition.
(e) The set of non-zero complex numbers under multiplication.
ab
(f ) The set R in which a * b = ∀ a , b ∈ R.
2
362 DISCRETE MATHEMATICAL STRUCTURES
3. Show that the set of all vectors in R2 is an infinite group with victor addition as the composition.
4. Prove that the set G = {a + 2 b: a, b ∈ Q} is a group with respect to addition.
5. Show that the set of all victors in R3 with victor addition as binary composition is an infinite
abelian group.
6. Show that the set of non-signed matrices of order n by m (n is fixed) with elements are rational
numbers with matrix multiplication as binary composition is a group.
7. Prove that the matrices
⎡1 0⎤ ⎡ 0 1 ⎤
⎢0 1⎥ , ⎢1 0 ⎥
⎣ ⎦ ⎣ ⎦
form a multiplicative group
8. On the set of integers Z, we introduce a binary operation * defined as follows. a * b = a + b + 1,
where + is ordinary addition. Show that (Z, *) is a group.
9. Show that the set G = {–1, 1}, is a finite abelian group of order 2, under multiplication.
10. Prove that the set {1, 2, 3, 4,5, 6} of order 6 is a finite abelian group of order 6 under multiplication
modulo 7.
11. Show that n * y = xy in a binary operation on the set of natural numbers. Is the operation
commutative and associative.
∴ a ∈ G ⇒ a −1 ∈ G such that
a–1 * a = e = a * a–1
now a −1 ∈ G ⇒ ( a −1 ) −1 ∈ G such that
(a–1) (a–1)–1 = e (a–1)–1 * (a–1)
consider a–1 * a = e
⇒ (a–1)–1 *(a–1 * a) = (a–1)–1 * e
⇒ {(a–1)–1 * a–1) * a = (a–1)–1
⇒ e * a = (a–1)–1
⇒ a = (a–1)–1
Therefore (a–1)–1 = a ∀ a ∈ G
Theorem 9.11: If (G, *) is a group then (a * b)–1 = b–1 * a–1 for all a, b ∈ G (Reversal law).
Proof: Let a, b ∈ G and e be the identity element in G.
a ∈ G ⇒ a −1 ∈ G such that a * a = a * a = e
–1 –1
now a, b ∈ G ⇒ a * b ∈ G and ( a b) −1 ∈ G
Consider (b–1 * a–1) * (a * b) = b–1 * (a–1 * a) * b (by associative law)
= b–1 * e * b (a–1 * a = e)
= b–1 * b (e is the identity)
= e (b–1 * b = e)
and (a * b) * (b–1 * a–1) = (b–1 * b–1) * a–1 (by associative law)
= a * e * a–1
= a * a–1 (e is the identity)
=e
Therefore (b–1 * a–1) (a * b) = (a * b) * (b–1 * a–1) = e
⇒ (a * b)–1 = b–1 * a–1 ∀ a , b ∈ G (by the definition of inverse)
Theorem 9.17: If (G, *) is a finite group of orders n, then for each a ∈ G, there exists a positive
integer m ≤ n such that am = e, e being the identity of G.
Proof: Let a ∈ G, then
a * a = a2 ∈ G
a2 * a = a * a * a = a 3 ∈ G
an–1 * a = a n ∈ G
2 3 n
∴ e, a, a , a , …, a are all elements of G.
These elements are (n + 1) in numbers, therefore they cannot all be distinct. If some ar = e then the
theorem is proved. In the other case, we must have
ar = as, 1 ≤ r ≤ s ≤ n
because all the elements are not distinct
now
ar = as
⇒ ar, a–r = as, a–r
366 DISCRETE MATHEMATICAL STRUCTURES
⇒ a0 = as–r
⇒ e = as–r
from our choice of r and
1 ≤ r ≤ s ≤ n
⇒ 1 ≤ s – r ≤ n.
Example 1: G = {1, –1, i, –i}, is a group with respect to multiplication 1 is the identity in G.
11 = 12 = 13 = … = 1 ⇒ O (1) = 1
(–1)2 = (–1)4 = (–1)6 = … = 1 ⇒ O (–1) = 2
i4 = i8 = i12 = … = 1 ⇒ O (i) = 4
(–i)4 = (–i)8 = … = 1 ⇒ O (–i) = 4
9.20 SUB-GROUP
We now introduce the concept of a sub-group.
Definition 9.24: Let (G, *) be a group and H, be a non-empty subset of G. If (H, *) is itself is a group,
then (H, *) is called sub-group of (G, *).
Example 1: Let a = {1, –1, i, –i} and H = {1, –1}
G and H are groups with respect to the binary operation, multiplication.
H is a subset of G, therefore (H, X) is a sub-group (G, X).
Example 2: Consider (Z6, +6), the group of integers modulo 6.
H = {0, 2, 4} is a subset of Z6 and {H, +6} is a group.
∴ {H, +6} is a sub-group.
Theorem 9.22: If (G, *) is a group and H ≤ G, then (H, *) is a sub-group of (G, *) if and only if
(i) a, b ∈ H ⇒ a * b ∈ H ;
(ii) a ∈ H ⇒ a −1 ∈ H
Proof: If (H, *) is a sub-group of (G, *), then conditions (i) and (ii) are obviously satisfied.
We, therefore prove now that if conditions (i) and (ii) are satisfied then (H, *) is a sub-group of
(G, *).
To prove that (H, *) is a sub-group of (G, *) all that we are required to prove is : * is associative in
H and identity e ∈ H .
That * is associative in H follows from the fact that * is associative in G.
Also,
a ∈ H ⇒ a −1 ∈ H by (ii)
and e ∈ H and a −1 ∈ H ⇒ a * a–1 = e ∈ H by (i)
Hence, H is a sub-group of G.
Theorem 9.24: Let (G, *) be a finite group and ∅ ≠ H ⊆ G. Then (H, *) is a sub-group (G, *) if and
only if a, b ∈ H ⇒ a * b ∈ H .
ALGEBRAIC STRUCTURES 369
Theorem 9.25: If (H1, *) and (H2, *) are both sub-groups of the group (G, *), then ( H1 ∩ H 2 , *) is
also a sub-group.
Proof: The set H , ∩ H 2 ≠ ∅ , since e ∈ H1 , ∩ H 2 . Suppose that a, b ∈ H1 ∩ H 2 , then a, b ∈ H1
and a, b ∈ H 2 , since (H1, *) and (H2, *) are sub-groups.
a, b ∈ H1 ⇒ a * b−1 ∈ H1
and a, b ∈ H 2 ⇒ a * b−1 ∈ H 2
Theorem 9.26: If (G, *) is a group and (H, *) is a sub-group of (G, *) and (K, *) is a sub-group of
(G, *) then (HK, *) is a sub-group of (G, *) if and only if HK = KH
Where
HK = {h * k / h ∈ H , k ∈ K } and KH = {k * h / h ∈ H , k ∈ K }
Proof: Left as an exercise to the student.
Example 3: ({0, 2, 4} + 1) is a sub-group of (6, +) because, if H = {0, 2, 4} then
0+0=0
0+2=2
0+4=4
2+2=4
2+4=0
4+4=2
i.e., a, b ∈ H ⇒ a + b ∈ H .
370 DISCRETE MATHEMATICAL STRUCTURES
H1 ∪ H 2 = {0, + 2, + 3, + 4, ...}
and 2, 3 ∈ H1 ∪ H 2 but 2 + 3 = 5 ∉ H1 ∪ H 2
Hence H1 ∪ H 2 is not closed under +.
9.22 COSETS
Let (H, *) be a sub-group (G, *) and a ∈ G
Then the sub-set:
a * H = {a * h : h ∈ H }
is called a left coset of H in G, and the subset
H * G = {h * a : h ∈ H }
is called a right coset of H in G.
Note: In general a * H ≠ H * a, however if G is abelian then
a * H = H * a ∀ a ∈G
There are only two distinct left cosets of H in G and two distinct right cosets of H in G.
Also we have
G= H ∪ H ×i
= H ∪i×H
= H ∪ H × ( −i)
= H ∪ ( −i ) × H
If e is the identity element of G, then
e * H = {e * h : L ∈ H } = {h : h ∈ H } = H
Similarly, H * e = H
Moreover, since e ∈ H , we have
a = a * e ∈ a * H and a = e * a ∈ a * H
i.e., every element of G belongs to some left (right) coset of H in G.
Example 2: Consider the group (Z, +)
Let H n = {0, + n, + 2 n, + 3 n , ...}
then the left cosets of H in Z are
H n , 1 + H n , 2 + H n , 3 + H n , ..., (n − 1) + H n
and Z = H n ∪ 1 + H n + 2 + H n + ... + ( n − 1) + H n
∴ a ∈ H , h ∈ H ⇒ a −1 * h ∈ H .
Now h ∈ H
⇒ h = a * (a–1 * h) ∈ a * H
∴ h∈ H ⇒ h∈a * H
⇒ H ⊆ a*H
Hence a * H = H
We now state the following theorem without proof:
372 DISCRETE MATHEMATICAL STRUCTURES
Theorem 9.28: If (H, *) is a sub-group of (G, *), then a * H = b * H if and only if a–1 * b ∈ H .
Theorem 9.29: If (H, *) is a sub-group of (G, *), then any two left cosets of H in a are either identical
or disjoint.
Proof: Let a * H and b * H be two left cosets of H in G. If a * H and b * H have no common element,
then a * H and b * H are disjoint.
If a*H ∩b*H ≠∅
Let c∈a* H ∩ b* H
Then c = a * h1 and c = a * h2
For some h1, h2 ∈ H
It follows that
a * h1 = b * h2
⇒ a–1 * b = h1 * h2–1
⇒ a–1 * b ∈ H (∴ h1 * h2 −1 ∈ H )
⇒ a * H = b * H.
Theorem 9.30: There exists a one-to-one correspondence between the elements of sub-group H and
those of any coset of H in G.
Proof: Define a mapping
f: H → a * H
by f (h) = a * h for all h ∈ H
Let h1, h2 ∈ H such that
f (h1) = f (h2)
now
f (h1) = f (h2)
⇒ a * h1 = a * h2
⇒ h1 = h2 (by left cancellation law)
∴ f is one-one.
Every element of a * H is of the form a * H for same h ∈ H .
∴ f is onto.
This completes the proof of the theorem.
Note: If (G, *) in a finite group, and (H, *) is a sub-group of G, then any two left cosets of H in G have the same
number of elements.
Theorem 9.31: If a * H and b * H are two distinct left cosets of H in G, then exists a one-to-one
correspondence between a * H and b * H.
Proof: Consider the mapping
f: a * H → b * H
ALGEBRAIC STRUCTURES 373
defined by
f (a * h) = b * h where h ∈ H .
The mapping f is one-one, since
f (a * h1) = f ( a * h2) where h1, h2 ∈ H
⇒ b * h1 = b * h2
⇒ h1 = h2 (by left cancellation law).
Thus f is one-one
f is onto mapping, since
b * h ∈ b * H is the f-image of
a*h ∈a* H
Thus f as defined above is a objective mapping from a * H to b * H.
This completes the proof of the theorem.
Lagrange’s Theorem: The theorem stated above indicate that each element of the group G belongs to
one and only one left coset of H. Thus G can be partitioned by G into disjoint sets each of which has
exactly as many elements as H. When the theorems are interpreted in the context of finite groups only
we obtain the following theorem known as Lagrange’s theorem.
Theorem 9.32: (Lagrange’s Theorem)
The order of any sub-group of a finite group divides the order of the group.
Proof: Let (G, *) we a finite group of order h, and (H, *) be a sub-group of G of order m.
We can decompose the set G into a union of a finite number of distinct left cosets of H say K.
Let a1 H, a2 H, … ak H denote the k distinct left cosets of H in G such that
G = a1 * H ∪ a2 * H ∪ a3 * H ∪ ... ∪ ak * H .
Where all the K left coset appearing on the right hand side are disjoint.
Therefore,
O (G) = O (a1 * H) + O (a2 * H) + … O (qk * H)
⇒ n = m + m + … k terms
⇒ n = km
⇒ m/n
⇒ O (H) / O (G).
This completes the proof of the theorem.
O (G)
IG (H) = O ( H )
Lagrange’s theorem is of fundamental importance and is used to prove many other important results.
Theorem 9.33: The order of every element of a finite group is a divisor of the order of the group.
Proof: Let (G, *) be a finite group and a ∈ G and let O (a) = m
Consider the set
H = {a, a2, a3, …am = e}
Obviously (H, +) is a sub-group of (G, *) and O (H) = m Lagrange’s theorem ensures that
O (H) / O (G) ⇒ m / O (G)
⇒ O (a) / O (G)
This completes the proof of the theorem,
We know that if H and K are two sub-groups of a group G, then HK is a sub-group of G if and only
if H * K = K * H.
If H and K are finite sub-groups of a group G, then we can find the O (H * K) by making use of
following theorem.
Theorem 9.34: Let (G, *) be a group (H, *) and (K, *) be two finite sub-groups of G such that
H * K = K * H then
O (H ) * O ( K )
O (H * K) = .
O (H ∩ K )
E X E R C I S E 9.3
1. Show that the system ({1, –1}, ×) is an abelian group.
2. Show that the set of complex numbers is a group under multiplication is a group.
3. Show that the set of even integers is a group under addition.
4. If Q denotes the set of rational numbers, then show that Q – {1} is a group with respect to the
operation * defined by a * b = a + b + ab.
5. Show that the set G = {6n : n ∈ Z } is a group with respect to multiplication.
6. Show that the pair {(0, 4, 8, 12), + 16} is a group.
7. Prove that a group (G, *) is commutative if and only if
(a * b)–1 = a–1 * b–1 ∀ a , b ∈ G.
8. Let (G, *) be a group since that (a * b2) = a2 + b2 for every a, b ∈ G. Prove that G is commutative.
9. Given a2 = e for every element a of the group (G, *) show that G is commutative.
10. If (G, *) is a group of even order prove that it has an element a ≠ e satisfying a2 = e.
11. In a group (Z, +) show that every element except o is of infinite order.
12. In any element, prove that the identity element is the only element whose order is 1.
ALGEBRAIC STRUCTURES 375
9.24 ISOMORPHISM
Let (G, *) and (G′, Δ ) be two groups.
A objective mapping
f: G → G ′
satisfying
f (a * b) = f (a) Δ f (b), ∀ a, b ∈ G
is called an isomorphism of G to G ′.
If there exists an isomorphism between two groups (G, *) and (G′, Δ ) then G and G ′ are said to
isomorphic to each other.
If (G, *) is isomorphic to (G ′, Δ ), we use the symbol
(G, *) ≅ (G ′, Δ )
for the statement G is isomorphic to G ′.
Example 1: Consider the group (R, +) and (R+, ×) where R+ denoted the set of positive real numbers.
Consider the mapping.
fa: R → R+, a ∈ R +
defined by
fa (x) = an
the mapping fa is structure preserving:
we have
fa (x + y) = ax + y = ax × ay
⇒ fa is structure preserving
Also fa (x) = fa (y)
⇒ ax = ay
⇒ ax – y = 1
⇒ x–y=0
⇒ x=y
⇒ fa is one-one.
From the definition
y ∈ R + ⇒ There exists a real number
x such that y = ax
376 DISCRETE MATHEMATICAL STRUCTURES
y ∈ R+ ⇒ y = a for some x ∈ k .
x
∴
⇒ y = fa (x)
⇒ fa is onto
+
∴ Thus (R, +) ≅ (R , x)
Example 2: The groups (Z, +) and (nZ, +), n ∈ Z are isomorphic to each other.
Theorem 9.35: The relation ‘≅’ in the set of all groups is an equivalence relation.
Proof: (a) ≅ is reflexive
If (G, *) is a group then
(G , *) ≅ (G ′, *)
since the identity mapping
IG : G → G′
is an isomorphism from (G, *) to (G′, *)
(b) ≅ is symmetric
Let (G, *) ≅ (G′, Δ )
Then (G′, Δ ) ≅ (G, *)
Therefore ≅ is symmetric
(c) ≅ is transitive
Let (G, *) ≅ (G′, Δ ) and (G′, Δ ) ≅ (G′′, 9)
Then (G, *) ≅ (G ′′, 9)
Therefore ≅ is transitive.
∴ ≅ is reflexive, symmetric and transitive therefore ≅ is an equivalence relation in the set of all
groups.
ALGEBRAIC STRUCTURES 377
Example 1: Let Z denote the set of integers (Z, +) is an infinite cyclic group 1 and –1 are the generators
of the group (Z, +).
Example 2: G = {1, –1, i, –i}is a group with respect to the binary operation ‘×’. (G, ×) is a cyclic
group.
i is a generator of G.
Since (i)4 = 1
(i)3 = –i
i2 = –i
0 1
(i ) = i
and G = {i4, i2, i, i3}
=<i>
Similarly (–i) is a generator
i, –i are the only generators of G .
If (G, *) is an infinite group generated by an element a, then we can write,
G = {…a–3, a–2, a–1, a0, a1, a2, a3,…}.
And if (G, *) is a finite cyclic group generated by a, then we can write,
G = {a, a2, a3, ..., an = e}
If (G, *) is a finite cyclic group of order n then
ai * aj = ai + j if i + j < n
= a0 if i + j = 0
= ai + j – n if i + j > n
where a is the generator of G.
We now state and prove the following theorems:
Theorem 9.36: Every cyclic group is abelian
Proof: Let (G, *) be a cyclic group
Generated by a
x, y ∈ G
⇒ x = a and y = a for some integers
m n
m and n
378 DISCRETE MATHEMATICAL STRUCTURES
x * y = am * an
= am + n
= an + m
= an * am
=y*x
This completes the proof of the theorem.
Note: The converse of the theorem may not hold.
∅ is one-one, since
ax = ay ⇒ x = y
The mapping ∅ is obviously onto.
Also, we have
x+y
∅ (x + y) = a
= ax * ay
= ∅ (x) * ∅ (y)
⇒ ∅ is structure preserving
ALGEBRAIC STRUCTURES 379
∴ ∅ is an isomorphism
∅ (G, *) ≅ (I, +).
Theorem 9.39: Every finite cyclic group of order n is isomorphic to (Zn, +). We leave the proof to the
reader and state the following theorem without proof.
“Every proper sub-group of an infinite cyclic group is isomorphic to the group itself.”
Theorem 9.40: Every proper sub-group of finite cyclic group is a finite cyclic group.
Theorem 9.41: The only groups which do not possess proper sub-group are the prime order finite
sub-groups.
Example 3: (G, *) is a group order 60, find all the sub-groups of G.
Solution: We can write
60 = 1 × 2 × 2 × 3 × 5
= 1 × 22 × 3 × 5
Therefore, the factors of 60 are:
1, 2, 3, 4, 5, 6,10, 12, 15, 20, 30, 60
Let a be a generator of (G, *) then the sub-groups of (G, *) are
{e}, <a>, <a2>, <a3>, <a4>, <a5>, <a6>, <a10>, <a12>, <a15>, <a20>, <a30>.
E X E R C I S E 9.4
1. Show that every group of order 2 is isomorphic to every other group of order 2.
2. Show that every group of order 3 is isomorphic to every other group of order 3.
3. Show that (I, +) is isomorphic to {a m : a ∈ Z }, +5 m ∈ Z is fixed.
4. Let G = Z6, then show that O (3) = 2.
5. Let (G, *) be an infinite cyclic group then prove that G has exactly the generators.
6. If G = <a> is cyclic group of order n then show that O (a) = n.
7. Let G be a group, H be a sub-group of G such that [G: H] = 2 show that every left coset of H
in G is also.
8. Show that any two cyclic groups of the same order are isomorphic.
9. Prove that any non-cyclic group of order 4 is isomorphic to Klein 4 – groups.
10. If (G, *) is a group of order 4, then show that G is abelian.
11. Show that the additive group Z4 is isomorphic to the multiplicative group of non-zero elements
of Z5.
12. Find all sub-groups of a cyclic group of orders 10 and 12.
13. Let (Z12, +12) be the group of integers modulo 12 then show that the subset generated by 3.
<3> = {3n (mod12) = n ∈ Z }
= {0, 3, 6, 9}.
380 DISCRETE MATHEMATICAL STRUCTURES
14. Consider (G1 + 15) the group of integers modulo 15 and the sub-group H = {0, 3, 6, 9, 12} of
G. Find all left cosets of H in G.
Theorem 9.43: A sub-group (H, *) is normal in (G, *), if and only if gh = Hg for each g ∈ G.
Proof: Suppose (H, *) is normal in (G, *)
Therefore, each g ∈ G, g * h * g–1 ⊆ H i.e., g H ⊆ Hg.
By replacing g by g–1 we have g–1 * H
g * (g–1 * H) * gH = Hg, ∀g ∈ G
(g * g–1) * H * g ⊆ g * H * (g–1 * g)
⇒ e*H*g ⊆ g*H*e
⇒ H* g ⊆ g * H
Thus Hg = gh
ALGEBRAIC STRUCTURES 381
Table 9.6
+ H3 1 + H3 2 + H3
H3 H3 1 + H3 2 + H3
1 + H3 H3 2 + H3 H3
2 + H3 2 + H3 H3 1 + H3
⎛1 2 3 4 ⎞ ⎛4 1 3 2⎞
and let f =⎜ ⎟ g=⎜ ⎟
⎝3 1 2 4⎠ ⎝4 3 2 1⎠
we have f (1) = g (1) = 3
ALGEBRAIC STRUCTURES 383
f (2) = g (2) = 1
f (3) = g (3) = 2
f (4) = g (4) = 4
i.e., f (a) = g (a) ∀ a ∈ S , therefore
f=g
Let S = (a1, a2, …, an) be a finite set. The number of permutations on S contains is n!. The set of all
permutations on S is denoted by Sn. Where |Sn| = n! If f ∈ S n then f is of the form
f = {(a, f (a), (a2), f (a2))}, …, (an, f (an))}
It can also be written as
⎛ a a2 a3 ... an ⎞
f =⎜ 1 ⎟
⎝ f (a1 ) f (a2 ) f (a3 ) ... f (an ) ⎠
the images f (a1), f (a2),… ,f (an) are the elements of S arranged in some order. The order of symbols in
the first row of a permutation is immaterial but columns should not be affected and every permutation of
Sn may be written in n! ways.
⎛1 2 3 ⎞
Example 2: Let S = {1, 2, 3} and f = ⎜ ⎟
⎝ 2 3 1⎠
⎛ 1 2 3⎞ ⎛ 2 3 1 ⎞ ⎛ 3 1 2 ⎞
We can write f =⎜ ⎟=⎜ ⎟=⎜ ⎟
⎝ 2 3 1⎠ ⎝ 3 1 2 ⎠ ⎝1 2 3 ⎠
⎛ 1 3 2 ⎞ ⎛ 2 1 3⎞ ⎛ 3 2 1 ⎞
⎜ ⎟=⎜ ⎟=⎜ ⎟
⎝ 2 1 3⎠ ⎝ 3 2 1⎠ ⎝1 3 2⎠
Hence, there are 3! = 6 ways of writing f.
9.28.2 Identity Permutation
Let S be a finite non-empty set. An identity permutation on S denoted by I is defined I(a) = a for all
a ∈ S.
⎛ a1 a2 ... an ⎞
Then I = ⎜ ⎟ is the identity permutation on S.
⎝ a1 a2 ... an ⎠
Example 2: Let S = {1, 2, 3, 4}, then
⎛1 2 3 4 ⎞
f =⎜ ⎟ is the identity permutation on S.
⎝1 2 3 4 ⎠
384 DISCRETE MATHEMATICAL STRUCTURES
⎛ a a2 ... an ⎞ ⎛ a1 a2 ... an ⎞
f =⎜ 1 ⎟ g =⎜ ⎟
⎝ f ( a1 ) f (a2 ) ... f (an ) ⎠ ⎝ g ( a1 ) g ( a2 ) ... g (an ) ⎠
be two arbitrary on S. We can find the composite of f and g as follows:
⎛ a a2 ... an ⎞ ⎛ a1 a2 ... an ⎞
fog = ⎜ 1 ⎟o⎜ ⎟
⎝ f (a1 ) f (a2 ) ... f ( an ) ⎠ ⎝ g (a1 ) g (a2 ) ... g ( an ) ⎠
⎛ a1 a2 ... an ⎞ ⎛ a1 a2 ... an ⎞
=⎜ ⎟o⎜ ⎟
( ( )) ( (
⎝ f g a1 f g a2 )) ... f g an ⎠ ⎝ g a1 g a2 ) ... g ( an ) ⎠
( ( )) ( ) (
⎛ a1 a2 ... an ⎞
=⎜ ⎟
⎝ f ( g ( a1 )) f ( g ( a2 )) ... f ( g (an )) ⎠
Clearly fog is a permutation and fog ∈ Sn.
Note: In general fog ≠ gof
⎛ 1 2 3⎞ ⎛ 1 2 3⎞
and f =⎜ ⎟, g = ⎜ ⎟
⎝ 2 3 1⎠ ⎝ 3 2 1⎠
be two permutations on S, we complete fog as follows:
⎛ 1 2 3⎞ ⎛ 1 2 3 ⎞
fog = ⎜ ⎟o⎜ ⎟
⎝2 3 1⎠ ⎝3 2 1⎠
⎛ 3 2 1 ⎞ ⎛ 1 2 3⎞
=⎜ ⎟o⎜ ⎟
⎝ 1 3 2 ⎠ ⎝ 3 2 1⎠
⎛1 2 3 ⎞
=⎜ ⎟
⎝1 3 2 ⎠
9.28.4 Inverse of a Permutation
If f is a permutation on S = (a1, a2, …, an) such that
⎛ a a ... an ⎞
f =⎜ 1 2 ⎟
⎝ b1 b2 ... bn ⎠
then there exists a permutation called the inverse f, denoted f –1 such that fof –1 = f –1of = I (the identity
permutation on S)
ALGEBRAIC STRUCTURES 385
⎛ b b ... bn ⎞
where f −1 = ⎜ 1 2 ⎟
⎝ a1 a2 ... an ⎠
Theorem 9.45: If S a set of n symbols, then the set Sn of all permutations on S in a group with respect
to the operation product of two permutations.
Proof: We have already seen that the product (composite) of two permutations on n symbols is again
a permutation. The product of permutations is associative. The identity permutation I defined on S acts
as the identity element of the group. If f is a permutation on S, then f –1 is also a one-one mapping on S
onto itself. Hence f –1 is also a permutation in S such that
f o f–1= f–1o f = I
Thus Sn is a group.
Definition 9.30: The group Sn is called the symmetric group (or permutation group).
Note:
(i) The order of Sn is n!.
(ii) For n ≤ 2, the group Sn is abelian and for n ≥ 3, the group Sn is non-abelian.
If f is a permutation a finite set S we define f 2 = f o f, f 3 = f o f o f, … order of a permutation.
Let S be a finite non-empty set with n symbols and Sn denote the set of all permutations on S. And let
I denote the identity permutation on S. If f ∈ S n , then the least positive integer k such that f k = I is
called the order of f in Sn.
Example:
⎛1 2 3 4 5 6 7 8 ⎞
If f =⎜ ⎟
⎝1 2 3 4 5 6 8 7 ⎠
⎛1 2 3 4 5 6 7 8 ⎞
Then f2 = f of =⎜ ⎟
⎝1 2 3 4 5 6 7 8 ⎠
=I
∴ order of f is 2.
⎛ 1 2 3 4⎞
Then ⎜ ⎟ is a cyclic permutation.
⎝4 3 2 1⎠
If S = {a1, a2, …, an} and f is a cyclic permutation on S, then we can write
f = (a1 a2 … an)
386 DISCRETE MATHEMATICAL STRUCTURES
9.29.1 Transposition
A cyclic of length 2 is called a transposition.
Let S = {a1, a2, a3, …, an} f, g and h be cyclic permutations on S.
Then we have:
(i) (f o g)–1 = g–1 o f –1
(ii) (f o g o h)–1 = h–1 o g–1 o f –1
If Sn is a permutation group on n symbols, then of the n! permutation in Sn, 1/2 n! are even permutations
and 1/2 n! are odd permutations. The set of all even permutations of degree n form a group under the
composition of permutations. The group of even permutations is called alternating group.
We state the following theorem without proof.
Theorem 9.46: Every permutation may be expressed as the product of transpositions in many ways.
Note: If f is a cycle of length n, then f can be expressed as a product of (n – 1) transpositions. Even and odd
permutations.
Definition 9.31: A permutation f is said to be an even permutation if f can be expressed as the product
of even number of transpositions.
Definition 9.32: A permutation f is said to be an odd permutation if f is expressed as the product of
odd number of transpositions.
Note:
(i) An identity permutation is considered as an even permutation.
(ii) A transposition is always odd.
(iii) The product of two even permutations is even, and also the product of two odd permutations is even.
(iv) The product of an even and an odd permutation is odd. Similarly the product of an odd permutation and
an even permutations is odd.
Let S = {a1, a2, a3, …, ak, ak + 1, …, an}
⎛ a1 a2 a3 ... ak ak +1 ak + 2 ... an ⎞
If f = ⎜ ⎟
⎝ a2 a3 a4 ... a1 ak +1 ak + 2 ... an ⎠
then f is S cyclic permutation. The length of f is k and degree of f is n. We can ignore the elements ak + 1,
ak + 2, …, an which are mapped onto themselves and write
f = (a1 a2 a3 … ak)
A cyclic permutation does not change by changing the places of its elements, provided their order is
not changed.
⎛1 2 3 4 5 6 7⎞
f =⎜ ⎟
⎝ 2 3 4 5 1 7 6⎠
the above permutation f can be written as f = (1 2 3 4 5) (6 7). Which is a product of two cycles. We now
state, the following theorem:
Theorem 9.47: Every permutation of n symbols can be expressed a product of disjoint cycles.
Proof: Let f be an element of Sn.
Consider the cycle
(1 f (1) f 2 (1), …)
Since O (f ) is finite, f = 1 for some k, i.e., f k (1) = 1 for some k
k
⎛ 1 2 3 4 5 6⎞
(4 1 3 5) = ⎜ 3 2 5 1 4 6 ⎟
⎝ ⎠
⎛1 2 3 4 5 6 ⎞
and ( 5 6 3) = ⎜1 2 5 4 6 3 ⎟
⎝ ⎠
⎛1 2 3 4 5 6 ⎞ ⎛ 1 2 3 4 5 6 ⎞
∴ (5 6 3) o (4 1 3 5) = ⎜1 2 5 4 6 3 ⎟ o ⎜ 3 2 5 1 4 6 ⎟
⎝ ⎠ ⎝ ⎠
388 DISCRETE MATHEMATICAL STRUCTURES
⎛ 3 2 5 1 4 6⎞ ⎛1 2 3 4 5 6⎞
=⎜ ⎟o⎜ ⎟
⎝5 2 6 1 4 3⎠ ⎝3 2 5 1 4 6⎠
⎛1 2 3 4 5 6⎞
=⎜ ⎟
⎝5 2 6 1 4 3⎠
⎛ 1 2 3 4 5 ⎞ ⎛1 2 3 4 5 ⎞ ⎛1 2 3 4 5 ⎞
=⎜ ⎟o⎜ ⎟o⎜ ⎟
⎝ 3 2 1 4 5 ⎠ ⎝1 4 3 5 2 ⎠ ⎝1 3 2 4 5 ⎠
⎛ 1 4 3 5 2 ⎞ ⎛1 2 3 4 5 ⎞ ⎛1 2 3 4 5 ⎞
=⎜ ⎟o⎜ ⎟o⎜ ⎟
⎝ 3 4 1 5 2 ⎠ ⎝1 4 3 5 2 ⎠ ⎝1 3 2 4 5 ⎠
⎛ 1 2 3 4 5 ⎞ ⎛1 2 3 4 5 ⎞
=⎜ ⎟o⎜ ⎟
⎝ 3 4 1 5 2 ⎠ ⎝1 3 2 4 5 ⎠
⎛ 1 3 2 4 5 ⎞ ⎛1 2 3 4 5 ⎞
=⎜ ⎟o⎜ ⎟
⎝ 3 1 4 5 2 ⎠ ⎝1 3 2 4 5 ⎠
⎛1 2 3 4 5 ⎞
=⎜ ⎟
⎝3 1 4 5 2⎠
= (1 3 4 5 2)
or (1 3) o (2 4 5) o (2 3)
= (1 3 2 4 5) o (2 3)
⎛ 1 2 3 4 5 ⎞ ⎛1 2 3 4 5 ⎞
=⎜ ⎟o⎜ ⎟
⎝ 3 4 2 5 1 ⎠ ⎝1 3 2 4 5 ⎠
⎛ 1 3 2 4 5 ⎞ ⎛1 2 3 4 5 ⎞
=⎜ ⎟o⎜ ⎟
⎝ 3 2 4 5 1 ⎠ ⎝1 3 2 4 5 ⎠
⎛1 2 3 4 5 ⎞
=⎜ ⎟
⎝3 2 4 5 1⎠
= (1 3 4 5 2)
Example 3: Express f = (a1 a2 a3 … an) as a product of transpositions.
Solution: f = (a1 a2 a3 … an)
ALGEBRAIC STRUCTURES 389
⎛1 2 3 4 5 6 7 8⎞
Example 4: Show that f = ⎜ ⎟ is even.
⎝ 7 3 1 8 5 6 2 4⎠
⎛1 2 3 4 5 6 7 8⎞
Solution: f =⎜ ⎟
⎝ 7 3 1 8 5 6 2 4⎠
⎛1 7 2 3 4 8 5 6⎞
=⎜ ⎟
⎝7 2 3 1 8 4 5 6⎠
= (1 7 2 3) o (4 8) o (5) o (6)
= (1 3) o (1 2) o (1 7) o (4 8)
f is expressed as a product of 4 transpositions, therefore f is even.
⎛1 2 3 4 5 6 7 8 ⎞
Example 5: Show that f = ⎜ ⎟ is odd
⎝1 4 3 6 5 8 7 2 ⎠
⎛1 2 3 4 5 6 7 8 ⎞
Solution: f =⎜ ⎟
⎝1 4 3 6 5 8 7 2 ⎠
⎛1 2 4 6 8 3 5 7 ⎞
=⎜ ⎟
⎝1 4 6 8 2 3 5 7 ⎠
= (1) o (2 4 6 8) o (3) o (5) o (7)
= (2 4 6 8)
= (2 8) o (2 6) o (2 4)
f is expressed as a product of 3 transpositions 3 is an odd number.
∴ f is odd.
(G, ⋅) and (G, ⋅) are groups and G and G are groups with respect to multiplication. Then the
mapping f: G → G, defined by f (a) = an ∀ a ∈ G, where n ∈ Z fixed, is a homomorphism.
⇒ f is a homomorphism of G into G .
Definition 9.35: Let (G, *) and (G, Δ) be two groups. A mapping f: G → G defined by
f (a *b) = f (a) Δ f (b) is called isomorphism, if f is a one-one, onto mapping.
From the above definition, it is clear that, a one-one, onto homomorphism is an isomorphism. Thus
every isomorphism is necessarily a homomorphism, whereas the converse need not be true. If f: G → G
is onto homomorphism, then G is called homomorphism image of G. Every quotient group of group is
a homomorphic image of the group.
Theorem 9.48: Let (G, *) and (G, ⋅) be two groups and f be a homomorphism then
(i) f (e) = e , where e is the identity of G and e is the identity in G.
(ii) f (a–1) = [f (a)] –1 ∀ a ∈ G
(iii) f (an) = [f (a)]n ∀ a ∈ G and n ∈ Z
Proof: (i) a ∈ G ⇒ a = a * e
ALGEBRAIC STRUCTURES 391
⇒ f (a) = f (a * e)
= f (a) o f (e) (3 f is a homomorphism)
⇒ a * a ∈G
–1
⇒ e ∈G
∴ ⇒ f (a * a–1) = f (e)
⇒ f (a) o f (a–1) = f (e) = e
⇒ [f (a)]–1 = f (a–1) ∀ a ∈ G
(iii) Left as an exercise to the student.
Theorem 9.49: Let f be a homomorphism of (G, *) into (G, ⋅) with Kernel K, then K is a normal
sub-group of G.
Proof: We know that
f (e) = ⇒ e e ∈ K
Thus ker f = K is a non-empty.
Subset of G.
K is a sub-group of G
a, a, b ∈ K ⇒ f (a) = e , and f (b) = e
now f (a * b) = f (a) o f (b)
= e o e (∴ f is a homomorphism)
= e
∴ a ∈ K, b ∈ K ⇒ a * b ∈ K
Now a ∈ K ⇒ a ∈ G ⇒ a −1 ∈ G
Also f (a–1) = [f (a)]–1
= ( e ) −1
=e
⇒ a −1 ∈ K ∀ a ∈ K
392 DISCRETE MATHEMATICAL STRUCTURES
Thus K is a sub-group of G.
We now prove that K is a normal sub-group G.
K ∈ K, a ∈ G
⇒ f (a * K * a–1)
= f (a * K) o f (a–1)
= f (a) o f (K) o f (a–1)
= f (a) o e o f (a–1)
= f (a) o f (a–1)
= f (a * a–1)
= f (e) = e
⇒ a * K * a–1 ∈ K ∀ K ∈ K , a ∈ G
Hence, K is a normal sub-group of G.
Now we state the following theorem without proof.
Theorem 9.50: Let f be a homomorphism of (G, *) into (G, ⋅) with Kernel K, then G/K ≅ G
Solution: ∀ a, b ∈ G ⇒ b ∈ G (∴ G is a group)
Now ∅ (a * b) = e
= e * e = ∅ ( a) ⋅ ∅ (b)
Hence ∅ is homomorphism.
Example 3: Consider two groups G and G where G = (Z, +) and G = {Zm/m = 0, …, x}.
ALGEBRAIC STRUCTURES 393
∴ ∅ is one-one.
E X E R C I S E 9.5
1. Define:
(a) Sub-group
(b) Order of a group
(c) Finite group
(d) Order of an element.
2. Show that the set of all elements a of an abelian group G which satisfy a2 = e, forms a sub-groups
of G.
3. If G is a group and N (a) = n ∈ G (ax = xa) for a ∈ G, then prove that N (a) is a sub-group of G.
4. If G = {1, –1, i, –i} is a group under multiplication then write all sub-groups of G.
5. Let (G, 0) be a group and a ∈ G. If N (G) denotes the normalizer of a in G, then show that
(N (G), 0) is a sub-group of (G, 0).
6. Define a cyclic group and give examples.
7. Show that the group {a, a2, a3, = e, 0} is a cyclic group.
8. Let P be the collection of sub-groups of (G, *) prove that the intersection of sub-groups in P is a
sub-group of (G, *).
9. Find all the sub-groups of a cyclic group of order 60.
10. Find all the sub-groups of a cyclic group of order 10.
11. Show that every sub-group of a cyclic group is cyclic.
12. List all sub-groups of a cyclic group of order 12.
13. Show that the group ({0, 6}, +12) is a sub-group of (Z12, +12) of integers modulo 12.
14. Show that every cyclic group is commutative.
15. State and prove Lagrange’s theorem.
16. If (G, *) is a finite group of composite order then show that (G, *) has non-trivial sub-groups.
17. Show that every group of Prime order is cyclic.
18. Prove that every sub-group of an abelian group is normal.
19. Prove that every quotient group of an abelian group is abelian.
ALGEBRAIC STRUCTURES 395
20. If (G, *) is a finite group of order n, with generator a. Then show that am is also a generator of G
if and only if m < n, and (m, n) = 1.
21. If (H1, ) and (H2, ) are two normal sub-group of (G, ) then show that is also a normal sub-group
of G.
22. Show that the intersection of any collection of normal sub-groups itself a normal sub-group.
23. Prove that every sub-group of index 2 is a normal sub-group.
24. Prove that the symmetric group of two symbols (S2, 0) is commutative.
25. Determine whether the following permutations are odd or even:
⎛a b c⎞
(a) ⎜ c a b ⎟
⎝ ⎠
⎛1 2 3 4 5 6 7⎞
(b) ⎜ 3 2 4 5 6 7 1 ⎟
⎝ ⎠
⎛1 2 3 4 5 6 7 8 9⎞
(c) ⎜ 6 1 4 3 2 5 7 9 8 ⎟
⎝ ⎠
⎛ 1 2 3 4 5⎞
(d) ⎜ 3 2 4 1 5 ⎟
⎝ ⎠
26. Express the following permutations as the product of transpositions.
⎛1 2 3 4 5 6 7⎞
(a) ⎜ 5 7 6 2 1 3 4 ⎟
⎝ ⎠
(b) (1 2 3) o (4 5) o (6 7 8)
27. G = (f1, f2, f3, f4) where
⎛1 2 3 4 ⎞ ⎛1 2 3 4⎞
f1 = ⎜ ⎟ , f2 = ⎜ ⎟
⎝1 2 3 4 ⎠ ⎝ 2 1 4 3⎠
⎛1 2 3 4⎞ ⎛ 1 2 3 4⎞
f3 = ⎜ ⎟ , f4 = ⎜ ⎟
⎝3 4 1 2⎠ ⎝ 4 3 2 1⎠
Show that (G , ⋅) is an abelian group.
section, we use R to denotes an arbitrary set. (In this section, the symbol R will no longer denote the set
of real numbers, unless specified).
The identity elements (R, +) and (R, ⋅) are denoted by ‘0’ and ‘1’ respectively. The inverse of a with
respect to ‘+’ is denoted by –a. We now define ring as follows.
9.33.1 Ring
Definition 9.38: An algebraic system (R, +, ⋅) is called a ring if the binary operations ‘+’ and ‘ ⋅ ’ R
satisfy the following properties:
1. (R, +) is an abelian group.
2. (R, ⋅) is a semi-group.
3. The operation ‘ ⋅ ’ is distributive over +, that is for any a, b, c ∈ R,
a ⋅ (b + c) = a ⋅ b + a ⋅ c and
(b + c ) ⋅ a = b ⋅ a + c ⋅ a
⎛0 a⎞
Example 1: The set of all matrices of the form ⎜ ⎟ a and b being real numbers, with matrix
⎝0 b⎠
addition and matrix multiplication is a ring.
Example 2: The set of integers Z, with respect to the operations + and × is a ring.
Definition 9.39: Let (R, +, ⋅) be a ring with unity. An element a ∈ R is said to be invertible, if there
exists an element a −1 ∈ R, called the inverse of a such that
a ⋅ a −1 = a −1 ⋅ a = 1
Second method
( − a ) ⋅ ( −b ) = − (( − a ) ⋅ b ) = − ( − (a ⋅ b )) = a b
⇒ ( −1) ⋅ ( −1) = 1
Definition 9.40: Let (R, +, ⋅) be a ring. R is said to be with zero divisors if there exists two non-zero
elements, a, b ∈ R such that a ⋅ b = 0.
Note: If a ≠ 0, b ≠ 0 ⇒ ab = 0 in R, a is called the left zero divisor and b is called the right zero divisor.
Definition 9.41: Let (R, + ⋅) be a ring. R is said to be without zero divisors if ab = 0 = ⇒ either a = 0
or b = 0 for all a, a, b ∈ R.
ALGEBRAIC STRUCTURES 399
Example: Let R denote the set of ordered pairs of real number i.e.
Let R = {(a, b): a, b are real} and addition and multiplication on R be defined as follows:
(a, b) + (c, d) = (a + c, b + d)
(a, b) (c, d) = (ac, bd)
Clearly (R, +, ⋅) is a commutative ring with unity (1, 1)
We observe that
(1, 0) (0, 1) = (1 ⋅ 0, 0 ⋅ 1) = (0, 0)
where (0, 0) is the additive identity in R also (1, 0) ≠ (0, 0), (0, 1) ≠ (0, 0)
Thus (1, 0) and (0, 1) are zero divisors of the ring R.
9.36 SUB-RINGS
Definition 9.42: Let (R, +, ⋅) be a ring and S be a non-empty subset of R. If (S, +, ⋅) is a ring then
(S, +, ⋅) is called a sub-ring of R.
Example: Let E denote the set of even integers. (E, +, ⋅) is a sub-ring of (Z, +, ⋅) , where Z denotes the
set of integers.
Note: Every ring (R, +, ⋅) has two trivial sub-rings ({0}, +, ⋅) and (R, +, ⋅) where 0 is the additive identity of
(R, +, ⋅).
Definition 9.43: Let (S, +, ⋅) be a sub-ring of (R, +, ⋅) where R is a ring with identity element 1. If
1 ∈ S , then S is called a unitary sub-ring of R and the ring is said to be unitary over ring (S, +, ⋅).
Example 3: In the ring (Z6, +6, ×6) the elements 0, 1, 3 and 4 are idempotent.
400 DISCRETE MATHEMATICAL STRUCTURES
Definition 9.46: Let (R, +, ⋅) be a ring. An element a ∈ R is said to be nilpotent if there exists a
positive integer n such that an = 0
Example 4: Zero element of a ring is nilpotent.
Definition 9.47: Let (R, +, ⋅) be a ring and S be a non-empty subset of R. Then the system (S, +, ⋅) is
a subring of (R, +, ⋅) if and only if.
(i) a – b ∈ S for all a, b ∈ S
(ii) a ⋅ b ∈ S for all a, b ∈ S
Theorem 9.52: Let (S1, +, ⋅) and (S2, +, ⋅) be two sub-rings of a ring (R, +, ⋅). Then ( S1 ∩ S 2 , +, ⋅) is
also a sub-ring of (R, +, ⋅).
Definition 9.48: Let (R, +, ⋅) be a ring. If a ⋅ a = a ∀ a ∈ R then (R, +, ⋅) is said to be Boolean ring.
Example 5: Let S be non-empty set. Then (P (S), Δ, ∩) is a ring where P (S), is the power set of S
P (S, Δ, ∩) is a Boolean ring, since
A ∩ A = A = A for all A ∈ P ( S )
Example 7: The ring of rational numbers (Q , +, ⋅) is a division ring, since 1 ∈ Q and the non-zero
elements of Q are invertible.
Example 8: Show that a division ring has no zero divisors.
Solution : Let ( R, +, ⋅) be a division ring
Let a, b ∈ R and a ≠ 0. Let ab = 0
ALGEBRAIC STRUCTURES 401
⇒ ( a – 1 a) b = 0
⇒ 1b = 0
⇒b=0
Thus a, b ∈ R, a ≠ 0 and ab = 0 ⇒ b = 0
Solution: Since a 2 = a ∀ a ∈ R
We have (a + a)2 = (a + a)
i.e. (a + a) (a + a) = (a + a)
⇒ a(a + a) + a(a + a) = a + a
⇒ ( aa + aa) + ( aa + aa) = a + a
⇒ (a 2 + a 2 ) + (a 2 + a 2 ) = a + a
⇒ (a + a) + (a + a) = (a + a) + 0
402 DISCRETE MATHEMATICAL STRUCTURES
⇒a+a=0
⇒ 2a = 0
2 is the least positive integer so that
2a = 0 ∀ a ∈ R
Hence, the characteristic of R is 2.
Theorem 9.55: The characteristic of an integral domain is either a prime or zero.
Theorem 9.56: The characteristic of a field is either a prime or zero.
Definition 9.53: A mapping f from a ring R into the ring R′ is said to be homomorphism if
(i) f (a + b) = f (a) + f (b)
(ii) f (ab) = f (a) f (b)
for all a, b ∈ R .
Example 13: In any ring (R, +, ⋅), the trivial sub-rings (R, +, ⋅) and ({0}, +, ⋅) are both ideals.
Example 14: ({0, 3, 6, 9}, +12, ×12) is an ideal of the ring (Z12, +12, ×12).
Definition 9.55: The center of a ring R is the set of all elements a ∈ R such that
xa = ax for all x ∈ R
If R is a commutative ring then the center of R is trivially, the ring R itself . The center of any ring
R is a subring of R.
E X E R C I S E 9.6
1. Define:
(a) Ring
(b) Commutative ring
(c) Ring with unity
(d ) Integral domain
(e) Field
give examples
ALGEBRAIC STRUCTURES 403
2. Show that the system (E, +, ⋅) of even integers is a ring under ordinary addition and multiplication.
3. Define sub-ring and give an example.
4. Show that a ring (R, +, ⋅) is without zero divisors if and only if cancellation law holds for
multiplication.
5. If (R, +, ⋅) is a ring and a, b ∈ R show that equation a + n = b has unique solution in R.
6. If R is a ring commutative with characteristic 2. Show that (a + b)2 = a2 + b2 ∀ a , b ∈ R.
7. If R is a Boolean ring, then show that a + a = 0 ∀ a ∈ R.
8. Show that every Boolean ring is commutative.
9. Show that a finite integral domain is a field.
10. If D = {a + b 5: a , b ∈ Z } , show that (D, +, ⋅) is an integral domain.
404 DISCRETE MATHEMATICAL STRUCTURES
10
10.1 INTRODUCTION
In this chapter, we study finite state machines. A finite state machine is a mathematical system with
discrete inputs and outputs. Each internal configuration of the system is called a state. A table lamp is a
finite state machine. A switching circuit is a finite state machine. In computer science, we find many
examples of finite state systems.
Finite state machines have many applications. A finite state machine can be used to model a physical
system and is similar to finite state automation. Lexical scanners, parity check machines, shift registers,
vending machines, etc., are some examples of finite state machines. A device that receives a set of input
signals and produces corresponding output signals is called an information—processing machine.
Fig. 10.2
The input tape is divided into squares and input symbols are stored on the input tape. The output
symbols are stored in output tape. The machine reads a sequence of symbols that are stored on an input
tape and stores sequence of output symbols on an output tape. The input and output tapes are allowed to
move only in one direction.
Example 1: Let S = {s0, s1, s2}
I = {a, b}
O = {p, q, r}
Initial state s0
Next state function δ : S × I → S, be defined by
δ (s0, a) = s1, δ (s1, a) = s2, δ (s2, a) = s0,
δ (s0, b) = s1, δ (s1, b) = s2, δ (s2, b) = s1,
output function λ : S × I → O, be defined by
λ (s0, a) = p, λ (s1, a) = p, λ (s2, a) = r,
λ (s0, b) = q, λ (s1, b) = r, λ (sq, b) = q,
then M = (S, I, O, δ , λ ) defines a finite state machine, with three internal states two input symbols and
three output symbols.
Table 10.1
I δ λ
S a b a b
S0 S1 S1 1 1
S1 S0 S1 0 1
Example: Draw the transition diagram of the finite State machine describe the Table 10.2.
Table 10.2
I δ λ
S a b a b
S0 S1 S1 x y
S1 S0 S1 x y
S2 S0 S1 x y
Solution: The graphical representation i.e., transition diagram of the finite state machine is pictured in
Fig. 10.4.
Fig. 10.4
Example 1: Draw the transition diagram state diagram of the finite state machine M = (S, I, O, δ , λ , S0)
given in the Table 10.3.
408 DISCRETE MATHEMATICAL STRUCTURES
Table 10.3
I δ λ
S a b c a b c
S0 S0 S1 S2 0 1 0
S1 S0 S1 S0 1 1 1
S2 S2 S1 S0 1 0 0
Fig. 10.5
Example 2: Find the sets S, I and O, the initial state, and transition table defining the next state and
output function for the finite state machine given in Fig. 10.6.
Solution: We have S = {s0, s1, s2, s3}
I = {a, b}
O = {0, 1}
S0 is the initial state
δ : S × I → S is the next function defined by
δ (s0, a) = s1, δ (s1, a) = s0, δ (s2, a) = s3, δ (s3, a) = s1,
δ (s0, b) = s2, δ (s1, b) = s2, δ (s2, b) = s0, δ (s3, b) = s3
output function
λ : S × I λ O is defined by
λ (s0, a) = 0, λ (s1, a) = 1, λ (s2, a) = 0, λ (s3, a) = 0,
λ (s0, b) = 0, λ (s1, b) = 0, λ (s2, b) = 1, λ (s3, b) = 0
FINITE STATE MACHINES 409
Fig. 10.6
Table 10.4
I δ λ
S a b a b
S0 S1 S2 0 0
S1 S0 S2 1 0
S2 S3 S0 0 1
S3 S1 S3 0 0
The least significant digits x1 y0 of the inputs arrive simultaneously at the input terminals at time fo.
If M = (S, I, O, δ , λ , S0) is a finite state machine, a string γ over I is called an input string and
corresponding there exists a string P ∈ O called the output string.
410 DISCRETE MATHEMATICAL STRUCTURES
A finite state machine transforms words into words. If I* and O* denote the sets of words on
the input and output alphabets I and O respectively. We can describe an operation of the machine by the
function
g: I* → O*
Where the domain and range of g are infinite sets.
Consider the sequence a = a0, a1, a2, … an … of the input symbols, we can define a function δ n as
follows
δ n : S × In → S, such that
Sn = δ n (s0, a0, a1, …an – 1)
= δ (sn – 1 (s0, a0, a1, …an – 1), an – 1)
for the output symbols O0, O1, O2, …. We define the function for the output sequence as follows.
λn : S × In → S, such that
On – 1 = λn (s0, a0, a1, …an – 1)
10.6 COVERING
Let M = ( S , I , O, δ , λ ) and M = (S, I, O, δ , λ ) be two finite state machines.
If (i) M and M have the same input and output alphabet, and
(ii) There exists a function f: S → S such that for every positive integer r,
δ r (s, a) = δ r ( f (s ), a )
and λr (s, a) = λ r ( f ( s ), a ) ∀ a ∈ I
then we say that M covers M.
Note: If M covers M; then M covers M .
Proof: Consider the finite state machine M = (S, I, O, δ , I) and the identity mapping f: S → S.
We have S = S , I = I , O = O, δ = δ , λ = λ
and M = (S , I , O, δ , λ )
By definition M and M have the same input and output alphabet, also we have
δ r (s, a) = δ r (f (s), a) = δ r (f (s), a) ∀ a ∈ I
∴ M covers M i.e., M covers M, thus the relation covering is reflexive.
To prove that the relation covering is transitive, we suppose that M covers M and M covers M
where M = (S , I , O, δ , λ ), M = ( S , I , O, δ , λ ) and M = (S, I, O, δ , λ ).
Now M covers M ⇒ I = I , O = O … (i)
M covers M.
Hence the relation covering is transitive.
Theorem 10.1: Let M be a finite state machine and S be any state in M. if a and b are any words, then
(i) δ (s, ab) = δ (δ (s, a), b)
(ii) λ (s, ab) = λ (δ (s, a), b)
Theorem 10.2: Let M = (S, I, O, δ , λ ) be a finite state machine and Si , S j ∈ S . If Si ≡ Sj, then for any
input sequence a.
δ ( Si , a ) = δ ( S j , a )
Theorem 10.3: Let P denote the partition generated by the equivalence relation ≡ and corresponding
k
to the k-equivalence relation ≡, let pk denote the k-partition on the set of states S. If for some positive
integer k, Pk +1 = Pk, then Pk = P and conversely.
k +1 k
Theorem 10.4: Let Si , S j ∈ S then Si ≡ S j if and only if Si ≡ S j and for all a ∈ I ,
k
δ (Si , a ) ≡ δ (S j , a ).
We now define equivalent machines.
FINITE STATE MACHINES 413
Definition 10.6: Two finite state machines M = (S, I, O, δ , λ ) and M = ( S , I , O, δ , λ ) are said to be
equivalent, if and only if for all S i ∈ S , there exists an S j ∈ S such that Si ≡ S j , and for all S j ∈ S ,
there exists an Si ∈ S such that Si ≡ Sj.
I δ λ
S 0 1 0 1
S0 S5 S3 0 1
S1 S1 S4 0 0
S2 S1 S3 0 0
S3 S1 S2 0 0
S4 S5 S2 0 1
S5 S4 S1 0 1
(b)
I δ λ
S 0 1 0 1
S0 S5 S3 0 1
S1 S1 S4 0 0
S2 S1 S3 0 0
S3 S1 S2 0 0
Definition 10.7: A finite state machine M = (S, I, O, δ , λ ) is said to be reduced if any only if Si ≡ Sj
⇒ Sj ≡ Si for all states Si , S j ∈ S .
Let the set of states S be partitioned in a set of equivalence classes [s], such that P = ∪ [ s]. Let f be
a function defined on P such that f [s] = S , where S is an arbitrary fixed element of [s].
Clearly [s] = [ s ].
We construct a reduced finite state machine M = ( S , I , O, δ , λ ) by taking
S = {s : λ s ( s ∈ S and f ([ s ])) = s }, O = o and I = o.
The function δ and λ are defined as follows:
δ ( s , a) = f [δ ( s , a )]
and λ ( s , a ) = λ ( s , a ) where s ∈ s and also s ∈ S
414 DISCRETE MATHEMATICAL STRUCTURES
Definition 10.8: Let M = (S, I, O, δ , λ ) and M = ( S , I , O, δ , λ ) be two finite state machines. Let f
be a mapping from s into S defined such that
f ( δ (s, a) = δ (f (s), a)
λ (s, a) = λ (f (s), a), for all a ∈ I then f is called a finite state homomorphism.
Definition 10.9: Let M = (S, I, O, δ , λ ) and M = ( S , I , O, δ , λ ) denote two finite state machines and
f : S → S be a homomorphism. If f is one-one and into (a bijection), then M is said to be isomorphic to M .
Solved Examples
Example 1: Let M = (S, I, O, δ , λ ) be finite state machine with transition table appearing in Table 10.6.
Find the set S, I, O and initial state S0. Draw the state diagram. If α = a a b a b a a b b a b is an input
word. Find the corresponding sequence of state and the output word.
Table 10.6
I δ λ
S a b a b
S0 S1 S2 x y
S1 S3 S1 y z
S2 S1 S0 z x
S3 S0 S2 z x
Starting with S0, we move state to state by the arrows which are labelled and obtain the following
sequence:
a/ x a/ y b/ x a/z b/z a/ y a/ z b/ y b/ x a/ x b/ z
S0 → S1 → S3 → S 2 → S1 → S1 → S3 → S0 → S 2 → S0 → S1 → S1
∴ β = s0, s1, s3, s2, s1, s1, s3, s0, s2, s0, s1, s1 is the sequence of states and r = x y x z z y z y x x z is the
corresponding output word.
b/z
A/x
S0 S1
A/z
a/z
S2 S3
b/x
Fig. 10.8
Example 2: Let I = {a, b}, O = {0, 1} and S = {s0, s1}. Define the functions δ : S × I → S, and
λ : S × I → O by the rules given in Table 10.7 representing the finite state machine M = (S, I, O, δ , λ )
Table 10.7
I δ λ
S a b a b
S0 S0 S1 0 1
S1 S1 S1 1 0
E X E R C I S E 10.1
1. Draw the state diagram for the finite state machine given by the Table on page 410.
I Input Output
S 0 1 0 1
S1 S2 S2 0 1
S2 S2 S3 1 1
S3 S5 S5 0 1
S4 S4 S1 1 1
S5 S5 S4 1 1
2. Draw the state diagram for the following finite state machine:
I Input Output
δ λ
S 0 1 0 1
a b c 0 0
b b c 0 0
c b c 0 1
3. A finite state machine is given by the following table. Draw its state diagram:
S 0 1 0 1
a b c 0 1
b a c 0 1
c c a 1 0
4. Draw finite state diagram for the finite state machine given by the following table:
0 1 2
A A B C
B B C A
C C A B
FINITE STATE MACHINES 417
I δ λ
S a b a b
S0 S1 S1 1 1
S1 S0 S1 0 1
8.
I δ λ
S a b c a b c
S0 S0 S1 S2 0 1 0
S1 S1 S1 S0 1 1 1
S2 S2 S1 S0 1 0 0
9. Find the sets S, I and O. Also find the initial state. Find the next state function. (δ ) and the
output function (λ ) for each of the finite state machine.
(a)
418 DISCRETE MATHEMATICAL STRUCTURES
(b)
(c)
(d)
(e)
(f )
FINITE STATE MACHINES 419
10. Let M = (S, I, O, δ , λ ) be the finite state machine appearing in the table given below:
I δ λ
S a b a b
S0 S2 S1 y z
S1 S2 S3 x y
S2 S2 S1 y z
S3 S3 S0 z x
Find S, I and O…. Draw the state diagram also find the output word r if the input word is α = a a
b b a b b a a b.
10.8.3 Subword
Definition 10.13: A word α is called a subword of the word w if w = α 0 α α1 λ itself is a subword
of w.
If α 0 = λ (the empty word), then α is called an initial segment of the word w.
420 DISCRETE MATHEMATICAL STRUCTURES
10.8.4 Concatenation
Let a1 a2 a3 … ap and b1 b2 b3 … bq be strings. Then their concatenation is the string a1 a2 a3 … ap b1 b2
b3 … bq. It is of length p × q .
The Concatenation is also called the join or product of strings.
Example 1: The Concatenation of 3215 and 7281 is 32157281.
Example 2: The concatenation of ‘place’ and ‘ment’ is ‘placement’.
If α and β are strings, the concatenation of α and β is α β . In general, it is not communicative
i.e., α β ≠ β α .
Example 3: If α = a a b b a c and β = c a b b c a then α β = a a b b a c c a b b c a and
β α = c a bb c a a a b b a c .
If A is an alphabet, then the finite set of all strings on A is denoted by A*.
Formal Language
Definition 10.14: Let A be an alphabet A formal language L over A is a subset of A*, the set of all
strings over A.
Example: Let A = (a, b) then L = (am bm : m > 0) is a language over A. It consists of all words
beginning with one or more a’s followed by the same number of b’s.
Definition 10.15: It L1 and L2 are language over an alphabet A, then the language L1 L2 over A is set of
all words over A formed by concatenating words in L1 with in L2.
∴ L1 L2 = {w :α β where α ∈ L1 , β ∈ L2 }
Example 1: If L1 = (a, ab, a2), L2 = (b, b2, aba) then L1 L2 = (ab, ab2, a2ba, ab2, ab3, ababa, a2b, a2b2,
a3ba)
Let L be a language over A. We can write L0 = {λ}, L1 = L and Ln +1 = Ln L (for n > 0)
Example 2: If L (a, bc) then L3 = (aaa, aabc, abca, bcaa, bcbcbc, bcbca, bcabc, abcbc).
10.8.5 Grammar
Definition 10.16: A phase-structure grammar G (or simply a grammar) is (N, T, P, S) where
(i) N is a finite non-empty set whose elements are called variables (or non-terminals).
(ii) T is a finite non-empty set whose elements are called terminals where N ∩ T = ∅.
(iii) A finite set P whose elements are α → β . When α and β are strings on N U T (where α has
atleast are symbol form N). The elements of P are called productions or production rules.
(iv) S is a special variable (non-terminal) called the start symbol. It is an element of N.
FINITE STATE MACHINES 421
Example: Consider the grammar G (N, T, P, S), where N = (S, A), T = (a, b),
P = ( S → b S , S → a A, A → b A, A → b).
The string ab A bb can be derivable directly from a A bb by using the production A → b A. It is
written as a Ab b ⇒ a b Ab b
∗ ∗
Definition 10.18: If α and β are strings on N U T then we say that α derive β if α ⇒ β , where ⇒
G G
Example 1: Consider the grammar G = (N, T, P, S), where N = (S, A, a, b) T = (a, b), and
P = ( S → a A, S → b, A → a a ) with S as the start symbol.
Solution: L (G) can be derived as follows:
We start with S.
S ⇒ aA
⇒ aaa
we can also use S → b to derive b
∴ L (G ) = {b, a a a}
Example 3: Consider the grammar G = (N, T, P, S), where N = (A, B, S), T = (a, b),
P = {S → a B, B → b, B → b A, A → a B} and S is the starting symbol.
Solution: We prove by giving example. We derive ab, (n = 1) and (ab)2, (n = 2)
S ⇒ aB
⇒ ab
∴ S ⇒ (a b)1
and S ⇒ aB
⇒ ab A
⇒ aba B
⇒ abab
⇒ (a b ) (a b )
∴ L (G) can be generated by G.
10.8.6 Types of Grammars
Definition 10.19: A grammar G which has no restriction on its production is called type zero grammar.
It is denoted by the symbol T0.
Definition 10.20: A grammar G is said to be of Type 1, every production α → β has the property that
l (α ) ≤ l ( β ). It is denoted by T1.
⇒ a a b b v1
⇒ a a b bc
The corresponding derivation is as shown in figure below (Fig. 10.10)
The state diagram of a finite automation (FA) is a directed graph in which the nodes (vertices)
correspond to the states of finite automation. The directed edge of the graph indicate the transition of a
state. The edges in the diagram are labeled with input/output.
The initial state in the transition diagram is indicated by the arrow labeled ‘start’ and final state is
indicated by a ‘double circle’.
The block diagram of a finite automation is shown in Fig. 10.11.
Table 10.8
I δ λ
S a b a b
S0 S1 S0 1 0
S1 S2 S0 1 0
S2 S2 S0 1 0
The finite state machine has S1 and S2 as the accepting starts. The lost output is 1. Hence, it is finite
automation. The transition diagram of the automation can be drawn as shown in Fig. 10.12 (note that
output symbols are omitted in the diagram).
Example 2: Consider the transition diagram of Fig. 10.13. Construct the state table and give the entire
sequence of states for the input string 110101.
Solution: The finite automation (FA) shown in Fig. 10.13 is A = ( S , I , δ , S0 , F )
Where S = (S0, S1, S2, S3)
I = (0, 1)
F = (S0)
and δ is defined by
δ ( q1 , 0) = q3 , δ ( q1 , 1) = q0
δ ( q2 , 0) = q0 , δ (q2 , 1) = q3
δ ( q3 , 0) = q1 , δ (q3 , 1) = q2
426 DISCRETE MATHEMATICAL STRUCTURES
Fig. 10.13
Table 10.9
States Inputs
0 1
S0 S2 S1
S1 S3 S0
S2 S0 S3
S3 S1 S2
δ ( S0 , 0) = S 2
⇒ δ ( S 0 , 110) = δ (δ ( S 0 , 11), 0) = δ ( S 0 , 0) = S 2
⇒ δ ( S0 , 1101) = δ (δ ( S0 , 110), 1)
= δ ( S 2 , 1)
= S3
⇒ δ ( S0 , 11010) = δ (δ ( S0 , 1101), 0)
= δ ( S3 , 0)
= S1
FINITE STATE MACHINES 427
⇒ δ ( S0 , 110101) = δ (δ ( S0 , 11010), 1)
= δ ( S1 , 1)
= S0
The entire sequence of states is
Example 4: Draw the transition diagram to represent the finite automation A = ( S , I , δ , S 0 , F ), where
S = (S0, S1, S2, S3), I = (a, b), F = (S0), and F is defined by
δ ( S0 , a ) = S 2 , δ ( S3 , a ) = S1 ,
δ ( S1 , a ) = S 3 , δ ( S 0 , b ) = S1 , δ ( S 2 , b) = S3
δ ( S2 , a ) = S0 , δ ( S1 , b ) = S0 , δ ( S3 , b) = S 2
Solution: The transition diagram representing the finite automation is a shown in Fig. 10.14.
Fig. 10.14
E X E R C I S E 10.2
1. Define finite automation.
2. Design a finite automation that accepts precisely those strings over (a, b) that contain an odd
number of a’s.
3. Draw the transition diagram of the finite automation of the figure given below as a transition
diagram of finite state machine.
FINITE STATE MACHINES 429
4. Find the finite state automation A with the input symbols a, b, c and output symbols x, y, z and
state diagram is given below:
Example 1: Consider the NDFA shown in table below with S2 and S3 as the find states. Draw the state
diagram for the NDFA.
Table 10.10
States Inputs
0 1
S0 (S0, S3) (S0, S1)
S1 ∅ (S2)
S2 (S2) (S2)
S3 (S4) ∅
S4 (S4) (S4)
430 DISCRETE MATHEMATICAL STRUCTURES
A1 = ( S , I , δ 1 , S0 , F 1 ) denote a NDFA.
By defining δ 1 ( S , α ) = {δ ( S , α )}, we can make DFA, and the NDFA equivalent finite state
machines that is, for every NDFA we can construct an equivalent DFA.
Example 2: Construct a DFA equivalent to A1 = ({S0 , S1 , S2 , S3 }, {0, 1}, {S3 }), where the transition
function is given by the table below.
FINITE STATE MACHINES 431
Table 10.11
States Inputs
a b
S0 S0 , S1 S0
S1 S2 S1
S2 S3 S3
S3 S2
Table 10.12
States Inputs
a b
(S0) (S0, S1) (S0)
(S0, S1) (S0, S1, S2) (S0, S1)
(S0, S1, S2) (S0, S1, S2, S3) (S0, S1, S3)
(S0, S1, S3) (S0, S1, S2) (S0, S1, S2)
(S0, S1, S2, S3) (S0, S1, S2, S3) (S0, S1, S2, S3)
Table 10.13
States Inputs
0 1
S0 S0 S1
S1 S1 S0 , S1
Solution: Let S = (S0, S1) then 2s = P ( S ) = {∅, {S0 }, {S1}, {S0 , S1 }} for the DFA equivalent to A1 we
have (S0) as the initial state and (S0), (S0, S1) as the final states.
The equivalent can be constructed as shown in Table 10.14.
432 DISCRETE MATHEMATICAL STRUCTURES
Table 10.14
States Inputs
a b
∅ ∅ ∅
(S0) (S0) (S1)
(S1) (S1) (S0, S1)
(S0, S1) (S0, S1) (S0, S1)
Example 4: Construct a DFA from the NDFA A1 = ({S0 , S1 , S2 }, {a, b}, δ 1 , S0 , F 1 ), where F = (S1)
and the transition function is given by the following table:
Table 10.15
Inputs
δ′ a b
S0 (S1, S2) φ
S1 φ (S2)
S2 φ (S2)
Table 10.16
δ1 a b
φ φ φ
(S0) (S, S2) φ
(S1) φ (S2)
(S2) φ (S2)
(S0, S1) (S1, S0) (S2)
(S0, S2) (S1, S2) (S2)
(S1, S2) φ (S2)
(S0, S1, S2) (S1, S2) (S2)
FINITE STATE MACHINES 433
δ (Si –1 , αi ) = Si for 1 ≤ i ≤ n
For a Moore machine if the input string is of length n, the output string is of the length n + 1.
Example: The table given below is a Moore machine:
Table 10.17
S0 S3 S1 0
S1 S1 S2 1
S2 S2 S3 0
S3 S3 S2 0
Table 10.18
Next State
Present α =0 α =1
state State Output State Output
S0 S3 0 S1 1
S1 S1 1 S2 0
S2 S2 0 S3 0
S3 S3 0 S0 0
Bibliography
Index