Professional Documents
Culture Documents
Discrete Mathematics
Discrete Mathematics
Board of Studies
___________________________________________________________________________________________
Subject Expert Panel
___________________________________________________________________________________________
Content Review Panel
___________________________________________________________________________________________
Copyright ©
Printed by
Universal Training Solutions Private Limited
Address
05th Floor, I-Space,
Bavdhan, Pune 411021.
All rights reserved. This book or any portion thereof may not, in any form or by any means including electronic
or mechanical or photocopying or recording, be reproduced or distributed or transmitted or stored in a retrieval
system or be broadcasted or transmitted.
___________________________________________________________________________________________
Index
I. Content....................................................................... II
IV. Abbreviations.......................................................VIII
Book at a Glance
I
Contents
Chapter I........................................................................................................................................................ 1
Logic............................................................................................................................................................... 1
Aim................................................................................................................................................................. 1
Objectives....................................................................................................................................................... 1
Learning outcome........................................................................................................................................... 1
1.1 Introduction............................................................................................................................................... 2
1.2 Statement/Proposition............................................................................................................................... 2
1.3 Truth Value . .............................................................................................................................................. 2
1.4 Venn Diagrams.......................................................................................................................................... 2
1.5 Compound Statements and Logical Connectives..................................................................................... 5
1.6 Truth Tables............................................................................................................................................... 7
1.7 Tautology, Contradiction and Contingency.............................................................................................. 8
1.8 Logical Equivalence.................................................................................................................................. 9
1.9 Negation of a Compound Statement......................................................................................................... 9
1.10 Some Standard Equivalent Statements in Logic................................................................................... 10
1.11 The Use of Logic in Circuits................................................................................................................. 10
1.12 Quantifiers..............................................................................................................................................11
Summary...................................................................................................................................................... 14
References.................................................................................................................................................... 14
Recommended Reading.............................................................................................................................. 14
Self Assessment............................................................................................................................................ 15
Chapter II.................................................................................................................................................... 17
Combinatorics............................................................................................................................................. 17
Aim............................................................................................................................................................... 17
Objectives..................................................................................................................................................... 17
Learning outcome......................................................................................................................................... 17
2.1 Introduction............................................................................................................................................. 18
2.2 Basic Counting Principles....................................................................................................................... 18
2.2.1 The Sum Rule......................................................................................................................... 18
2.2.2 The Product Rule.................................................................................................................... 18
2.2.3 Inclusion and Exclusion.......................................................................................................... 19
2.2.4 Tree Diagrams......................................................................................................................... 20
2.3 The Pigeonhole Principle........................................................................................................................ 21
2.4 Permutations and Combinations............................................................................................................. 22
2.4.1 Permutation............................................................................................................................. 22
2.4.2 Combinations.......................................................................................................................... 24
2.4.3 Permutations with Indistinguishable Objects......................................................................... 24
Summary...................................................................................................................................................... 26
References.................................................................................................................................................... 26
Recommended Reading.............................................................................................................................. 26
Self Assessment............................................................................................................................................ 27
Chapter III................................................................................................................................................... 29
Mathematical Induction............................................................................................................................. 29
Aim............................................................................................................................................................... 29
Objectives..................................................................................................................................................... 29
Learning outcome......................................................................................................................................... 29
3.1 Introduction............................................................................................................................................. 30
3.2 First Principle of Mathematical Induction.............................................................................................. 30
3.3 Second Principle of Mathematical Induction.......................................................................................... 32
3.4 Different Perspective of Applying Mathematical Induction Principles ................................................. 33
3.5 Steps to Use Mathematical Induction..................................................................................................... 35
II
Summary...................................................................................................................................................... 40
References.................................................................................................................................................... 40
Recommended Reading.............................................................................................................................. 40
Self Assessment............................................................................................................................................ 41
Chapter IV................................................................................................................................................... 43
Recurrence Relation................................................................................................................................... 43
Aim............................................................................................................................................................... 43
Objectives..................................................................................................................................................... 43
Learning outcome......................................................................................................................................... 43
4.1 Introduction............................................................................................................................................. 44
4.2 Definition of Recurrence Relation ......................................................................................................... 44
4.2.1 Linear Recurrence Relation with Constant Coefficients........................................................ 44
4.3 Construction of Recurrence Relation...................................................................................................... 44
4.3.1 Degree of Recurrence Relation............................................................................................... 45
4.3.2 Characteristic Equation of Recurrence Relation..................................................................... 45
4.3.3 Characteristic Roots of Recurrence Relation.......................................................................... 45
4.3.4 Homogeneous Recurrence Relation........................................................................................ 46
4.3.5 Non-homogenous Recurrence Relation.................................................................................. 46
4.4 Solution of Recurrence Relation............................................................................................................. 46
4.4.1 Solution of Homogenous Recurrence Relation...................................................................... 46
4.4.2 Solution of Non-homogenous Recurrence Relation............................................................... 47
4.5 Applications of Recurrence Relation...................................................................................................... 48
Summary...................................................................................................................................................... 50
References.................................................................................................................................................... 50
Recommended Reading.............................................................................................................................. 50
Self Assessment............................................................................................................................................ 51
Chapter V..................................................................................................................................................... 53
Graphs.......................................................................................................................................................... 53
Aim............................................................................................................................................................... 53
Objectives..................................................................................................................................................... 53
Learning outcome......................................................................................................................................... 53
5.1 Introduction............................................................................................................................................. 54
5.2 Terminologies in Graph.......................................................................................................................... 54
5.3 Representation of Graph......................................................................................................................... 56
5.4 Uses of Graphs........................................................................................................................................ 57
5.5 Some Important Graphs.......................................................................................................................... 58
5.6 Degree Sequence..................................................................................................................................... 59
5.6.1 Graphical Degree Sequence.................................................................................................... 59
5.7 Isomorphism in Graphs........................................................................................................................... 60
5.7.1 Isomorphism by Using Adjacency Matrix.............................................................................. 61
5.8 Applicability of Graphs........................................................................................................................... 62
Summary...................................................................................................................................................... 64
References.................................................................................................................................................... 64
Recommended Reading.............................................................................................................................. 64
Self Assessment............................................................................................................................................ 65
Chapter VI................................................................................................................................................... 67
Tree............................................................................................................................................................... 67
Objectives . ............................................................................................................................................ 67
Learning outcome......................................................................................................................................... 67
6.1 Introduction............................................................................................................................................. 68
6.2 Tree......................................................................................................................................................... 68
6.2.1 Properties of Tree Graph......................................................................................................... 69
III
6.2.2 Equivalent Properties of Tree................................................................................................. 69
6.3 Spanning Tree......................................................................................................................................... 71
6.3.1 Terminologies in Spanning Tree............................................................................................. 71
6.4 Fundamental Circuits.............................................................................................................................. 72
6.5 Shortest Spanning Tree........................................................................................................................... 73
6.6 Kruskal’s Algorithm................................................................................................................................ 74
6.7 Binary Tree............................................................................................................................................. 76
6.7.1 Binary Rooted Tree................................................................................................................. 76
6.7.2 Height of Binary Tree............................................................................................................. 76
6.8 Graph/Tree Search Techniques............................................................................................................... 77
Summary...................................................................................................................................................... 81
References.................................................................................................................................................... 81
Recommended Reading.............................................................................................................................. 81
Self Assessment . ......................................................................................................................................... 82
Chapter VII................................................................................................................................................. 85
Connected and Disconnected Graphs....................................................................................................... 85
Aim............................................................................................................................................................... 85
Objectives..................................................................................................................................................... 85
Learning outcome......................................................................................................................................... 85
7.1 Connected and Disconnected Graph....................................................................................................... 86
7.1.1 Walk........................................................................................................................................ 86
7.1.2 Trail......................................................................................................................................... 86
7.1.3 Path ........................................................................................................................................ 87
7.1.4 Cycle (Circuit)........................................................................................................................ 87
7.2 Connected Graph.................................................................................................................................... 87
7.2.1 Component.............................................................................................................................. 88
7.2.2 Cut Vertex............................................................................................................................... 88
7.3 Weight Graph.......................................................................................................................................... 88
7.3.1 Dijkstra’s Algorithm............................................................................................................... 89
7.4 Connectivity............................................................................................................................................ 91
7.4.1 Edge Connectivity................................................................................................................... 91
7.4.2 Vertex Connectivity................................................................................................................ 92
7.4.3 Degree of Graph...................................................................................................................... 93
Summary...................................................................................................................................................... 95
References.................................................................................................................................................... 95
Recommended Reading.............................................................................................................................. 95
Self Assessment............................................................................................................................................ 96
Chapter VIII................................................................................................................................................ 98
Introduction to Probability........................................................................................................................ 98
Aim............................................................................................................................................................... 98
Objectives..................................................................................................................................................... 98
Learning outcome......................................................................................................................................... 98
8.1 Introduction............................................................................................................................................. 99
8.2 Terminologies in Probability................................................................................................................... 99
8.3 Probability ............................................................................................................................................ 100
8.3.1 Definition of Probability Using an Event............................................................................. 100
8.3.2 Definition of Probability Using Sample Space..................................................................... 101
8.3.3 Rules of Probability.............................................................................................................. 101
8.3.4 Conditional Probability......................................................................................................... 103
8.3.5 Axiomatic Approach of Probability...................................................................................... 105
8.4 Bayes’ Theorem.................................................................................................................................... 105
8.5 Probability Distributions....................................................................................................................... 106
8.5.1 Binomial Distribution........................................................................................................... 107
IV
8.5.1.1 Probability Function of Binomial Distribution...................................................... 107
8.5.1.2 Parameters of Binomial Distribution..................................................................... 108
8.5.1.3 Important Measures or Constants of Binomial Distribution.................................. 109
8.5.2 Poisson Distribution...............................................................................................................110
8.6 Other Types of Distribution...................................................................................................................112
8.6.1 Multinomial Probabilities......................................................................................................112
8.6.2 Hypergeometric Probabilities................................................................................................112
8.7 Random Walk.........................................................................................................................................113
Summary.....................................................................................................................................................116
References...................................................................................................................................................116
Recommended Reading.............................................................................................................................116
Self Assessment...........................................................................................................................................117
V
List of Figures
Fig. 1.1 All X’s are Y’s................................................................................................................................... 3
Fig. 1.2 All scientists are scholars................................................................................................................... 3
Fig. 1.3 No X’s are Y’s................................................................................................................................... 4
Fig. 1.4 No wicket keeper is a bowler, in a cricket team................................................................................ 4
Fig. 1.5 (a) Some X’s are Y’s.......................................................................................................................... 4
Fig. 1.5 (b) Some X’s are Y’s.......................................................................................................................... 4
Fig. 1.6 (a) Some quadratic equations have two imaginary roots................................................................... 5
Fig. 1.6 (b) Some quadratic equations have two imaginary roots ................................................................. 5
Fig. 2.1 Basic rules of counting principles................................................................................................... 18
Fig. 2.2 Bit strings of length four without consecutive 1s............................................................................ 21
Fig. 2.3 More pigeons than pigeonholes....................................................................................................... 21
Fig. 4.1 Homogenous and non-homogenous recurrence relation................................................................. 46
Fig. 6.1 Tree.................................................................................................................................................. 68
Fig. 6.2 Graphs are not trees......................................................................................................................... 69
Fig. 6.3 Spanning tree................................................................................................................................... 71
Fig. 8.1 Bayes’ theorem illustration-I......................................................................................................... 105
Fig. 8.2 Bayes’ theorem illustration-II........................................................................................................ 105
Fig. 8.3 Bayes’ theorem illustration-III....................................................................................................... 106
Fig. 8.4 Probability distribution.................................................................................................................. 106
Fig. 8.5 Positively skewed binomial distribution....................................................................................... 108
Fig. 8.6 Symmetrical binomial distribution................................................................................................ 108
Fig. 8.7 Negatively skewed binomial distribution...................................................................................... 109
Fig. 8.8 Bell-Shaped binomial distribution................................................................................................. 109
Fig. 8.9 Different paths leading to a final position......................................................................................113
Fig. 8.10 Estimate lies in a range around µ.................................................................................................115
VI
List of Tables
Table 4.1 Solution to Example 1................................................................................................................... 45
Table 4.2 Solution to solve non-homogenous recurrence relation................................................................ 47
Table 5.1 Different types of graphs............................................................................................................... 59
VII
Discrete Mathematics
Abbreviations
BFS - Breadth First Search
DFS - Depth First Search
FIFO - First In, First Out
LHS - Left Hand Side
MST - Minimum Spanning Tree
RHS - Right Hand Side
SP - Shortest Path
w.r.t - With respect to
VIII
Chapter I
Logic
Aim
The aim of this chapter is to:
Objectives
The objectives of this chapter are to:
• explain tautology
Learning outcome
At the end of this chapter, you will be able to:
1
Discrete Mathematics
1.1 Introduction
In order to understand mathematics like any other language, one must learn the vocabulary and its application. Math
logic is the structure that allows us to describe concepts in terms of maths. We will start with very basic ideas and
build on them.
Logic defines the ground rules for establishing truths. Mathematical logic spells out these rules in complete detail,
defining what constitutes a formal proof. Learning mathematical logic is a good way to learn logic because it creates
a firm foundation. Writing formal proofs in mathematical logic is like computer programming to a great extent.
1.2 Statement/Proposition
A simple sentence which is declarative or assertive and is either true or false (but not both), is called as a statement
or a proposition in logic. We denote the statements by lower case letters like p, q, r etc. They are called statement
letters.
Example:
Consider the following sentences:
• My new shirt is blue in colour.
• Is the shirt blue in colour?
• How beautiful is the new shirt!
In above sentences,
Sentence 1 is a simple assertive sentence, hence, it is a statement.
Sentence 2 is an interrogative sentence (question form) hence, it is not a statement.
Sentence 3 is an exclamatory sentence (a common). Hence, it is not a statement.
Thus, for a sentence to be a statement, it should be assertive. Moreover, it should be true or false. Sentence which
is interrogative or exclamatory is not a statement. Mathematical identities are considered to be statements.
Example:
Consider the following sentences:
• The earth is round.
• Every set is a finite set.
• 2 is a prime number.
Sentences 1, 2 and3 are simple assertive sentences. Therefore, they are statements. The truth value of sentence 1
and 3 is ‘T’ and that of sentence 2 is ‘F.
2
Type I: “All X’s are Y’s”
This statement is assumed to be true with true value T. In the language of sets, the statement means that X is a subset
of Y. Hence, each element of X belongs to Y. This is represented by the following Venn diagram. The validity of the
statement: All X’s are Y’s are shown in the figure below.
We observe that X is a subset of Y. Further, each element of the set X belongs to the set Y, does not belong to X.
Only some elements of Y belong to X. In general, when the statement: All X’s are Y’s is given with truth value T,
the statement: All Y’s are X’s does not follow from it.
U
Y
X x
Example:
Consider the statement: “All scientists are scholars”.
It is assumed to be true with truth value T.
Let U = Set of all the people
X = Set of all the scientists
Y = Set of all the scholars
We can draw the Venn diagram as shown in the figure below.
We observe that there is a scholar say y, who is not a scientist. Hence, the statement: All scholars are scientists follow
from statement 1. However, the statement: Some scholars are scientists follows from 1.
U
Y
X x
3
Discrete Mathematics
U
X
Example:
Consider the statement: “No wicket keeper is a bowler, in a cricket team”.
This statement is of the type “No X’s are Y’s”. It is assumed to be true with truth value T.
Let U= Set of all the players
W= Set of wicket keepers
B= Set of bowlers.
The Venn diagram in the figure below represents the truth of the statement: “No wicket keeper is a bowler”. We
know that the statement: No Y’s are X’s follows from the statement: No X’s are Y’s. Hence, the figure below also
represents the truth of the statement. ‘No Bowler is a Wicket-keeper’.
U
W
U
U
X
Y Y
X
(a) (b)
Fig. 1.5 Some X’s are Y’s
4
Fig. 1.5 (a) and (b) both represent the truth of the statement: “Some X’s are Y’s”.
From Fig.1.5 (a), we observe that the statement: “Some X’s are Y’s” follows from the statement: “Some X’s are Y’s”.
In Fig.1.5 (b) we observe that the statement: All Y’s are X’s follows from the statement: “Some X’s are Y’s”.
Example:
Consider the statement: “Some quadratic equations have two imaginary roots”. This statement is of the type, Some
X’s are Y’s. It is assumed to be true with the truth value T.
Let, U= Set of all equations
X= Set of quadratic equations
Y= Set of quadratic equations having two imaginary roots
The Venn diagram Fig.1.6 (a) represents the truth of the statement: “Some quadratic equations have two imaginary
roots”
U U
X
Y X Y
(a) (b)
5
Discrete Mathematics
Disjunction or Alternation (p ∨ q): If p and q are two simple statements, then the compound statement ‘p or q’ is
called their disjunction.
It is denoted by p ∨ q and read as p or q. the statement p and q are called its disjuncts.
Example:
Consider, p: I will watch the cricket match on TV.
q: I will go to the Wankhede stadium.
Then, p ∨ q: I will watch the cricket match on TV or go to the Wankhede stadium.
Conjunction (p ∧ q):
If p and q are two simple statements, then the compound statement ‘p and q’ is called their conjunction.It is denoted
by p ∧ q and read as ‘p and q’. The statement p and q are called its conjuncts.
Example:
Consider, p: 12 is an even number.
q: 12 is a perfect square.
Then, p ∧ q: 12 is an even number and it is a perfect square.
1 NOT ~ Negation
2 OR ∨ Disjunction
3 AND ∧ Conjunction
4 IF … THEN → Implication
6
Example:
Using the statements,
p: Akshay is rich
q: Akshay is happy
and assuming that ‘not rich’ is ‘poor’,
write the following statements in symbolic form.
Solution:
We have, p: Akshay is rich.
~p: Akshay is poor.
q: Akshay is happy.
~q: Akshay is unhappy.
Thus,
p ∧ ~q : Akshay is rich and unhappy.
~p ∧ q : Akshay is poor but happy.
~p ∧ ~q : Akshay is neither rich nor happy.
~p ∨ ~q : Akshay is unhappy or poor.
~ (~p ∧ q) : It is not true that Akshay is poor and happy.
~q ↔ p : Akshay is unhappy if and only if he is rich.
p q p∨q
T T T
T F T
F T T
F F F
p q p∧q
T T T
T F F
F T F
F F F
7
Discrete Mathematics
p q p→q
T T T
T F F
F T T
F F T
p q p↔q
T T T
T F F
F T F
F F T
Example:
Consider the statement pattern p ∨ ~p
The truth table for p ∨ ~p is as follows.
Since p ∨ ~p always takes value T for all possible truth values of p, it is a tautology.
Note: The disjunction of a statement pattern and its negation is always a tautology.
p ~p p ∨ ~p
T F T
F T T
Contradiction
A statement pattern which is always false (i.e., always takes truth value F) irrespective of truth values of its component
statement letters is called a contradiction.
Example:
Consider the statement pattern p ∧ ~p.
The truth table for p ∧ ~p is given along side. Since p ∧ ~p always takes a value F for all possible truth values of
p, it is a contradiction.
Note:
i. The conjunction of a statement pattern and its negation is always contradiction. Thus, (p ∨ q) ∧ ~
(p ∨ q), (p → q) ∧ ~(p → q) etc. are contradictions.
ii. Negation of a tautology is a contradiction and vice- versa.
8
iii. A statement pattern is a tautology by virtue of the property of logical connectives and their positions
in the statement pattern. It is independent of the statement letters it contains.
p ~p p ∧ ~p
T F F
F T F
Contingency
A statement pattern which is neither a tautology nor a contradiction is called a Contingency. Thus, a contingency is
a statement pattern which is either true or false depending on the truth values of its component statement letters.
Note: If a statement pattern is not a tautology, then it may be either a Contradiction or a Contingency.
Example:
Let p: 6 is an even number,
q: 6 is a multiple of 3.
Hence, p and q are logically equivalent.
Two statement patterns are said to be logically equivalent if their truth values are identical for each combination of
the truth values of their component statement letters.
If A, B are logically equivalent statement patterns, we denote it by A≡B or A⟺B.
Example:
Consider the following truth table:
p q A: p → q B: ~p ∨ q A↔B
T T T T T
T F F F T
F T T T T
F F T T T
9
Discrete Mathematics
The negation of the disjunction of two statements is logically equivalent to the conjunction of their negations.
i.e., ~(p ∨ q) ≡ ~p ∧ ~q (De Morgan’s Law)
Proof:
We construct the truth table as follows, using the rule for truth value of negation for column 3, 4 and 6,
disjunction for column 5, conjunction for column 7.
1 2 3 4 5 6 7
p q ~p ~q p∨q ~ (p ∨ q) ~ p ∧ ~q
T T F F T F F
T F F T T F F
F T T F T F F
F F T T F T T
INPUT OUTPUT
Current will flow along a particular path when the switches are closed. Current will flow from the input to the output
when all switches along some path from input to output are closed.
Let c, p, q, r be the following propositions:
c: current flows from input to output.
p: current flows through switch p.
q: current flows through switch q.
10
r: current flows through switch r. Consider the circuits given below and overleaf.
INPUT OUTPUT
Current flows from input to output when p alone is closed, or q alone is closed or both switches are closed.
Here, c = p ∨ q.
INPUT OUTPUT
Current will only flow from input to output when both p and q are closed. Here, c = p ∧ q.
q
INPUT OUTPUT
Here, c = p ∨ q ∨ r.
INPUT OUTPUT
q r
Here, c = p ∨ (q ∧ r).
1.12 Quantifiers
• The language of propositions allows us to model a great variety of properties about specific objects; however,
it doesn’t allow us to state general properties such as “Every cloud has a silver lining”.
• These general properties are known as universal properties, since they describe properties that must be satisfied
by every individual in some universe of discourse.
• In order to symbolise universal and existential properties we shall need two new symbols i.e. ∀ (called as ‘For
all’) and ∃ (called as ‘there exist’).
• The quantifier symbols are used to build predicates; a predicate is like a“∀” is the universal quantifier, and
“∃” is the existential quantifier.
11
Discrete Mathematics
• Any quantifier that starts with “∃” (such as “∃x”) is an existential quantifier. “∃x” is translated as “there exists
an x such that..” We can combine a quantifier with a predicate to make a well-formed formula, as in ‘∃xBx’
• To understand such a well-formed formula, we can rewrite it as a semi-formal statement: There exists an x
such that Bx. Or alternatively, There is at least one x such that Bx. So what it says is that, there is some object
x, and x is B.
• In other words, it simply says that something is B. If the predicate “Bx” means x is a boy, then the well-formed
formula can be translated as there is at least one boy, or a boy exists.
• Notice that “∃xBx”, “∃yBy”, “∃zBz”, etc. all say the same thing. They are different well-formed formulae since
they employ different variables. But they are logically equivalent nonetheless.
• Also notice that the truth of “∃xBx” is consistent with the claim that there is more than one B. It is just that this
is not what “∃xBx” says. The latter well-formed formula says that there is one or more. It might be the case
that there is just one, or it might be that there is more than one.
Any quantifier that starts with “∀” is a Universal Quantifier. “∀x” means “for all x, ... “. Again we can combine a
universal quantifier with a predicate to form a well-formed formula, such as : ∀xBx
In semi-formal notation, this means the same as “for all x, Bx”. What this says is that for any object x, x is B. If
“Bx” means x is a boy, this well-formed formula would mean for every x, x is a boy. In other words, take any object
whatsoever; it is a boy, which is just the same as saying that everything is a boy. Under such a translation, the well-
formed formula is of course actually false.
Now consider the following formula, what do you think it means? (Suppose “Dy” means y is dirty, and “By” as
before.)
For all y, (By→Dy)
For all y, if y is a boy, then y is dirty.
Everything is such that if it is a boy, then it is dirty.
We might find the interpretation of well-formed formula difficult at first, but if you try to understand them step-by-
step, then it might become easier. We can see in the above example that the last sentence says the same as “Every
boy is dirty”, which is just what the well-formed formula means. We will use the same translation scheme as before
to understand the meaning of the well-formed formula.
1. ∀zDz
Everything is dirty.
2. ∀z(Dz→Dz)
Everything that is dirty is dirty.
The second well-formed formula above actually means “It is not the case that EVERYTHING IS D.” So it says that
not everything is D. This is of course the same as saying that something is not D. Refer to the figure below.
12
D
Suppose the gray region represents everything that is D. The area outside the gray region represents things that are
not D.
To say that not everything is D is to say that something exists in the class represented by the region outside the D
circle. So this is the same as saying that something is not D.
• ~∀y ~ Dy: It is not the case that everything is not D (In other words, something is D!)
• ∃yDy: Something is D
• ∃y ~ Dy: Something is not D
• ~∃yDy: It is not the case that something is D (So everything is not D)
• ~∃y ~ Dy: It is not the case that something is not D (So everything is D)
As you can see, some of these wffs are equivalent to each other:
• ∀yDy ≡ ~∃y ~ Dy
• ~∀yDy ≡ ∃y ~ Dy
• ∀y ~ Dy ≡ ~∃yDy
• ~∀y ~ Dy ≡ ∃yDy
Example:
The following are all examples of universal properties:
1. Every cloud has a silver lining.
2. All the bells in heaven shall ring.
3. Each student must hand in homework.
4. Nobody knows the trouble I seen.
5. Roses are red.
6. Jim doesn’t know anybody who can sign his bail application.
Example:
The following are all examples of existential properties:
1. Something’s got into the tank.
2. There is a tavern in the town.
3. I heard it from one of your friends.
4. A mad dog has bitten Robert.
5. Some people prefer logic.
13
Discrete Mathematics
Summary
• In mathematical logic, a propositional calculus or logic (also called sentential logic) is a formal system in which
formulas of a formal language may be interpreted as representing propositions.
• In mathematics, a logical value, also called a truth value, is a value indicating the relation of a proposition to
truth. In classical logic, the truth values are true and false.
• Venn diagrams or set diagrams are diagrams that show all hypothetically possible logical relations between
finite collections of sets (aggregation of things).They are used to teach elementary set theory, as well as illustrate
simple set relationships in probability, logic, statistics, linguistics and computer science.
• In logic, a logical connective (also called a logical operator) is a symbol or word used to connect two or more
sentences (of either a formal or a natural language) in a grammatically valid way, such that the compound
sentence produced has a truth value dependent on the respective truth values of the original sentences.
• Each logical connective can be expressed as a function, called a truth function. For this reason, logical connectives
are sometimes called truth-functional connectives. The most common logical connectives are binary connectives
(also called dyadic connectives) which join two sentences whose truth values can be thought of as the function’s
operands.
• Tautology is an unnecessary or unessential repetition of meaning, using different and dissimilar words that
effectively say the same thing.
• In logic, quantification is the binding of a variable ranging over a domain of discourse. The variable thereby
becomes bound by an operator called a quantifier. Academic discussion of quantification refers more often to
this meaning of the term than the preceding one.
• In grammar, a quantifier is a type of determiner, such as all or many, that indicates quantity. These items have
been argued to correspond to logical quantifiers at the semantic level.
References
• Simpson, S. G., 2010. Mathematical Logic, Logic, Pennsylvania state university press.
• Schwichtenberg, H., 2004. Mathematical Logic, Logic, Mathematics Institute University Munchen.
• Lal, A. K., Lecture Notes on Discrete Mathematics, [Pdf] Available at: <http://home.iitk.ac.in/~arlal/book/
mth202.pdf> [Accessed 20 June 2013].
• Lovasz, L. & Vesztergombi, K., Discrete Mathematics, [Pdf] Available at: <http://www.cims.nyu.edu/~regev/
teaching/discrete_math_fall_2005/dmbook.pdf> [Accessed 20 June 2013].
• nptelhrd, 2007. Lecture 1 - Propositional Logic, [Video online] Available at: <http://www.youtube.com/
watch?v=xlUFkMKSB3Y> [Accessed 20 June 2013].
• nptelhrd, 2007. Lecture 1 - Propositional Logic, [Video online] Available at: <http://www.youtube.com/watch
?v=xlUFkMKSB3Y&list=PL0862D1A947252D20> [Accessed 20 June 2013].
Recommended Reading
• Nerode, A. & Shore, R. A., Logic for Applications, Mathematical Logic, 2nd ed., Springer Textbooks.
• Hinman, P. G., 2005. Fundamentals of Mathematical logic, Logic, A K Peters, Ltd.
• Kleene, S. C., 2002. Mathematical logic, Proof and theory, Courier Dover Publications.
14
Self Assessment
15
Discrete Mathematics
10. Translate the following statement into symbolic form using quantifiers.
“Some men do not like cat”, if M is set of all men, C = cats
a. ∃x ∈ ~C
b. ∃x ∋ ~C
c. ∃x ∈ M, (C(x))
d. ∃x ∈ M, (~C(x))
16
Chapter II
Combinatorics
Aim
The aim of this chapter is to:
Objectives
The objectives of this chapter are to:
Learning outcome
At the end of this chapter, you will be able to:
• recognise the techniques to solve problems using permutation and combination theorems
17
Discrete Mathematics
2.1 Introduction
Combinatorics is the study of arrangements of objects, which is an important part of discrete mathematics. This
subject was studied in seventeenth century, when combinatorial questions arose in the study of gambling games.
The important part of combinatorics is counting of objects with certain properties. Counting theory has several uses.
Few of them have been mentioned below:
• It is used to determine the complexity of algorithms
• It is also required to determine whether there are enough telephone numbers or internet protocol addresses to
meet demand.
Another important combinatorial tool is the pigeonhole principle which we will study in this chapter, this states
that when objects are placed in boxes and there are more objects than boxes, then there is a box containing at least
two objects.
We can phrase many counting problems in terms of ordered or unordered arrangements of the objects of a set. These
arrangements, called permutations and combinations, are used in many counting problems.
A password on a computer system consists of six, seven or eight characters. Each of these characters must be
a digit or a letter of the alphabet. Each password must contain at least one digit. How many such passwords are
there? The technique needed to answer such questions and a wide variety of other counting problems will be
introduced in this chapter.
Counting
Principle
SUM PRODUCT
Rule Rule
Example:
The department will award a free computer to either a Computer Science (CS) student or a CS professor. How many
different choices are there, if there are 530 students and 15 professors? There are 530 + 15 = 545 choices.
18
Example:
How many different license plates are there which contain exactly three English letters?
Solution:
There are 26 possibilities to pick the first letter, then 26 possibilities for the second one, and 26 for the last one. So,
there are 26⋅26⋅26 = 17576 different license plates.
The sum and product rules can also be phrased in terms of set theory.
Sum rule:
Let A1, A2… Am be disjoint sets. Then the number of ways to choose any element from one of these sets is,
|A1 ∪ A2 ∪… ∪ Am | = |A1| + |A2| + … + |Am|.
Product rule:
Let A1, A2… Am be finite sets. Then the number of ways to choose one element from each set in the order A1, A2…
Am is,
|A1 × A2 ×… × Am | = |A1| ⋅ |A2| ⋅… ⋅ |Am|.
How many bit strings of length 8 either start with a 1 or end with 00?
..
Task 2:
19
Discrete Mathematics
..
How many cases are there, that is, how many strings start with 1 and end with 00? There is one way to pick the first
bit (1), two ways for the second… sixth bit (0 or 1), one way for the seventh, eighth bit (0).
Product rule: In 25 = 32 cases, Tasks 1 and 2 are carried out at the same time.
Since there are 128 ways to complete Task 1 and 64 ways to complete Task 2, and in 32 of these cases, tasks 1 and 2
are completed at the same time, there are 128 + 64 – 32 = 160 ways to do either task. In set theory, this corresponds
to sets A1 and A2 that are not disjoint. Then we have:
|A1 ∪ A2| = |A1| + |A2| - |A1 ∩ A2|
This is called the principle of inclusion-exclusion.
20
0
0
0 1
1 0
0
0
1 0
1
0
0
1 0 1
1 0
1st 2nd 3rd 4th
bit bit bit bit
In mathematics, the pigeonhole principle states that if n objects are placed into m boxes, and if n > m, then there is
at least one box with at least two objects in it.
Another formulation would be that m boxes cannot contain more than m objects with a single object in each; add
an object and one of the boxes must be used twice.
Illustration:
Suppose that a flock of pigeons flies into a set of pigeonholes to roost. The pigeonhole principle states that if there
are more pigeons than pigeonholes, then there must be at least one pigeonhole with at least two pigeons in it (refer
to the figure below.). This principle applies to other objects besides pigeons and pigeonholes.
21
Discrete Mathematics
Prove by Contradiction
Suppose that the theorem is false and derive a contradiction. Suppose that none of the k boxes contains more than
one object. Then, the total number of objects would be at the most k. This is a contradiction, because there are at
least k + 1 objects.
Example 1:
If there are 11 players in a soccer team that wins 12-0, there must be at least one player in the team who scored at
least twice.
Example 2:
If you have 6 classes from Monday to Friday, there must be at least one day on which you have at least two
classes.
Example 3:
Assume you have a drawer containing a random distribution of a dozen brown socks and a dozen black socks. It is
dark, so how many socks do you have to pick to be sure that among them there is a matching pair?
There are two types of socks, so if you pick at least 3 socks, there must be either at least two brown socks or at least
two black socks.
Generalised pigeonhole principle: ⋅3/2⋅ = 2.
Example:
3! = (3)(2)(1) = 6
4! = (4)(3)(2)(1) = 24
5! = (5)(4)(3)(2)(1) = 120
6! = (6)(5)(4)(3)(2)(1) = 720
2.4.1 Permutation
“A permutation is one of the different arrangements of a group of items where order matters”.
When order matters, AB ≠ BA
22
Example:
Consider the following:
Given 3 people, Bob, Mike and Sue, how many different ways can these three people be arranged, as far as an order
matters?
Let BMS stand for the order of Bob on the left, Mike in the middle and Sue on the right. Since order matters, a
different arrangement is BSM. Where Bob is on the left, Sue is in the middle and Mike is on the right. If we find all
possible arrangements of Bob, Mike and Sue where order matters, we have the following:
BMS, BSM, MSB, MBS, SMB, SBM
The number of ways to arrange three people three at a time is:
3! = (3)(2)(1) = 6 ways
A permutation of r (where r ≥ 1) elements from a set of n elements is any specific ordering or arrangement, without
any repetition of the r elements. Each rearrangement of the r elements is a different permutation. The number of
permutations of n things taken r at a time (with r ≤ n) is written as:
P (n, r) or
P (n, r) =
Points to be remember
• If you want to arrange 3 people in groups of 3 at a time, there are 3! ways to accomplish this task.
• If you want to arrange 4 people in groups of 4 at a time, there are 4! ways to accomplish this task.
• If you want to arrange n objects in groups of n at a time, there are n! ways to accomplish this task.
• = n!
Example:
I. Three married couples have bought six seats in a row for a performance of a musical comedy.
a. In how many ways can they be seated?
6! = 720
b. In how many ways can they be seated if each couple is to sit together with the husband to the left of his
wife?
3! = 6
c. In how many ways can they be seated if each couple is to sit together?
3! !2! !2! ×2! = 48
d. In how many ways can they be seated if all the men are to sit together and all the women are to sit
together?
2! ×3! ×3! = 72
23
Discrete Mathematics
2.4.2 Combinations
A combination is an arrangement of a group of items where order does not matter.
When order does not matter, AB = BA.
Example:
Consider the following:
Given 3 people, Bob, Mike and Sue, how many different ways can these three people be arranged where order
does not matter?
Solution:
Since order does not matter, any arrangement with Bob, Mike and Sue is considered the same arrangement. Therefore,
the only arrangement is BMS.
Now suppose we want to take four people, Bob, Mike, Sue and Alice, and arrange them in groups of three at a time
where order does not matter. The following demonstrates all the possible arrangements.
BMS, MSA, BMA, BSA
There are 4 ways to arrange 4 people in groups of 3 at a time.
A combination of r (where r ≥1) elements from a set of n elements is a subset of r elements without regard to order.
If C (n, r) or ( ) denotes the number of combinations of n elements taken r at a time, where r ≤ n, then
Remark: and
Example:
Find the number of ways to pick 4 people and place them in groups of 3 at a time, where order does not matter.
Solution:
Since order does not matter, use the combination formula.
C (4,3) =
There are 4 ways to arrange 4 items; taken 3 at a time, when order does not matter.
Example:
Find the number of ways to take 20 objects and arrange them in groups of 5 at a time where order does not matter.
Solution:
C (20,5) =
There are 15,504 ways to arrange 20 objects; taken 5 at a time, when order does not matter.
Example:
In the State Lotteries, will we use a combination or a permutation?
Solution:
If order matters, then it is a permutation. If order does not matter, then it is a combination. Do the
numbers on a ticket have to be in the same order as the order in which they became the winning numbers?
In other words, let’s say the winning numbers rolled out of the machine in the order of: 1,2,3,4,5,6. Do the numbers
on your ticket have to be in this same order to win? Or will any order such as 2,3,1,5,6,4 also be a winning
ticket? The answer is, any order of the winning numbers will produce the winning ticket. Thus, the lotteries are
combinations.
24
Examples:
I. How many strings can be made by reordering the letters of the word “daricks”?
II. How many strings can be made by reordering the letters of the word “darickschan”?
III. How many strings can be made by reordering the letters of the word “darickswaihongchan”?
Theorem 2:
The number of ways to distribute n distinguishable objects into k distinguishable boxes so that ni objects are placed
into box i,
i = 1,2,…, k ,
equals
Examples:
In a class of 20 students, 5 of them will get Grade A, 10 of them Grade B, 3 of them Grade C, and 2 will be fail.
How many grade distributions are possible among 20 students?
How many ways can we distribute a standard deck of 52 playing cards into 4 sets of 13 cards each?
25
Discrete Mathematics
Summary
• In Combinatorics, the rule of sum or addition principle is a basic counting principle. Stated simply, it is the
idea that if we have a ways of doing something and b ways of doing another thing and we can not do both at
the same time, then there are a + b ways to choose one of the actions.
• The inclusion-exclusion principle can be thought of as a generalisation of the rule of sum in that it too enumerates
the number of elements in the union of some sets (but does not require the sets to be disjoint).
• In mathematics and computer science, the pigeonhole principle states that if n items are put into m pigeonholes
with n > m, then at least one pigeonhole must contain more than one item. This theorem is exemplified in
real-life by truisms like “there must be at least two left gloves or two right gloves in a group of three gloves”.
It is an example of a counting argument, and despite seeming intuitive it can be used to demonstrate possibly
unexpected results.
• In elementary combinatorics, the name “permutations and combinations” refers to two related problems, both
counting possibilities to select k distinct elements from a set of n elements, where for k-permutations the order of
selection is taken into account, but for k-combinations it is ignored. However k-permutations do not correspond
to permutations of n objects unless k = n.
References
• Johnsonbaugh, R., 2008. Discrete Mathematics, 7th ed., Basic Counting Principle, Prentice Hall.
• Vatsa, B. S. & Vatsa, S., 2009. Discrete Mathematics, Pigeonhole Principle, New Age International.
• Combinatorics , [Pdf] Available at: <http://www.dartmouth.edu/~chance/teaching_aids/books_articles/
probability_book/Chapter3.pdf> [Accessed 20 June 2013].
• Cameron, P. J., Notes on Combinatorics, [Pdf] Available at: <http://www.maths.qmul.ac.uk/~pjc/notes/comb.
pdf> [Accessed 20 June 2013].
• eHow, 2012. Introduction to Combinatorics : Principles of Math, [Video online] Available at: <http://www.
youtube.com/watch?v=jrLYCzCc77g> [Accessed 20 June 2013].
• bethjonesmath, 2008. Introduction to Combinatorics (part 1) [Video online] Available at: <http://www.youtube.
com/watch?v=cErUmuxraQ0> [Accessed 20 June 2013].
Recommended Reading
• Koshy, T., 2004. Discrete mathematics with applications, Combinatorics and Discrete Mathematics, Elsevier
Academic Press.
• Hein, J. L., 2009. Discrete Structures, Logic, and Computability, Permutation and Combinations, Jones and
Bartlett Learning.
• Merris, R., 2004. Combinatorics, 2nd ed., John Wiley & Sons.
26
Self Assessment
1. When building a house, Bob can choose from four different lots, three different house styles, and five different
floor plans. How many different possibilities are there for building a house?
a. 60
b. 30
c. 40
d. 50
2. Alan and Mike have ten major league baseball ballparks that they would like to visit over the next few years. If
they have not visited any of the parks previously and would like to visit four parks this summer, in how many
ways can they organise their trip?
a. 1000
b. 2000
c. 5000
d. 5040
3. In the state track meet, eight sprinters will run the 100-yard dash. How many ways can gold, silver, and bronze
medals be awarded?
a. 333
b. 336
c. 400
d. 433
4. How many five-digit zip codes can be made where all digits are unique if the possible digits are 0 through 9?
a. 1340
b. 10300
c. 30240
d. 3240
5. If n=5 and r=2, what is the value of 5P2? The symbol 5P2 means the number of permutations of 5 items taken
2 at a time.
a. 10
b. 20
c. 30
d. 35
6. How many different ways can a chairperson and an assistant chairperson be selected for a research project, if
there are seven scientists available?
a. 32
b. 40
c. 42
d. 50
27
Discrete Mathematics
7. In how many ways can three class representatives be chosen from a group of twelve students? If the order of
the arrangement is not important, how many outcomes will there be?
a. 150
b. 220
c. 200
d. 500
28
Chapter III
Mathematical Induction
Aim
The aim of this chapter is to:
Objectives
The objectives of this chapter are to:
Learning outcome
At the end of this chapter, you will be able to:
29
Discrete Mathematics
3.1 Introduction
Mathematical induction is the process of proving a general formula from particular cases. It is a technique for
showing a statement, a theorem, or a formula that is asserted about every natural number.
Moreover, mathematical induction is used to establish that a given statement is true of all natural numbers. It is the
method of proving that the first statement in the infinite sequence of statements is true, and then proving that if any
one statement in the infinite sequence of statements is true, then so is the next one.
Working rule:
Let p (n): given statement to be proved.
Step I : Prove statement for n=1
Step II : Assume that statement is true for n = k; n ∈ ℕ.
Step III : Prove statement for n = k+1.
Then by first principle of mathematical induction, the result is true for all n ≥ 1.
Example 1:
Prove that sum of first n natural numbers in .
Solution:
Let p (n) = 1 + 2 + 3 + … + n
=
Step I: For n=1.
LHS =1
RHS =
∴ LHS = RHS
∴ Statement is true for n=1.
∴ 1 +2 +3 +… +k =
30
=
= RHS
Example 2:
Prove that sum of squares of first n natural numbers is
Solution:
Let,
P (n) = 12 + 22 + 32 + … + n2
=
i.e. to prove 12 + 22+ 32+ … + n2
Step I: For n =1
LHS = 12=1
RHS =
=
=1
∴ LHS = RHS
∴ the statement is true for n = 1.
Consider,
LHS = 12+22+32+ … + k2 + (k+1)2
= (12+22+32+ … + k2) + (k+1)2
=
= RHS
31
Discrete Mathematics
Working rule:
Consider p (n)
Step I : Prove statement for n = 1
Step II : Assume statement for 1 < k < 1
i.e., for k = 2,3,4,5 …., (m-2), (m-1) statement is true.
Step III : Now to prove statement or n = m
Then statement p (n) is true ∀ n ≥ 1
Example 1:
Prove that integer ‘n’ can be expressed as a product of positive primes, n ≥ 2.
Solution:
Let p (n): n can be expressed as product of primes n ≥ 2.
: n = p1.p2.p3 … pr where pi’s are prime numbers.
Step I : For n = 2
Here ‘2’ itself a prime number.
Result holds for n = 2.
32
Example 2:
If u1=3, u2=5, un = 3un-1 – 2n-2 for n ≥ 3.
Then using induction, show that, un = 2n +1 ∀ n ≥ 3.
Solution:
Let p (n) : un = 2n +1
Step I: For n = 3.
Um = 3um-1 – 2um-2 (by definition)
= 3.2m-1 – 2.2m-2
= 3.2m-1 – 2m-2+1
= 3.2m-1 – 2m-2
= (3-1). 2m-1
= 2.2m-1
= 2m
∴ Statement is true for n = m.
∴ By second principle of Mathematical induction p (n) is true ∀ n ≥ 3.
Example:
Prove that 1 + 4 + 9 + ... + n2 = for all positive integers n.
Another way to write “for every positive integer n” is ∀ n ∈ ℤ +. This works because ℤ is the set of integers, so ℤ
+
is the set of positive integers.
The ‘∀’ is the symbol for “for all” or “for every” or “for each” and the symbol that looks like a weird e is the “element
of” symbol. So technically, the statement is saying “for every n that is an element of the positive integers”, but it’s
easier to say “for every positive integer n”.
Solution:
Identify the general term and nth partial sum before beginning the problem
The general term, an, is the last term on the left hand side. an = n2
Find the next term in the general sequence and the series
The next term in the sequence is ak+1 and is found by replacing n with k+1 in the general term of the sequence,
33
Discrete Mathematics
an.ak+1 = ( k + 1 )2
The next term in the series is Sk+1 and is found by replacing n with k+1 in the nth partial sum, Sn. You may wish to
simplify the next partial sum, Sk+1
Sk+1 =
We will use these definitions later in the mathematical induction process. We’re now ready to begin.
1. Show the statement is true for n = 1, that is, Show that a1 = S1.
a1 is the first term on the left or you can find it by substituting n=1 into the formula for the general term, an.
S1 is found by substituting n=1 into the formula for the nth partial sum, Sn.
LHS: a1 = 1
RHS: S1 = = =1
So, you can see that the left hand side equals the right hand side for the first term, so we have established the first
condition of mathematical induction.
Sk+1 = .
We begin with something that we know (assume) is true and add the next term, ak+1, to both sides.
Sk + ak+1 = + ak+1
On the left hand side, Sk + ak+1 means the “sum of the first k terms” plus “the k+1 term”, which gives us the sum of
the first k+1 terms, Sk+1.
Assume k=10. Then Sk would be S10, the sum of the first 10 terms and ak+1 would be a11, the 11th term in the sequence.
S10 + a11 would be the sum of the 10 terms plus the 11th term which would be the sum of the first 11 terms. On the
right hand side, replace ak+1 by (k+1)2, which is what you found it was before beginning the problem.
Sk+1 = +
Now simplify. It is almost always easier to factor rather than expand when simplifying.
This is especially aided by the fact that your goal is in factored form. You can use that to help you factor.
You know that you want a (k+1) (k+2) (2k+3) in the final form.
We see right now that there is a (k+1) that is common to both of those, so let’s begin by factoring it out.
34
Sk+1 =
What’s left inside the brackets [ ] doesn’t factor, so we expand and combine like terms.
Sk+1 =
Sk+1 =
Now, try to factor 2k2 + 7k + 6, keeping in mind that you need a (k+2) and (2k+3) in the goal that you don’t have
yet.
Sk+1 =
Conclusion
The conclusion is found by saying “Therefore, by the principle of mathematical induction” and restating the original
claim.
• Basis or Base step is to prove that the statement is true for the lowest value of the statement.
• Inductive step is to show that, if the statement is true for some natural number n then it is also true when n+1
is substituted in place of n.
The assumption in second step that the statement is true for some n is called Induction Hypothesis.
Let's use the Mathematical induction to prove the following statement.
1 + 3 + 5 + .............. + (2n - 1) = n2 is true for all natural numbers.
This statement gives the formula for sum of odd natural numbers less than or equal to n.
To prove the statement by mathematical induction, first step is to prove Base step. Let the statement be P(n).
Base step: In this step, it should be proved that the statement is true for lowest value, that is P(1) = 1, substitute 1
in place of n.
1 = 12
1=1
Both sides are equal, so the statement is true for n = 1.
Inductive step: Let us assume that P(n) is true.
1 + 3 + 5 +................. + (2n - 1) = n2
It must than be shown that P(n + 1) is also true.
1 + 3 + 5 + ................ + (2n -1) + (2n + 1)
= n2 + (2n + 1)
= n2 + 2n + 1
= (n + 1)2
Thereby, showing that P(n + 1) is true.
Since both, the Base and Inductive step have been proved, it has been proved by mathematical induction that P (n)
is true for all natural number.
35
Discrete Mathematics
The Inductive step is another way to say that, if P (1) is true then P (2) is true, if P (2) is true then P (3) is true, if P
(3) is true then P (4) is true and so on.
Mathematical induction is just a shortcut that defines infinite number of such steps into two steps above.
1. Use mathematical induction to prove that, 1+2+3+ … + n = for all positive integers n.
Solution:
Let the statement P (n) be
1 + 2 + 3 + ... + n =
LHS = 1
RHS = =1
1 + 2 + 3 + ... + k = and show that p (k + 1) is true by adding k + 1 to both sides of the above
statement.
1 + 2 + 3 + ... + k + (k + 1) = + (k + 1)
= (k + 1) ( + 1)
1 + 2 + 3 + ... + k + (k + 1) =
12 + 22 + 32 + ... + n2 =
36
STEP 1: We first show that p (1) is true.
LHS = 12 = 1
RHS = =1
Expand k (2k + 1) + 6 (k + 1)
We have started from the statement P (k) and have shown that,
12 + 22 + 32 + ... + k2 + (k + 1)2 =
13 + 23 + 33 + ... + n3 =
RHS = =1
37
Discrete Mathematics
13 + 23 + 33 + ... + k3 =
Add (k + 1)3 to both the sides.
= (k + 1)2 [ + (k + 1)]
We have started from the statement P(k) and have shown that
13 + 23 + 33 + ... + k 3 + (k + 1) 3 =
n3 + 2 n is divisible by 3
13 + 2(1) = 3
3 is divisible by 3
We now consider the algebraic expression (k + 1)3 + 2 (k + 1); expand it and group it like terms:
(k + 1)3 + 2 (k + 1) = k 3 + 3 k 2 + 5 k + 3
38
= [k3 + 2 k] + [3k2 + 3 k + 3]
= 3 M + 3 [k2 + k + 1] = 3 [M + k2 + k + 1]
Hence, (k + 1)3 + 2(k + 1) is also divisible by 3 and therefore, statement P (k + 1) is true.
39
Discrete Mathematics
Summary
• Mathematical induction is a method of mathematical proof typically used to establish that a given statement is
true of all natural numbers (non-negative integers).
• The method can be extended to prove statements about more general well-founded structures, such as trees; this
generalisation, known as structural induction, is used in mathematical logic and computer science. Mathematical
induction in this extended sense is closely related to recursion.
• Mathematical induction should not be misconstrued as a form of inductive reasoning, which is considered non-
rigorous in mathematics.
• Mathematical induction is a form of rigorous deductive reasoning.
• The principle of mathematical induction is usually stated as an axiom of the natural numbers.
• The simplest and most common form of mathematical induction proves that a statement involving a natural
number n holds for all values of n.
• The proof consists of two steps, a) the basis (base case): showing that the statement holds when n is equal to
the lowest value that n is given in the question. Usually, n = 0 or n = 1. b) The inductive step: showing that if
the statement holds for some n, then the statement also holds when n + 1 is substituted for n.
References
• Langote, U. B. & Vhanmane, M. M., 2009. Discrete Mathematics, Mathematical Induction, 2nd ed., Tech-Max
Publication.
• Rosen, K., 2007. Discrete Mathematics, Mathematical Induction, 6th ed., McGraw Hill publication.
• Davis, T., Mathematical Induction, [Pdf] Available at: <http://www.math.utah.edu/mathcircle/notes/induction.
pdf> [Accessed 20 June 2013].
• Mathematical Induction, [Pdf] Available at: <http://www.people.vcu.edu/~rhammack/BookOfProof/Induction.
pdf> [Accessed 20 June 2013].
• bullcleo1, 2010. Mathematical Induction [Video online] Available at: <http://www.youtube.com/
watch?v=QHkG0d5kZvE> [Accessed 20 June 2013].
• AbsoluteMathematics, 2011. Mathematical Induction [Video online] Available at: <http://www.youtube.com/
watch?v=Uqn3f2k4vrA> [Accessed 20 June 2013].
Recommended Reading
• Fomin, D., Genkin, S. & Itenberg, I., 1996. Mathematical Circles (Russian Experience), AMS.
• Graham, R., Knuth, D. & Patashnik, O., 1994. Concrete Mathematics, 2nd ed., Addison-Wesley.
• Courant, R. & Robbins, H., 1996. What is Mathematics?, Oxford University Press.
40
Self Assessment
1. Let S (n) = 2n − 1. Evaluate S(k)
a. k - 1
b. k - 2
c. 2k - 1
d. (k – 1)2
3. The sum of the first n odd numbers is equal to the nth square. 1 + 3 + 5 + 7 + . . . + (2n − 1) = n². To prove this
by mathematical induction, what will be the induction assumption?
a. 2k
b. k2
c. k + 2
d. k/2
41
Discrete Mathematics
8. Mathematical induction is the method of proving statement true for all ___________ numbers.
a. even
b. odd
c. natural
d. prime
9. In mathematical induction, which of the following is true, if p (n) is a statement involving a natural number?
a. P(1)
b. P (r)
c. P (k) ≠ 0
d. P (k+1) ≠ 0
10. According to second principle of mathematical induction, statement is true for all ____________.
a. n
b. n – 1
c. n > 1
d. n ≥ 1
42
Chapter IV
Recurrence Relation
Aim
The aim of this chapter is to:
Objectives
The objectives of this chapter are to:
Learning outcome
At the end of this chapter, you will be able to:
43
Discrete Mathematics
4.1 Introduction
In computer science, recursive techniques are useful in algorithms, programmes etc.The recursive formula is called
recurrence relation, in which if we know the first few terms of a sequence, then by using previous terms, we can
find all remaining terms. Recurrence relations arise naturally in many counting problems and programme analysis
problems and programme analysis problems.
To define sequence corresponding to recurrence relation, it is important to know first few terms, which are called
as initial conditions of recurrence relation.
Example:
1) ar = ar-1 + with initial condition a0 = 10. It generates the sequence a0 = 10, a1 = 15, a2 = 20 …
i.e., <10, 15, 20, 25, …>
2) Fibonacci sequence: fn = fn-1 + fn-2 with initial conditions f0 = 1, f1 =1.
It generates f0 = 1, f1 =1, f2 =2, f3 = 3, f4 = 5, f5 = 8 …
i.e., <1, 1, 2, 3, 5, 8, 13, 21, … >
Example:
ar = ar-1 +2 with a0 =1
Corresponding sequence is,
<1, 3, 5, 7, 9, 11 ...> sequence of odd numbers.
Now if we take the same recurrence relation:
Ar = ar-1 +2 with a0 = 2
Corresponding sequence is,
<2, 4, 6, 8 … >, sequence of even numbers.
Solution:
Initially land cost = Rs.100000/- i.e., a0 = 100000, suppose an is the land cost after n years.
44
We observe following table:
No. of years Initial land cost at starting of nth year 20% increases land cost Land cost at end of nth year
0 100000 00 100000
2 120000
: : :
n-1 --- ---
N an-1
Example:
Find degree of recurrence relation.
Solution:
Here, we require two values of ar-1, ar-2, to find value of ar. Hence, degree of recurrence relation is 2.
Example:
Find characteristic equation and characteristic roots of recurrence relation.
ar- 7 ar-1 +12 ar-2 = 0
45
Discrete Mathematics
Solution:
Degree of recurrence relation is k =2.
Characteristic equation is,
⇒ 1. αk - 7 αk-1 + 12 αk-2 = 0 as k=2
⇒ 1. α 2 - 7 α2-1 + 12 α2-2 = 0
⇒ α - 7 α + 12 = 0
Homogenous Solution ( ):
A solution that satisfies the recurrence relation when right hand side of recurrence relation is zero, is called
homogeneous solution. And is denoted as .
Particular Solution (
A solution which satisfies the recurrence relation with non zero f(r) on right hand side is called particular solution.
It is denoted by
Recurrence Relation
c0 ar + c1 ar-1 +c2 ar-2 + ... + ck ar-k = f(r)
46
c0 ar + c1 ar-1 + c2 ar-2 +c3 ar-3 + ... + ck ar-k = 0
with k initial conditions.
Step II : Find order, characteristic equation, characteristic roots (say α1, α2, α3... αk) of recurrence relation.
Characteristic roots are may or may not be distinct.
Step III : (A) If all characteristic roots are not distinct that is α1 ≠ α2 ≠ α3 ≠... αk then,
c1 (α1) r + c2 (α2) r + c3 (α3) r +...+ck (αk) r
(B) If all characteristic roots are not distinct, say α1 occurs t times and remaining are distinct. Then,
c1 (α1) r + c2 (α2) r + (αi-1) r + ( + r+ r2 + ... + r (t-1)) + ci+1 (αi+1)r+ ...+ ck is homogenous
solution, with all c0, c1, c2, c3, ... ck are constant.
(d0+d1r) ar
47
Discrete Mathematics
Step VI : Form ar = +
Step VII: Find values of c0, c2 ... ck from ar, using initial conditions which gives required solution of given recurrence
relation.
Economics
Recurrence relations, especially linear recurrence relations, are used extensively in both theoretical and empirical
economics.
In particular, in macroeconomics, one might develop a model of various broad sectors of the economy (the financial
sector, the goods sector, the labor market, etc.) in which some agents’ actions depend on lagged variables.
The model would then be solved for current values of key variables (interest rate, real GDP, etc.) in terms of
exogenous variables and lagged endogenous variables. Refer to time series analysis.
Biology
Some of the best-known difference equations have their origins in the attempt to model population dynamics.
Example: The Fibonacci numbers were once used as a model for the growth of a rabbit population.
The logistic map is used either directly to model population growth, or as a starting point for more detailed models.
In this context, coupled difference equations are often used to model the interaction of two or more populations.
For example, the Nicholson-Bailey model for a host-parasite interaction is given by
Nt+1 = λ Nt e-aPt,
Pt+1 = Nt (1-e-aPt),
with Nt representing the hosts, and Pt the parasites, at time t.
Integro difference equation is a form of recurrence relation important to spatial ecology. These and other difference
equations are particularly suited to modelling univoltine populations.
Solved Examples:
1. Paresh opened a bank account by investing Rs.1000. He deposits Rs.100 in it each month. Bank pays 2% interest
monthly. Find the recurrence relation for the amount of money on Paresh’s account after n years.
Solution:
Let N = Number of months
P = Principle amount
R = Rate of interest
T = Total amount
I = Interest
I= and
T=P+I
48
Consider following table for some months.
N P I= T=P+I
1222 + 24.44 =
2 1122 + 100 = 1222
1246.44
: : : :
n -1 …. …. an-1
( +
n 1000 + an-1
⇒an =
=
⇒an = 1020+ 1.02 an-1 with a0 = 1000
3. If characteristic roots of recurrence relation are 2, 2, 3 with f(r) = (r2 + 1) 2r. Then what will be particular solution
of such recurrence relation.
Solution:
Here 𝛂 = 2 is a characteristic root, with multiplicity 2, and f(r) = (r2 + 1) 2r contains one of the term 2r hence two
time contradiction occur in
49
Discrete Mathematics
Summary
• In mathematics, a recurrence relation is an equation that recursively defines a sequence i.e., each term of the
sequence is defined as a function of the preceding terms.
• The term difference equation sometimes (and for the purposes of this article) refers to a specific type of recurrence
relation.
• “Difference equation” is frequently used to refer to any recurrence relation.
• If the recurrence is inhomogeneous, a particular solution can be found by the method of undetermined coefficients
and the solution is the sum of the solution of the homogeneous and the particular solutions.
• Another method to solve an inhomogeneous recurrence is the method of symbolic differentiation.
• Many linear homogeneous recurrence relations may be solved by means of the generalised hypergeometric series.
Special cases of these lead to recurrence relations for the orthogonal polynomials, and many special functions
References
• Ramana, B. V. & Grimaldi, R. P., 2008. Discrete and Combinatorial Mathematics, Recurrence Relations, 5th
ed., Pearson Education India.
• Rosen, K. H. & Michaels, J. G., 2000. Handbook of discrete and combinatorial mathematics, Recurrence
Relations, CRC Press.
• Recurrence Relations, [Pdf] Available at: <http://www.mathdb.org/resource_sharing/training/se_rr.pdf>
[Accessed 20 June 2013].
• Moura, L., Recurrence Relations, [Pdf] Available at: <http://www.site.uottawa.ca/~lucia/courses/2101-10/lect
urenotes/07RecurrenceRelations.pdf> [Accessed 20 June 2013].
• tjkearns1, 2013. Introduction to Recurrence Relations-1 [Video online] Available at: <http://www.youtube.com/
watch?v=loh8rYkghHg> [Accessed 20 June 2013].
• nptelhrd, 2007. Lecture 32 - Recurrence Relations [Video online] Available at: <http://www.youtube.com/
watch?v=qvw1GX93JSY> [Accessed 20 June 2013].
Recommended Reading
• Gupta, S. B., 2005. Comprehensive Discrete Mathematics and Structures, Recurrence Relations, 2nd ed., Laxmi
Publication.
• Veerarajan., 2006. Discrete Mathematics, Recurrence Relations, 7th ed., Tata McGraw-Hill.
• Gupta, S. B., 2008. Discrete Mathematics And Structures, Recurrence Relations, 5th ed., Laxmi Publications
Ltd.
50
Self Assessment
1. Roots of characteristic equation of recurrence relation are called _____________.
a. roots
b. root equation
c. characteristic roots
d. recurrence roots
2. A solution that satisfies the recurrence relation when right hand side of recurrence relation is zero, is called
_________________.
a. particular solution
b. zero solution
c. recurrence solution
d. homogeneous solution
3. A solution which satisfies the recurrence relation with non zero f(r) on right hand side is called
_______________.
a. particular solution
b. zero solution
c. recurrence solution
d. homogeneous solution
51
Discrete Mathematics
52
Chapter V
Graphs
Aim
The aim of this chapter is to:
Objectives
The objectives of this chapter are to:
Learning outcome
At the end of this chapter, you will be able to:
• recognise the complex graphs and understand the intricacy of information or complexity of problem
53
Discrete Mathematics
5.1 Introduction
In everyday life, we have to translate descriptive data into various types of symbolic forms. Graph is also one of
the forms of symbolic representation of descriptive data in terms of points (verticals) and line segments (edges). It
is widely used in many fields like Electrical Engineering, telecommunication, genetics, computer science etc.
A graph is simply a collection of finite points (called vertices) and line segments (called edges) in which each edge
is assigned to pair of points called end vertices or terminal (not necessarily distinct). Informally, a graph is a bunch
of dots connected by lines. Here is an example of a graph:
Sadly, this definition is not precise enough for mathematical discussion. Formally, a graph is a pair of sets (V, E),
where:
• V is a non-empty set whose elements are called vertices.
• E is a collection of two-element subsets of V called edges.
The vertices correspond to the dots in the picture, and the edges correspond to the lines.
Thus, the dots-and-lines diagram above is a pictorial representation of the graph (V, E) where,
V = {A, B, C, D, E, F, G, H, I}
E = {{A, B}, {A, C}, {B, D}, {C, D}, {C, E}, {E, F}, {E, G}, {H, I}}.
Here, V = {u, v, w}
E = {e1, e2,}
e1 e2
(2)
v1 v2 e2 Here, V = {v1, v2, v3, v4, v5}
E = {e1, e2, e3, e4, e5}
e1
e5 e3 Observe in G2 edge
G2
v5 e2 = (v2, v2) has end vertices v2 and v2 i.e., same and
vertices.
v4 e4 v3
54
Loop: If both the end vertices of an edge are same then the edge is called a loop.
Example:
Here, V = {v1, v2, v3} , E = {e1, e2, e3, e4, e5} Hence edge
v1 e4 is a loop.
e4 e5 Observe that in G3 , edges e1 and e2 have same pair of end
e1 G3 vertices.
e2 i.e., e1 = (v1, v2)
v3 e2 = (v1, v2)
e3
Parallel edges: If two or more edges have same terminal vertices, then these edges are called as parallel edges.
Simple graph: A graph without loops and parallel edges is called simple graph.
Compound graph: A graph which contains loops or parallel edges is called compound graph or multigraph.
Adjacency and incidence: Tow vertices v1 and v2 in a graph G are said to be adjacent to each other, if they are
end vertices of the same edge e.
If the vertex u is an end vertex of the edge e then the edge e is said to be incident on vertex u.
Degree of a vertex: The number of edges incident on a vertex v is called degree of vertex v, with loop being counted
twice.
Notation: Degree of v = d (v)
Example:
Here,
d (v1) = 4
v1 d (v2) = 6
v2 d (v3) = 3
v6 d (v4) = 4
d (v5) = 1
d (v6) = 0
v5 v4 v3
10. Degree of the graph: Sum of the degrees of all vertices of graph G is called degree of the graph G.
Notation: d (G) = degree of graph G.
i.e.,
Example:
Here,
v1 v2 d (v1) = 2
d (v2) = 4
d (v3) = 1
v3 d (v4) = 2
d (v5) = 3
d (G) = 2 + 4 +1 + 2 + 3 = 12
v5 v4 ∴ = 12.
55
Discrete Mathematics
Structure representation
A graph can be represented by structure with points and lines each line has two end points.
Example: Above order form of graph represented by structure.
Matrix representation
Depending on adjacency of vertices and incidency of an edge, a graph can be represented in two types of
matrices:
Adjacency matrix: If G is a graph on n vertices say v1, v2, v3, .... vn then adjacency matrix of G is the n
× n matrix A(G) =
Where,
v2
v4
A (G) =
v3
Observations:
The sum of the entries in the ithcolumn or ithrow gives the degree of vertex vi (diagonal entries counted twice).
aij= 0 if there is no loop at vi.
Since the number of edges joining vi to vj= no. of edges joining vj to vi.i.e. aij = aji
∴ Adjacency matrix is symmetric.
If G is a simple graph, then A (G) is a matrix containing 0s and 1s (Binary matrix in which each diagonal entry is
0).
Incidence matrix:
Let G be a graph in structural form with n vertices v1, v2 ...vn and m edges e1, e2, ...em then the incidence matrix of
G denoted by I(G) is,
56
I(G) = [aij]n×m where,
aij=
Example:
e1
v1 e3 e1 e2 e3 e4 e5
e2 v2 v1 1 1 0 0 1
I = (G) v2 1 1 2 1 0
e5 e4 v3 0 0 0 1 1
v3
Observations:
• Any column’s sum must be 2.
• The sum if the entries in a row indicate the degree of the corresponding vertex.
• If two columns are identical, then the corresponding edges are parallel edges.
• If a row contains only zero’s then the corresponding vertex must be an isolated vertex.
• If a row contains a single ‘1’ the corresponding vertex must be pendent vertex.
• If an edge is a loop there will be a single ‘2’ in the column remaining entries being zero’s.
• Attraction: Each vertex represents a person, and each edge represents a romantic attraction. The graph could be
directed to model the unfortunate asymmetries.
• Airline connections: Each vertex represents an airport. If there is a direct flight between two airports, then there
is an edge between the corresponding vertices. These graphs often appear in airline magazines.
• The web: Each vertex represents a web page. Directed edges between vertices represent hyperlinks.
People often put numbers on the edges of a graph; put colours on the vertices; or add other ornaments that capture
additional aspects of the phenomenon being modelled.
For example, a graph of airline connections might have numbers on the edges to indicate the duration of the
57
Discrete Mathematics
corresponding flight. The vertices in the attraction graph might be coloured to indicate the person’s gender.
A simple graph G
2. Complete Graph is called a complete
graph, if there is an
edge between each
pair of vertices.
Notation: Kn =
complete graph on n
vertices.
58
5. n-partite Graph Graph G(V, E) is 1
said to be n-partite.
2 5
If vertex set V is
partitioned in to n
disjoint vertex sets
3 4
say V1, V2, V3, ... Vn.
Example:
V2 d (v1) = 2
d (v2) = 2
d (v3) = 2
V1 d (v4) = 3
V4
d (v5) = 5
d (v6) = 2,
V6
Decreasing sequence of degree is
V5
5, 3, 2, 2, 2, 2
Havel-Hakimi Theorem
Let S =(d1, d2, …, dn) be a sequence of n integers written in decreasing order: d1 ≥ d2 ≥ … ≥ dn-1 ≥ dn.
Then, S is a graphic sequence if and only if the following sequence S’ of n-1 integers is graphic, where k = d1:
S’ = (d2-1, d3-1 … dk+1-1… dn-1, dn).
59
Discrete Mathematics
Example:
Show that the following sequence is graphical 5, 5, 4, 4, 3, 2, 2, 1.
Solution:
Consider degree sequence.
4, 3, 3, 2, 1, 2, 1 Arrange terms
4, 3, 3, 2, 2, 1, 1 Use theorem
2, 2, 1, 1, 1, 1 Use theore
1, 0, 1, 1, 1 Arrange terms
1, 1, 1, 1, 0 Use theorem
0, 1, 1, 0 Arrange terms
1, 1, 0, 0 Use theorem
0, 0, 0
Example:
Following two graphs G1 and G2 are isomorphic.
G1 G2
p q w x
r s
z y
Here,
Number of vertices in G1 = 4 =number of vertices in G2
Number of edges in G1 = 4 = number of edges in G2
60
In graph G1
P 2 2, 2
Q 2 2, 2
R 2 2, 2
S 2 2, 2
In graph G2
W 2 2, 2
X 2 2, 2
Y 2 2, 2
Z 2 2, 2
i.e., adjacency of vertices preserves.
⇒f (p) = w, f (q) = x, f (r) = y, f (s) = z is bijection.
∴ G1 and G2 are isomorphic graphs.
Example:
Using adjacency matrices show that following two graphs are isomorphic:
q
b
t
p r
e c
a
s
d
Solution:
Adjacency matrix of G1 is,
61
Discrete Mathematics
C1,2, C3,4
Last matrix is A2
∴ Graphs G1 and G2 are isomorphic.
• In computer science, graphs are used to represent networks of communication, data organisation, computational
devices, the flow of computation, etc.
Example:
The link structure of a website could be represented by a directed graph. The vertices are the web pages available
at the website and a directed edge from page A to page B exists if and only if A contains a link to B.
• A similar approach can be taken to problems in travel, biology, computer chip design, and many other fields.
The development of algorithms to handle graphs is therefore of major interest in computer science.
• The transformation of graphs is often formalised and represented by graph rewrite systems. They are either
directly used or properties of the rewrite systems (e.g. confluence) are studied.
• Complementary to Graph Transformation Systems focussing on rule-based in-memory manipulation of graphs
are graph databases geared towards transaction-safe, persistent storing and querying of graph-structured data.
• Graph-theoretic methods, in various forms, have proven particularly useful in linguistics, since natural language
often lends itself well to discrete structure.
• Traditionally, syntax and compositional semantics follow tree-based structures, whose expressive power lies
in the Principle of Compositionality, modelled in a hierarchical graph. Within lexical semantics, especially as
applied to computers, modelling word meaning is easier when a given word is understood in terms of related
words; semantic networks are therefore important in computational linguistics. Still other methods in phonology
(e.g. Optimality Theory, which uses lattice graphs) and morphology (e.g. finite-state morphology, using finite-
state transducers) are common in the analysis of language as a graph. Indeed, the usefulness of this area of
mathematics to linguistics has borne organisations such as text graphs, as well as various ‘Net’ projects, such
as WordNet, VerbNet, and others.
62
• Graph theory is also used to study molecules in chemistry and physics. In condensed matter physics, the three
dimensional structure of complicated simulated atomic structures can be studied quantitatively by gathering
statistics on graph-theoretic properties related to the topology of the atoms.
Example:
Franzblau’s shortest-path (SP) rings.
• In chemistry, a graph makes a natural model for a molecule, where vertices represent atoms and edges bonds.
This approach is especially used in computer processing of molecular structures, ranging from chemical editors
to database searching.
• In statistical physics, graphs can represent local connections between interacting parts of a system, as well as
the dynamics of a physical process on such systems.
63
Discrete Mathematics
Summary
• In mathematics and computer science, graph theory is the study of graphs, mathematical structures used to
model pair wise relations between objects from a certain collection.
• Graphs are one of the prime objects of study in Discrete Mathematics.
• A graph may be undirected, meaning that there is no distinction between the two vertices associated with each
edge, or its edges may be directed from one vertex to another.The graphs studied in graph theory should not be
confused with [graphs of functions] or other kinds of graphs.
• Graphs are represented by drawing a dot or circle for every vertex, and drawing an arc between two vertices if
they are connected by an edge. If the graph is directed, the direction is indicated by drawing an arrow.
• A common problem, called the subgraph isomorphism problem, is finding a fixed graph as a subgraph.
• One reason to be interested in such a question is that many graph properties are hereditary for subgraphs, which
means that a graph has the property if and only if all subgraphs have it too.
References
• Gross, J. L. & Yellen, J., 2003. Handbook of Graph Theory, Graphs, CRC Press.
• Gross, J. L., 2007. Combinatorial Methods with computer applications, Graph theory, Chapman and Hall
CRC.
• Chapter IV – Graph Theory, [Pdf] Available at: <http://www.math.hkbu.edu.hk/~zqiao/Math1130_2009/Chap4.
pdf> [Accessed 20 June 2013].
• Graphs - Terminology and Representation, [Online] Available at: <http://www.radford.edu/~nokie/classes/360/
graphs-terms.html> [Accessed 20 June 2013].
• patrickJMT, 2010. Graph Theory - An Introduction! [Video online] Available at: <http://www.youtube.com/
watch?v=HmQR8Xy9DeM> [Accessed 20 June 2013].
• StatsLabDublin, 2013. Discrete Mathematics : Important Graph Theory Terms [Video online] Available at:
<http://www.youtube.com/watch?v=TwLYYOMAK4o> [Accessed 20 June 2013].
Recommended Reading
• Liu, C. L., 1968. Introduction to Combinatorial Mathematics, Graph theory, McGraw Hill New York.
• Deo N., 1974. Graph Theory with applications to Engineering and Computer Science, Graphs, Prentice Hall,
Englewood Cliffs, N.J.
• Rosen, K., Discrete Mathematics and its applications with Combinatorics and graph theory, Graph theory, 6th
ed., Tata McGraw Hill publication.
64
Self Assessment
1. ____________ is a collection of finite points and line segments in which edge is assigned to a pair of points.
a. Vertices
b. Vertex
c. Graph
d. Cut Edge
2. If two or more edges have same terminal vertices, then these edges are called ______________.
a. graph
b. complete graph
c. loop
d. parallel edges
3. Two vertices v1 and v2 in a graph G are said to be ______________ to each other if and only if they are end
vertices of the same edge e.
a. parallel
b. adjacent
c. ordered
d. composite
5. A simple graph G is called a _______________ graph, if there is an edge between each pair of vertices.
a. null graph
b. regular graph
c. complete graph
d. n-partite graph
6. If all vertices of a graph G have same degree then G is called a _____________ graph.
a. simple
b. regular
c. complete
d. bipartite
65
Discrete Mathematics
10. How many regular graphs are there for 4R6 graph?
a. 4
b. 6
c. 2
d. 3
66
Chapter VI
Tree
Aim
The aim of this chapter is to:
Objectives
The objectives of this chapter are to:
Learning outcome
At the end of this chapter, you will be able to:
67
Discrete Mathematics
6.1 Introduction
Mathematically speaking, a tree is a geometric figure consisting of vertices and edges, but of a special kind. We
think of vertices as points in the plane and edges as line segments.
Most of the trees we use in computer science have a special vertex called a root. Such trees are usually called “rooted
trees.” We could certainly describe what we mean by a rooted tree in ordinary English.
Tree is special type of graph. It has various applications in
• technology
• classifications and distribution study
• managerial problems etc.
A connected, acyclic graph is called a tree. (A graph is acyclic if no subgraph is a cycle.) Below mentioned is a
figure for a tree.
A vertex of degree one is called a leaf. In the above figure, there are 5 leaves. The graph shown above would no longer
be a tree if any edge were removed, because it would no longer be connected. The graph would also not remain a
tree if any edges were added between two of its vertices, because then it would contain a cycle. Furthermore, note
that there is a unique path between every pair of vertices. These features of the example tree are actually common
to all trees.
6.2 Tree
A connected graph without any cycle is called as a Tree.
Notation: Tree graph on n vertices is denoted as Tn.
Example:
1. Trees on 1, 2 and 3 vertices
T1 T2 T3
T4
T4
T5
T5
T5
68
4. Non isomorphic tree 6 vertices (T6)
T6 T6 T6 T6
Disconnected hence
not tree.
69
Discrete Mathematics
Let T be a tree with k+1 vertices. Each edge of T is bridge (isthmus), hence, T-e is dis-
connected having two components T1 and T2 are tree.
Suppose T1 has K1 vertices and T2 and K2 vertices and
K1 + k2 = k +1 and k1, k2 < k.
By step 2, T1 has k1-1 edges and T2 has K2-1 edges.
∴ Edge set of T contains
(k1-1) + (k2-1) + 1 edges.
= (k1 + k2) -1
= (k + 1) -1
=k
∴ Tree on k+1 vertices has (k+1) -1=k edges is proved.
∴ By the method of mathematical induction result is true for any number of vertices.
∴ Tree with p vertices p-1 edges.
Theorem 2:
Let T be a graph on p vertices and q edges. If T is acyclic and q = p-1, then T is connected and q = p-1.
Proof:
Let T be a graph on p vertices and q edges. As T is acyclic and q = p-1, then only remains to show that T
is connected.
Prove this by the method of contradiction. Contradictorily, assume that T is disconnected and has 2 ≤ k
components say T1, T2, T3, ... Tk. Suppose each component has p1, p2, p3, .... pk vertices respectively.
⇒ p1 +p2 +p3 +...+pk = p
Clearly, each Ti is tree and has (p1 -1), (p2 -1), (pk -1 ) edges respectively.
∴ Total number of edges in T are,
(p1- 1) + (p2-1) + (p3-1) + ... + (pk-1)
= (p1 +p2 +p3 + ...+ pk) - k
= p- k
∴ Total number of edges in T are p-k
For k ≥ 2, which is contradiction.
∴k=1
∴ T has only one component, i.e., T is connected.
Theorem 3:
Let T be a graph on p vertices and q edges. If T is connected and p = q-1, then T is connected and every edge is an
isthmus.
Proof:
Let T be a graph on p vertices and q edges.
If T is connected and p = q-1, then only remains to show that each edge of T is isthmus. We prove this by
the method of contradiction.
Contradictorily assume that edge e of graph is not isthmus.
∴ T – e is connected and edges in T – e are (p-1) -1 = p-2 which is contradiction that p-1 which is contra-
diction that p-1 ≥ p-2.
∴ e must be isthmus.
∴ every edge of T is isthmus.
Theorem 4:
Let T be a graph on p vertices and q edges. If T is connected and each edge is isthmus, then there exist exactly one
path between any pair of vertices of T.
Proof:
Let T be a connected graph with p vertices and q edges, in which each edge is isthmus. Prove that there
exists a unique path between any pair of vertices of T.
Let u and v be any two vertices of T. Since T is connected, there exists u-v path.
Prove this by the method of contradiction.
70
Contradictorily assume that there exists more than one paths say p1 and p2 from u-v in T.
Union of p1 and p2 forms a circuit. Edge of cycle is not isthmus, which is contradiction.
∴ There exists a unique path between any two vertices of T.
Theorem 5:
A connected graph G with p vertices and p-1 edges is tree.
Proof:
Let G be a connected graph with p vertices and p-1 edges.
Claim that G is tree. That is only to show that G is cyclic.
Prove this by the method of contradiction.
Contradictorily assume that G contains circuit C.
If e is edge contained in the circuit, then C-2 is connected.
∴ G – e is a graph connected with n vertices and n-2 edges. This is contradiction.
∴ G does not contain any circuit.
∴ G is connected and acyclic.
∴ G is a tree.
Definition:
Let G be a connected graph. T is the one that is spanning sub-graph of G. Then T is called as spanning tree of G.
Example:
Spanning sub-graph:
Let G be a graph. H is a sub-graph of G containing all vertices of G, then H is called as spanning sub-graph of G.
71
Discrete Mathematics
3. Let G be a connected graph with n vertices and m edges, then any spanning tree of G has n-1 branches and
(m-(n-1)) = m-n+1 chords.
Example:
For following graph G, find any two spanning tree of G. List all branches and chords for corresponding spanning
tree.
e1 e2
v1 v3
e7 e8
e6 e3
e9 e10
v6 v4
e5 e4
v5
Solution:
72
Example:
Find all fundamental circuits w. r. t. spanning tree T of graph G.
v1 e1 v2 v1 v2
e4 e5 e2 e4 e5 e2
v4 e3 v3 v4 v3
Solution:
Fundamental circuit w. r. t. e1 is
e1
v1 v2
e4 e5 e2
v4 v3
e4 e5 e2
v4 e3 v3
Example:
v2
4 5
v1 v3
3
7 6
5
v5 3 v4
73
Discrete Mathematics
v1 v3
Weight of T1
3
=7+3+3+6
T1
= 19
= 7 6
v5 3 v4
v2
4
v1 v3
Weight of T2
=4+7+3+6
T2 =
= 20
7 6
v5 3 v4
v2
4 5
Weight of T3
v1 v4
=4+5+3+3
3 = 15
T3 =
v5 3 v3
v2
4 5
Weight of T4
v1 v3
=7+4+5+6
= 22
T4 = 7
6
v5 v4
v2
5
Weight of T5
v1 v3
=7+5+5+6
= 23
T5 = 7 5 6
v5 v4
74
Step 2 : Find increasing sequence of weights of all edges of G, say w1, w2, w3, ... , wm.
Step 3 : Select edge ei of minimum weight w1 which is not loop.
Step 4 : Suppose the edges e1, e2, e3 ... ei have been chosen. Then choose next edge ei +1
such that,
a) ei + 1 ≠ ek k = 1, 2, ... i
b) Induced sub-graph G < e1, e2, e3... ei+1> does not contain circuit.
c) W (ei+1) is of smallest weight satisfying a), b).
Step 5 : Stop if (n-1) edges have been chosen. Else, continue with step 4.
Example:
Using Kruskal’s algorithm, find shortest spanning tree of following graph.
v3 3 v4
e3
5
e2 e4
v2 2 e10 6 v5 e5 v6
v1 10 e7
e1 e11 2 e6 12
e9
8 3
e8
v8 1 v7
Solution:
Plot all vertices of graph G.
Increasing sequence of weights of given graph is:
1, 2, 2, 3, 3, 4, 5, 6, 8, 10, 12
Corresponding edge sequence of increasing weights of graph is:
Weight 1 2 2 3 3 4 5 6 8 10 12
v3 v4
5
v2 e2
10 2 e10 6
e7
v5 e5 v6
v1 e1 2 12
e11 e6
3
e8
v8 1 v7
Trace next edge e1 of next minimum weight 10. Trace next edge e5 of next minimum weight 12.
Graph becomes connected, without any cycle, contains all vertices of G i.e., spanning tree.
Weight of spanning tree is 1 + 2 + 2 + 3 + 5 + 10 + 12 = 35
Weight of minimum spanning tree = 35.
75
Discrete Mathematics
Example: Root
Remarks:
1. Every binary tree has odd number of vertices.
2. Every binary tree with n vertices has exactly one root (vertex of degree 2), pendent vertices and vertices
are degree of 3.
Example: verify above remarks for above binary trees.
Example:
v1
v2 v11
0 LE V E L
1 LE V E L
v4 v13
v3 2 LE V E L
v5 v12 v14 3 LE V E L
v6
v8 v16 4 LE V E L
v7 v15 5 LE V E L
v9 v10
Solution:
Oth level vertices is v1
1st level vertices are v2 and v11
2nd level vertices are v3, v4, v12, v13
3rd level vertices are v5, v6, v14
4th level vertices are v7, v8, v15, v16
5th level vertices are v9, v10
∴ Maximum number of levels = 5
76
∴ Height of binary tree = 5
In this topic we are going to focus on two methods or techniques of graph or tree search. i.e., Breadth First Search
and Depth First Search.
In other words, it exhaustively searches the entire graph or sequence without considering the goal until it finds it.
It does not use a heuristic algorithm.From the standpoint of the algorithm, all child nodes obtained by expanding a
node are added to a FIFO (i.e., First In, First Out) queue.
In typical implementations, nodes that have not yet been examined for their neighbours are placed in some container
(such as a queue or linked list) called “open” and then once examined are placed in the container “closed”.
Applications:
Breadth-first search can be used to solve many problems in graph theory, such as:
• Finding connected components: The set of nodes reached by a BFS (breadth-first search) form the connected
component containing the starting node.
• Finding all nodes within one connected component.
• Finding the shortest path between two nodes u and v.
• Testing a graph for bi-partiteness: BFS can be used to test bi-partiteness, by starting the search at any vertex and
giving alternating labels to the vertices visited during the search. That is, give label 0 to the starting vertex, 1 to
all its neighbours, 0 to those neighbours’ neighbours, and so on. If at any step a vertex has (visited) neighbours
with the same label as itself, then the graph is not bipartite. If the search ends without such a situation occurring,
then the graph is bipartite.
Example:
This search technique has two steps to follow which are:
a. Visit start vertex and put into a FIFO queue.
b. Repeatedly remove a vertex from the queue, visit its unvisited adjacent vertices, put newly visited vertices
into the queue.
77
Discrete Mathematics
In a non-recursive implementation, all freshly expanded nodes are added to a stack for exploration. The time and
space analysis of DFS differs according to its application area. In theoretical computer science, DFS is typically
used to traverse an entire graph, and takes time O (|V| + |E|), linear in the size of the graph.
Applications:
Algorithms that use depth-first search as a building block include:
• finding connected components
78
• topological sorting
• finding 2-(edge or vertex)-connected components
• finding strongly connected components
• solving puzzles with only one solution, such as mazes (DFS can be adapted to find all solutions to a maze by
only including nodes on the current path in the visited set.)
Example:
79
Discrete Mathematics
Return to 5.
Do a DFS (3).
Return to 1.
80
Summary
• In mathematics, more specifically graph theory, a tree is an undirected graph in which any two vertices are
connected by exactly one simple path. In other words, any connected graph without cycles is a tree.
• A spanning tree of a connected graph G is a maximal set of edges of G that contains no cycle, or as a minimal
set of edges that connect all vertices.
• A Shortest Spanning Tree or Minimum Spanning Tree (MST) or minimum weight spanning tree is then a
spanning tree with weight less than or equal to the weight of every other spanning tree.
• More generally, any undirected graph (not necessarily connected) has a minimum spanning forest, which is a
union of minimum spanning trees for its connected components.
• In computer science, a binary tree is a tree data structure in which each node has at most two child nodes,
usually distinguished as “left” and “right”. Nodes with children are parent nodes, and child nodes may contain
references to their parents. Outside the tree, there is often a reference to the “root” node (the ancestor of all
nodes), if it exists.
• A rooted binary tree is a tree with a root node in which every node has at most two children.
• A full binary tree (sometimes proper binary tree or 2-tree or strictly binary tree) is a tree in which every node
other than the leaves has two children.
• A perfect binary tree is a full binary tree in which all leaves are at the same depth or same level.(This is
ambiguously also called a complete binary tree).
• Kruskal’s algorithm is an algorithm in graph theory that finds a minimum spanning tree for a connected weighted
graph. This means it finds a subset of the edges that forms a tree that includes every vertex, where the total
weight of all the edges in the tree is minimised. If the graph is not connected, then it finds a minimum spanning
forest (a minimum spanning tree for each connected component).
References
• Dr. Sharma, G. C. & Dr. Jain, M., 2009. Advance Discrete Mathematics, Trees, 1st ed., Laxmi Publications,
Ltd.
• Singh, S. G., 2010. Graph Theory, Trees, PHI Learning Pvt. Ltd.
• IEEM 2012 Discrete Mathematics:Trees [Pdf] Available at: <http://chern.ie.nthu.edu.tw/DM/9-Tree.pdf>
[Accessed 23 June 2013].
• 2009. Discrete Mathematics. 5 Graphs & Trees [Pdf] Available at: <http://vplab.snu.ac.kr/lectures/09-1/
discrete_math/dm09_slide5.pdf> [Accessed 23 June 2013].
• 2007. Lecture 16-Trees [Video online] Available at: <https://www.youtube.com/watch?v=q0woiOp7sqU>
[Accessed 23 June 2013].
• 2007. Lecture 17- Trees and Graphs [Video online] Available at: <https://www.youtube.com/watch?v=fZqfkJ-
cb28> [Accessed 23 June 2013].
Recommended Reading
• Veerarajan, T., 2008. Discrete Mathematics with Graph Theory and Combinotorics, Tata McGraw-Hill Publishing
Company Limited.
• Babu, R., 2011. Discrete Mathematics, Dorling Kindersley (India) Pvt. Ltd.
• Simpson, A., 2010. Discrete Mathematics By Examples, Tata McGraw-Hill Publishing Company Limited.
81
Discrete Mathematics
Self Assessment
1. Trees are simple graphs and they do not contain ___________.
a. loop
b. parallel edges
c. vertex
d. pendent vertex
2. A spanning tree with weight less than or equal to the weight of every other spanning tree is called a
__________.
a. binary tree
b. weighted tree
c. shortest spanning tree
d. sub graph
4. Which of the following is the minimum number of vertices in kth level binary tree?
a. k+1
b. 2k+1
c. (k+1)2
d. 2(k+1)
v4 v15
a. 6
b. 7
c. 8
d. 9
82
6. What is the radius of the given tree?
v2 v7 v12
v6 v8
v4 v15
a. 5
b. 4
c. 3
d. 6
v4 v15
a. v9
b. v7
c. v5, v10
d. v16, v13, v9
v1 v2
v7 v10
a. V6
b. V4
c. V5
d. V7
83
Discrete Mathematics
10. If T is spanning tree of K9, how many vertices will be there for a tree T?
a. 8
b. 7
c. 9
d. 10
84
Chapter VII
Connected and Disconnected Graphs
Aim
The aim of this chapter is to:
Objectives
The objectives of this chapter are to:
Learning outcome
At the end of this chapter, you will be able to:
85
Discrete Mathematics
7.1.1 Walk
Let G be a graph. A finite alternating sequence W: {v1, e1, v2, e2, v3, e3 ... vi ei ... vi+1 ... vn} of vertices and edges of
G beginning and ending with a vertex in such a way, that every edge in W is incident on a vertex which precedes
and succeeds, is called as walk in G.
Note:
1. The walk is called v1 – vn walk.
2. v1 and vn are called terminal vertices of the walk and v2, v3, ... vn-1 are called intermediate vertices.
3. If terminal vertices are same in a walk, then it is called as closed walk.
4. In a walk, an edge or a vertex may be repeated more than once.
5. The number of edges in the walk (including repetition) is called the length of the walk.
Example:
Consider,
v2 e2
e1
v1
e6 e5 e4 e3
v5 e7 e8
v4
7.1.2 Trail
A walk in which no edge is repeated is called a trail. If terminal vertices in a trail are same, it is called a closed trail,
otherwise it is called an open trail.
86
Example:
Consider,
v1 e1 v2
e2
e6 e7 e4
e3
v3
v5 e5 v4 e8
Now,
1. v3, e3, v3 e2 v2 e7 v5 e5 v4 e4 v2 e1 v1 here edges are not repeated, therefore, it is a trial (∴it is trail).
2. v2 e2 v3 e3 v3 e2 v2: not a trail (∵ e2 is repeated twice)
7.1.3 Path
The walk in which no vertex is repeated more than once is called a path. Since vertex does not repeat, edge cannot
repeat more than once.
∴ Every path is a trial. Loop cannot be included in a path.
Length of Path: Number of edges in the path is called length of path. Any two paths with the same number of
vertices are isomorphic.
Example:
v1
v8 v2
v6
v7 v3
v5 v4
87
Discrete Mathematics
7.2.1 Component
Let G be a graph and u be a vertex of G. Let v(u) denote the set of all vertices in G which are connected to the vertex
u. Then, the sub-graph G’ of G induced by v(u) is called a component of G.
Example:
1. Following are connected graphs, (Graph is only one component)
G1 G2 G3
2. Following are disconnected graphs (Graph contains more than one components)
G1 G2 G3 G4
V
V V V V V V
V
Example:
u u v
2 3
3 5
x v 1 4 y
4 5 2
w x w
88
7.3.1 Dijkstra’s Algorithm
Dijkstras’s algorithm gives shortest path between a vertex to all other vertices of connected graph.
Steps of Dijkstras’s algorithm:
Step 1 : Consider given connected weighted graph. G.V is set of vertices of G.
S. and t are any two vertices of G.
Step 2 : Initially λ(s)= 0 and λ(v) =∞. Pv denotes shortest path from S to V.
Assign T = V.
Step 3 : Select vertex u in T for which λ(u) is minimum.
Step 4 : If u = t then STOP. And Pt is desired path.
Step 5 : For every vertex V ∈ T which is adjacent to u, Consider edge e = {u,v} If λ(u) + W(e) < λ(v) then,
λ (v) = λ (u) +W(e) and Pv = Pu ∪ {e}
Step 6 : Modify T by T = T(u) and go to step 2.
Example:
By using Dijkstra’s algorithm, find the shortest path from vertex a to all vertices of the graph given below.
b 2 c
2 4
2 3 1
a d 4 e h
1 3 7
6
f 5 g
Solution:
Initially λ (a) = 0
Vertex a b c d e F g h
λ 0 ∞ ∞ ∞ ∞ ∞ ∞ ∞
T a b c d e F g h
Vertex a b c d e F g h
λ 0 2 ∞ ∞ ∞ 1 ∞ ∞
T a b c d e F g h
λ(f) = 1 is minimum
Vertex d and g are adjacent to f
∴ λ (d) = min {∞, 4} = 4
∴ λ (g) = min {∞, 6} = 6
89
Discrete Mathematics
Vertex a b c d e f g h
λ(v) 0 2 ∞ 4 ∞ 1 6 ∞
T - b c d e - g h
λ (b) = 2 is minimum
The vertex in T adjacent to b are c, d, e.
∴ λ (c)= min {∞, 4} = 4
λ (d) = min {4, 4} = 4
λ (e) = min {∞, 6} = 6
Vertex a b c d e f g h
λ(v) 0 2 4 4 6 1 6 ∞
T - - c d e - g h
Vertex a b c d e f g h
λ(v) 0 2 4 4 6 1 6 5
T - - - d e - g h
λ(d) = 4 is minimum
The vertices in T adjacent to d is e only.
Λ(e) = min {6, 8}= 6
Vertex a b c d e f g h
λ(v) 0 2 4 4 6 1 6 5
T - - - - e - g h
λ(h) = 5 in minimum
The vertices in T adjacent to h is g only.
λ (g) = min {6,11} = 6
Vertex a b c d e f g h
λ(v) 0 2 4 4 6 1 6 5
T - - - - e - g -
λ (e) = λ (g)= 6
Suppose λ (e) = 6 is minimum and g ∈ T is adjacent to e.
∴ λ (g) = min {6,13} = 6
90
Vertex a b c d e f g h
λ(v) 0 2 4 4 6 1 6 5
T - - - - - - g -
Finally,
Vertex a b c d e f g h
λ(v) 0 2 4 4 6 1 6 5
T - - - - - - - -
b 2 2 c
4
c
6
0 5
a
d e h
4
f 1 g 6
7.4 Connectivity
Connectivity of a graph includes following terminologies:
Example 1:
e2
e3 e1
e4
Example 2:
e1
e2
91
Discrete Mathematics
Example 3:
e1
e2
e3
Removal of minimum three edges e1, e2, e3 are required to disconnect the graph.
∴ λ (G) = 3
Example 1:
Example 2:
v1
v2
Example 3:
v1
v3 v2
Removal of minimum three vertices v1, v2, v3 requires to disconnect the graph
∴ k (G) = 3
92
7.4.3 Degree of Graph
Let G be a connected graph. Degree of minimum degree vertex of graph G is called degree of graph G.
Notation: δ (G) = degree of graph G.
Example 1:
v1 v4
v5
v3 v7
v2 v6
Example 2:
v1 v2
v4 v3
d(v1) = 2, d(v2) =3
d(v3) = 2, d(v4) = 3
Min {2, 2, 3, 3} = 2
∴ δ (G) = 2
Example 3:
v1 v2
v5
v4 v3
d (v1) = 3, d (v2) =3
d (v3) = 3, d (v4) = 3, d (v5) = 4
min {3, 3,3, 3, 4} = 3
∴ δ (G) = 3
Theorem 1:
The edge connectivity of a graph G can not exceed the smallest degree of a vertex in G.
Proof:
Let G be a connected graph with n vertices. Degrees of these vertices is d1, d2, d3, d4, ... dn.
Suppose v1 is vertex of smallest degree vertex in G.
93
Discrete Mathematics
∴ δ (G) = d1
∴ there are d1 edges incident on vertex v1.
The removal of such d1 edges graph becomes disconnected.
∴ λ (G) ≤ δ (G)
Theorem 2:
The vertex connectivity of graph G cannot exceed the edge connectivity of G. i.e., k (G) ≤ λ (G).
Proof:
Let G be a connected graph with edge connectivity λ (G) = t.
∴ Removal of t edges from graph G becomes disconnected and vertex set is partitioned into two disjoint subsets
v1 and v2.
End vertices of above t edges in v1 are at the most t in number.
∴ removing t edges from G graph becomes disconnected.
k (G) ≤ δ (G)
k (G) ≤ λ (G) ≤ δ (G)
94
Summary
• A walk is an alternating sequence of vertices and edges, beginning and ending with a vertex, where each vertex
is incident to both the edge that precedes it and the edge that follows it in the sequence, and where the vertices
that precede and follow an edge are the end vertices of that edge. A walk is closed if its first and last vertices
are the same, and open if they are different.
• A trail is a walk in which all the edges are distinct. A closed trail has been called a tour or circuit, but these are
not universal, and the latter is often reserved for a regular subgraph of degree two.
• Traditionally, a path referred to what is now usually known as an open walk. Nowadays, when stated without
any qualification, a path is usually understood to be simple, meaning that no vertices (and thus no edges) are
repeated.
• A walk that starts and ends at the same vertex but otherwise has no repeated vertices or edges is called a
cycle.
• If it is possible to establish a path from any vertex to any other vertex of a graph, the graph is said to be connected;
otherwise, the graph is disconnected. A graph is totally disconnected if there is no path connecting any pair of
vertices. This is just another name to describe an empty graph or independent set.
References
• Kenneth, R., 2008. Discrete Mathematics and its applications, Graphs, 6th ed., Tata McGraw Hill
Publications.
• Deo, N., 2004. Graph Theory with Applications to Engineering and Computer Science, Connected and
Disconnected Graphs, PHI Learning Pvt. Ltd.
• Graphs, [Pdf] Available at: <https://courses.cit.cornell.edu/info2950_2012sp/graph.pdf> [Accessed 23 June
2013].
• Graph concepts, [Pdf] Available at: <http://users.phys.psu.edu/~ralbert/phys597_08/c02_graph_conc.pdf >
[Accessed 23 June 2013].
• 2011. Disconnected Graphs-Graph Theory [Video online] Available at: <https://www.youtube.com/
watch?v=iR7o8rPi2PI > [Accessed 23 June 2013].
• 2009.Connected Graph [Video online] Available at: <https://www.youtube.com/watch?v=wG-82q-0Dhg >
[Accessed 23 June 2013].
Recommended Reading
• Marcus, D., 2008. Graph Theory: A Problem Oriented Approach, Mathematical Association of America.
• Balakrishnan, V. K., 1997. Schaum’s outline of theory and problems of graph theory. McGraw-Hill
Professional.
• Gross, J. L. & Yellen, J., 2006. Graph theory and its applications, Graph theory, Chapman and Hall/CRC.
95
Discrete Mathematics
Self Assessment
1. If terminal vertices are same in a walk, it is called a/ an ____________ walk.
a. identical
b. uniform
c. open
d. closed
4. The graph is said to be a connected graph, if there is a path between every _________.
a. point
b. pair of vertices
c. pair of edge
d. component
e5
e6
e3
e2 e4
e1
a. e1
b. e3, e6
c. e1, e4
d. e1, e2, e6
96
7. Which of the following is an expression of the given graph?
a. connected
b. disconnected
c. bipartite
d. complete
a. 1
b. 3
c. 2
d. 5
a. 2
b. 6
c. 1
d. 3
a. 1
b. 6
c. 5
d. 4
97
Discrete Mathematics
Chapter VIII
Introduction to Probability
Aim
The aim of this chapter is to:
Objectives
The objectives of this chapter are to:
• explain the students to solve practical problems using binomial and poisons distribution
Learning outcome
At the end of this chapter, you will be able to:
98
8.1 Introduction
Probability is basically concerned with drawing conclusions (or inference) from experiments involving uncertainties.
For these conclusions and inferences to be reasonably accurate, an understanding of probability theory is essential.
Study of probability in computer science is important for software development phases since it is used to extract
requirements from the customers which are used by the next phases for designing and implementation of the system.
Because of its importance, this chapter focuses on the various aspects required in computer science and help students
to get familiar with basic concepts of discrete probability in the long run.
a. Probabilistic experiment
A probabilistic experiment, or random experiment, or simply an experiment, is the process by which an observation
is made. In probability theory, any action or process that leads to an observation is referred to as an experiment.
Example:
• tossing a pair of fair coins
• tossing a balanced dice
• counting cars that drive past a toll booth
b. Sample space
The sample space associated with a probabilistic experiment is the set consisting of all possible outcomes of the
experiment and is denoted by S. The elements of the sample space are referred to as sample points. A discrete sample
space is one that contains either a finite or a countable number of distinct sample points.
c. Event
An event in a discrete sample space S is a collection of sample points, i.e., any subset of S. In other words, an event
is a set consisting of possible outcomes of the experiment.
Example:
Experiment 1: Tossing a coin
Sample space: S = {Head or Tail} or we could write:
S = {0, 1} where 0 represents a tail and 1 represents a head.
99
Discrete Mathematics
E2 = {Tail},
E3 = {All heads}
Experiment 4:
Two items are picked, one at a time, at random from a manufacturing process, and each item is inspected and
classified as defective or non-defective.
Sample space:
S = {NN, ND, DN, DD} where
N = Non-defective
D = Defective
Some events:
E1 = {only one item is defective} = {ND, DN}
E2 = {both are non-defective} = {NN}
8.3 Probability
Let S be the sample space in probabilistic experiment E. Suppose each outcome of an experiment is equally likely
and the number of outcomes is finite. If A is an event connected with E, then the probability of the occurrence of
A, P (A), is given by:
Example:
Consider the experiment of tossing a single balanced dice and recording the number on the top face.
A: The number on the top face is an even number. Then A = {2, 4, 6} the probability of occurrence of A, P (A), is
given by
P (E) =
The probability of non-occurrence of the event (called its failure) is denoted by:
P( )= .
Notice the bar above the E, indicating the event does not occur.
Thus,
P ( ) + P (E) =1
In other words, this means that the sum of the probabilities in any experiment is 1.
100
8.3.2 Definition of Probability Using Sample Space
When an experiment is performed, we set up a sample space of all possible outcomes.
In a sample of n equally likely outcomes, we assign a chance (or weight) of to each outcome.
5. The probability of an event not occurring is one minus the probability of it occurring.
P (E’) = 1 – P (E)
Disjoint: P (A and B) = 0
If two events are mutually exclusive, then the probability of either occurring is the sum of the probabilities of
each occurring.
Example:
Given: P (A) = 0.20, P (B) = 0.70, A and B are disjoints.
B B’ Marginal
A 0.00 0.20 0.20
A’ 0.70 0.10 0.80
Marginal 0.70 0.30 1.00
101
Discrete Mathematics
The values in BOLD are given in a problem. The grand total is always 1.00 and the remaining values are
obtained after addition and subtraction.
B B’ Marginal
A and B are mutually exclusive
A
if this value is 0
A and B are all inclusive
A’
if this value is 0
Marginal 1.00
9. Independent events
Two events are independent if the occurrence of one does not change the probability of the other occurring. An
example would be rolling a 2 on a dice and flipping a head on a coin. Rolling the 2 does not affect the probability
of flipping the head.
If events are independent, then the probability of them both occurring is the product of the probabilities of each
occurring.
Example:
P (A) = 0.20, P (B) = 0.70, A and B are independent.
B B’ Marginal
The 0.14 is because the probability of A and B is the probability of A times the probability of B or 0.20 × 0.70
= 0.14.
Conditional probability
The probability of event B occurring that event A has already occurred is read “the probability of B given A”
102
and is written: P (B|A)
General multiplication rule
P (A and B) = P (A) × P (B|A)
Example:
P (A) = 0.20, P (B) = 0.70, P (B|A) = 0.40
A good way to think of P (B|A) is that 40% of A is B. 40% of the 20% which was in event A is 8%, thus the
intersection is 0.08.
B B’ Marginal
A 0.08 0.12 0.20
A’ 0.62 0.18 0.80
Marginal 0.70 0.30 1.00
The last two are because if two events are independent, the occurrence of one doesn’t change the probability of the
occurrence of the other. This means that the probability of B occurring, whether A has happened or not, is simply
the probability of B occurring.
Example:
Given P (A) = 0.20, P (B) = 0.70, P (A and B) = 0.15
B B’ Marginal
A 0.15 0.05 0.20
A’ 0.55 0.25 0.80
Marginal 0.70 0.30 1.00
Example:
Consider the toss of two distinct balanced dice. For finding the probability of getting a sum of 7, when it is given
that the digit in the first dice is greater than that in the second dice. In the probabilistic experiment of tossing two
dice the sample space S consists of 6 × 6 = 36 outcomes.
103
Discrete Mathematics
• Let B be an event: The digit in the first dice is greater than the second.
B : {(6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (5 , 1), (5 , 2), (5 , 3),(5 , 4), (4, 1), (4, 2), (4, 3), (3, 1), (3, 2), (2, 1)}.
• Let C be the event: The sum of the digits in the two dice is 7 but the digit in the first dice is greater than the
second.
C: {(6, 1), (5, 2), (4, 3)} = A ∩ B.
• Recall that the probability of an event occurring given that another event has already occurred is called a
conditional probability.
• The probability that event B occurs, given that event A has already occurred is,
P (B|A) =
• This formula comes from the general multiplication principle and a little bit of algebra.
• Since we are given that event A has occurred, we have a reduced sample space. Instead of the entire sample
space S, we now have a sample space of A since we know A has occurred.
• So the old rule about being the number in the event divided by the number in the sample space still applies. It
is the number in A and B (must be in A since A has occurred) divided by the number in A.
• If you then divide numerator and denominator of the right hand side by the number in the sample space S, then
you have the probability of A and B divided by the probability of A.
Example 1:
The question, “Do you smoke?” was asked of 100 people. Results are shown in the table.
Yes No Total
Male 19 41 60
Female 21 28 40
Total 31 69 100
1. What is the probability of a randomly selected individual being a male who smokes?
Solution: This is just a joint probability.
The number of “Male and Smoke” divided by the total = = 0.19
104
8.3.5 Axiomatic Approach of Probability
Analysing the concept of equally likely probability, we see that three conditions must hold.
1. The probability of occurrence of any event must be greater than or equal to 0.
2. The probability of the whole sample space must be 1.
3. If two events are mutually exclusive, the probability of their union is the sum of their respective probabilities.
These three fundamental concepts form the basis of the definition of probability.
P (E1|E) =
P (E1|E) =
105
Discrete Mathematics
=
Example:
Of all the smokers in a particular district, 40% prefer brand A and 60% prefer brand B. Of those smokers who prefer
brand A, 30% are females, and of those who prefer brand B, 40% are females.
What is the probability that a randomly selected smoker prefers brand A, given that the person selected is a
female?
Solution:
106
Fig. 8.4 Probability distribution
In this chapter we focus only 2 types of discrete distribution, i.e., Binomial and Poisson’s Distribution
For example, the tossing of a fair coin for a fixed number of times is a Bernoulli process and the outcome of such
tosses can be represented by the binomial distribution. This distribution applies in situations where there are repeated
trials of any experiment for which only one of two mutually exclusive outcomes (denoted as ‘success’ and ‘failure’)
can result on each trial.
The Bernoulli process has following characteristics:
• Dichotomy: This means that each trial has only two mutually exclusive possible outcomes, viz., ‘success’ or
‘failure’, ‘yes’ or ‘no’, ‘heads’ or ‘tails’ and the like.
• Stability: This means that the probability of the outcome of any trial is known (or given) and remains fixed
over time i.e., remains the same for all the trials.
• Independence: This means that the trials are statistically independent, i.e., to say the happening of an outcome
or the event in any particular trial is independent of its happening in any other trial or trials.
107
Discrete Mathematics
108
Fig. 8.7 Negatively skewed binomial distribution
(iv) But if p stays constant and n increases, the shaded portion tends to bunch up together to form a bell shape,
i.e., the binomial distribution tends to become symmetrical and the graph will be something like as shown
in the figure below.
• Variance =
• Standard Deviation =
• Coefficient of Skewness =
• Coefficient of Kurtosis =
Example 1:
Five coins are tossed 3200 times. Find the frequency of distribution of heads and tales and tabulate the results.
Answer:
Here,
n = 5, N = 3200
p=
q=
109
Discrete Mathematics
r = 0, 1, 2, 3, 4, 5
0 5
1 5
2 5
3 5
4 5
5 5
Total 3200
Example 2:
The probability of a defective volt is 0.2. Find the mean, variance and standard deviation for the distribution of
defective volts in a total of 1000, and also find coefficient of skewness and kurtosis.
Answer:
Here,
p = 0.2
q = 1 – 0.2 = 0.8
n = 1000
Mean = n.p = 1000 0.2 = 200
Variance = n.p.q = 1000 0.2 0.8 = 160
Standard Deviation = = = 12.6
The random variable of interest in Poisson distribution is the number of occurrences of a given event during a given
interval (this interval may be time, distance, area etc). We use X to represent the discrete random variable and r to
represent a specific value that X can take. The probability function of this distribution is written as-
f (X = r) =
Where,
e = 2.7183 being the basis of natural logarithms.
r = 0, 1, 2, 3... ∞
m = average number of occurrences per specified interval or we can say it is th mean of the distribution and m ≥
0.
110
The Poisson process has following characteristics:
• Concerning a given random variable, the mean relating to a given interval can be estimated on the basis of past
data concerning the variable under study.
• If we divide the given interval into very small intervals, we will find:
The probability that exactly one event will happen during the very small interval is a very small number
and is constant for every other very small interval.
The probability that two or more events will happen within a very small interval is so small, that we can
assign it a zero value.
The event that happens in a given very small interval does not depend on when the very small interval falls
during a given interval.
The number of events in any small interval does not depend on the number of events in any other small
interval.
The Poisson distribution has following uses:
The use of Poisson distribution is resorted to those cases when we do not know the value of ‘n’ or when ‘n’ cannot
be estimated with any degree of accuracy. In fact, in certain cases, it does not make any sense in asking the value
of ‘n’. For example,
• The goals scored by one team in a football match are given, it cannot be stated how many goals could not be
scored.
• If one watches carefully one may find out how many times the lightning flashed, but it is not possible to state
how many times it did not flash.
• The number of deaths per day in a district in one year due to a disease
• The number of scooters passing through a road per minute during a certain part of the day for a few months
• The number of typing mistakes per page in a book containing many pages by an experienced typist
• The number of suicides per day in a city
• The number of telephone calls per minute in a telephone booth
• The number of bacteria in a drop of clean water
Example 1:
A book distributed randomly, contains 100 misprints throughout its 100 pages. What is the probability that a page
observed at random contains at least 2 misprints?
Answer:
m=
P (r) =
Put r = 0,
P (0) =
P (1) =
111
Discrete Mathematics
P (r ≥ 2) = 1 –
=1–
Example 2:
If the mean of Poisson distribution is 4, find standard deviation, coefficient of skewness and kurtosis.
Answer:
Here, mean = m = 4
∴Standard deviation =
β1 =
β2 =
Example:
The probability that a person will pass a College Algebra class is 0.55, the probability that a person will withdraw
before the class is completed, is 0.40, and the probability that a person will fail is 0.05. Find the probability that in
a class of 30 students, exactly 16 pass, 12 withdraw, and 2 fail.
Outcome X P(outcome)
Pass 16 0.55
Withdraw 12 0.40
Fail 2 0.05
Total 30 1.00
Example:
How many ways can 3 men and 4 women are selected from a group of 7 men and 10 women?
112
Solution:
P = ≅ 0.3779.
Note that the sum of the numbers in the numerator are the numbers used in the combination in the denominator.
This can be extended to more than two groups and called an extended hyper geometric problem.
To decide which way the particle will move, we toss a coin. If toss comes up with H, the particle moves to the right;
if the toss comes up with a tail, the particle moves to the left. In other words, the outcome is +1with probability P
(H) and outcome is –1 with probability P (T).
In effect, the particle moves on a lattice of equally spaced points. This process that the particle is undergoing is
called a Random walk also called Brownian motion.
Random walk is precisely the way the molecules from an open bottle of perfume spread the smell into the entire
room, and is called a diffusion process. Tossing the coin N times corresponds to taking N steps.
Suppose the particle starts the random walk at the origin, takes k steps to the right, and concomitant N - k steps to
the left. If NH is the number of heads and NT is the number of tails, then clearly, the distance from the origin is NH
– NT = 2k -N. There are many paths which lead to the final position of l = 2k -N, and correspond to the number of
different ways that k heads can come up in N toss.
Assume N is even, which implies, since with l = even. Define N = 2M and l = 2m.
Then we have,
PRW = (m, N) = probability of reaching position 2m
=P(
= ; –M ≤ m ≤ M
Fair Coin
For simplicity, consider the special case when the probability to step to the right or left is equal, that is, p =q =
113
Discrete Mathematics
Then we have,
PRW (m, N) =
The interpretation of the formula above is the following. Since in every toss there are two outcomes, the
probability of a specific outcome is . A specific path is the result of taking N steps, and hence the
probability of it occurring is .
The probability of reaching a point l is given by multiplying the probability for a specific path to occur by all the
possible ways (paths) that go from the origin to the point l. We thus obtain P (l, N).
For a particle undergoing a random walk, its position m at every point in its N-steps is a random variable. An important
tool for studying the behaviour of random variables is to compute the average values of quantities of interest.
For a function of the random variable m, say f (m), let us denote its average value by <f (m)>.
Then we have,
<f (m)> = -----equation (1)
The above expression means that the average value of f(m) is given by the summing the value of f(m) for every
outcome m, weighted by the likelihood of that value occurring. We have the following natural definition for P
(H).
P (H) = ------- equation (2)
The two most important properties of any random variable is its average and its standard deviation. Let us return
to the random walk with p =q = .
The average position of the particle is given by,
<m> = -------equation (3)
<m> = 0 -------- equation (4)
The reason we get zero is because we have assumed equal probability to step to the right or to the left.
Hence, on the average, its steps on either side of the origin cancel, with the average being at the starting point.
However, we intuitively know that even though the average position of the particle undergoing random walk is zero,
it will deviate more and more from the origin as it takes more and more steps.
The reason being that every step the particle takes is random; it is highly unlikely that the particle will take two
consecutive steps in opposite directions. The measure of the importance of the paths that are far from the origin is
measured by the average value of the square of the position of the particle.
The reason this measure is useful, is because every time the particle deviates from the origin, be it in the right or left
directions, the square of the deviation is always be positive. We hence have the standard deviation given by,
2
------------- equation (5)
We have the important result from equation (9) and (12) that, since, for
k= ,m≡ , we have the following,
The equation above has an important interpretation. In any particular experiment, all we can obtain is NH= number
of heads for N trial. So how do we compute P (H)?
114
We would like to set <NH> = NH, but there are errors inherent in this estimate, since in any particular set of toss, we
can get any value of NH which need not be equal to <NH>. In other words, what is the error we make if set P (H) =
?
Equation (14) tells us that for a fair coin, with , if we compute , we have
= ---------------equation (12)
In other words, the estimate that we obtain for PH from our experiment, namely is withinthe errors which are
approximately equal to the actual value.
The point to note that the errors that are inherent in any estimate are quantified above, and go down as the ,
Where,
In general, for any random variable with standard deviation given by , the estimate for the probability ,
where NH is the number of times that the outcome has occurred, is given by,
The relation of with what it is estimating, namely , is graphically shown in the figure below.
µ - 2σ µ µ + 2σ
115
Discrete Mathematics
Summary
• The binomial distribution is the discrete probability distribution of the number of successes in a sequence
of n independent yes/no experiments, each of which yields success with probability p.
• The Poisson distribution is a discrete probability distribution that expresses the probability of a number of events
occurring in a fixed period of time if these events occur with a known average rate and independently of the
time since the last event.
• A probability distribution identifies either the probability of each value of a random variable (when the
variable is discrete), or the probability of the value falling within a particular interval (when the variable
is continuous).
• The probability distribution describes the range of possible values that a random variable can attain and
the probability that the value of the random variable is within any (measurable) subset of that range.
• A random walk is a mathematical formalisation of a trajectory that consists of taking successive random steps.
The results of a random walk analysis have been applied to computer science, physics, ecology, economics,
psychology and a number of other fields as a fundamental model for random processes in time.
References
• Yakov, G. S., 1992. Probability theory: An introductory Course, Introduction to Probability, Springer
Textbooks.
• Grinstead, C. M., 1997. Introduction to Probability, Conditional Probability. AMS Bookstore.
• Introduction to Probability [Pdf] Available at: <http://www.dartmouth.edu/~chance/teaching_aids/books_articles/
probability_book/amsbook.mac.pdf> [Accessed 23 June 2013].
• Bertsekas, D.P. & Tsitsiklis, J. N., Introduction to Probability [Pdf] Available at: <http://vfu.bg/en/e-Learning/
Math--Bertsekas_Tsitsiklis_Introduction_to_probability.pdf > [Accessed 23 June 2013].
• 2011.Introduction to Probability [Video online] Available at: <https://www.youtube.com/watch?v=-8eSOmTPUbk
> [Accessed 23 June 2013].
• 2010.Introduction to Probability [Video online] Available at: <https://www.youtube.com/watch?v=YWt_u5l_jHs
> [Accessed 23 June 2013].
Recommended Reading
• Freund, J.E., 1993. Introduction to Probability, Dover publications.
• Rota G. C., 1998. Probability Theory, Preliminary Edition.
• Roussas, G.G., 2007. Introduction to Probability, Elsevier Inc.
116
Self Assessment
1. What is the probability of getting an ace if a person chooses a card at random from a standard pack of 52 playing
cards?
a.
b.
c.
d.
3. There are 15 balls numbered 1 to 15, in a bag. If a person selects one at random, what is the probability that the
number printed on the ball will be a prime number greater than 5?
a.
b.
c.
d.
4. In a class of 100 students, suppose that 60 are French, and suppose that 10 of the French students are females.
Find the probability that if I pick a French student, it will be a girl, that is, find P(A|B).
a.
b.
c.
d.
5. What is the probability that the total of two dices will be greater than 8, given that the first dice is a 6?
a.
b.
c.
d.
6. If the probability that person A will be alive in 20 years, is 0.7, and the probability that person B will be alive
in 20 years is 0.5. What is the probability that they will both be alive in 20 years?
a. 0.35
b. 0.45
c. 0.30
d. 0.25
117
Discrete Mathematics
7. A fair dice is tossed twice. Find the probability of getting a 4 or 5 on the first toss and a 1, 2, or 3 in the second
toss.
a.
b.
c.
d.
8. Two balls are drawn successively without replacement from a box which contains 4 white balls and 3 red balls.
Find the probability that the first ball drawn is white and the second is red.
a.
b.
c.
d.
9. A bag contains 5 white marbles, 3 black marbles and 2 green marbles. In each draw, a marble is drawn from the
bag and not replaced. In three draws, find the probability of obtaining white, black and green in that order.
a.
b.
c.
d.
10. The probability that a student passes in Mathematics is and the probability that he passes in English is . If
the probability that he will pass at least in one subject is , what is the probability that he will pass in both the
subjects? (We assume it is based on probability only).
a.
b.
c.
d.
118
Application I
Medical Testing
There is a deadly disease called ‘X’ that has infected 10% of the population. There are no symptoms; victims just
drop dead one day. Fortunately, there is a test for the disease. The test is not perfect, however:
• If John has the disease, there is a 10% chance that the test will say NO! (These are called “false negatives”.)
• If John does not have disease, there is a 30% chance that the test will say YES! (These are “false positives”.)
A random person is tested for the disease. If the test is positive, then what is the probability that the person has the
disease?
Solution:
For finding mere solution, follow the steps below:
Step 1: Find the sample space
The sample space is found with the tree diagram below.
pos
.09
.9
.1
yes neg
.1
.01
.9 .27
no pos
.3
.7
person neg
.63
has X? outcome event A: event B:
test result event A ∩ B ?
probability has test
disease? positive?
119
Discrete Mathematics
We can also compute the probability that the test is correct for a random person. This event consists of two outcomes.
The person could be sick and the test can be positive (probability 0.09), or the person could be healthy and the test
can be negative (probability 0.63).
Therefore, the test is correct with the probability 0.09 + 0.63 = 0.72. The test is correct almost three-quarters of
the time. But there is a simple way to make the test correct 90% of the time: always return a negative result. This
“test” gives the right answer for all healthy people and the wrong answer only for the 10% that actually have the
disease.
120
Application II
A Chess Problem
In how many different ways can we place a pawn (p), a knight (k), and a bishop (b) on a chessboard so that no two
pieces share a row or a column?
Solution:
A valid configuration is shown below in the left figure, and an invalid configuration is shown in the right figure.
First, we map this problem about chess pieces to a question about sequences. There is an abijection from configurations
k
p
b
b k
p
valid invalid
to sequences.
(rp, cp, rk, ck, rb, cb)where rp, rk, and rb are distinct rows and cp, ck, and cb are distinct columns.
In particular, rp is the pawn’s row, cp is the pawn’s column, rk is the knight’s row, etc. Now we can count the number
of such sequences using the generalised product rule:
• • rp is one of 8 rows
• • cp is one of 8 columns
• • rkis one of 7 rows (any one but rp)
• • ck is one of 7 columns (any one but cp)
• • rb is one of 6 rows (any one but rp or rk)
• • cb is one of 6 columns (any one but cp or ck)
121
Discrete Mathematics
Application III
Boxing
Flo, famed 6.042 TA, has decided to try out for the US Olympic boxing team. Flo figures that n people (including
himself) are competing for spots on the team and only k will be selected. Thus, there are two cases to consider:
• Flo is selected for the team and his k −1 teammates are selected from among the other n −1 competitors. The
number of different teams that be formed in this way is:
• Flo is not selected for the team, and all k team members are selected from among the other n − 1 competitors.
The number of teams that can be formed this way is:
All teams of the first type contain Flo, and no team of the second type does; therefore, the two sets of teams are
disjoint. Thus, by the sum rule, the total number of possible olympics boxing teams is:
Claire, equally-famed 6.042 TA, thinks Flo isn’t so tough and so she might as well try out also. She reasons that n
people (including her) are trying out for k sports. Thus, the number of ways to select the team is simply:
Claire and Flo each correctly counted the number of possibly boxing teams; thus, their answers must be equal.
So we know:
+=
122
Application IV
Pass the Broccoli
Here’s a game that involves a random walk. There are n+1 people, numbered 0, 1. . .n sitting in a circle:
0
n 1
B
n – 1 2
. 3
. .
k + 1 .
k k – 1
The B indicates that person 0 has a big stalk of nutritious broccoli, which provides 250%of the US recommended
daily allowance of vitamin-C and is also a good source of vitamin-A and iron.
(Typical for a random walk problem, this game originally involved a pitcher of beer instead of a broccoli.)
Person 0 passes the broccoli either to the person on his left or the person on his right with equal probability. Then,
that person also passes the broccoli left or right at randomand so on. After a while, everyone in an arc of the circle
has touched the broccoli and everyone outside that arc has not. Eventually, the arc grows until all but one person
has touched the broccoli. That final person is declared the winner and gets to keep the broccoli!
Suppose that we are allowed to position ourself anywhere in the circle. Where we should stand in order to maximise
the probability that we win? We shouldn’t be person 0; we can’t win in that position. The answer is “intuitively
obvious”: we should stand as far as possible from person 0 at position .
Let’s verify this intuition. Suppose that we stand at position k ≠ 0. At some point, the broccoli is going to end up
in the hands of one of our neighbors. This has to happen eventually; the game can’t end until at least one of them
touches it. Let’s say that person k − 1 gets the broccoli first. Now let’s cut the circle between ourself and our other
neighbor, person k + 1:
k (k − 1) . . . 3 2 1 0 n (n − 1) . . . (k + 1)
B
Now there are two possibilities. If the broccoli reaches to us before it reaches person k + 1, then we lose.
But if the broccoli reaches person k + 1 before it reaches to us, then we and every other person who has touched
the broccoli will win!
This is just the flea problem: the probability that the broccoli hops n − 1 people to the right (reaching person k +1)
before it hops 1 person to the left (reaching to us) is. Therefore, our intuition was completely wrong: our probability
of winning is regardless of where we’re standing!
123
Discrete Mathematics
Bibliography
References
• 2007. Lecture 1 - Propositional Logic, [Video online] Available at: <http://www.youtube.com/
watch?v=xlUFkMKSB3Y> [Accessed 20 June 2013].
• 2007. Lecture 1 - Propositional Logic, [Video online] Available at: <http://www.youtube.com/watch?v=xlUFk
MKSB3Y&list=PL0862D1A947252D20> [Accessed 20 June 2013].
• 2007. Lecture 16-Trees [Video online] Available at:< https://www.youtube.com/watch?v=q0woiOp7sqU>
[Accessed 23 June 2013].
• 2007. Lecture 17- Trees and Graphs [Video online] Available at:< https://www.youtube.com/watch?v=fZqfkJ-
cb28> [Accessed 23 June 2013].
• 2007. Lecture 32 - Recurrence Relations [Video online] Available at: <http://www.youtube.com/
watch?v=qvw1GX93JSY> [Accessed 20 June 2013].
• 2009. Discrete Mathematics. 5 Graphs & Trees [Pdf] Available at:< http://vplab.snu.ac.kr/lectures/09-1/
discrete_math/dm09_slide5.pdf> [Accessed 23 June 2013].
• 2009.Connected Graph [Video online] Available at:< https://www.youtube.com/watch?v=wG-82q-0Dhg >
[Accessed 23 June 2013].
• 2010. Graph Theory - An Introduction! [Video online] Available at: <http://www.youtube.com/
watch?v=HmQR8Xy9DeM> [Accessed 20 June 2013].
• 2010.Introduction to Probability [Video online] Available at:< https://www.youtube.com/watch?v=YWt_u5l_jHs
> [Accessed 23 June 2013].
• 2011. Disconnected Graphs-Graph Theory [Video online] Available at:< https://www.youtube.com/
watch?v=iR7o8rPi2PI > [Accessed 23 June 2013].
• 2011.Introduction to Probability [Video online] Available at:< https://www.youtube.com/watch?v=-8eSOmTPUbk
> [Accessed 23 June 2013].
• 2013. Introduction to Recurrence Relations-1 [Video online] Available at: <http://www.youtube.com/
watch?v=loh8rYkghHg> [Accessed 20 June 2013].
• AbsoluteMathematics, 2011. Mathematical Induction [Video online] Available at: <http://www.youtube.com/
watch?v=Uqn3f2k4vrA> [Accessed 20 June 2013].
• Bertsekas, D.P. & Tsitsiklis, J. N., Introduction to Probability [Pdf] Available at:< http://vfu.bg/en/e-Learning/
Math--Bertsekas_Tsitsiklis_Introduction_to_probability.pdf > [Accessed 23 June 2013].
• bethjonesmath, 2008. Introduction to Combinatorics (part 1) [Video online] Available at: <http://www.youtube.
com/watch?v=cErUmuxraQ0> [Accessed 20 June 2013].
• bullcleo1, 2010. Mathematical Induction [Video online] Available at: <http://www.youtube.com/
watch?v=QHkG0d5kZvE> [Accessed 20 June 2013].
• Cameron, P. J., Notes on Combinatorics, [Pdf] Available at: <http://www.maths.qmul.ac.uk/~pjc/notes/comb.
pdf> [Accessed 20 June 2013].
• Chapter IV – Graph Theory, [Pdf] Available at: <http://www.math.hkbu.edu.hk/~zqiao/Math1130_2009/Chap4.
pdf> [Accessed 20 June 2013].
• Combinatorics , [Pdf] Available at: <http://www.dartmouth.edu/~chance/teaching_aids/books_articles/
probability_book/Chapter3.pdf> [Accessed 20 June 2013].
• Davis, T., Mathematical Induction, [Pdf] Available at: <http://www.math.utah.edu/mathcircle/notes/induction.
pdf> [Accessed 20 June 2013].
• Deo, N., 2004. Graph Theory with Applications to Engineering and Computer Science, Connected and
Disconnected Graphs, PHI Learning Pvt. Ltd.
• Dr. Sharma, G. C. & Dr. Jain, M., 2009. Advance Discrete Mathematics, Trees, 1st ed., Laxmi Publications,
Ltd.
124
• eHow, 2012. Introduction to Combinatorics : Principles of Math, [Video online] Available at: <http://www.
youtube.com/watch?v=jrLYCzCc77g> [Accessed 20 June 2013].
• Graph concepts, [Pdf] Available at:< http://users.phys.psu.edu/~ralbert/phys597_08/c02_graph_conc.pdf >
[Accessed 23 June 2013].
• Graphs - Terminology and Representation, [Online] Available at: <http://www.radford.edu/~nokie/classes/360/
graphs-terms.html> [Accessed 20 June 2013].
• Graphs, [Pdf] Available at:< https://courses.cit.cornell.edu/info2950_2012sp/graph.pdf> [Accessed 23 June
2013].
• Grinstead, C. M., 1997. Introduction to Probability, Conditional Probability. AMS Bookstore.
• Gross, J. L. & Yellen, J., 2003. Handbook of Graph Theory, Graphs, CRC Press.
• Gross, J. L., 2007. Combinatorial Methods with computer applications, Graph theory, Chapman and Hall
CRC.
• IEEM 2012 Discrete Mathematics: Trees [Pdf] Available at:< http://chern.ie.nthu.edu.tw/DM/9-Tree.pdf>
[Accessed 23 June 2013].
• Introduction to Probability [Pdf] Available at:< http://www.dartmouth.edu/~chance/teaching_aids/books_articles/
probability_book/amsbook.mac.pdf> [Accessed 23 June 2013].
• Johnsonbaugh, R., 2008. Discrete Mathematics, 7th ed., Basic Counting Principle, Prentice Hall.
• Kenneth, R., 2008. Discrete Mathematics and its applications, Graphs, 6th ed., Tata McGraw Hill
Publications.
• Lal, A. K., Lecture Notes on Discrete Mathematics, [Pdf] Available at: <http://home.iitk.ac.in/~arlal/book/
mth202.pdf> [Accessed 20 June 2013].
• Langote, U. B. & Vhanmane, M. M., 2009. Discrete Mathematics, Mathematical Induction, 2nd ed., Tech-Max
Publication.
• Lovasz, L. & Vesztergombi, K., Discrete Mathematics, [Pdf] Available at: <http://www.cims.nyu.edu/~regev/
teaching/discrete_math_fall_2005/dmbook.pdf> [Accessed 20 June 2013].
• Mathematical Induction, [Pdf] Available at: <http://www.people.vcu.edu/~rhammack/BookOfProof/Induction.
pdf> [Accessed 20 June 2013].
• Moura, L., Recurrence Relations, [Pdf] Available at: <http://www.site.uottawa.ca/~lucia/courses/2101-10/lect
urenotes/07RecurrenceRelations.pdf> [Accessed 20 June 2013].
• Ramana, B. V. & Grimaldi, R. P., 2008. Discrete and Combinatorial Mathematics, Recurrence Relations, 5th
ed., Pearson Education India.
• Recurrence Relations, [Pdf] Available at: <http://www.mathdb.org/resource_sharing/training/se_rr.pdf>
[Accessed 20 June 2013].
• Rosen, K. H. & Michaels, J. G., 2000. Handbook of discrete and combinatorial mathematics, Recurrence
Relations, CRC Press.
• Rosen, K., 2007. Discrete Mathematics, Mathematical Induction, 6th ed., McGraw Hill publication.
• Schwichtenberg, H., 2004. Mathematical Logic, Logic, Mathematics Institute University Munchen.
• Simpson, S. G., 2010. Mathematical Logic, Logic, Pennsylvania state university press.
• Singh, S. G., 2010. Graph Theory, Trees, PHI Learning Pvt. Ltd.
• StatsLabDublin, 2013. Discrete Mathematics : Important Graph Theory Terms [Video online] Available at:
<http://www.youtube.com/watch?v=TwLYYOMAK4o> [Accessed 20 June 2013].
• Vatsa, B. S. & Vatsa, S., 2009. Discrete Mathematics, Pigeonhole Principle, New Age International.
• Yakov, G. S., 1992. Probability theory: An introductory Course, Introduction to Probability, Springer
Textbooks.
125
Discrete Mathematics
Recommended Reading
• Babu, R., 2011. Discrete Mathematics, Dorling Kindersley (India) Pvt. Ltd.
• Balakrishnan, V. K., 1997. Schaum’s outline of theory and problems of graph theory. McGraw-Hill
Professional.
• Courant, R. & Robbins, H., 1996. What is Mathematics?, Oxford University Press.
• Deo N., 1974. Graph Theory with applications to Engineering and Computer Science, Graphs, Prentice Hall,
Englewood Cliffs, N.J.
• Fomin, D., Genkin, S. & Itenberg, I., 1996. Mathematical Circles (Russian Experience), AMS.
• Freund, J.E., 1993. Introduction to Probability, Dover publications.
• Graham, R., Knuth, D. & Patashnik, O., 1994. Concrete Mathematics, 2nd ed., Addison-Wesley.
• Gross, J. L. & Yellen, J., 2006. Graph theory and its applications, Graph theory, Chapman and Hall/CRC.
• Gupta, S. B., 2005. Comprehensive Discrete Mathematics and Structures, Recurrence Relations, 2nd ed., Laxmi
Publication.
• Gupta, S. B., 2008. Discrete Mathematics And Structures, Recurrence Relations, 5th ed., Laxmi Publications
Ltd.
• Hein, J. L., 2009. Discrete Structures, Logic, and Computability, Permutation and Combinations, Jones and
Bartlett Learning.
• Hinman, P. G., 2005. Fundamentals of Mathematical logic, Logic, A K Peters, Ltd.
• Kleene, S. C., 2002. Mathematical logic, Proof and theory, Courier Dover Publications.
• Koshy, T., 2004. Discrete mathematics with applications, Combinatorics and Discrete Mathematics, Elsevier
Academic Press.
• Liu, C. L., 1968. Introduction to Combinatorial Mathematics, Graph theory, McGraw Hill New York.
• Marcus, D., 2008. Graph Theory: A Problem Oriented Approach, Mathematical Association of America.
• Merris, R., 2004. Combinatorics, 2nd ed., John Wiley & Sons.
• Nerode, A. & Shore, R. A., Logic for Applications, Mathematical Logic, 2nd ed., Springer Textbooks.
• Rosen, K., Discrete Mathematics and its applications with Combinatorics and graph theory, Graph theory, 6th
ed., Tata McGraw Hill publication.
• Rota G. C., 1998. Probability Theory, Preliminary Edition.
• Roussas, G.G., 2007. Introduction to Probability, Elsevier Inc.
• Simpson, A., 2010. Discrete Mathematics By Examples, Tata McGraw-Hill Publishing Company Limited.
• Veerarajan, T., 2008. Discrete Mathematics with Graph Theory and Combinotorics, Tata McGraw-Hill Publishing
Company Limited.
• Veerarajan., 2006. Discrete Mathematics, Recurrence Relations, 7th ed., Tata McGraw-Hill.
126
Self Assessment Answers
Chapter I
1. d
2. b
3. c
4. a
5. c
6. d
7. a
8. d
9. c
10. d
Chapter II
1. a
2. d
3. b
4. c
5. b
6. c
7. b
8. a
9. d
10. a
Chapter III
1. c
2. b
3. b
4. b
5. a
6. a
7. a
8. c
9. a
10. d
Chapter IV
1. c
2. d
3. a
4. b
5. c
6. d
7. b
8. c
9. a
10. b
127
Discrete Mathematics
Chapter V
1. c
2. d
3. b
4. a
5. c
6. b
7. c
8. d
9. b
10. a
Chapter VI
1. b
2. c
3. d
4. b
5. c
6. b
7. a
8. c
9. b
10. c
Chapter VII
1. d
2. b
3. c
4. b
5. a
6. d
7. c
8. d
9. c
10. a
Chapter VIII
1. b
2. c
3. a
4. c
5. d
6. a
7. c
8. b
9. d
10. a
128