0% found this document useful (0 votes)
249 views452 pages

Rama-Topics in Combinatorics and Graph Theory

This book is written to cover some aspects of combinatorics and graph theory, the important topics of Discrete Mathematics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
249 views452 pages

Rama-Topics in Combinatorics and Graph Theory

This book is written to cover some aspects of combinatorics and graph theory, the important topics of Discrete Mathematics.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 452

R.

Rama

Topics in
Combinatorics
and Graph
Theory
Topics in Combinatorics and Graph Theory
R. Rama

Topics in Combinatorics
and Graph Theory
R. Rama
Department of Mathematics
Indian Institute of Technology Madras
Chennai, Tamil Nadu, India

ISBN 978-3-031-74251-4 ISBN 978-3-031-74252-1 (eBook)


https://doi.org/10.1007/978-3-031-74252-1

Jointly published with Ane Books Pvt. Ltd.


In addition to this printed edition, there is a local printed edition of this work available via Ane Books in South Asia
(India, Pakistan, Sri Lanka, Bangladesh, Nepal and Bhutan) and Africa (all countries in the African subcontinent).
ISBN of the Co-Publisher’s edition: 978-81-19662-08-1

© Ane Books Pvt. Ltd. 2025

This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether the
whole or part of the material is concerned, specifically the rights of reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage
and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or
hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does
not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective
laws and regulations and therefore free for general use.
The publishers, the authors, and the editors are safe to assume that the advice and information in this book are
believed to be true and accurate at the date of publication. Neither the publishers nor the authors or the editors
give a warranty, express or implied, with respect to the material contained herein or for any errors or omissions
that may have been made. The publishers remain neutral with regard to jurisdictional claims in published maps
and institutional affiliations.

This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland

If disposing of this product, please recycle the paper.


Preface

This book is written to cover some aspects of combinatorics and graph theory, the impor-
tant topics of Discrete Mathematics. The book covers substantial amount of basic on both
the above said topics. Each chapter of combinatorics covers all the introductory aspects
with adequate examples. Some chapters also give some expanded topics of combinatorics.
First eleven chapters cover all aspects of combinatorics. Chapter 12 covers introduction
to discrete probability. Each chapter is providedwith limited number of workable exercise
problems. Apart from the worked out examples in each chapter, there is a consolidated
number of problems with solutions on this topic ‘combinatorics’ provided at the end of
Chap. 12.
Chapters 13–23 are on topics of graph theory. All the basics required for reading the
content are provided. There is a chapter on ‘Independent sets, covering and Matchings’
which gives the perfect matching theorem and domination. The vertex coloring and edge
coloring are given in Chap. 20 highlighting the bounds on vertex coloring, coloring planar
graphs, and nice aspects of the 4-color theorem. The general form of Ramsey Number is
given with its understanding the usual form of Ramsey Number R(s, t). The bounds com-
puted for some Ramsey Number are stated and proved. There is a chapter on introduction
to spectral graph theory. There is a set of worked out examples on graph theory at the
end of Chap. 23.

Chennai, India R. Rama

Acknowledgements This book is written on two important topics of Discrete Mathematics.


They are combinatorics and graph theory. I wrote the book during my sabbatical (August
2022–February 2023) at IIT Madras. I thank the institute for its support during this period.
I also thank the department for the support. I acknowledge the institutes recognition to me
as ‘Girija Vaidyanathan Chair Professor’. I immensely thank Mr. E. Boopal and my Ph.D.
student Mr. Sivasankar for completely helping in editing the book to its present form.

v
Contents

Part I Combinatorics
1 Basics of Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1 Basic Operations on Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Relations and Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3 Countable and Uncountable Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
1.4 Number Sequences and Summation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.5 Growth Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.6 Sum and Product Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2 Induction and Pigeon Hole Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.1 The Method of Mathematical Induction and Strong Induction . . . . . . . . 31
2.2 Pigeon Hole Principle (PHP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.3 Strong Form of PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3 Binomial Theorem and Binomial Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.1 Binomial Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.2 Pascal Triangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.3 Multinomial Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.4 Binomial Theorem for Real Exponents . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4 Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.1 Set Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
4.2 Integer Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.3 Ferrers’ Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5 Permutations, Combinations and Cycles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
5.1 Permutations on Sets and Multisets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
5.2 Combinations on Sets and Multisets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
5.3 Unlimited Repetitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
5.4 Sorting a Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

vii
viii Contents

6 Generating Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
6.1 Power Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
6.2 Exponential Generating Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
7 Recurrence Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
7.1 Generating Function Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
7.2 Other Methods of Solving Recurrence Relations . . . . . . . . . . . . . . . . . . . 97
7.3 Some Sorting Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
8 Inclusion Exclusion Principle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
8.1 The Principle of Inclusion-Exclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
8.2 Euler’s Phi-Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
8.3 Derangements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
8.4 Counting Combinations by PIE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
8.5 Rook Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
9 Partial Order and Lattices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
9.1 Partial Order Relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
9.2 Hasse Diagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
9.3 Lattices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
9.3.1 Bounded Lattices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
9.3.2 Modular and Distributive Lattices . . . . . . . . . . . . . . . . . . . . . . . . . . 139
9.4 Basic Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
9.5 Mobius Inversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
10 Polya’s Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
10.1 Permutation Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
10.2 Burnside’s Lemma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
10.3 Equivalent Colorings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
10.4 Cycle Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
10.5 Polya’s Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
11 More on Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
11.1 Catalan Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
11.2 Integer Lattice Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
11.3 Eulerian Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
11.4 Narayana Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
11.5 Schroder Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
12 Discrete Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
12.1 Activity and Outcomes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
12.2 The Definition of Probability Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
12.3 Finite Probability Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
12.4 Ball-Box Distribution: Cases and Analysis . . . . . . . . . . . . . . . . . . . . . . . . 208
Contents ix

12.5 Random Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210


12.6 Joint Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
12.7 Expectations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
12.8 Mean, Variance and Standard Deviation . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
12.9 Law of Large Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

Part II Graph Theory


13 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
13.2 Pictorial Representation of a Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
13.3 Some Special Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
14 Paths Connectedness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
14.1 Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
14.2 Adjacency Matrix and Incidence Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 289
14.3 Subgraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
14.4 Isomorphism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
14.5 Connectedness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
14.6 Non Separable Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
15 Trees ............................................................... 301
15.1 Basic Definitions and Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
15.2 Spanning Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
15.3 Tree Decompositions of a Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
16 Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
16.1 Vertex Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
16.2 Edge Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
16.3 Local Connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
17 Eulerian and Hamiltonian Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
17.1 Euler Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
17.2 Non Eulerian Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
17.3 Hamiltonian Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
17.4 Toughness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
17.5 Other Hamiltonicity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
18 Planar Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
18.1 Embedding of Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
18.2 Some Simple Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343
18.3 Characterization of Planar Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
x Contents

19 Independent Sets, Coverings and Matchings . . . . . . . . . . . . . . . . . . . . . . . . . . . 355


19.1 Independent Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
19.2 Matchings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
19.3 Matching in Bipartite Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
19.4 The Perfect Matching Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
19.5 Domination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
20 Graph Coloring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
20.1 Vertex Coloring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
20.2 Brooks’ Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
20.3 Planar Graphs Coloring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
20.4 Edge Coloring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
21 Ramsey Numbers and Ramsey Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379
21.1 Some Basic Theorems on Subsets and Coloring . . . . . . . . . . . . . . . . . . . . 379
21.2 Ramsey Numbers of Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
21.3 Ramsey Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
21.4 Bounds on Ramsey Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
22 Spectral Properties of Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
22.1 Basics of Spectral Graph Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
22.2 Laplacian Matrix of Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
22.3 Eigen Values and Eigen Vectors of Graphs . . . . . . . . . . . . . . . . . . . . . . . . 400
23 Directed Graphs and Graph Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
23.1 Directed Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
23.2 Minimal Connector Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
23.3 Shortest Path Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412

Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
Part I
Combinatorics
Basics of Counting
1

1.1 Basic Operations on Sets

This chapter introduces the basic tools required for the development of discrete mathematics.
The major concepts to be developed are sets, relations and functions. There is no branch of
mathematics that can be studied without the above said topics.
Set theory was developed by two key historical mathematicians Georg Cantor (1845–
1918) and Richard Dedekind (1831–1916). Cantor realized the significance of 1-1 functions
between sets and introduced the notion of cardinality of a set. The German word for a set
is Menge, which is the reason Cantor denotes a set by M and its elements by m. Cantor
proved that the set of all real numbers is uncountable while the set of all algebraic reals is
countable. In 1878 he gave the first formulation of the celebrated continuum hypothesis.
Dedekind is mostly known for his research in algebra and set theory. He was the first
to define real numbers by means of cuts of rational numbers. The key concept ”ideal” in
modern algebra was first introduced by Dedekind. His contributions to set theory as well as
the study of natural numbers and modular lattices are remarkable.
Sets: A set M is a collection of objects of any kind. We write m ∈ M to indicate that m is
an element of M. Examples of sets can be found everywhere around us. For example the set
of all students in an algebra class, the set of all faculty in an educational institution, the set
of all prime numbers.
If a is not an element of a set M then we write a ∈ / M.
Notations: Sets are usually denoted by capital letters X , Y , Z , . . . .
If X is a set and a, b, c, . . . are its elements then X is written as

X = {a, b, c, . . . }.

© Ane Books Pvt. Ltd. 2025 3


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_1
4 1 Basics of Counting

If X is a set such that it contains elements that satisfy a particular property P then X is
written as
X = {x : P(x) is ture}.

Examples 1.1 1. N = {1, 2, 3, . . . } = the set of all natural numbers.


2. Z = {0, ±1, ±2, . . . } = the set of all integers.
3. X = {x ∈ N : x is prime} = the set of all prime numbers.

Definitions 1.2 1. Two sets X and Y are said to be equal iff every element of X is an
element of Y and vice versa written as X = Y .
2. Given two sets X and Y , X is said to be included in Y or X is a subset of Y if every
element of X is an element of Y and is written as X ⊆ Y .
3. Given two sets X and Y , X is said to be properly included in Y or X is a proper subset
of Y if X ⊆ Y and X  = Y .
4. The set which has no element is called an empty set and is denoted by ∅.
5. For any set X , the set of all subsets of X is called the power set of X and is denoted as
P (X ) = {Y : Y ⊆ X }.

Operations on Sets: We describe methods for generating new sets from existing sets by
introducing basic operations on sets.
Union of Sets: Given two sets X and Y , the union of the sets X and Y denoted by X ∪ Y is
defined as
X ∪ Y = {x/x ∈ X or x ∈ Y }

Intersection of Sets: Given two sets X and Y , the intersection of X and Y denoted by X ∩ Y
is defined as
X ∩ Y = {x/x ∈ X and x ∈ Y }

Disjoint Sets: Two sets X and Y are said to be disjoint iff X ∩ Y = ∅ (i.e., they have no
common elements).
Complement of a Set:

1. Given a set X , the absolute complement of X denoted by X is defined as X = {x/x ∈


/ X }.
2. The complement of X with respect to another set A denoted by A ∩ X is defined as

A ∩ X = {x/x ∈ A and x ∈
/ X }.

The set A ∩ X is also the difference of sets A and X and can also be denoted as
A\X .
1.1 Basic Operations on Sets 5

Symmetric Difference: Given any two sets X and Y , the symmetric difference of sets X
and Y denoted by X ⊕ Y is defined as

X ⊕ Y = (X \Y ) ∪ (Y \X )

If all sets under consideration in a certain discusion are subsets of a set U , then U is
called the universal set.

Examples 1.3 Let X = {1, 2, 3}, Y = {3, 4, a, b}. Then

1. X ∪ Y = {1, 2, 3, 4, a, b}
2. X ∩ Y = {3}
3. X = {n/n  = 1, 2, 3}
4. X \Y = {1, 2}.

Representation of a Set Pictorially: Sets can be represented pictorially by means of dia-


grams called as Venn diagrams. The universal set ‘U ’ is usually represented by a rectangle
and any subset A of a universal set is represented by a circle inside the universal set (see
Fig. 1.1).
Two proper subsets A, B of U such that A and B are disjoint i.e., A ∩ B = ∅ is represented
in Fig. 1.2.

Fig. 1.1 . U

Fig. 1.2 . U

A B
6 1 Basics of Counting

Union of two sets A and B can be represented as

where A ∩ B  = ∅
Intersection of two sets A and B is represented as

Complement of a set A with respect to the universal set is given as

Laws of Set Theory: For any sets A, B, C subsets of a universal set u, we have the following
rules:

(i) Commutative Laws:

A ∪ B = B ∪ A, A ∩ B = B ∩ A.

(ii) Associative Laws:

(A ∪ B) ∪ C = A ∪ (B ∪ C)
(A ∩ B) ∩ C = A ∩ (B ∩ C)

(iii) Distributive Laws:

A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C)
A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)
1.1 Basic Operations on Sets 7

(iv) Identity Laws:

A∪∅= A A∩u = A
A∩U = A A∩∅ = ∅

(v) Inverse Laws:

A∪ A=u u =∅
A∩ A=∅ ∅=u

(vi) Double Negation:


A = A.
(vii) Idempotent Laws:

A∪ A= A
A∩ A= A

(viii) Demorgan’s Laws:

A∪B = A∩B
A∩B = A∪B

(ix) Domination Laws:

A∪U =U
A∩∅=∅

(x) Absorption Laws:

A ∪ (A ∩ B) = A
A ∩ (A ∪ B) = A

One can easily observe that the power set of the universal set P(u) is closed under
union, intersection and complement.
8 1 Basics of Counting

1.2 Relations and Functions

In this section we define the concept of relation within the framework of set theory. A (binary)
relation is used in connection with ordered pair of objects. In a set {x, y} the order of the
elements is irrelevant in general. If the order of the elements is relevant then the idea of an
ordered pair is considered and is represented as {{x}, {x, y}} where x is the first element and
y follows x in the order. Thus the concept of ordered pair is defined as follows.
An ordered pair of x and y, denoted by (x, y) is the set (x, y) := {{x}, {x, y}}. We call x
and y the first and second components of the ordered pair (x, y), respectively. In case x = y
we have (x, x) = {{x}}.
A relation is a set of ordered pairs.

Cartesian Product of Sets: Let X and Y be sets. The cartesian product of X and Y is defined
by
X × Y = {(a, b)/a ∈ X , b ∈ Y }.
i.e., the cartesian product X × Y is the set of all ordered pairs (a, b) with a ∈ X and b ∈ Y .
Definitions 1.4 If X and Y are sets and if ρ ⊂ X × Y , we say that ρ is a relation between
X and Y .
If (x, y) ∈ ρ then we write xρ y.

Examples 1.5 Let X be a subset of real numbers. Define

ρ1 = {(x, y)/x, y ∈ X , y = x 2 + 2}
ρ2 = {(x, y)/x, y ∈ X , x = y}

Domain and Range of Relations: Let X and Y be two sets and let ρ be a relation between
X and Y .
The domain of ρ is defined by

D(ρ) = {x ∈ X /∃ y ∈ Y , (x, y) ∈ ρ}

The range of ρ is defined by

R(ρ) = {y ∈ Y /∃ x ∈ X , (x, y) ∈ ρ}

A relation ‘ρ’ is simply a subset of X × Y . For any (a, b) ∈ ρ, one can think of a ∈ X
being assigned to b ∈ Y . One should observe that it is possible to have both (a, b), (a, c) ∈ ρ
for any a ∈ X and also there can be an a ∈ X (a, b) ∈ / ρ ∀ b ∈ Y.
1.2 Relations and Functions 9

Equivalence Relations: Let X be a set and ρ be a relation in X (i.e., ρ ⊂ X × X ).

1. ρ is called reflexive if ∀ x ∈ X , (x, x) ∈ ρ.


2. ρ is called symmetric if ∀ (x, y) ∈ ρ, (y, x) ∈ ρ.
3. ρ is called antisymmetric if (x, y) ∈ ρ and (y, x) ∈ ρ implies x = y.
4. ρ is called transitive if (x, y) ∈ ρ and (y, z) ∈ ρ implies (x, z) ∈ ρ.
5. ρ is an equivalence relation if it is reflexive, symmetric and transitive.
6. ρ is an order relation if it is reflexive, antisymmetric and transitive.

An order relation ρ is said to be a total order relation if for all (x, y) ∈ X 2 either (x, y) ∈ ρ
or (y, x) ∈ ρ. Otherwise ρ is said to be a partial order relation. A totally ordered set is also
called a chain.
If ρ is an equivalence relation on the set X , then for each x ∈ X the set {y ∈ X /(x, y) ∈ ρ}
is called the ρ-equivalence class of the element x.

Theorem 1.6 Let X be any given non empty set and let ρ be an equivalence relation on X .
Then the following are true:

1. The collection of distinct ρ-equivalence classes forms a partition of X .


2. If P is a partition of X and a relation ρ is defined by xρ y iff there exists A in P such
that x, y ∈ A, then ρ is an equivalence relation.

Proof (1) Given that ρ is an equivalence relation. Let [x] = {y ∈ X /(x, y) ∈ ρ}. Since ρ
is reflexive, x ∈ [x]. Let x, y ∈ X such that x  = y and [x] ∩ [y]  = ∅.
Then ∃ z ∈ [x] ∩ [y] such that (x, z) ∈ ρ and (y, z) ∈ ρ thus (x, y) ∈ ρ and (y, z) ∈ ρ
since ρ is an equivalence relation, which implies that [x] = [y] which is a contradiction.
Therefore for any distinct x, y ∈ X , [x] ∩ [y] = ∅.
If z ∈ X then z ∈ [z] thus z ∈ ∪{[x]/x ∈ X } ⊂ X . Therefore X = ∪{[x]/x ∈ X }.
(2) Given that P is a partition of X and ρ is a relation defined by xρ y iff there exists A ∈ P
such that x, y ∈ A. Let z ∈ X . By definition of partition P, ∃ A ∈ P such that x ∈ A.
By definition of ρ, xρx, thus, ρ is reflexive.
Suppose that xρ y. Then both x and y belong to some element A of P. Since both y
and x belong to A, yρx, thus, ρ is symmetric.
Suppose that xρ y and yρz. Then both x and y belong to some element A of P and y
and z belong to some element B of P. Since P is a partition of X , A = B. Thus xρz.
Therefore ρ is transitive.

Remark 1.7 Let ρ be an equivalence relation on a finite set X . If each equivalence class
has r elements, there are |Xr | equivalence classes.
10 1 Basics of Counting

Examples 1.8 Let X = set of all natural numbers union {0}.Define

ρ = {(x, y)/5x + r ≡ 5y + r }
Then ρ is an equivalence relation. The equivalence classes are:

[0], [1], [2], [3], [4].

For example [4] = {4, 9, 14, 19, 24, …}.

Functions: Let X and Y be given sets. By a function f : X → Y from X into Y we mean


a rule that assigns a unique element y = f (x) ∈ Y to every element x ∈ X . Note that a
function is a special case of a relation. Usually X is called as the domain of the function f
and the set { f (x) : x ∈ X } is called as the range of f .

Examples 1.9 The relation ρ = {(a, 1), (b, 2), (c, 3), (d, 4)} is a function from
X = {a, b, c, d} to Y = {1, 2, 3, 4}.

Examples 1.10 Let f be a function defined by the rule f (x) = 2x 2 + 1. The domain of
the function is the set of all real numbers and the range is the set of all real numbers greater
than or equal to ‘1’. The function can also be represented using (x, y)-co-ordinate system
as Fig. 1.3.

Remark 1.11 From the above example it is clear that we can define graph of a function f
whose domain and range are subsets of real numbers.

Definitions 1.12 Let f : X → Y and let B ⊂ Y . Then the inverse image of B denoted by
f −1 (B) is defined as f −1 (B) = {x ∈ X / f (x) ∈ B}.
If B = Range of f , then f −1 (B) is called as the inverse of the function f .

Fig. 1.3 .
1.2 Relations and Functions 11

Definitions 1.13 1. If there exists a function g : A → Y such that g(x) = f (x) where
f : X → Y and A ⊂ X , then g is called as the restriction of f to A and is denoted by
f /A = g.
2. In particular if B is a singleton set, say B = {b}, then f −1 (B) is called the inverse image
of the point b under f denoted by f −1 (b).

Proposition 1.14 For any two subsets A and B of the range Y of a function f : X → Y ,
we have

1. f −1 (A ∪ B) = f −1 (A) ∪ f −1 (B)
2. f −1 (A ∩ B) = f −1 (A) ∩ f −1 (B)
3. f −1 (A\B) = f −1 (A)\ f −1 (B).

Definitions 1.15 Let X , Y be sets and f : X → Y be a function. The function f is said to


be injective if for all x, y ∈ X , f (x) = f (y) implies x = y. f is also said to be one to one.

The function f is said to be surjective if ∀ y ∈ Y there exists an x ∈ X such that f (x) = y.


i.e., Range of f = Y . f is also said to be onto. The function f is said to be bijective if it is
both injective and surjective.
Note that if there exists a function g : Y → X then also f is said to be bijective. Here g
is the inverse of f . One can easily prove that f is injective if and only if for each y ∈ Range
of f , the set f −1 ({y}) has exactly one element.

Definitions 1.16 Let g : X → Z and f : Z → Y be functions. The composition of f and


g denoted by f ◦ g is defined as f ◦ g : X → Y such that f ◦ g(x) = f (g(x)).

Examples 1.17 Let f , g : R → R such that

f (x) = x 2 , g(y) = y + 1

Then f ◦ g : R → R and f ◦ g(x) = (x + 1)2 . Note that f is neither injective nor surjective
but g is a bijective function.

Examples 1.18 Let f : N → N ∪ {0} and g : N ∪ {0} → N,

f (n) = n − 1, g(n) = n + 1
12 1 Basics of Counting

then f ◦ g : N ∪ {0} → N ∪ {0} such that

f ◦ g(x) = f (g(x)) = n x .

Note that f and g are both one to one and onto. Thus f ◦ g is also one to one and onto.

One can show in general that the composition of surjective functions is surjective and the
composition of injective functions is injective. As a partial converse to this statement, we
have the following result.

Proposition 1.19 Let f : Z → Y , g : X → Z and let f ◦ g : X → Y , then the following


hold true:

1. If f ◦ g is surjective then so is f .
2. If f ◦ g is injective then so is g.

We conclude the section with some examples.

Examples 1.20 Let X be a given set and let A be an arbitrary subset of X .


Define a function χ A : X → R as

1 if x ∈ A
χ A (x) =
0 otherwise

The function χ A is called the characteristic function of the subset A in X .

Examples 1.21 Define a function f : X → R such that f (x) = c where c is a constant and
c ∈ R. Then f is said to be a constant function.

Finite and Infinite Sets


In this section we define the concept of finite and infinite sets. We observe that given a finite
set, the number of elements the set contains is uniquely determined.

Definitions 1.22 A set X is said to be finite if it is either empty or there exists a bijection
f : {1, 2, . . . , n} → X for n ∈ N. A set X is infinite if it is not finite.

Remark 1.23 Since bijection f : {1, 2, . . . , n} → X defines an inverse f −1 , the finiteness


of a set X can also be defined as g : X → {1, 2, . . . , n}.
1.2 Relations and Functions 13

Proposition 1.24 A set X is finite if and only if there exists a finite set Y and a bijection
f : X → Y.

Proof If X is finite there exists some finite n and a bijection

g : {1, 2, . . . , n} → X

which implies that f = g −1 : X → {1, 2, . . . , n} is well defined. For Y = {1, 2, . . . , n}, we


have a bijection f : X → Y .
Conversely, suppose there exists a finite set Y and a bijection f : X → Y . Since Y
is finite there exists some n ∈ N and a bijection h : Y → {1, 2, . . . , n}. Let g = h ◦ f :
X → {1, 2, . . . , n}. Since f and h are bijections, h ◦ f is also a bijection and hence X is
finite. 

Remark 1.25 One can also show that for a given set X and for some element x0 ∈ X , X is
finite iff X \{x0 } is finite.

Definitions 1.26 1. Given two sets X and Y , we say that X and Y have same cardinality,
denoted by |X | = |Y |, if there is a bijection f : X → Y .
2. We say that cardinality of X is not greater than cardinality of Y , denoted by |X | ≤ |Y | if
there exists an injective function f : X → Y .
3. We say that cardinality of X is not less than cardinality of Y , denoted by |X | ≥ |Y | if
there exists a surjective function f : X → Y provided Y  = ∅.

Note that |X | < |Y | if |X | ≤ |Y | and |X |  = |Y |. If X = ∅, then |X | = 0, and if X is finite


then |X | = number of elements in X . In the following theorem we see that all finite sets have
cardinality less than the set of natural numbers.

Theorem 1.27 Let X and Y be any two given sets. Then the following statements are
equivalent:

(i) There exists an injective function f : X → Y .


(ii) There exists a surjective function g : Y → X .

Proof The case when X = ∅ or Y = ∅ is trivial. If X  = ∅ and Y  = ∅ then


(i) ⇒ (ii) Let f : X → Y be an injective function and let x ∈ X .
Define g : Y → X such that

f −1 (y) if y ∈ R( f )
g(y) =
x if y ∈ Y \R( f )
14 1 Basics of Counting

It is clear that g is onto.


(ii) ⇒ (i) Let g : Y → X is surjective, define f : X → Y such that f (x) = yx where yx =
g −1 (x), x ∈ X . Clearly f is injective. 

One can see that |X | ≤ |Y | iff there exists a surjective function f : Y → X . In the fol-
lowing we see that two sets X and Y have same cardinality iff there is a injection (surjection)
from X to Y and from Y to X .
We use the following lemma without proof.

Lemma 1.28 Let {X i } and {Yi } are sets such that f i : X i → Yi is a bijection ∀ i. If all
X i ’s are pairwise
  disjoint and all Yi ’s are pairwise disjoint, then there is a bijection f :
Xi → Yi
i i

1.3 Countable and Uncountable Sets

We have observed so far that a set is either finite or infinite.

A = {1, 2, 3, 4, 5}
is an example of a finite set where as the set of all positive even numbers and the set of all
real numbers are examples of infinite sets. We can infact show that the cardinality of the
set of all positive even numbers is same as that of the set of all positive natural numbers.
This is not the case for real numbers. Hence we further classify infinite sets based on their
cardinality as countable or uncountable.

Definitions 1.29 1. A set X is called countably infinite if |X | = |N|.


2. A set X is called countable (countably infinite) if |X | ≤ |N|. i.e., there exists a bijection
f : X → N.
3. A set X is called uncountable if it is not countable i.e., |X | > |N|.

Remark 1.30 Observe that a set X is countable if and only if it is finite or countably infinite.

Examples 1.31 1. N is countably infinite since f : N → N such that f (x) = x is a bijec-


tion.
2. N is countably infinite since f : N → N such that f (x) = x + 1 is a bijection.
1.3 Countable and Uncountable Sets 15

Properties of Countable sets: Let X , Y be countable sets

(i) For Z ⊆ X , Z is countable.


(ii) X ∪ Y is countable.
(iii) X ∩ Y is countable.

The following result is a generalization of the previous result (ii).

Theorem 1.32 Countable union of countable sets is countable.

Proof Exercise. 

Examples 1.33 The set R of all real numbers is countable.

Solution: Suppose R is countable, then by properties of countable sets (0, 1) ⊆ R is count-


able. Then ∃ an bijection f : N → (0, 1). Let 0 · ai1 ai2 ai3 ai4 . . . be the decimal representa-
tion f (i).
Now we choose an x ∈ (0, 1) such that the nth digit in the decimal representation of x is
different from the nth digit in the decimal representation of f (x).
By the choice of x, x  = f (i) ∀ i ∈ N+ which contradicts our assumption that f is a
bijection. Hence (0, 1) is uncountable and so is R. 

Theorem 1.34 (Cantor’s Theorem) The power set of any set X has greater cardinality than
the set X i.e., there is no surjection from X to P (X ).

Proof Suppose f is a surjection from X to P (X ). Let Y = {x ∈ X : x ∈ / f (x)}. Since f is


onto, there exists y ∈ X such that f (y) = Y . Note that Y ∈ P (X ).
If y ∈ Y then by definition of Y , y ∈
/ f (y) = Y .
If y ∈
/ Y = f (y) then by definition of Y , y ∈ Y . We reach a contradiction in both cases,
and therefore |X |  = |P (X )| holds. 

Corollary 1.35 There is no injection from P (X ) to X .

Proof Exercise. 

In the following theorem we state that for any set X there exists a set whose cardinality
is same as P (X ).

Theorem 1.36 Let X be a given set. Then |P (X )| = |2 X | where 2 X denotes the set of all
functions from X into A where |A| = 2.
16 1 Basics of Counting

One can observe from the Cantor’s theorem that

N0 = |N| ≤ |P (N)| ≤ |P (P (N))| ≤ |P (P (P (X )))| ≤ . . .

Thus one can obtain a sequence of sets having greater cardinality than the previous element
in the sequence. In the following theorem we show that apart from the first element, every
element in the above sequence is uncountable. To be precise we see that the cardinality of
R is 2N0 .
Recursive Definition: Recursion is a process in which one or more initial stages of the
process are specified and the nth stage of the process is defined using some of the previous
stages, using some fixed method. For example method of proof by induction is based on a
recursively defined structure. Recursion can be used to define sets, functions and sequences.
Recursive definitions always have two parts:

(a) Base case


(b) Recursive step

Recursive definitions are also called as inductive functions or recurrence relations.

Examples 1.37 The set of all Fibonacci numbers {1, 1, 2, 3, 5, 8, . . . } can be defined recur-
sively as:
Base case: f (1) = 1, f (2) = 1.
Recursive step: f (n) = f (n − 1) + f (n − 2), n ≥ 3.

Remark 1.38 Functions such as factorial, Fibonacci, etc., are simpler to define in terms of
other functions. Recursion can be used to naturally define such functions.

Definitions 1.39 A function f is recursively defined if at least one value f (x) is defined in
terms of another value f (y) where x  = y.

Examples 1.40 Let X = {2, 4, 6, 8, . . . }. X can be defined recursively as follows: Let f :


N+ → X such that
Base case: (a) f (1) = 2, f (2) = 4.
Recursive step: (b) f (z) = f (x) + f (y) where x, y < z.

We now state the general principle of recursive definition which guarantees the existence
and uniqueness of a recursively defined function for a given set.
Principle of Recursive Definition: Let X be a set and x ∈ X . If f : X → X , then there is
a unique function g : N → X such that

g(1) = x, g(s(n)) = f (g(n)) for all n ∈ N


1.4 Number Sequences and Summation 17

where s(n) is defined as

s(n) = n + 1 s(n + m) = n + S(m).

1.4 Number Sequences and Summation

Counting is the fundamental concept of discrete mathematics. A discrete set is a set contain-
ing discrete elements as its members. This set may be finite or infinite and may or may not
have a property to describe its elements. For example the natural numbers 1, 2, 3, 4, 5, . . .
can be said to be a set of natural numbers.
A sequence is a set of elements or numbers in a particular order. One can define a sequence
formaly using the definition of a function.

Definitions 1.41 A sequence is a function f from a subset of natural numbers N to a set


S. The values or members of the sequence can be called as terms. Usually a sequence is
denoted by a0 , a1 , a2 , . . . where each ai is a member of the set S. Note that function f is
sometimes referred to as an ‘output’ function. So we can write f (n) as an . The notation
{an } denotes the sequence a0 , a1 , a2 , . . . .

Examples 1.42 (1) 2, 4, 6, 8 is a sequence with 4 terms. Here a1 = 2, a2 = 4, a3 = 6,


a4 = 8. It is a finite sequence.
(2) The sequence 1, 2, 3, 5, 8, 13, 21, 34, . . . is an inifnite sequence. It is the well known
Fibonacci sequence.
(3) The sequence { n1 } is a sequence representing 1, 21 , 13 , 41 , . . . .

Some Special Sequences

1. Arithmetic progression: It is a sequence with terms a, a + d, a + 2d, a + 3d, . . . , a +


nd, . . . . Here in {a + kd}, a, d are real numbers k ∈ N. d is called as common difference.
2. Geometric progression: It is a sequence with terms a, ar , ar 2 , ar 3 , . . . , ar n , . . . . Here
the initial term is a and r is called as common ratio. In the sequence {ar n }, a, r are real
numbers.

Examples 1.43 1. {−2 + 3k} is an arithmetic progression with its terms as −2, 1, 4, 7,
10, 13, . . . . Here a = −2, d = 3.
2. Consider the sequence {1, −1, 1, −1, 1, −1, . . . }. It is a geometric progression with
a = 1, r = −1. One can refer {(−1)n } as a formula representing the above sequence.

Remark 1.44 There are sequences that are neither arithmetic progression nor geometric
progression.
18 1 Basics of Counting

Examples 1.45 Consider the sequence 1, 5, 13, 25, . . . . This sequence is neither an arith-
metic progression nor a geometric progression. {2n 2 + 2n + 1} is the closed form corre-
sponding to the above sequence.

Summations
Sum of the terms of a sequence is called as summation of the sequence. For example
a2 + a3 + a4 + a5 is a summation from the sequence a0 , a1 , a2 , . . . . The summation may
range either covering all the terms or a finite number of them.

Definitions 1.46 Let {an } be a sequence. The sum of the terms at , at+1 , . . . , as is written
as at + at+1 + · · · + as is called a summation where the index is running from t to s.
s
Notation 1.47 ai stands for the summation of at , at+1 , . . . , as . We say ‘i’ is the
i=t
index of the summation and the index is running from t to s. Also ‘t’ is called the lower
index and ‘s’ is called the upper index of the summation.

Examples 1.48 1. Consider the sequence {n 2 }. The value of the summation


4
(i)2 = 22 + 32 + 42
i=2
= 29
7
2. The value of the summation (−1)i = −1.
i=3

More Than One Summation


Most commonly used nested summations are double summations. They occur almost in
many parts of mathematics and computer programming. The summations


s 
m
ai j
i=t j=

is called as double summation.

Examples 1.49 Let f (x) = x + 1. The value of the summation


4
f (x) = f (1) + f (2) + f (3) + f (4)
x=1
= 14

Here f (x) is describing a sequence {n + 1}.


1.5 Growth Functions 19

Remark 1.50 A summation can be sometimes expressed in a closed form.

Examples 1.51 Closed form of


n
n(n + 1)(2n + 1)
i2 = .
6
i=1

Linearity Property


n 
n 
n
(kam + bm ) = k am +  bm
m=1 m=1 m=1
where k,  are real numbers, {an }, {bm } are sequences.
In particular
 n n 
n
(am ± bm ) = am ± bm .
m=1 m=1 m=1

Examples 1.52 1. The progression a, a + d, a + 2d, . . . is also sometimes called as arith-


metic series. The sum of the first ‘n’ terms of this series will be

n 
n 
n
(a + kd) = a+d k
k=0 k=0 k=0
dn(n + 1)
= na + .
2
This is the closed form for the arithmetic series.
2. The progression a, ar , ar 2 , . . . is also sometimes called as geometric series. Its closed
form will be a(r(r −1)−1) , r  = 1. Here, |r | may be <1 or >1. It is not difficult to prove that
n+1


 a
ar k = when |r | < 1.
1−r
k=0

1.5 Growth Functions

For many problems in science and engineering, a method of solution is described via algo-
rithms. An algorithm or a sequence of computation will consist of a finite set of instructions
leading to a solution for a given problem. The instructions in any algorithm can be in any
programming language, English sentences or pseudocode etc. There may be more than one
way to solve a problem and hence the sequences of computation will be different. Hence
it is important to evaluate an algorithm in terms of number of steps or time taken to com-
plete the assignment. Also such an estimate of time must be independent of the computer
20 1 Basics of Counting

or software used. Also such an analysis must be true for any input irrespective of its size.
Growth functions are very useful abstraction to capture the running time of any algorithm
in a very general way. Consider the following simple example to understand the concept of
estimating computation steps or time.

Examples 1.53 Let A be a sequence of n numbers say A[1], A[2], . . . , A[n]. The numbers
are indexed as 1, 2, 3, . . . , n for writing down an algorithm for a sequential search in A to
check whether a number ‘t’ is present in A or not present in A.

Algorithm M (in pseudocode)


i := 1
while (i ≤ n and A[i]  = t)
i ←i +1
if (i > n), then print ‘not present’
return i.

Clearly algorithm M will compare t with every number in A in a sequential way. If ‘t’ is
present in A[1], then the algorithm will stop so its computation by returning the index ‘1’ to
say t is present as the first number in A. If not the instructions are given to compare t with
every element in the array A. In the worst case scenario, it may be that t is not present in A.
But the algorithm will compare t with all entries in A. This is said to be the worst instance
of the problem. In any case, the number of comparisons made with t is given by the index
‘i’ and it is actually the number of computation steps which is 2n. Also the index increasing
step has to be executed along with the ‘while’ step; which will be ‘n’. Hence one can use
‘3n’ steps to solve the problem completely for any input t. Other steps in the algorithm are
computed only once. Hence we can say that the running time for the algorithm M is in terms
of 3n or n. This running time varies as you vary t. Growth functions are very useful for the
estimation of the number of computational steps of any algorithm. Growth functions are
described to be functions of ‘n’ where n is the size of the input, which is usually taken to be
a large integer r . Complexity of any algorithm is judged only by looking at growth function.
Given any two functions f and g we wish to give systematic method of comparing f and
g interms of the common input ‘n’. We would like to understand the meaning of f and g
grow at the same rate for large values of input ‘n’ (say). In this process we only concentrate
on actual number of computational steps involved for any large size input.
1.5 Growth Functions 21

The Big O Notation

Definitions 1.54 Let f and g be any two functions from N to R (set of real numbers). We
say g asymptotically dominates f or ‘ f is in big-O of g’ if there exist c and k such that

| f (x)| ≤ c|g(x)| for all x ≥ k.

In notation, f (x) ∈ O(g(x)) or


f ∈ O(g).

Note 1.55 It is clear that any f that satisfies the above condition can be said to be in O(g).

We state the following theorem which gives a necessary condition for a function f to be
in O(g).

| f (x)|
Theorem 1.56 (i) If lim = , where  ≥ 0, then f ∈ O(g).
x→∞ |g(x)|
| f (x)|
(ii) If lim = ∞, then f ∈
/ O(g).
x→∞ |g(x)|

Remark 1.57 A function f ∈ O(g) means that f is bounded by a constant multiple of g


for large values of x.

Examples 1.58 Show that n 2 + 7 ∈ O(n 2 ) using the definition of big-O as well as the
above theorem.

Solution: Using the definition of big-O, let c = 2, and k = 3. Then for 2n 2 = n 2 + n 2 ≥


n 2 + 9 ≥ n 2 + 7. Hence n 2 + 7 ∈ O(n 2 ).
Solution by the Above Theorem:

n2 + 7
lim = 1.
n→∞ n2
Here  = 1. So n 2 + 7 ∈ O(n 2 ).

Remark 1.59 A function f (n) ∈ O(n t ) means that for any value of n, irrespective of value
of ‘n’, the function f (n) is bounded above by n t , t ∈ N.
22 1 Basics of Counting

Examples 1.60 Show that n 4 ∈


/ O(n 3 ).

Solution: Consider
n4
lim = ∞.
n→∞ n 3

Hence by the above theorem, n 4 ∈


/ O(n 3 ).

Remark 1.61 In complexity measurements, the functions f , g defined above always set to
positive real numbers.

The Litte O Notation

Definitions 1.62 If for real valued functions f , g,

f (n)
lim =0
n→∞ g(n)

then we say that f belongs to little-o of g. i.e., f ∈ o(g).

Remark 1.63 The fact that if f ∈ o(g), then g ∈ O( f ) can be verified easily. One can see
from the definition of big O, an + b ∈ O(n 2 ). But this bound is not tight. On the other hand
an + b ∈ o(n 2 ) but an 2 ∈
/ o(n 2 ). So little o notation is describing asymptotic upper bound
that is not asymptotically tight. For example an ∈ o(n 2 ) but an 2 ∈ / o(n 2 ).

θ -notation: For a given function g(n), f (n) ∈ θ (g(n)) if there exist positive constants k1 , k2
and n 0 such that 0 ≤ k1 g(n) ≤ f (n) ≤ k2 g(n) for all n ≥ n 0 .

Examples 1.64 Consider f (n) = n 2 − 2n, g(n) = n 2 . We can see

c1 n 2 ≤ n 2 − 2n ≤ c2 n 2 ∀ n ≥ n 0 .
2
⇒ c1 ≤ 1 − ≤ c2
n

For c2 , n ≥ 3, c1 ≤ 13 . So choose c1 = 13 , c2 = 1, n ≥ 3 and f (n) ∈ θ (g(n)).

-Notation (Big-Omega Notation)


For two functions f (n), g(n), if there exist positive constants k and n 0 such that 0 ≤ kg(n) ≤
f (n) for all n ≥ n 0 , then we say f (n) ∈ (g(n)). Here f (n) grows no faster than g(n).
Clearly ‘’ gives lower bound for functions.
1.6 Sum and Product Rules 23

Examples 1.65 (i) Consider f (n) = 2n + 3, g(n) = n. It is not difficult to see 2n + 3 ∈


(n).
(ii) Consider f (n) = log(n 3 ) + 2 and g(n) = log(n). Clearly

log(n 3 ) + 2 = 3 log(n) + 2
≥ log(n) ∀ n > 1 and k = 1

This means log(n 3 ) + 2 ∈ (log(n)).

o-Notation (Little-‘oh’ Notation)


For given functions f (n) and g(n), if 0 ≤ f (n) ≤ kg(n) for all n ≥ n 0 , ‘k’ being any positive
constant, then we say f (n) ∈ o(g(n)). Note that little-‘oh’ is used for denoting an upper
bound that is not asymptotically tight one.

Examples 1.66 Consider f (n) = 3n and g(n) = n 2 . Then clearly 3n ≤ kn 2 for any ‘k’.

We have seen briefly all the notations used for indicating the growth functions.
The largest number of computation steps required to solve a given problem counts for time
complexity of the algorithm. One may call this measurement as worst-case time complexity.
Usually the size of the input is taken to be very large for any given analysis. The constants
involved in the counting of steps are usually ignored. We can see that asymptotic notations
described above are very useful for describing the worst-case running time T (n) (say).
Clearly T (n) is usually defined for integer n.

1.6 Sum and Product Rules

It is equally important to learn enumeration techniques. The enumeration methods are also
called as counting methods.
Basic Counting Rules
Many counting problems require the number of distributions of objects or elements in a
specified manner. The objects may or may not be distinct.

Examples 1.67 Let n persons arrive at the same time at a railway booking counter, to book
tickets. The booking however can be done only sequentially i.e., one at a time. Hence an
ordering of these n persons is required so that the tickets are issued to them. Hence we need
to know how many different ways are there to order the persons or prioritize the persons so
as to issue tickets to them.
24 1 Basics of Counting

Examples 1.68 Three dice are rolled sequentially. The outcome of rolling will be a sequence
of numbers between 1 and 6. That is one outcome may be (4, 3, 2). In general outcome will
be (k1 , k2 , k3 ) where 1 ≤ ki ≤ 6, 1 ≤ i ≤ 3. What we call sample space will be

A = {(k1 , k2 , k3 )/ki = 1, 2, 3, 4, 5, 6, 1 ≤ i ≤ 3}.

A is the set of all possible outcomes by rolling the dice activity. Suppose the question
is: Find the number of elements of A such that k1 + k2 + k3 = 4. The exhaustive collection
will tell that the number is 3.

In both the above examples the problem is to make an enumeration or number of distri-
butions of objects into holes. Before proceeding let us learn two fundamental principles that
are useful for enumeration.
Let  be a set, and let || denote the number of elements in .
Addition Rule
Suppose  is the union of disjoint nonempty subsets E 1 , E 2 , . . . , E t . Then || = |E 1 | +
|E 2 | + · · · + |E t |. For the disjoint sets E i , 1 ≤ i ≤ t, each element of  occurs exactly in
one E i . So, we say that E 1 , E 2 , . . . , E t form a partition of . If E i ’s overlap, then more
refined method is needed to enumerate .
The addition rule can be understood as an event-activity problem. Suppose E is an
event and  is the set of ways that E can happen. The question is to count . Suppose
E 1 , E 2 , . . . , E t are mutually exclusive events and it is known that E 1 can happen in m 1
ways, E 2 can happen in m 2 ways and so on and E t can happen in m t ways. Then the
addition principle enumerates the activity as follows:
‘The event that E 1 or E 2 or E 3 or . . . E t can occur in m 1 + m 2 + · · · + m t ways’.

Examples 1.69 Class VIII contains 30 boys and 35 girls. In how many ways can a leader
be selected so that the leader is a boy or girl?
Since there are totally 65 students in the class, any one of this 65 can be nominated as a
leader. It can be seen that the leader can be one from the 30 boys (or) one from the 35 girls.
However the activity will complete only after selecting a leader. Hence the number of ways
of selecting a girl leader is 35. Similarly for selecting a boy leader, the number of ways is
30. Hence the total number of ways will be 65.

Examples 1.70 A box contains 10 red balls, 10 blue balls and 10 yellow balls. In how many
ways can we pick a blue or yellow ball from the box.
Since there are 10 blue balls and 10 yellow balls, there are 10 + 10 = 20 ways to select a
blue or yellow ball.

The above examples are simple and direct as we considered only non-overlapping events.
More examples can be seen later.
1.6 Sum and Product Rules 25

Multiplication Rule
The cartesian product of two sets X and Y will be

X × Y = {(x, y)/x ∈ X , y ∈ Y }.

If E is an event to be completed in two stages and if there are t1 outcomes for the first
stage E 1 and t2 outcomes for the second stage E 2 . The event E is considered to be complete
only when both the stages are complete. Hence the number of ways E to happen will be
t1 × t2 . In general if events E 1 , E 2 , . . . , E m can happen t1 , t2 , . . . , tm ways respectively and
total event E is considered to be complete only if E 1 , E 2 , . . . , E m in sequence are complete,
then E can happen in t1 · t2 · t3 · · · tm ways.

Examples 1.71 A social service organization has 10 men and 15 lady members. A person
among them has to be nominated as president and a person as treasurer. Find the number of
ways such nomination can be done?

Solution: The activity nomination is a pair (x, y) where x is the president,y is the treasurer
and x and y are members of the organization. The activity will be complete only when
nominations are made for both the posts. Hence one must use multiplication principle. The
following are the two cases.

Case (i) A member can be both the president and treasurer at the same time. In this case
the number of possible nominations are 25 × 25 = 625.
Case (ii) If a president cannot be a treasurer and vice versa, then the number of possible
different nominations are 25 × 24 = 600.
Case (iii) If members with different gender are to hold the positions, then the number of
possible different nominations is

10 × 15 + 15 × 10 = 300.

Here we applied both addition and multiplication principles as the nomination is the
union of two disjoint sets.

Examples 1.72 (i) How many 4-digit numbers can be formed using the digits 1–9?
(ii) How many such numbers can be formed so that the last digit is always an even number?
(iii) How many such numbers can be formed so that no digit can be repeated?
26 1 Basics of Counting

Solution:

(i) There are 94 such 4-digit numbers as each digit of the number can be selected in 9
ways. The activity of forming a 4-digit number will be complete only when all the
4-digits are filled. Hence by multiplication principle the answer will be 94 .
(ii) The even numbers are 2, 4, 6, 8. The last digit should contain only one of these numbers.
Hence the last digit can be filled only in 4 ways. Hence the total number of ways in
this case will be 93 × 4.
(iii) The activity is to choose numbers from 1 to 9 for 4 positional digits of the number.
Any one position can be filled in 9 ways. Since repetitions are not allowed,the next
selection will be only from 8 available numbers. Hence the total number of ways will
be 9 × 8 × 7 × 6.

An enumeration problem many times may require the applications of both addition and
multiplication principles. The following example is an illustration of such a situation.

Examples 1.73 Let  = {a1 , a2 , . . . , an }, where || = n. Show that the number of subsets
of  is 2n .

Solution: A subset A of  can be formed in n steps as follows. The subset A may contain
a1 or may not, it may contain a2 or it may not and so on, A may contain an or not. Hence
each ai may or may not be put in A. For each pick ai , there are 2 possible ways in forming
A. Hence the number of subsets will be 2n .

Examples 1.74 How many 5-digit numbers are there that are with exactly one 3 or one 5
in the first digit?

Solution: The activity is to form a 5-digit number using the number 1 to 9. Out of the 5-digits
4-digits can be filled in 94 ways except the first one. If the first position contains 3, then there
are 94 numbers having 3 in the first digit. The situation is identical if the first digit contains
5. Hence the total number of such numbers will be 94 + 94 = 2 × 94 .
Exercise

1. Prove that

n
n(n + 1)(2n + 1)
k2 = ∀k ≥0
6
k=0
2. Find the closed formula for the following sequences

(i) 1, 3, 6, 10, 15, 21, . . .


(ii) 1, 1, 2, 3, 5, 8, 13, . . .
1.6 Sum and Product Rules 27

(iii) 6, 12, 24, 48, . . .


(iv) 1, 5, 23, 119, 719, . . .

3. Let A = {0, 1, 2, 3, 4, 5, 6, 7, 8} and f (x) = x 2 (mod 9). Find the range of f .


4. Sketch the graph of the following relations

(i) {(x, y) ∈ R × R|x ≥ y 2 }


(ii) {(x, y) ∈ R × R|y ≥ x 2 }

5. Let A = {0, 1, 2, a, b} and B = {a, b, c, 1, 2}.


Find the following

(i) A∪B
(ii) A∩B
(iii) A\B
(iv) B\A

6. Prove the following

(i) A ∪ B = A ∪ (A ∪ B)
(ii) A ∪ B = A ∩ B
(iii) A ⊕ B = (A ∪ B)\(A ∩ B)

7. If X ⊕ A = A find X if it exists.
8. Let A = {2, 3, 4, 5}, B = {1, 2, 5, 6}, C = {1, 3, 4, 6}, U = N
Find

(i) A∩ B ∩C
(ii) A∩ B ∩C
(iii) A∩ B ∩C
(iv) A∩ B ∩C

9. Let X , Y and Z be any given sets. Show that

(i) If X ⊆ Y and Y ⊆ Z then X ⊆ Z .


(ii) If X ⊂ Y and Y ⊂ Z then X ⊂ Z .
(iii) X = Y iff X ⊆ Y and Y ⊆ X .
(iv) X ∈ P (X ) and ∅ ∈ P (X ).
(v) X ⊆ Y ⊆ Z ⊆ X iff X = Y = Z .

10. Show that {a/a = b2 for a real number ‘b’} = {a/a ≥ 0, a is real}.
28 1 Basics of Counting

11. Prove that for all sets X and Y , ∅ ⊆ X ∩ Y ⊆ X ∪ Y .


12. Given X , Y , Z , prove the following (expand this as laws of set)

(i) X ∪Y =Y ∪ X
(ii) (X ∪ Y ) ∪ Z = X ∪ (Y ∪ Z )
(iii) X ∩Y =Y ∩ X
(iv) (X ∩ Y ) ∩ Z = X ∩ (Y ∩ Z )
(v) X ∪ (Y ∩ Z ) = (X ∪ Y ) ∩ (X ∪ Z )
(vi) X ∩ (Y ∪ Z ) = (X ∩ Y ) ∪ (X ∩ Z )
(vii) P (X ∩ Y ) = P (X ) ∩ P (Y )

13. Determine whether the following are equivalence relations and if so, determine the
corresponding equivalence classes.

(i) ρ = {(x, y)/x − y is divisible by 7}


(ii) ρ = {(x, y)/x, y ∈ N, x ≤ y}
(iii) ρ = {(x, y)/0 ≤ x ≤ 20, 0 ≤ y ≤ 20}
(iv) ρ = {(x, y)/x, y ∈ R, x − y ∈ Q}

14. Determine whether f −1 exists. If so find the inverse where f : R → R is defined as

(i) f (x) = e x
(ii) f (x) = 1+x1
2

(iii) f (x) = x 2 + 3x + 1
(iv) f (x) = x

15. Let f , g, h be any three functions from X → X such that X  = ∅. Show that f ◦ (g ◦
h) = ( f ◦ g) ◦ h.
16. Let f : X → Y be bijective and g : Y → X be its inverse. Show that g is unique.
17. Let f : Z → Y and g : X → Z such that both f and g are bijective. Show that f ◦ g
is bijective.
18. Let f , g : X → Y be two functions. We say that f is equal to g denoted by f = g if
f (x) = g(x) ∀ x ∈ X . Define f , g : Z → Z as f (x) = 2x 2 − x and g(x) = x − 1. Is
f = g?
19. Show that the set of all irrational numbers.
20. Let X be an infinite set and let Y be a countable set. Prove

(i) |X ∪ Y | = |X |.
(ii) If X \Y is infinite, then |X \Y | = |X |.
(iii) If Y is finite, then |X \Y | = |X |.
1.6 Sum and Product Rules 29

21. Show that if X is an infinite set, then there exists Y  X such that |Y | = |X |.
22. Show that f (n) ∈ O(g(n)) in the following

(i) f (n) = n 2 log(n 2 + 1) + 5n 3 + 4


g(n) = n 3
(ii) f (n) = n 2 + 5n + 10
g(n) = 15n 2

23. Let f (x) = a0 + a1 x + a2 x 2 + · · · + at x t , with at being positive. Prove that

(i) θ ( f (n)) = θ (n k )
(ii) O( f (n)) = O(n k ).
Induction and Pigeon Hole Principle
2

2.1 The Method of Mathematical Induction and Strong Induction

In this section we discuss the last axiom of Zermelo-Fraenkel set theory known as the axiom
of choice which is stated as follows.
Axiom of Choice
Every family of non-empty sets (Ai )i∈I has a choice function

f :I → {Ai }
i∈I

such that f (i) ∈ Ai for each i ∈ I .


The axiom guarantees the existence of a choice function but does not indicate on how to
construct such a function. The axiom of choice is indeed equivalent to many other results in
different areas of mathematics. Our interest lies in understanding the equivalence of axiom
of choice to a well known important proof technique called as the principle of mathematical
induction. We list some of the equivalent statements here without proof.

Theorem 2.1 The following are equivalent:

1. Axiom of Choice: Every family of non empty sets has a choice function.
2. Zorn’s Lemma: If (X , ≤) is a non-empty partially ordered set in which every chain has
an upper bound, then, X has a maximal element.
3. Well-ordering Principle: For every set X , there is a relation < such that (X , <) is a
well-ordering.

© Ane Books Pvt. Ltd. 2025 31


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_2
32 2 Induction and Pigeon Hole Principle

4. Bernstein’s Theorem: Given any two sets X and Y , there exists either a bijection between
X and a subset of Y or a bijection between Y and a subset of X .
5. Housdorff Maximal Principle: Every partially ordered set has a maximal chain.

Since axiom of choice is equivalent to the well ordering principle, it can be shown that
the well ordering on N is equivalent to the principle of mathematical induction which is
defined as follows:

Definition 2.2 1. Principle of mathematical Induction (PMI): Weak form: Let S ⊆ N. Sup-
pose 1 ∈ S and n + 1 ∈ S whenever n ∈ S. Then S = N.
2. Principle of mathematical Induction (PMI): Strong form: Let S ⊆ N. Suppose 1 ∈ S and
n + 1 ∈ S whenever 1, 2, . . . , n ∈ S. Then S = N.
3. Well ordering Principle for N: (WOP): Every non-empty subset S of N has a least element.

Theorem 2.3 The following statements are equivalent.

(a) PMI weak form


(b) PMI strong form
(c) WOP for N.

Proof (c) ⇒ (a)


Let P(n) be a property that is satisfied for some n.
We assume that

(i) P(1) is true


(ii) P(K + 1) is true whenever P(K ) is true.

We need to show that P(n) is true for all n ∈ N. Suppose ∃ m ∈ N such that P(m) is not
true.
Let S = {m ∈ N/P(m) is false}.
Since m ∈ S, S  = ∅ and by well ordering principle there exists a least element t ∈ S.
Since P(1) is true, t  = 1. Therefore t ≥ 2 and t − 1 ∈/ S since t is the least element
of S. Hence P(t − 1) is true. But by hypothesis (ii) P(t − 1) ⇒ P(t) ⇒ P(t) is true, a
contradiction as t ∈ S. Therefore our assumption that ∃ m P(m) is false is not true.
Hence P(n) is true ∀ n ∈ N.
(a) ⇒ (b)
PMI weak form ⇒ PMI strong form
Assume PMI weak form to be true and let S ⊆ N such that 1 ∈ S and

{1, 2, . . . , n} ⊆ S ⇒ n + 1 ∈ S
2.2 Pigeon Hole Principle (PHP) 33

We need to show that S = N


Define P(n) to be the property that {1, 2, 3, . . . , n} ∈ S for n ∈ N and let A = {n ∈ N :
P(n) is true}.
P(1) is true since 1 ∈ S
Assume P(K ) to be true for some K (i.e.,) K ∈ A (i.e.,) {1, 2, . . . , K } ⊆ S.
Then by definition of S, {1, 2, . . . , K } ⊆ S ⇒ K + 1 ∈ S.
⇒ {1, 2, . . . , K } ⊆ S ⇒ P(K + 1) is true (i.e.,) K + 1 ∈ A.
Thus P(K ) ⇒ P(K + 1). Hence by PMI weak form P(n) is true ∀ n ∈ N.
⇒ n ∈ A ∀ n ∈ N ⇒ A = N.
(b) ⇒ (c)
Let S ⊆ N S  = φ there ∃ m ∈ S since S  = ∅. We need to show that S has a minimal
element. We prove by contradiction. Suppose S has no least element.
Define P(n) to be the property that n ∈ / S.
Observe that P(1) holds as 1 ∈ /S
If 1 ∈ S and S ⊆ N then ‘1’ is the least element of S which is a contradiction since S has
no least element.
Let K ∈ N such that ∀ 1 ≤ i ≤ K , i ∈ / S. Then P(i) holds true ∀ 1 ≤ i ≤ K .
If K + 1 ∈ S then K + 1 is the least element of S a contradiction. Thus K + 1 ∈ / S and
P(k + 1) holds true. (i.e.,) ∀ 1 ≤ i ≤ K , P(i) ⇒ P(K + 1).
Thus by PMI strong form, P(n) holds true ∀ n ∈ N ⇒ S = ∅, a contradiction to our
assumption that S is non empty. Therefore S has a least element. 

It is clear from the above example that the cardinality of R is greater than that of N. Does
there exist a set Y such that |Y | > |R|? The answer is ‘yes’ and is proved by Cantor. The
following results explain that given any set X , ∃ a set P (X ) (the power set of X ) whose
cardinality is greater than that of X .

2.2 Pigeon Hole Principle (PHP)

If (n + 1) pigeons occupy n holes, then there must be atleast two pigeons in a hole. That is
if m is the average number of pigeons per hole, then it must be true that some pigeon hole
contains at least m pigeons and some must contain at most m pigeons.

Example 2.4 In a group of 85 people show that there must be at least 8 people who were
born in the same month.

Solution: Suppose the number of persons born in any month is at most 7. This means the
group cannot exceed 84 which is contradiction.
34 2 Induction and Pigeon Hole Principle

Another form of PHP

Let f be a function from a finite set A to a finite set B, such that |A| > |B|. Then there
exists an element b ∈ B and distinct elements a, a ∈ A such that f (a) = f (a ) = b.

Example 2.5 Show that any sequence of 7 distinct integers either has an increasing subse-
quence of 4 terms or it has a decreasing subsequence of 3 terms.

Solution: Let the sequence be S = {x1 , x2 , x3 , x4 , x5 , x6 , x7 }. Let ai be the maximum num-


ber of terms in a increasing subsequence of S with xi as its first term. Similarly bi be the
minimum number of terms in a decreasing subsequence of S with xi as the last term. If there
is some i for which ai ≥ 4, then the result is true. Similar situation for bi .
So assume ai ≤ 3 and bi ≤ 2 for i = 1, 2, 3, 4, 5, 6, 7. Since there are 6 ordered pairs
of the form (a, b) where 1 ≤ a ≤ 3, 1 ≤ b ≤ 2, by PHP, there must be a situation that
(ai1 , bi1 ) = (ai2 , bi2 ), with 1 ≤ i 1 ≤ i 2 ≤ 7 as there are 7 elements. That xi1 , xi2 distinct,
imply xi1 < xi2 or xi1 > xi2 .

– Case i: If xi1 < xi2 , then any increasing sequence with xi2 can be extended on its left by
prefixing xi1 at the beginning. Hence ai1 > ai2 .
– Case ii: If xi1 > xi2 , any decreasing sequence with xi1 at the last can be suffixed with xi2
and hence bi2 > bi1 .

Hence the solution.

Example 2.6 205 letters are delivered to 40 apartments. Then show that there must be some
apartment that received at most 5 letters.

Solution: Assume that every apartment received only <5 letters. Then the total number of
letters delivered will be at most 160. Hence by averaging of PHP, there must be an apartment
that received at most 5 letters.

Example 2.7 In a tennis tournament, there are n participants. Any two players play one
game against each other. Show that, after a certain period of time, there must be two players
who have completed the same number of games.

Solution: The situation is that, a player can finish 0 game, 1 game, 2 games and so on upto
(n − 1) games. That is if there is a player who finished (n − 1) games, then there cannot be
a player who completed 0 game. Hence the values 0 and (n − 1) both cannot occur in the
number of games. Hence the number of possible games played at any given point of time
will be at most (n − 1). But the number of possibilities for the number of games finished by
any one of them is n.(0, 1, 2, . . . , n − 1 games). Hence by PHP the solution follows.
2.3 Strong Form of PHP 35

2.3 Strong Form of PHP

In the above section, in the definition of PHP there is no indication on the capacity of the
holes. One can say the activity as below.
There are n pigeons, m pigeon holes, with a restriction that each hole can accomodate
only ‘t’ pigeons. Find the minimum number of pigeons to be chosen so that one of the holes
is in full capacity.
The answer will be (t − 1) · m + 1 number of pigeons. One can make harder restrictions
on the capacity of each pigeon hole. We have the following theorem which can be proved
easily.
Theorem 2.8 If there are m pigeon holes each having the capacity as t1 , t2 , . . . , tm and
suppose there are
m
(ti − 1) + 1
i=1
pigeons to be put in the holes, then there is one hole with its full capacity.

Exercises

1. 161 books are distributed to 40 children. Show that there must be a child who gets 5
books.
2. In a family, there are 12 people.

(a) Prove that at least two of the members were born on the same day of the week.
(b) Prove that at least two of the members were born in the same month.
(c) Suppose the house has 4 bedrooms, show that there must be at least 3 persons sleeping
in the same bed room.

3. There are 50 boxes of chocolates. Each box contains no more than 24 chocolates. Show
that there are at least 3 boxes containing the same number of chocolates.
4. Show that among 4 numbers one can find 2 numbers so that their difference is divisible
by 3.
5. How many names do you need to select to guarantee that there are at least 2 names
which have the same first two letters?
6. A group of maths professors hold a annual dinner. No new guests enter the dinner after
it has begun and no one leaves the dinner hall until it has ended. Show that at least two
professors shook the same number of distinct individual hands.
7. Suppose you randomly select k integers out of the first 2016 positive integers. What is
the smallest k that guarantees that at least one pair of the selected integers will sum to
2017?
36 2 Induction and Pigeon Hole Principle

8. Given 39 positive integers, show that there must be at least 3 of them that have the same
remainder when divided by 15.
9. Show that among 11 positive integers less than or equal to 20,there are 2 consecutive
integers.
10. Given three permutations of the set {1, 2, . . . , 28}, show that two of them have common
subsequence of length four.
11. In a town 1500 babies were born in a day. Using PH principle show that two babies
were born within a minute of each other.
12. There are 40 boxes containing marbles. Each box contains no more than 12 marbles.
Show that there are atleast 4 boxes containing the same number of marbles.
13. Given 13 different 2-digit numbers, show that it is possible to select two numbers so
that their difference is a 2-digit number with the first and second digit being the same.
14. A box is filled with balls with three different colors, red, blue and green. Find the least
number of balls of each color that must be put in the box so that there are atleast 7 red
balls, or atleast 9 blue balls or atleast 8 green balls.
15. If (t + 1) numbers are chosen from the numbers {1, 2, 3, . . . , 2t}, then show that there
exist two numbers in the choice that will be coprime to each other.
16. A teacher distributes 200 chocolates to a class having 100 students with a condition
that every student must get atleast one chocolate and no single student should get more
than 100 chocolates. Show that it is possible to find a set of students who together get
exactly 100 chocolates.
Binomial Theorem and Binomial Identities
3

3.1 Binomial Coefficients

Earlier, in an example we have seen that C(n, r ) stands for the coefficient of a r b(n−r ) in the
expansion of (a + b)n . We see a simple combinatorial argument for this as follows.

n r b(n−r )
Theorem 3.1 (Binomial Theorem) (a + b)n = r =0 C(n, r )a

Proof
(a + b)n = (a + b)(a + b) . . . (a + b) .
  
n times
It is the product of (a + b), n times. On multiplication, we obtain the sum of terms. The
powers of a and b on multiplication will be of the form a r b(n−r ) , 0 ≤ r ≤ n. Each such term
is obtained by choosing a’s from r of (a + b) terms and remaining (n − r ) of (a + b) terms
for b’s so that the product produces a power term of the form a r b(n−r ) . Choosing r terms
from n of (a + b) terms can be done in C(n, r ) ways which is nothing but the coefficient of
a r b(n−r ) . Hence the theorem. 
n
Example 3.2 (1) (1 + x)n = C(n, r )x r
n r =0
(2) Setting x = 2 in (1), C(n, r )2r = 3n , n ≥ 0
n r =0
(3) Setting x = −1, C(n, r )(−1)r = 0, n ≥ 1
r =0
(4) C(n, r ) = C(n, n − r )
n
r =0 C(2n + 1, r ) = 2 .
(5) 2n

© Ane Books Pvt. Ltd. 2025 37


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_3
38 3 Binomial Theorem and Binomial Identities

Example 3.3 A teacher trainee has to work in a school for 5 d in August. The trainee is
not allowed to work two consecutive days in the school. Find the number of ways that the
trainee can choose the five days to work in the school.

Solution: The trainee can work for example on August 4, 6, 8, 10 and 12th. Without loss of
generality let us assume that the trainee works on 5 d a1 , a2 , a3 , a4 and a5 , each ai is a day in
August. Then the ai ’s must satisfy a condition that 1 ≤ a1 < a2 − 1 < a3 − 2 < a4 − 3 <
a5 − 4 ≤ 27, to avoid consecutive days. Instead of choosing {a1 , a2 , a3 , a4 , a5 }, we may
choose the dates {a1 , a2 − 1, a3 − 2, a4 − 3, a5 − 4} out of 27. Hence there are C(27, 5)
possible ways for the trainee to complete the work.

Binomial Identities

There are a large number of equations involving binomial coefficients. We state only a few
of them.
Identity 3.1: Let m, n, r be positive integers. Then


r
C(n, r )C(m, r − i) = C(m + n, r ).
i=0

This identity is sometimes called as Vandermonde convolution.

Proof A combinatorial argument looks simple and elegant. Suppose there are n girls and
m boys in a class and for an activity one requires r students from this group of (m + n)
students. The r students may be formed with i girls and (r − i) boys. The i girls can be
selected in C(n, i) ways and (r − i) boys can be selected in C(m, r − i) ways. The selection
of r -students then can be done in C(m, i)C(n, r − i) ways. Hence the result. 

Identity 3.2:

C(n, r ) = C(n − r , r − 1) + C(n − 1, r )

Proof Proved later in an example. 

Identity 3.3: (Pascal’s identity)

C(n + 1, r ) = C(n, r − 1) + C(n, r )


3.2 Pascal Triangle 39

Proof The activity is to select r students from (n + 1) students (say). Let x be a member
of the group. The presence of x in the r -subset makes the number of subsets as C(n, r ). If a
subset does not contain x, such subsets can be counted by the formula C(n, r − 1). Hence

C(n + 1, r ) = C(n, r − 1) + C(n, r )


Identity 3.4: Let n and r be non-negative integers with r ≤ n. Then


n
C(n + 1, r + 1) = C(k, r ).
k=0

This is also known as column-sum property.

Proof Proof is by induction on


 n.
1 if r = 0
For n = 0, C(1, r + 1) =
0 otherwise
n−1
Assume C(n, r + 1) = C(k, r ), n ≥ 1.
k=0

Induction Step: Consider


n 
n−1
C(k, r ) = C(k, r ) + C(n, r )
k=0 k=0
= C(n, r + 1) + C(n, r )
= C(n + 1, r + 1) (by Pascal identity).


3.2 Pascal Triangle

Earlier we have seen what are binomial coefficients. We saw some standard binomial iden-
tities also.
Pascal’s Formula

C(n + 1, k + 1) = C(n, k + 1) + C(n, k)


is called the Pascal’s formula. A simple combinatorial proof was given earlier. The binomial
coefficients are in the following triangular manner.
40 3 Binomial Theorem and Binomial Identities

Fig. 3.1 Pascal triangle

1 = C(0, 0)
C(1, 0) = 1 1 = C(1, 1)
C(2, 0) = 1 2 = C(2, 1) 1 = C(2, 2)
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
... ... ...
C(n, 0) C(n, 1) C(n, 2) ... C(n, k) C(n, k + 1) . . . C(n, n)

Example 3.4 Consider the following Pascal’s Triangle.


Write down the boxed coefficients as C(n, k) and make a comment on the sum based on
Pascal’s Triangle (Fig. 3.1).

Solution: The sum is nothing but

C(2, 2) + C(3, 2) + C(4, 2) + C(5, 2) + C(6, 2) + C(7, 2)

The sum is equal to C(8, 3) = 56.

Hockey Stick Formula

The above observation can be generalised as

C(2, 2) + C(3, 2) + C(4, 2) + · · · + C(n, 2) = C(n + 1, 3).

The validity of the formula can be shown using simple mathematical induction.
3.2 Pascal Triangle 41

Example 3.5 Show that

(n − 1)n(n + 1)
1 · 2 + 2 · 3 + 3 · 4 + · · · + (n − 1) · n = .
3

Solution: Using the hockey stick formula twice,

LHS = 2(C(2, 2) + C(3, 2) + C(4, 2) + · · · + C(n, 2))


= 2C(n + 1, 3)
(n − 1)n(n + 1)
=
3
On similar lines, show the following.

(n − 2)(n − 1)n(n + 1)
1 · 2 · 3 + 2 · 3 · 4 + · · · + (n − 2)(n − 1)n =
4
The general form of hockey-stick theorem is as follows.

Theorem 3.6

C(n, 0) + C(n + 1, 1) + C(n + 2, 2) + · · · + C(n + k, k) = C(n + k + 1, k).

Example 3.7 Find the value of


5
C(47, 4) + C(52 − i, 3).
i=1

Solution:


5
C(47, 4) + C(52 − i, 3)
i=1
= C(47, 4) + C(51, 3) + C(50, 3) + C(49, 3) + C(48, 3) + C(47, 3)
= {C(47, 4) + C(47, 3)} + C(51, 3) + C(50, 3) + C(49, 3) + C(48, 3)
using C(n, k) + C(n, k + 1) = C(n + 1, k)
= {C(48, 4) + C(48, 3)} + C(51, 3) + C(50, 3) + C(49, 3)
= C(52, 4).

Example 3.8 If
(1 + x)n = a0 + a1 x + a2 x 2 + · · · + an x n
42 3 Binomial Theorem and Binomial Identities

then show that


a1 2a2 3a3 nan n(n + 1)
+ + + ··· + is .
a0 a1 a2 an−1 2

Solution: From the binomial theorem, we know


n(n − 1)(n − 2) · · · (n − k + 1)
C(n, k) =
k!

nC1 2nC2 3nC3 nCn


+ + + ··· +
nC0 nC1 nC2 nCn−1
n 2 · n(n−1) 3n(n−1)(n−2)
n·1
= + 2!
+ 3!
n(n−1)
+ ··· +
1 n n
2!
n(n + 1)
= n + (n − 1) + (n − 2) + · · · + 1 = .
2

3.3 Multinomial Coefficients

A set is a collection of objects or elements where each element occurs exactly once. A
multiset is a set that allows its objects to repeat. For example the set S = {a, a, a, b} has a’s
occurring 3 times. However the order is immaterial.

Example 3.9 A bag contains five red balls, three yellow balls and two white balls to be
arranged in a row. In how many different ways it can be done?

Solution: A permutation that deals with a multiset is called a multiset permutation.


Suppose each red, yellow, white ball is distinguishable, then the bag contains 10 distinct
balls which can be arranged in 10! ways. The arrangement of 5 red balls alone can be done
in 5! ways. Similarly yellow and white balls can be arranged in 3! and 2! ways respectively.
Then labelling of the 10 balls to distinguish them can be done in 5! × 3! × 2! ways. If T
is the required number of arrangements of the balls in a row, then T × 5! × 3! × 2! = 10!
(Multiplication rule). Hence T = 5!3!2! 10!
.
The situation in the above example can be generalized as below. Suppose that
k1 , k2 , . . . , km are the occurrence of the objects a1 , a2 , . . . , am where k1 + k2 + · · · + km =
n. Then the number of linear of the n element multiset will be
n!
k1 !k2 ! . . . km !
The following is the theorem which can be proved by an easy method.
3.3 Multinomial Coefficients 43

Theorem 3.10 (Multinomial Theorem) Let n, m, k1 , k2 , . . . , km be non-negative integers


satisfying k1 + k2 + · · · + km = n. Consider the multiset of n objects in which ai , the ith
object occurs ki times for 1 ≤ i ≤ m. Then the number of ways to linearly arrange the n
elements will be
n!
k1 !k2 ! . . . km !
It is called the multinomial coefficient and is denoted by C(n, k1 , k2 , . . . , km ).

Example 3.11 Suppose that k1 , k2 , . . . , km are nonnegative integers such that k1 + k2 +


· · · + km = n, then the coefficient of x1k1 x2k2 . . . xmkm in the product (x1 + x2 + · · · + xm )n is
C(n, k1 , k2 , . . . , km ).

Solution: x1k1 is obtained from the product by choosing k1 terms of

(x + x2 + · · · + xm )(x1 + x2 + · · · + xm ) · · · (x1 + x2 + · · · + xm ) .
 1  
n−times

This can be done in C(n, k1 ) ways. Similarly for the other powers in the prod-
uct, there are C(n, ki ) ways for i = 2, . . . , m. Hence the coefficient of x1k1 · · · xmkm is
C(n, k1 )C(n, k2 ) · · · C(n, km ) = C(n, k1 , k2 , · · · , km ).
Actually the sum 
C(n, k1 , k2 , . . . , km ) = m n .
∀ki ≥0

Some Ball-Box Distribution Examples

Example 3.12 There are 5 balls and 3 boxes. Solve the following two problems under the
4 cases where the balls are either distinct or identical and where the boxes are either distinct
or identical.

(a) Find the number of ways to distribute the balls in the boxes.
(b) Find the number of ways to distribute the balls in the boxes so that each box contains
atleast one ball.

Solution:
Case 1: Let the 5 balls be distinct and 3 boxes be distinct. Let the boxes be labelled as
B1 , B2 , B3 .

(a) Each ball has 3 choices. Hence there are 35 = 729 ways.
(b) Suppose that the box B1 has i balls. Then the remaining (5 − i) balls are to be put
in boxes B2 and B3 so that they are nonempty. Hence (5 − i) must be >2. Hence the
44 3 Binomial Theorem and Binomial Identities

number of ways to distribute the remaining (5 − i) balls in B2 and B3 will be (25−i − 2)


as neither B2 nor B3 is empty. Hence the total number of ways will be

C(5, i)(2(5−i) − 2) = 150.
i≥1,5−i≥2

Case 2: Let the 5 balls be distinct and the boxes be identical. The distribution of the balls
may be 1, 2, 2 or 1, 1, 3 as each box must contain atleast one ball and the boxes are identical.
Let the balls be t1 , t2 , t3 , t4 and t5 . For (1, 2, 2) choose any of the 5 balls to be put in box
B1 in C(5, 1) ways. The remaining distribution can be done in C(4, 2)C(2, 2) ways. Hence
totally there are 30 ways. Since the boxes are identical, the number will be actually 30 2 = 15.
The argument will be similar for (1, 1, 3) distribution and it will be 10.
Case 3 and Case 4 are ‘5 balls are identical 4 boxes are distinct’ and ‘5 balls are identical
and 3 boxes are also identical’ respectively. Case 3 and 4 are left as exercise.

Example 3.13 (Repeated Counting Example) The problem is to find the number of ways
to distribute 5 distinct balls into 3 distinct boxes so that no box is empty.

Solution 1: Let the boxes be named as B1 , B2 , B3 and the balls be named as b1 , b2 , b3 , b4


and b5 .
A ball can be put in box B1 in 5 ways, second ball can be put in B2 in 4 ways and the
r d
3 ball can be put in B3 in 3 ways. Then distribute the remaining 2 balls in the 3 boxes in
3 × 3 ways. So the answer is 5 × 4 × 3 × 3 × 3 = 540.
Solution 1 is incorrect. Suppose balls b1 , b2 are put in B1 , b3 , b4 are put in B2 and b5 in
B3 . The distribution in Solution 1, that is, (b1 b2 , b3 b4 , b5 ) more than once as the method
distinguishes between the order in which the balls are put into the boxes.
Write down the correct solution similar to case 1(b) of above example.

Example 3.14 Find the number of solutions to x1 + x2 + x3 = 5, x1 , x2 , x3 ≥ 0.

Solution: The integral equation can be understood as distributing 5 identical balls into 3
distinct boxes and finding the number of ways of doing that. Hence it will be

 1 x3 =5−x
5 5−x 1 −x2 
5
1= (5 − x1 + 1) = 21
x1 =0 x2 =0 0 x1 =0

The method of distributing identical balls into distinct boxes is connected to counting
multisets, integer solutions of an integral equation and counting number of binary strings
over ‘0 and 1’ as follows.
3.3 Multinomial Coefficients 45

Theorem 3.15 (a) The number of multisets with k elements chosen from a n-element set
(distinct n elements) is equal to the number of integer solutions to x 1 + x2 + · · · + xn =
k, xi ≥ 0, i = 1, 2, . . . , n.
(b) The number of binary strings of length n with k 0’s and (n − 1) 1’s is equal to the
number of integer solutions to x1 + x2 + · · · + xn = k, xi ≥ 0, 1 ≤ i ≤ n.
(c) The counting of (a) and (b) will be C(k + n − 1, k).

Proof (a) If xi denotes the number of occurrences of i in the multiset, then it clearly means
the number of integer solutions is same as number of multisets with k-objects.
(b) The binary string is constructed with (n − 1) 1’s. Place the binary string in a row with
0’s placed between two consecutive 1’s which includes placing of 0’s in the beginning
and ending positions of the string. This means each binary string is specified by a tuple
(x1 , x2 , . . . , xn ), xi ≥ 0 such that x1 + x2 + · · · + xn = k where xi ’s stands for the ith
substring over 0’s in the setup.
(c) It is easy to see that the number of binary strings with (n − 1) 1’s and r 0’s will be
C(n − 1 + r , r ). 

Remark 3.16 (1) The number of ways of distributing r identical balls into n distinct boxes
will be C(n − 1 + r , r ).
(2) Number of r -permutations of n objects, each object repeating infinitely will be nr .

Example 3.17 How many 9 digit binary numbers are there with exactly four 1’s?

Solution: Distributing four 1’s, there will be 5 positions where the 5 0’s can be placed to
form substrings of 0’s. Hence the answer will be C(9, 5) or C(9, 4).

Example 3.18 Find the number of ways of distributing 10 identical balls into 3 distinct
boxes where each box is nonempty.

Solution: Let xi be the number of balls put in box Bi , 1 ≤ i ≤ 3. Then the number of
distributions will be the number of integral solutions to x1 + x2 + x3 = 10, xi ≥ 1, 1 ≤
i ≤ 3. Since each box must contain atleast one ball, the problem reduces to finding integer
solutions of x1 + x2 + x3 = 7, xi ≥ 0. The answer is C(3 − 1 + 7, 7) = C(9, 2) = 36.
46 3 Binomial Theorem and Binomial Identities

3.4 Binomial Theorem for Real Exponents

In Sect. 3.1, we saw the expansion of (a + b)n in a sum of the form

(a + b)n = C(n, 0)a n b0 + C(n, 1)a n−1 b + · · · + C(n, n)a 0 bn

where n ≥ 0 is an integer. Here C(n, k) are called as binomial coefficients.


Also
n!
C(n, r ) = .
r !(n − r )!
Binomial theorem can be applied to expressions like (a + b)t , where t takes negative values.
For example
−1
1 b
(a + b)−1 = 1+
a a
1 b b2 b3
= 1 − + 2 − 3 + ··· , a = 0
a a a a

When a = 1,
(1 + b)−1 = 1 − b + b2 − b3 + · · · , |b| < 1.
So we can see that there is a binomial theorem for a negative integer.
Also we say
n! n(n − 1) . . . (n − k + 1)
C(n, k) = =
k!(n − k)! 1.2.3...k
where n, k are integers. However the term

r (r − 1) . . . (r − k + 1)
1.2.3...k

for any real ‘r ’ is a meaningful calculation. For example when r = 13 , we have


1
3
1
3 −1 1
3− 2 ··· 1
3 −k+1
1.2.3...k
1 1
− 1 13 − 2 1
−3
= 3 3 3
for k = 4
1.2.3.4
10
=− .
243
We now state ‘Newton’s Binomial Theorem’ which gives the binomial theorem for any
real exponent.
3.4 Binomial Theorem for Real Exponents 47

Newton’s Binomial Theorem

For any real value r which is not a non negative integer,




(1 + x)r = C(r , j)x j , where |x| < 1.
j=0

The proof for the above theorem comes from the Maclaurin series expansion of (1 + x)r
with |x| < 1.

Definition 3.19 The expression

n(n − 1) . . . (n − r + 1)
C(n, r ) =
1.2.3...r
for r ≥ 0 and n being any real number is called as ‘generalised binomial coefficient’.

Example 3.20 Show that

C(−n, r ) = (−1)r C(n + r − 1, r )

for n being positive integer.

Solution:
−n(−n − 1) . . . (−n − r + 1)
C(−n, r ) =
1.2.3...r
(−1)r (n)(n + 1)(n + 2) . . . (n + r − 1)
=
1.2.3...r
(−1)r (n + r − 1)!
= = (−1)n C(n + r − 1, r ).
r !(n − 1)!
Exercise

1. Let n be a positive integer with n ≤ 50. Show that the sum

C(98, 30) + 2C(97, 30) + 3C(96, 30) + · · · + 69C(30, 30)

is equal to C(100, 32).


Hint: Use the binomial identity

C(n, m) + C(n − 1, m) + · · · + C(m, m) = C(n + 1, m + 1).

2. In Pascal triangle where does the sequence (1, 1, 1, . . . ) appear?


48 3 Binomial Theorem and Binomial Identities

3. How many terms are there in the expansion (x + y)10 ? Find the coefficient of the center
term whose power will be x 5 y 5 .
4. The first three terms in the expansion of a binomial are 1, 10, 40. Find the expansion.
5. Find the value of
a1 a3 a5
+ + + ···
2 4 6
if
(x + y)n = a0 + a1 x + a2 x 2 + · · · + an x n
n −1
Ans: [ 2n+1 ].
6. Show that 1 + 3 + 6 + · · · + C(n, 2) = C(n + 1, 3).
7. 20 students enter a contest at school. The school offers a first,second and third prize.
How many different combinations of 1st, 2nd and 3rd place winners can there be?
8. A vegetable vendor has four different types of onions,three different types of chillies
and 8 different types of greens. How many vegetable combinations can the vendor
create if each bag has one type of onion and one type of chilli?
9. In a 12-storey house ten people enter a lift cabin. It is known that they will leave the
lift in groups of 2, 3 or 5 people at different storeys. Find the number of ways they can
do so if the lift does not stop upto second storey.
10. A committee of 5 is to be formed from 10 women and 7 men. If the committee must
contain more women than men, find the number of ways it can be done.
11. A set contains (2n + 1) elements. If the number of subsets of the set containing n
elements is 4096, find the value of n.
12. How many integer valued solutions are there to each of the following equations?

(a) x1 + x2 + x3 = 14, ∀ xi ≥ 0
(b) x1 + x2 + x3 + x4 = 22, ∀ xi ≥ 1

13. A bag has 450 identical balls. The balls are to be distributed in 65 boxes. One bag
marked with ‘’ will receive atleast 10 balls. 34 bags marked with ‘’ must contain
atleast 1 ball in each of them. There is no condition for the remaining 30 bags. Find
the number of ways that the balls can be distributed so that there can be some left over
balls in the original bag.
14. Determine the coefficient of x 10 y 20 z 120 in (2x + 3y + z 2 )100 .
Hint: Here z appears in multiple copies.
15. How many coefficients in the polynomial (1 + x + x 2 )n are not divisible by 3?
16. Let 1 ≤ r ≤ n. How many integer sequences.

1 ≤ a1 < a2 < a3 < · · · < ar ≤ n

satisfy ai ≡ i (mod 2) for all i?


17. How many words can be made from the letters of EAZALA?
3.4 Binomial Theorem for Real Exponents 49

18. Write down the binomial expansion of the following functions.

(i) f (x) = (2 + 3x)−1 , |x| < 2


3
− 21
(ii) f (x) = (1 + 5x) , |x| < 1
5
(iii) f (x) = (1 + x)−3 , |x| < 1

19. Show that


C(r , k) = C(r − 1, k − 1) + C(r − 1, k)
for any real number r .
20. Let n and k be two non-negative integers. Then show that

(i) C(n, k) = 2t if n is even and k is odd, t ∈ N.


(ii)  
n k
C(n, k) = C ,
2 2
when both n and k are even or n and k are being odd.
(iii)    
n−1 k
C(n, k) = C ,
2 2
when n is odd and k being even.

21. In a Pascal triangle of binomial coefficients, show that the number of odd coefficients
in row m is 2t where ‘t’ is the number of 1’s in the binary representation of m.
22. Prove that for all integers m ≥ 2,


m
t(t − 1)C(m, t) = 2m−2 (m 2 − m).
t=2

23. Show that



n
(a + b)n = C(n, t)a n−t bt
t=0
using mathematical induction.
24. The sequence a0 , a1 , a2 , . . . , an of positive integers is said to be ‘log-concave’ if at2 <
at−1 at+1 for 1 ≤ t < (n − 1). Verify whether the sequence

C(n, 0), C(n, 1), C(n, 2), . . . , C(n, n)

is log-concave or not.
Partitions
4

4.1 Set Partitions

Stirling Number of Second Kind

Suppose S is a set having n elements. Then we know that the number of subsets of S is 2n .
That is
 n
C(n, i) = 2n
i=0
We have seen the proof of this earlier.
In an identical fashion, one may understand the number of partitions of a set having
m-elements into t nonempty subsets. The situation can be understood as, the counting of
number of ways of distributing m distinguishable balls into t identical boxes. We give the
definition of the Stirling numbers of the second kind as follows.

Definition 4.1 The number of partitions of a set having m elements into t nonempty subsets
is denoted by s  (m, t). s  (m, t) are called the Stirling numbers of second kind.

Example 4.2 When m = 0, s  (0, 0) = 1


When m  = 0, s  (m, 0) = 0 and s  (0, t) = 0
When m = t, s  (m, m) = 1, m ≥ 1 and s  (m, t) = 0 when m < t

Example 4.3 Find s  (4, 2) and s  (4, 3)

Solution: To distribute balls, let b1 , b2 , b3 , b4 be the balls to be distributed into 2 boxes so


that no box is empty. The possible distributions are like,
({b1 }, {b2 , b3 , b4 }) − C(4, 1) ways

© Ane Books Pvt. Ltd. 2025 51


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_4
52 4 Partitions

({b1 , b2 }, {b3 , b4 }) − 2C(4, 2) ways


Total = C(4, 1) + 21 C(4, 2) = 7

So s  (4, 2) = 7. Similarly, show s  (4, 3) = 6.

Remark 4.4 In general it can be shown that the number of ways of distributing m distin-
guishable balls into t boxes will be
1 
c(m, i 1 , i 2 , . . . , i t )
m!
i j >0

where i 1 + i 2 + · · · + i t = m

The Stirling numbers of the second kind satisfy the following recurrence relation.

Theorem 4.5 Let m and t be integers greater than zero. Then,

s  (m, t) = s  (m − 1, t − 1) + t · s  (m − 1, t).

Proof The proof can be given in terms of ball-box distributing activity. Suppose that we
need to distribute m distinct balls into t boxes with no nonempty box. The following are the
two cases.
Case (i): Let the box containing the first ball has only that ball in it. Then removing it from
the list, we have (m − 1) balls and (t − 1) boxes. Hence the number of ways will be

C(t, 1) × s  (m − 1, t − 1).

Case (ii): Let the box containing the first ball has atleast 2 balls in it. Then removing the first
ball gives the distribution of (m − 1) distinct balls into t boxes. Then we need to put back
the first ball, for which we have t choices. Hence the total number will be t · s  (m − 1, t).
Combining Case (i) and Case (ii), we have the total number of distributions s  (m, t). 

The following table gives the value of s  (m, t) for some values of m and t. Hence we
assume, 
  1 if m = 0
s (m, 0) = s (0, t) =
0 if m  = 0

Example 4.6 Find the number of surjective functions from a set S containing 6 elements
to a set S containing 4 elements.
4.1 Set Partitions 53

m 01234 5
s  (m, 0) 1 0 0 0 0 0
s  (m, 1) 1 1 1 1 1
s  (m, 2) 1 3 7 15
s  (m, 3) 1 6 25
s  (m, 4) 1 10
s  (m, 5) 1

Solution: Let g be a surjective function from S to S. Such a function actually defines a


partition of S. That is, for example if S = {1, 2, 3, 4, 5, 6}, S = {b1 , b2 , b3 , b4 } and g(1) =
b1 , g(2) = b2 , g(3) = b3 , g(4) = b4 , g(5) = b1 , g(6) = b2 . Then the set S is partitioned as
{1, 5}, {2, 6}, {3}, {4}. Therefore, as the t-blocks labelled and distinct, we have 6! ways to
do this partitioning. Hence it is 6!s  (6, 4) = 6! × 65.

Bell Numbers

Suppose the problem is to find all partitions of a set S containing m elements. Then what
we get is the following definition.

Definition 4.7 The number of all set partitions of a set S containing m elements into
nonempty parts is in general denoted by B (m) and is called the ‘Bell number’.

The following formula can be proved easily using the same technique of ball-box distri-
bution activity.
 m
B (m + 1) = C(m, i)B (i).
i=0

Example 4.8 Find B (4).

Solution: We assume s  (4, 1) = s  (4, 4) = 1. We have earlier computed s  (4, 3) and s  (4, 2).
Hence B (4) = 1 + 7 + 6 + 1 = 15.
In terms of ball-box activity, we write the following theorem without proof.

Theorem 4.9 The number of ways of distributing m distinct balls into t identical boxes, so
that no box is empty is B (m).

From the above it is clear that the formula for finding the number of ways of distributing
m distinct balls into t boxes for m ≤ t will be B (m) and for m > t, it will be
54 4 Partitions


t
s  (m, i)
i=1

We already know what a factorial of a number n is i.e.,



1 · 2 · 3 · · · n if n ≥ 1
n! =
1 if n = 0

We now see two new factorials called falling factorial and rising factorial or Pochhammer
of a number n. 
n(n − 1)(n − 2) · · · (n − k + 1) if k ≥ 1
(n)k =
1 if n = 0
will be called as ‘falling factorial’ of n upto k.

n(n + 1)(n + 2) · · · (n + k − 1) if k ≥ 1
[n]k =
1 if n = 0

will be called as ‘rising factorial’ of n upto k.

Example 4.10 For n = 4,

4! = 1 · 2 · 3 · 4 = 24
(4)3 = 4(4 − 1)(4 − 2)
= 4 · 3 · 2 = 24
[4]3 = 4 · 5 · 6 = 120
(4)4 = 4!

The following result connects the falling factorial with Stirling numbers.

Theorem 4.11 Let m ≥ 1. Let s  (m, t) denote the Stirling numbers of the second kind. Then


m
xm = s  (m, t)(x)t
t=1

Proof Clearly
(x)t = x(x − 1) · · · (x − t + 1)
is a polynomial in x. We can write

(x)t+1 = (x)t (x − t).


4.1 Set Partitions 55

We already know what s  (m, t) is. The proof is by induction on m.


When m = 1,


1
x= s  (1, t)(x)t
t=1
=x

Assume the equality for index (m − 1). i.e.,


m−1
x m−1 = s  (m − 1, t)(x)t
t=1

Consider

m
s  (m · t)(x)t
t=1

We know the recursion satisfied by s  (m, t) as

s  (m, t) = s  (m − 1, t − 1) + ts  (m − 1, t)

m 
m−1
s  (m, t)(x)t = [s  (m − 1, t − 1) + ts  (m − 1, t)](x)t
t=1 t=1

m−1 
m−1
= s  (m − 1, t − 1)(x)t + ts  (m − 1, t)(x)t
t=1 t=1

m−1 
m−1
= s  (m − 1, t − 1)(x)t+1 + ts  (m − 1, t)(x)t
t=1 t=1

m−1 
m−1
= s  (m − 1, t)(x)t (x − t) + ts  (m − 1, t)(x)t
t=1 t=1

m−1 
m−1
=x s  (m − 1, t)(x)t − ts  (m − 1, t)(x)t
t=1 t=1

m−1
+ ts  (m − 1, t)(x)t
t=1

m−1
=x s  (m − 1, t)(x)t
t=1
=x·x m−1
(by induction assumption)
=x . m


56 4 Partitions

4.2 Integer Partitions

Integer Compositions

Consider the equation

x1 + x2 + · · · + xt = m (4.1)

with each xi being a non-negative integer, for 1 ≤ i ≤ t. For example the equation x1 +
x2 + x3 = 4 will have the tuple (1, 1, 2) as its solution. That is x1 = 1, x2 = 1, x3 = 2 here.
In general one can represent the solution of (4.1) as a t-tuple (a1 , a2 , . . . , at ) where each
ai is a non negative integer. Such a solution is some times referred to as an integer solution.
Such solutions are called weak composition of an integer ‘m’ into ‘t’ parts. The problem is
to find the number of possible weak compositions of n.
Let us consider a modified situation where the composition of solution is (a1 , a2 , . . . , at )
where each ai > 0 instead of ai ≥ 0, ai being an integer for 1 ≤ i ≤ t. Such a t-tuple is
usually referred to as composition.
Consider the activity of distributing n chocolates to ‘t’ students so that each student gets
atleast one chocolate. Let the students be arranged in a queue like s1 , s2 , . . . , st being the
queue arrangement. Let the ‘n’ chocolates be arranged linearly on a table, (say). So, student
‘s1 ’, the first student in the queue picks some x1 chocolates by indicating his selection by
standing against position ‘x1 ’ in the linear arrangement of the chocolates. It means the student
has to select his chocolates from the left most position in the arrangement of chocolates.
The activity continues till the student st gets his chocolates. One can see that in the linear
arrangement of chocolate there are (n − 1) gaps in between the n chocolates. Each student
has to choose a position in this (n − 1) gaps to indicate his selection of chocolates. Hence
there areC(n − 1, t − 1) possible choices.
We can understand the situation where each xi ≥ 0 as an activity where some students
do not get anything. We can call this as an unfair distribution of chocolates. So the situation
can be understood as some students are not allowed to take any chocolates or may be the
distributor says that this student has a chocolate for him already, which is not true. So we
can reframe the above activity as distributing (n + t) chocolates to k-students so that each
student get atleast one chocolate. This count will be C(n + t − 1, t − 1). Now take away
one chocolate from each so that some of these t students may not get any chocolate. Hence
the number of weak compositions of n is C(n + t − 1, t − 1).

4.3 Ferrers’ Diagram

Integer partitions can be viewed using Ferrers’ diagrams or Young’s diagram. Suppose
λ = (5, 4, 1) is a partition. Clearly λ is a partition of 10. We can say λ has 3-parts or λ is a
3-tuple. The diagrammatic understanding of λ is as below:
4.3 Ferrers’ Diagram 57

Every unit is represented by a unit square. To represent the number 5; we draw 5 unit
squares linearly with left justification. That is

represents 5. We can say this is the first row representation of 5 in λ. For the number 4 in λ,
we draw 4 unit squares, left justified, just as second row below the first row. i.e.,

is the diagram for the first 2 components of λ. Proceeding as above, the diagram

completely represents the partition λ = (5, 4, 1) of 10. Clearly area of λ is 10 unit squares.
There are more than one partition of 10 and hence different Ferrers’ diagram. As the number
of partitions grow rapidly with ‘n’ the number of Ferrers’ diagrams increase.

Example 4.12 Let n = 4. (2, 1, 1), (3, 1), (1, 1, 1, 1) are partitions of 4. The corresponding
Ferrers’ diagram are

respectively.

Now Ferrers’ diagram can be formally defined as below:

FD(λ) = {(m, n) ∈ N × N | 1 ≤ m ≤ k, 1 ≤ j ≤ λm }

Note that area of λ is equal to area of F D(λ).

Definition 4.13 Conjugate of a given Ferrers’ diagram can be obtained by exchanging rows
and columns.
58 4 Partitions

Example 4.14 Conjugate of

Clearly area of λ is same as area of μ.

Self-conjugate Ferrers’ diagram satisfy the property that it is same as its conjugate. For

example the Ferrers’ diagram is the same as its conjugate. Ferrers’ diagrams can
be used to prove some nice properties of partitions of numbers. Let p(n) denotes the number
of different partitions of an integer n and pk (n) denotes the number of partitions of n into
exactly k parts. Also let p ∗ (n) denotes the number of self-conjugate partitions of n.
Consider a partition λ of an integer ‘n’ with its largest partition as ‘k’ (say). By removing
this partition from λ one can get a partition λ̄ and it will be a partition of (n − k). No part in
λ̄ is larger than k. This preceding process of modifying λ to λ̄ can be reverted. For example
consider the Ferrers’ diagram for λ = (5, 2, 2, 1).

λ̄ = (2, 2, 1) and its Ferrers’ diagram will be

So we can say the following property which identifies a 1-1 relation between the two
types of Ferrers’ diagrams.

Theorem 4.15 Let n, k be positive integers and pn (k) denote the number of partitions of

n with its largest part being k. Let pn−k (k) denote the number of partitions of (n − k) with
none of its part being larger than k. Then
4.3 Ferrers’ Diagram 59


pn (k) = pn−k (k).

Counting pn (k) is not so easy.

Example 4.16 Consider n = 6 and k = 3.


The partitions are (3, 3), (3, 2, 1), (3, 1, 1, 1).
So p6 (3) = 3.
For any integer n, there is exactly one partition with k = n and k = 1. That is (n) and
(1, 1, . . . , 1) are the only partitions. Also for n ≥ 2, pn (n − 1) = 1.
  
nparts

The following recursion is not difficult to prove.

Theorem 4.17 For integers, n and k

pn (k) = pn−1 (k − 1) + pn−k (k), 1 < k < n.

The following result can be established by direct constructions to show that there exists
a 1-1 correspondence between the number of self-conjuge partitions of an integer ‘n’ with
the set of partitions of ‘n’ with distinct odd number of parts. Let p o (n) denote the number
of partitions of n with distinct odd parts.

Theorem 4.18 Let n be a positive integer then p∗ (n) = p o (n).

Example 4.19 Consider the following partition of 21.

λ = (6, 5, 4, 3, 2, 1).

The corresponding Ferrers’ diagram will be

Modify λ in steps so that we get a partition

λ̄ = (11, 7, 3)
60 4 Partitions

For any self-conjugate partition, the Ferrers’ diagram has symmetry along the diagonal.
So we can see that the number of unit squares below the first row lying in the first column
is always odd. Now add this many number of unit squares in the first row of λ̄. Continue
the same for second row against second column. We get λ̄ satisfying the given property of
having odd number of distinct parts.

Exercises

1. Find the number of partitions of 19 with odd number of distinct parts.


2. Determine whether the following partitions are self-conjugate or not.

(i) (5, 4, 3, 2, 1)
(ii) (9, 6, 3, 2, 1)
(iii) (14, 7, 2, 1, 1).

3. Show that

(i) S  (n, 2) = 2n−1 − 1 for n ≥ 2


(ii) S  (n, n − 1) = C(n, 2) for n ≥ 1.

4. Show that the Bell numbers B (n) satisfy the following recurrence.


n
B (n) = C(n − 1, j − 1)B (n − j).
j=1
Permutations, Combinations and Cycles
5

5.1 Permutations on Sets and Multisets

A permutation means simply an arrangement of objects. For example the permutations of


the three letters x, y, z are
x yz, x zy, yx z, yzx, zx y, zyx.
Hence the total number of arrangements of x, y, z will be 6. If it is the arrangement of
letters w, x, y, z, then the total number of arrangements will be 24. If it is the arrangement
of letters v, w, x, y, z, then the total number of such arrangements will be 120. The number
of permutations increases dramatically as the size of the set increases. In the calculations
multiplication principle is used for counting.

Example 5.1 Suppose four persons w, x, y, z are in a running race. Determine the possible
ways the runners can finish first and second.

Solution: Any one of w, x, y, z can be the winner. The remaining 3 will then be the runners.
Also each of the four runners can finish first. Hence applying multiplication principle, there
will be 4 × 3 = 12 possible ways the runners can finish first and second. The possibilities
are described as in Fig. 5.1.
We have the following formal definition of permutation of different sizes.

Definition 5.2 A permutation of any r objects taken from a set of n objects is an arrangement
of the r objects. Number of such arrangements will be denoted by P(n, r ).

© Ane Books Pvt. Ltd. 2025 61


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_5
62 5 Permutations, Combinations and Cycles

Fig. 5.1 Possibilities

In the following theorem, we actually find P(n, r ) for a given n and r using multiplication
principle.

Theorem 5.3 The number of permutations of r objects taken from a set of size n is

n!
P(n, r ) = = n(n − 1)(n − 2) · · · (n − r + 1).
(n − r )!

Proof The activity is to choose r objects from a set containing n objects. So we have, the
first element can be selected in n ways, the second element can be selected in (n − 1) ways,
the third element can be selected in (n − 2) and so on. The r th element can be selected in
(n − r + 1) ways. Then the arrangement activity of r -elements will be complete in sequence.
Hence by multiplication principle we have

P(n, r ) = n(n − 1)(n − 2) · · · (n − r + 1)

Definition 5.4 While counting sets, one often needs to compute the product of the form
n(n − 1)(n − 2) · · · (n − r + 1) · · · 2 · 1. This product will be called as ‘n factorial’ and is
denoted by n!.
5.1 Permutations on Sets and Multisets 63

Assuming 0! = 1, the number of n permutations of n objects is P(n, n) = n!.

Example 5.5

P(7, 3) = 210
P(4, 1) = 4
P(4, 4) = 24

Example 5.6 Find the number of words of length 4 formed using the English alphabet set
when

(i) no repetition of a symbol is allowed in the thus formed word.


(ii) repetition of a symbol is allowed in the thus formed word.

Solution:

(i) In this case one can see words like ‘wood’, ‘good’ cannot be formed. Since we need
to use a symbol only once, the number of such words will be 26.25.24.23. That is it is
P(26, 4).
(ii) The number of words in this case will be 264 . Here we allow words of the form ‘wood’,
‘good’, ‘wool’ and so on.

Example 5.7 How many ways one can arrange the seven letters ‘ARRANGE’?

Solution: There are two R’s and two A’s. These are indistinguishable. Let us assume that
A1 = A2 = A and R1 = R2 = R. The the set {A1 , A2 , R1 , R2 , N , G, E} has 7 elements
and the number of arrangements will be 7!. However we see that A1 R1 R2 A2 N G E and
A2 R1 R2 A1 N G E are one and the same and such words must be counted only once. The
permutation of R1 and R2 will be 2! and the permutation of A1 , A2 will be 2!. Hence we
must divide 7! by 2! × 2! to get the correct counting which is 2!2!
7!
= 1260.

Example 5.8 A linear arrangement of balls are to be made. There are 6 red balls and 4
green balls available. Find the number of arrangement of the 10 balls so that

(i) the green balls are always together


(ii) the red balls are always together.
64 5 Permutations, Combinations and Cycles

Solution:

(i) Since the green balls must be together always, let the G 3 be the togetherness of the
green balls. Then problem is to find the arrangement of 6 red balls and G 3 . Hence it
will be 7!.
(ii) The situation is identical to (i) and the answer is 5!.

Definition 5.9 (i) Permutation or arrangement of r objects from a n-object set in a row will
be called a linear permutation.
(ii) Permutation or arrangement of r objects from a n-object set in a circular fashion is
called circular arrangement or circular permutation.

Example 5.10 In how many ways can 7 toys be arranged in a circular fashion?

Solution: In Fig. 5.2 a typical situation will be.


Whether the arrangement is seen clockwise or counter clockwise, actually does not matter.
That is they are the same. The enumeration is done by fixing a position in the circular
arrangement. That is with respect to Ti the remaining T j , j  = i are to be permutated linearly.
Hence the number of circular arrangement will be 6!.
A direct simple theorem to count the number of circular arrangement of n objects will
be as follows.

Theorem 5.11 For n different objects, the number of ways they can be arranged in a fixed
circle is (n − 1)!.

Fig. 5.2 Circular fashion


5.1 Permutations on Sets and Multisets 65

Fig. 5.3 Beads arrangement

The problems on circular permutations get more exciting where restrictions are imposed
on the arrangements of the objects.

Example 5.12 Find the number of arrangement of 5 different coloured beads on a necklace.

Solution: Let the beads be numbered as b1 , b2 , b3 , b4 , b5 . Some arrangements will be.


In Fig. 5.3a and b the positions of b2 , b3 , b4 , b5 with respect to b1 have flipped. But
actually they are same. Hence in this case number of different arrangements will not be
(n − 1)! = (5 − 1)! = 4! but it will be 4!2 .

Remark 5.13 The counting of circular arrangements can be viewed in two ways giving rise
to two different counting.

(i) When the positions on the circle are numbered,the arrangement is simply a linear one.
(ii) When the positions are not numbered,the arrangement is not simply a linear one but
some repeated situation will occur.

Example 5.14 10 students are made to sit in a round table such that two particular students
sit on either side of teacher. Find the total number of such arrangements.

Solution: Three positions on the table are fixed,one by the teacher and two particular students
on either side of the teacher. Treating this arrangement as one unit, we need to place remaining
8 students. This can be done in 8! ways. Also the students sitting on the either side of the
teacher can be done in 2 ways. Therefore the total number of ways will be 8! × 2.
66 5 Permutations, Combinations and Cycles

Example 5.15 In how many ways 8 boys and 4 girls can sit around in a circular table so
that no two girls sit together?

Solution: 8 boys can sit in a circle in 8! ways. There are 8 spaces in between them. One can
place the 4 girls in this 8 spaces in P(8, 4) ways. Hence the total number of ways will be
8! × P(8, 4) = 8!×8!
4! .

Remark 5.16 In general,the number of circular permutations of n objects taken r at a


)
time will be P(n.r
r if the arrangement along clockwise and counter clockwise are taken as
)
different. Otherwise it will be P(n,r
2×r .

Example 5.17 How many ways can 10 people be seated round a table if there are only 7
chairs?

Solution: The activity is first arrangement of 7 out of 10 persons and there is no distinction
between the arrangement in clockwise and counter clockwise direction. Hence the answer
will be P(10,7)
7 .

Example 5.18 How many necklaces of 12 pearls each can be made from 30 pearls of
different sizes.

P(30,12)
Solution: The answer will be 2×12 (why?).

5.2 Combinations on Sets and Multisets

Combinations are simply selection of required number of elements without arrangement.


For example the combination or subsets of size 2 that can be selected from the 4 letters of
the word ‘BIRD’ are simply

{B I }, {I R}, {R D}, {B R}, {B D}, {I D}.

In general the number of r -element subsets of a set of n element is of central importance


in enumerative combinatorics. Hence we have a formal definition as follows.
5.2 Combinations on Sets and Multisets 67

Definition 5.19 A combination is a subset of elements of a set. The number of r -element


subsets of a n element set is denoted by C(n, r ) and is read as ‘n choose r ’.

Example 5.20 Find the combinations (i.e. subsets) of size 2 and 3 taken from the set X =
{x, y, z}.

Solution: The total number of subsets of X is 23 = 8.


Subsets of size 2:
{x, y}, {x, z}, {y, z}
Subsets of size 3:
{x, y, z}
Note:
The subset {x, z} is same as {z, x}.

Theorem 5.21 For all non-negative integers r ≤ n, the number of combinations of size r
which can be selected from a set of size n is C(n, r )
 
n n!
C(n, r ) = =
r r !(n − r )!

Proof Earlier we have seen what is P(n, r ). It is the arrangement of r elements chosen from
n!
an n element subset. It is equal to (n−r )! . But the choosen r elements can be permutated
in r ! different ways. But we need to count only one of these r ! permutations to obtain the
number of combinations. So
 
n P(n, r ) n!
C(n, r ) = = = .
r r! r !(n − r )!


 
n
Notation: C(n, r ) is alternatively denoted as . They are also binomial coefficients
r
because they are the coefficients in the binomial expansion.
68 5 Permutations, Combinations and Cycles

Example 5.22 Some binomial expansions are,

(a + b)2 = C(2, 0)a 2 + C(2, 1)ab + C(2, 2)b2


= a 2 + 2ab + b2
       
3 3 3 2 3 3 3
(a + b)3 = a + a b+ ab2 + b
0 1 2 3
= a 3 + 3a 2 b + 3ab2 + b3
         
4 4 4 3 4 2 2 4 4 4
(a + b)4 = a + a b+ a b + ab3 + b
0 1 2 3 4
= a 4 + 4a 3 b + 6a 2 b2 + 4ab3 + b4
..
.
       
n n n (n−1) n (n−2) 2 n n
(a + b)n = a + a b+ a b + ··· + b
0 1 2 n

Example 5.23 How many ways can 11 cricket players be chosen from a team of 14 players?

Solution: The answer is simple and it is C(14, 11) = 14·13·12


6 = 364


n
Example 5.24 Show that C(n, r ) = 2n .
r =0

Solution: We have already seen that the number of subsets of an n-element set is 2n . Each
C(n, r ) stands for the number of r -element subsets of an n-element set. Hence the solution.

Example 5.25 Show that      


n−1 n−1 n
+ =
r −1 r r

Solution: The r element subset A may or may not contain the tth  at of a set
 element
n−1
X = {a1 , a2 , . . . , an }. If at is in A, the number of such A’s will be . Otherwise it
r −1
 
n−1
will be .
r
5.3 Unlimited Repetitions 69

Example 5.26 Consider strings over 0s and 1s of length n.

(1) There are 2n different strings of length n since each position of the string will contain
either a 0 or 1.
(2) nCr denote the number of strings having r 0’s and (n − r ) 1’s.
(3) Let us find number of strings with r 0’s and (n − r ) 1’s such that no two 0’s are adjacent.
Notice that there are (n − r ) 1’s in each string of length n and these 1’s separate the
string into (n − r + 1) substrings. Each of the substrings must be either empty or must
contain exactly one ‘0’. Thus, each substring is specified by r nonempty substrings out
of (n − r + 1) substrings. Hence, the number of strings with length n and no adjacent
0’s is
 n − r + 1  2  
n+1
n −r +1
=
r r
r ≥0 r =0

Let us see some simple direct examples on combinations.

Example 5.27 (1) In how many ways can 5 students be selected from a class of 45 students?
Solution: C(45, 5) ways.
(2) How many ways a committee of 6 or more can be chosen from 8 people?
Solution: C(8, 6) + C(8, 7) + C(8, 8)
(3) A group of 9 doctors is composed of 5 cardiologists and 4 dentists. In how many ways
can a committee of 5 be formed that includes at least one cardiologist and one dentist?
Solution: C(5, 1) × C(4, 1) × C(7, 3)
(4) A bag contains 15 distinguishable balls of which 5 are blue, 4 are yellow and 6 are
green in colour. Find the number of ways to draw 4 balls so that there is at least one
blue ball in the last draw.
Solution: Solution is an exercise.

5.3 Unlimited Repetitions

A set S may be a finite or an infinite set. If we say the set ‘S’ is an n-element set, it means, it
is a finite set having n distinct elements. A subset of S will also be a finite set having some
elements of ‘S’ without repetitions. So one can talk about k-combination of a set S that is
used to describe a subset of ‘S’ having ‘k’ distinct elements. We know that the number of
such subsets will be 2|S| . But can we not consider subsets of S having repetitions of elements
of S in them? Yes, we can form k-combinations of the set S with repetitions.
70 5 Permutations, Combinations and Cycles

Example 5.28 Let S = {a, b, c}, then the 2-combinations of S are

{a, a}, {b, b}, {c, c}, {a, b}, {b, c}, {c, a}.

Here there are six of them.

Definition 5.29 A multiset is a set with repeated elements.

Example 5.30 T = {1, a, a, 2, b, 3, 3, c, c, c} is a multiset.

One can see in T , each element is occurring only a finite number of times. We can call this
number to be a frequency of it. That is, frequency of 1 is one, frequency of a is 2, frequency
of b is 1, frequency of 3 is 2, frequency of c is 3. Let f r eq(α) denote the frequency of a
symbol ‘α’. Clearly 
f r eq(α) = |T |
α∈T
For each multiset, there lies an underlying set S.
One can define sub multiset A of a multiset T to be a multiset by itself and f r eq(α) in
A is less than or equal to f r eq(α) in T for every α ∈ T . The number of such submultisets
will be 
( f r eq(a) + 1).
a∈T
One can easily prove this from our basic understanding of formation of subsets of a
set S.

Example 5.31 Find the number of k-element multisubsets of a multiset T .

Solution: Let S be an underlying set for T whose elements are from ‘S’ in a repeated
manner. That is if f r eq : S → N where f r eq(a) denotes the number of occurrences of
α in T . Suppose S = {a1 , a2 , . . . , an } and xi = f r eq(ai ). Then the integer solution of
x1 + x2 + · · · + xn = k will be a multisubset having k-elements. But we know that number
of such solutions will be C((n + k − 1), k).
We can see the above count is also the number of ways of distributing k identical balls
into n distinct boxes.

5.4 Sorting a Set

For a set S = {a1 , a2 , . . . , an } we know that number of subsets of S is 2n which includes


the empty set. In its counting, one would like to list such subsets of S algorithmically. Let
us understand the subset A construction by looking at any element x of S being in A or
5.4 Sorting a Set 71

not. One can construct a binary string over {0, 1} corresponding to every subset of S. For
example the binary string 10101 000
 . . . 0 corresponds to a subset A = {a1 , a3 , a5 } where
n−5
the positions of the symbols in the string corresponds to the elements of S as they are read
from left to right. Sometimes the binary string is also represented as an n-tuple. Also the
presence of symbols ‘ai ’ in the subset is indicated by ‘1’ and ‘0’ by its absence. Also one
also can see this string over 0, 1 will correspond to an integer between 0 and 2n − 1. For
example for S = {a1 , a2 , a3 }, n = 3,

011 = 0 × 20 + 1 × 2 + 1 × 22
=6

So the subset corresponding to the integer ‘6’ will be A = {a2 , a3 }. We can now under-
stand the ordering of subsets of a set S = {a1 , a2 , . . . , an } based on the number ‘t’ between
0 and 2n − 1 that they represent. That is the subset corresponding to 10 appear before the
subset corresponding to 11. Subset ∅ will correspond to 0 and it will appear always first in
the list.

Example 5.32 Let S = {a1 , a2 , a3 , a4 }. Find the subset next to the subset A = {a1 , a3 , a4 }.

Solution: The binary string corresponding to A is 1011 and the integer corresponding to
1011 will be 11. The next integer is 12 and its binary form is 1100. So the subset B = {a1 , a2 }
will next to A.
We can write down a simple algorithm for understanding the order of subsets of a given
set. It is also said to be a subsets generating algorithm.
Algorithm: Subsets of {a1 , a2 , . . . , an }
∗ (0, 0, . . . , 0) = (0000 . . . 0) ∗
   
n−tuple n
while (x1 , x2 , . . . , xn )  = (1, 1, . . . , 1)
do
find the largest index i
(between 1 and n) such that xi = 0.
replace xi with 1, and xi+1 , xi+2 , . . . , xn with 0.

Remark 5.33 The above algorithm is a very simple algorithm which has a natural order-
ing on the binary strings. Because of such ordering in the corresponding integers in base
2 representation, this is also called as lexicographic ordering of strings over {0, 1} of
length n.
72 5 Permutations, Combinations and Cycles

We can understand this lexicographic ordering as a squashed ordering of subsets because


a complete ordering of subsets is available to us before introducing a new member to the
expansion of subsets. We understand more through the following example.

Example 5.34 Let S = {a1 , a2 , a3 , a4 }. The list will start with ∅. Then element a1 is intro-
duced. The new list will be
∅, {a1 }.
Next a2 is introduced such that the subsets do not contain a2 come before those containing
a2 . The list will be
∅, {a1 }, {a2 }, {a1 , a2 }.
The list expands as below with a3

∅, {a1 }, {a2 }, {a1 , a2 }, {a3 }, {a1 , a3 }, {a2 , a3 }, {a1 , a2 , a3 }.

The compute list of subsets in squashed ordering will be

∅, {a1 }, {a2 }, {a1 , a2 }, {a3 }, {a1 , a3 }, {a2 , a3 }, {a1 , a2 , a3 }, {a4 },


{a1 , a4 }, {a2 , a4 }, {a1 , a2 , a4 }, {a3 , a4 }, {a1 , a3 , a4 }, {a2 , a3 , a4 }, {a1 , a2 , a3 , a4 }.

Let us briefly see how k-combination of an n-element set can be generated. One direct
method is to look into all binary strings of length n and list only those with k 1’s. This list
will contain all subsets of size k. There are other methods of generating permutations which
have some practical improvement in terms of time complexity.

k-Subsets of a Multiset

Let S = {a1 , . . . , an } be a set and A be a multiset on S. That A is a set with the elements of
S such that each element can occur one or more times. By k-combination of A we mean a
multisubset of A with k-elements. That is number of such subsets will be same as number
of integer solutions of
x1 + x2 + · · · + xn = k
where 0 ≤ xi ≤ m i , 1 ≤ i ≤ n. Let ξ(k; m 1 , . . . , m n ) denote such sets.

Example 5.35 Let S = {a1 , a2 , a3 } A = {3a1 , 3a2 , 3a3 }.

ξ(3; 3, 3, 3) = {{a1 , a1 , a1 }, {a2 , a2 , a2 }, {a3 , a3 , a3 }, {a1 , a1 , a2 }, {a1 , a2 , a2 },


{a1 , a3 , a3 }, {a2 , a3 , a3 }, {a1 , a1 , a3 }, {a2 , a2 , a3 }, {a1 , a2 , a3 }}.

Next we briefly look for an algorithm to find such ‘k’ subsets.


5.4 Sorting a Set 73

Fig. 5.4 Grid

A simple and direct method to generate all the multisubsets of a multiset will be to
completely order the elements of the multiset distinctly and then one can use lexicographic
ordering technique as before. For example, the elements of A in the above example can be
taken to be Ā = {a11 , a12 , a13 , a21 , a22 , a23 , a31 , a32 , a33 }. Then the complete set of the subsets of
Ā can be generated (Fig. 5.4).
But this method will generate a multisubset more than once. In particular let us assume
that we want to find all k-element multisubsets of A. One can assume that the elements of
A are ordered. Then a lexicographic ordering of the k-element multisubsets can be written.
For example if A = {a1 , a1 , a1 , a2 , a3 , a3 }. It has 6 elements and the number of subset of A
will be 26 .

Exercises

1. Find the number of natural numbers between 100 to 1000 that have exactly one occur-
rence of 7 or 9.
2. Three players a, b, c take turns at a game, according to the following conditions. In
the beginning a and b play, the loser is replaced by c. That is in the second round,
the winner has to play with c. The game continues in this way until a player wins in
succession, thus he becomes the winner of the game. We disregard the possibility of a
game being ending in a draw. List a few possible winning outcomes.
3. A graduate student has to compulsorily do 4 courses per semester. He must choose
a department course from a list of 4 elective courses, and he can choose the remain-
ing courses from the other departments which offer totally 20 courses per semester.
74 5 Permutations, Combinations and Cycles

Determine the number of possible ways that a graduate student gets to select his 4
courses.
4. In a country, a unique number board of each car has to be given such that the first
position always contains a symbol from the set {A, E, F, G, K , L}. The board has to
contain totally 5 cells. The cells from the 2nd to 5th can contain integers from 1 to 9.
Find the number of distinct number boards that can be assigned with.
5. A lady has 4 different hand bags, 5 different hair clips and 6 different pairs of sandals.
In how many different ways can this women take a hand bag, wear a hair clip and a
sandal while going out to work?
6. Using the digits 1, 2, 3, 4 and 5 how many 3-digit numbers can be formed if

(a) the last digit must be a 5 and repetition is not allowed?


(b) first digit is an odd number?
(c) the number is divisible by 2 and repetition allowed?

7. If a three digit number is formed from the digits 1, 2, 3, 4, 5 and 6, how many numbers
are between 101 and 499?
8. Two cards are drawn from a standard deck of 52 cards without replacement. Find the
number of ways of drawing a 7 and a king in that order.
9. There are 10 cars in a car race competition. The top 3 winning cars receive money. Find
the number of possible money winning orders for the car race.
10. How many lines can be drawn using 3 non-collinear points A, B and C in a plane?
11. A team of 5 students are to be arranged in circular manner from a group of 12 students.
Find the number of ways it can be done.
12. In how many different ways can the letters of the word ‘YELLOW’ be arranged in such
a way that the vowels always occur together?
13. How many 6 letter words can be formed from an English alphabet that contain 2 or 3
vowels?
14. Find the number of ways of selecting a 2-member committee for a farmer society which
consists of 20 members.
15. A cricket association consists of 9 teams. How many games will be played over the
course of the year if each team play every other team exactly 10 times?
16. How many 2-element sets are there in the set {x ∈ N/1 ≤ x ≤ 50}?
17. In how many ways a 10 digit positive integer can be formed if the digits in odd positions
are always odd and the digits in the even positions are always even?
18. Anne has bought 15 chocolates to her 4 children Bob, Andrew, Mary and Kelab. In
how many ways can she distribute the chocolates such that each child gets atleast one
chocolate?
19. How many ways can I distribute 90 note books to a class of 15 boys and 25 girls if it is
the condition that each boy gets one notebook and each girl gets at least 2 notebooks?
5.4 Sorting a Set 75

20. How many 4-digit even numbers greater than 1500 can be formed using the digits 7, 1,
4, 2 and 9?
21. How many 3 letter words can be formed using the letters in the word ‘M A H A B
A L L I U R A M’ that contains atmost one vowel?
22. (i) Find the number of ways of placing 10 red balls and 4 white balls in a row.
(ii) Find the number of ways of placing 10 red balls and 4 white balls in a row so that
red balls are together and the white balls are together.
(iii) Find the number of ways of placing 10 red balls and 4 white balls in a row so that
the arrangement always starts with a white ball and ends with a red ball.
23. Find the number of ways of arranging 12 students in a class room in to 6 disks to
perform a group project in a competition.
24. Find the number of ways of arranging the letters in the words ‘W O D E P E A L
S’ and ‘S A U C I L E T A’.
25. Consider the following grid with a marked source ‘A’ and target ‘B’.
A robot needs to move along the lines starting from source ‘A’. The only allowed moves
are right and down ways. Find the number of paths from A to B.
26. A postman has to visit 6 cities each 7 times. In how many different ways can the postman
make his visits so that, always his starting city is different from ending city?
27. Find the number of ways of selecting a 11-member cricket team and a 7-member kabaddi
team from a group of 4 people if

(i) a person cannot be in both teams.


(ii) a person can be in both.
(iii) exactly one person can be in both in teams.

28. On a festival day a teacher in a class distributes 65 chocolates to 10 students. How many
different distributions are there so that each student gets atleast one chocolate?
Generating Functions
6

In this chapter, we will define what are recurrence relations and we discuss the methods to
solve them. Such relations can be used for solving counting problems.


A power series of the function f (x) will be of the form f (x) = an x n . Such repre-
n=0
sentation of functions have numerous applications. However in this chapter, we are going to
see how these power series representations can be used for counting purpose. These power
series when summed up will be called generating functions. We ultimately use them to solve
recurrence relations.

6.1 Power Series

Sequence of the form (1, 1, 2, 3, 5, 8, 13, 21, . . . ) is called the Fibonacci sequence of
Fibonacci numbers. A sequence of the form (a, a, a, a, . . . ) is called a constant sequence.
Any general sequence can be written as

(a0 , a1 , a2 , a3 , a4 , . . . ).

A sequence is a string of objects that follow a particular pattern.


Consider a power series with ai as the coefficient of x i and write it as a0 + a1 x + a2 x 2 +


a3 x 3 + · · · . That is an x n = a0 + a1 x + a2 x 2 + a3 x 3 + · · · .
n=0
This power series is called as the generating series or generating function of
(a0 , a1 , a2 , a3 , a4 , . . . ).

© Ane Books Pvt. Ltd. 2025 77


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_6
78 6 Generating Functions

Examples 6.1 1. Consider the sequence (1, 1, 1, 1, . . . ). The generating function for this
sequence will be 1 + x + x 2 + x 3 + · · · .

 1
i.e., xn = .
1−x
n=0

2. Consider the sequence (20 , 2, 22 , 23 , 24 , . . . ). The generating function for this sequence
will be

 1
2n x n = .
1 − 2x
n=0

3. Let the generating function f (x) = 1+x1


. The power series expansion for f (x) =


1
= (−1)n x n . The sequence will be (1, −1, 1, −1, 1, . . . ).
1+x
n=0

Remark 6.2 We only take the representations of sequences as power series. We are not
going to test any convergence conditions of such series. It is only a representation through
which a view of the nth term or more terms can be got.

Operations on Power Series

The basic operations like addition, subtraction, multiplication and division can be defined
on power series which represent sequences.
Addition

∞ ∞
∞   ∞
 ∞
    
If n
an x and n
bn x are two power series, then an x n
+ bn x n
= (an +
n=0 n=0 n=0 n=0 n=0
bn )x n .

Multiplication

∞ ∞
 ∞
 ∞
 ∞
    
The multiplication of n
an x and n
bn x will be an x n
bn x n
= cn x n
n=0 n=0 n=0 n=0 n=0
where

cn = a0 bn + a1 bn−1 + a2 bn−2 + · · · + an b0

n
= ak bn−k .
k=0
6.1 Power Series 79

Subtraction

∞ ∞
∞   ∞
 ∞
    
If n
an x and n
bn x are two power series, then an x n
− bn x n
= (an −
n=0 n=0 n=0 n=0 n=0
bn )x n .

Division



Let an x n be a power series with coefficients ai  = 0, i ≥ 0. If at is the first nonzero
n=0
coefficient, then

 ∞
 ∞

an x n = an x n = x t an+t x n .
n=0 n=t n=0

 ∞

Let an x n be the multiplicative inverse of an x n where an  = 0, then
 ∞

n=0 ∞  n=0
 
an x n / an x n can be defined.
n=0 n=0



Example 6.3 Let f (x) = x n . Consider g(x) = (1 − x). Then
n=0

f (x).g(x) = (1 + x + x 2 + · · · )(1 − x)
= 1.

g(x) is the multiplicative inverse of f (x).


Hereafter we will not call the series as ‘power series’. We will call it as generating
function. We represent sum by F(x), i.e.,


F(x) = an x n
n=0

will be the generating function, for future reference.


80 6 Generating Functions

Example 6.4 The following are some generating functions.




F1 (x) = 3n x n
n=0
∞
F2 (x) = 2n x n
n=4


F3 (x) = n2 x n
n=0


 ∞

Definition 6.5 Two generating functions F1 (x) = an x n and F2 (x) = bn x n are said
n=0 n=0
to be equal iff an = bn for n ≥ 0.

So far we have seen the power series representations of infinite sequences. Now we write
power series representations of a few sequences that have finite number of terms.

Examples 6.6 1. The generating function of (2, 4, 6, 8, −4) will be 2 + 4x + 6x 2 +


8x 3 − 4x 4 .
2. The sequence associated with the generating function 1 + x + x 3 + x 5 + x 7 is
(1, 1, 0, 1, 0, 1, 0, 1).


 ∞

Definition 6.7 Let F(x) = an x n and G(x) = bn x n . Suppose a0 = 0. Then, the gen-
n=0 n=0
erating function F(G(x)) is obtained by substituting G(x) for each x in F(x).


F(G(x)) = an (G(x))n ,
n=0

where (G(x))n is obtained by multiplication method.

Remark 6.8 In any multiplication, we must work with finitely many multiplications and
additions. If a0  = 0, then the constant term in F(G(x)) will be a0 + a1 b0 + a2 b02 + a3 b03 +
· · · which is an infinite sum of numbers. In this case we need to know its sum or its
convergence, which is undesirable.



Definition 6.9 Let F(x) = an x n . Then the term-by-term differentiation of F(x) will
n=0
be
6.1 Power Series 81



d
(F(x)) = (m + 1)am+1 x m .
dx
m=0

Example 6.10 Let F(x) = (1 + x)m and G(x) = (1 + x)n . Then

F(x)G(x) = (1 + x)m+n .

Using binomial theorem,


 m  n  m+n
  
C(m, t)x t
C(n, r )x =
r
C(m + n, l)x l .
t=0 r =0 l=0

By multiplication rule of power series,


k
C(m, i)C(n, k − i) = C(m + n, k).
i=1

This is called Vandermonde Convolution.

Example 6.11 Let a sequence of numbers satisfy the following:

a0 = 1,
an = 2an−1 .

Find the generating function of the sequence.

Solution: It is clear that the terms of the sequence are powers of 2. The generating function


F(x) = an x n
n=0


= a0 + an x n
n=1


=1+ 2an−1 x n
n=1


= 1 + 2x am x m
m=0
= 1 + 2x F(x)
 ∞
1
⇒ F(x) = = 2n x n
1 − 2x
n=0
82 6 Generating Functions

The other power series one can use as generating functions are as follows:

1. Exponential Functions:

 xn
ex =
n!
n=0
2. Logarithmic Functions:

 (−1)n−1 x n
log(1 + x) =
n
n=1

Some uses of generating functions


Some of the combinatorial problems that we solved earlier can be modeled and solved by
generating functions.

Example 6.12 Suppose the situation is to find the number of ways of distributing 20 choco-
lates to 5 children so that each child gets atleast one chocolate. The answer is C(19, 4). There
can be more restrictions imposed on the distribution, like ‘a child can not receive more than
5 chocolates’. If the restriction is on more than one child, PIE can be used. For the problem
of distributing n chocolates to 1 child, the number of ways is
1. The sequence that enumerates for all n ≥ 1 be (an ) and an = 1. Hence the generating
function will be x + x 2 + x 3 + x 4 + · · · = 1−xx
.
Suppose the problem is to distribute n apples to 5 children. Then the product (x + x 2 +
x + x 4 + · · · )5 represents and enumerates the number of distributions via its coefficients.
3

The coefficient of x n is (say) of the form x k1 x k2 x k3 x k4 x k5 where each x ki is taken from the
ith factor of the product. That is k1 + k2 + k3 + k4 + k5 = n. This means child 1 gets k1
chocolates, child 2 gets k2 chocolates and so on. Hence, the number of integral solutions of
k1 + k2 + k3 + k4 + k5 = n, which is the coefficient of x n will be the number of distributions
of n chocolates to 5 children.

Example 6.13 If an = the number of integral solutions of k1 + k2 + k3 + k4 + k5 = n


where 0 ≤ k1 ≤ 3, 0 ≤ k2 ≤ 3, 1 ≤ k3 ≤ 5, 2 ≤ k4 ≤ 7. Find the generating function for
(an ).

Solution: The generating function for the condition 0 ≤ k1 ≤ 3 will be F1 (x) = 1 + x +


x 2 + x 3.
Similarly, the other generating functions are:
0 ≤ k2 ≤ 3 : F2 (x) = 1 + x + x 2 + x 3 .
1 ≤ k3 ≤ 5 : F3 (x) = x + x 2 + x 3 + x 4 + x 5 .
2 ≤ k4 ≤ 7 : F4 (x) = x 2 + x 3 + x 4 + x 5 + x 6 + x 7 .
6.1 Power Series 83

Then the generating function that we require will be


F1 (x)F2 (x)F3 (x)F4 (x)
= (1 + x + x 2 + x 3 )2 (x + x 2 + x 3 + x 4 + x 5 )(x 2 + x 3 + x 4 + x 5 + x 6 + x 7 )

Example 6.14 Find the coefficient of x 54 in (1 + x 2 + x 3 + x 4 )10

10!
Solution: The answer will be 3!6! .

Example 6.15 Find the number of ways to split n distinct cookies in 3 parts. The first part
can have 0 or more cookies. The second part can have only odd number of cookies. The
third part can contain only even number of cookies.

 1
Solution: Let F1 (x) = 2n x n = , which is the generating function for the first
1 − 2x
n≥0
part. It can seen that the number of odd subsets of an n-element set is 2n−1 . Hence the

generating function for the second part will be F2 (x) = ∞ n=1 2
n−1 x n = x . Also, the
1−2x
number of subsets having even number of elements will be 2 n−1 for n ≥ 1 and is 1 if n = 0.
Hence the generating function for the third part will be F3 (x) = 1 + 1−2xx
= 1−2x
1−x
. Let G(x)
be the generating function product

x(1 − x)
F1 (x).F2 (X ).F3 (x) =
(1 − 2x)3
−1 1 1 1
= + . .
4 1 − 2x 4 (1 − 2x)3
By binomial theorem,


(1 − 2x)−3 = C(−3, n)(−2x)n
n=0


= C(n + 2, 2)2n x n
n=0

Therefore, coefficient of x n in G(x) will be


C(n + 2, 2)2n − 2n
= 2n−3 n(n + 3), n ≥ 0
4
84 6 Generating Functions

6.2 Exponential Generating Functions

Some counting problems cannot be solved by using the ordinary generating functions intro-
duced in the previous section. Those problems where the counting is tied to a specific
k-element subsets for each k, require a more structured generating functions. Then, in this
∞
xn
case, for each sequence (an ) we will associate a generating function of the form an .
n!
n=0
We formally define it as follows.
Definition 6.16 Let (an ), n ≥ 0 be a sequence of real numbers. Then the formal power

 xn
series F(x) = an is called the exponential generating function for (an )∞
0
n!
n=0

Examples 6.17 1. Consider the sequence {1, 1, 1, . . . }. The exponential generating triv-
∞
xn
ially will be F(x) = 1 which is nothing but e x .
n!
n=0
2. Let (an ) be a sequence such that an = 1 if n = 1 and an = 0 otherwise. The exponential
generating function will be
∞
xn
F(x) = an = x.
n!
n=0
3. Let X be an empty set. Then the exponential generating function will be F(x) =
∞
xn
an = 1.
n!
n=0
4. Let X be a non empty set. Then the exponential generating function will be F(x) =
e x − 1.
5. Let X be a set having even size. Hence the generating function will involve x 2 , x 4 , x 6 , . . .
terms. Hence,
e x + e−x
F(x) =
2

Remark 6.18 Addition and multiplication operations can be defined similarly for expo-
nential generating functions.

Example 6.19 Find the exponential generating function for

{an | an is the number of subsets of an nelement set}


6.2 Exponential Generating Functions 85

Solution: Let A1 be a subset of an n-element set X . For each x ∈ X , there are two possibil-
ities. They are, either x belongs to A1 or x belongs to X \ A1 . Let F(x) be the exponential
generating function e x for both the number of subsets for A1 and X \ A1 . Hence, the expo-
∞
xn
nential generating function will e x .e x = e2x = 2n . We already know that the number
n!
n=0
of subsets of an n element set is 2 .n

Example 6.20 Let  = {0, 1, 2} and ternary strings be formed over  such that the strings
contain only even number of zeros, any number of 1’s and 2’s. Find the number of such
numbers of length n, n ≥ 0.

Solution: As there are no restrictions on 1’s and 2’s, we can assume the exponential gener-
ating function e x for each of them. Already we have seen the generating function for even
parity will be

 x 2n∞
x2 x4
1+ + + ··· =
2! 4! (2n)!
n=0
e x + e−x
=
2
In order that the condition on strings over {0, 1, 2} to satisfy, we need to use the multi-
plication principle so that all the conditions are satisfied. Hence, the exponential generating
function for the situation will be
 x 
e + e−x e3x + e x
(e x )(e x ) =
2 2
∞    ∞
1  n xn xn
= 3 +
2 n! n!
n=0 n=0

The number strings of length n will be 3 2+1 .


n

Some combinatorial aspects of generating functions are discussed below. We can see
the approach of generating function method is useful for giving good interpretations for
standard combinatorial problems.

1. Ball-Box Distributions
(a) The number of ways of distributing n indistinguishable balls into m distinguishable
boxes is the coefficient of x n in
1
(1 + x + x 2 + x 3 + · · · )m = .
(1 − x)m
86 6 Generating Functions

Interpretation: Suppose there are m distinguishable boxes and x k represents k indistin-


guishable boxes. Each box, may contain ‘0’ ball represented by x 0 , or 1 ball represented
by x 1 , or two balls represented by x 2 and so on. That is each box containment can be
represented by
(1 + x + x 2 + x 3 + · · · ).
Here assume unlimited number of balls being distributed. Hence, the distribution in the
m boxes can be represented by

(1 + x + x 2 + x 3 + · · · )m . (6.1)

Now the problem can be modified as distribution of n indistinguishable balls in m balls


and the corresponding representation will fetch the coefficient of x n satisfying,

x n1 x n2 . . . x nm = x n .

That is the number ways will be the number of non negative integral solutions of the
equation n 1 + n 2 + n 3 + · · · + n m = n. The answer will be C(m + n − 1, n).
(b) Suppose the problem is to find the number of ways of distributing n indistinguishable
balls into m distinguishable boxes with atmost n k balls in the kth box. In this case we
need to find the coefficient of x n in the product
m
(1 + x + x 2 + · · · + x n k ).
k=1

(c) Suppose the problem is to find the number of ways of distributing n indistinguishable
balls into m distinguishable boxes with atleast tk balls in the kth box. Then we need to
find the coefficient of x n in the product
m
x t1 +t2 +···+tm
x tk (1 + x 2 + · · · ) =
(1 − x)m
k=1

2. Ordered Object Selection


The number of ways of selecting an ordered n objects where the objects may repeat from
n
a set containing m objects is the coefficient of xn! in the product
 m
x x2 x3
1+ + + + ··· = emx .
1! 2! 3!

Example 6.21 Find the 3-permutations of the set A = {x, x, y, y, z}.


6.2 Exponential Generating Functions 87

x3
Solution: By generating functions, the answer will be the coefficient of 3! in the product
  
x x2 x x2 x
1+ + 1+ + 1+
1! 2! 1! 2! 1!

and it will be
3! 3! 3! 3! 3!
+ + + + = 18
1! 1!2! 2! 1!2! 2!1!

Exercise

1. Find the coefficient of x 24 in (1 + x 4 + x 8 )10 .


2. Find a generating function for an which is the number of ways of distributing n similar
balls in numbered baskets where the first, third, fifth, seventh and ninth baskets are non
empty.
3. Find the generating function for an , the number of integral solutions to the equation
k1 + k2 + k3 + k4 + k5 = n if
(i) 0 ≤ ki ≤ 2 for each i.
(ii) ki > 0 for i = 1,2.
(iii)1 ≤ k1 ≤ 2 and k2 , k3 , k4 ≥ 0.
4. Let a basket contain 2 apples,one orange and 5 bananas. Fruits of the same type are
identical. Then find the number of ways of choosing k fruits.
5. Find the number of integral solutions to x + y + z = 4, 0 ≤ x ≤ 2, 0 ≤ y ≤ 1, 0 ≤
z ≤ 5.
6. Show that f (x) = 1−4x 1
is the generating of the sequence {C(2n, n)|n ≥ 0}
7. How many binary strings with each number of zero’s can be formed?
8. Find the exponential generating function for each of the following sequences.
(i) an = 3n
(ii) an = (−1)n 3n
(iii) an = n!
(iv) an = 7n
9. For each exponential generating functions given below, find the sequence {an : n ≥ 0}
they represent.
(i) e3x
(ii) x 3 e2x
1
(iii) 1−x
−x
10. Find the coefficient of x5! in e −e
5 x
2 .
11. Expand the generating function F(x) = 1
(1−2x)(1+4x)2
in powers of x. Find the coeffi-
cient of x 102 .
12. A country floats coins in denominations of 2, 3, 5 and 7. How many different ways are
there to spend an amount of 27 exactly?
88 6 Generating Functions

13. How many strings of length n can be made using the symbols {a, b, c, d, e, f } if atleast
one a and two c’s are present in each of the string?
14. Find the number of ways of placing n balls into 3 boxes so that the first and second
boxes contain atmost 10 balls and the third box can hold any number of balls. Use the
generating function method.

15. Let {a1 , a2 , a3 , . . . } and {b1 , b2 , b3 , . . . } be two sequences and let bm = m
t=1 at . If
F(x) is the generating function of {a1 , a2 , a3 , . . . } and G(x) is the generating function
of {b1 , b2 , b3 , . . . }. Find the relationship between F(x) and G(x).
Recurrence Relations
7

7.1 Generating Function Method

Consider the sequence of numbers,

0, 1, 1, 2, 3, 5, 8, 13, . . .

This sequence is called the Fibonacci sequence of numbers. It is easy to see that each
term is the sum of the previous two terms. So how do we define it mathematically. Let {Fn }
denote the terms of the Fibonacci sequence. Then,

F0 = 0
F1 = 1
F2 = F1 + F0
F3 = F2 + F1
..
.
Fn = Fn−1 + Fn−2 for n > 1

This relation ‘Fn = Fn−1 + Fn−2 ’ is known as the recurrence relation between nth, (n −
1)th and (n − 2)th terms.

Definition 7.1 For any sequence {an }, n ≥ 0, if there is a single formula that will allow us
to compute an is known as the closed form formula for {an }, n ≥ 0.

If for any sequence {an }, n ≥ 0, we have a closed form formula, then we need not use
the fact that, how each term is formed / related from the previous terms. Hence we can

© Ane Books Pvt. Ltd. 2025 89


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_7
90 7 Recurrence Relations

use generating functions to derive such closed form solution. The steps involved in such a
procedure will be:

(1) Find the generating function from the recurrence relation.


(2) Manipulate the generating function to a closed form.
(3) Invert the function in step 2 to obtain the numbers an .

Example 7.2 Consider the Fibonacci recurrence relation given above that

Fn = Fn−1 + Fn−2 , n ≥ 2 (7.1)

Shift the indices so that we can avoid initial conditions F0 and F1 . So, write the relation
(7.1) as
Fn+2 = Fn+1 + Fn . (7.2)
Multiply, (7.2) throughout by x n+2 to get

Fn+2 x n+2 = Fn+1 x n+2 + Fn x n+2

And sum over n = 0 to ∞ throughout.



 ∞
 ∞

Fn+2 x n+2 = Fn+1 x n+2 + Fn x n+2 . (7.3)
n=0 n=0 n=0



Let f (x) = Fn x n . Then (7.3) becomes
n=0

f (x) − F1 x − F0 = f (x)x − x F0 + x 2 f (x)


F0 + F1 x − F0 x
⇒ f (x) = .
1 − x − x2
Put F0 = 0 and F1 = 1.

x
f (x) =
1 − x − x2
The form

x
f (x) =
1 − x − x2
is known as the closed form formula. f (x) is the generating function of the Fibonacci
sequence.
7.1 Generating Function Method 91

Next we need to invert f (x) obtained above to find ‘an ’ which is Fn here. Consider

x x
f (x) = =
1−x −x 2
1 − φx − φ̂x 2
√ √
where φ = 1+2 5 is the famous golden ratio and φ̂ = 1− 5
2 .
Using partial fraction method,
x k1 k2
f (x) = = +
(1 − φx)(1 − φ̂x) 1 − φx ˆ
1 − φx

where, k1 = 1
and k2 = 1
. Therefore,
φ−φ̂ φ̂−φ

F(x) = k1 (1 − φx)−1 + k2 (1 − φ̂x)−1



 ∞

= k1 φ n x n + k2 (−1)n φ̂ n x n
n=0 n=0
1
∴ Fn = (φ n − φ̂ n )
φ − φ̂

Definition 7.3 A recurrence of the form

f (n) = a1 Fn−1 + a2 Fn−2 + · · · + ak Fn−k

is said to be a linear recurrence relation with constant coefficients where a1 , a2 , . . . , ak


are called the coefficients and a1 , ak  = 0. If f (n) ≡ 0, the recurrence relation is said to be
homogeneous.

Example 7.4 The following are the linear homogeneous recurrence relations with constant
coefficients

(i) Fn − Fn−1 − Fn−2 = 0, F1 = 0, F2 = 1


(ii) Fn − Fn−1 − Fn−2 = 0, where F1 = 1, F2 = 3
(iii) Fn − Fn−2 − Fn−3 = 0, F1 = F2 = F3 = 1
(iv) Fn − 2Fn−1 − Fn−2 = 0, F1 = 0, F2 = 1

We have seen above, how to find the solution to (i) in Example 7.4 which is the famous
Fibonacci sequence. By similar way, we can find the solutions to (ii), (iii) and (iv) in
Example 7.4 using generating function method. We have used a linear generating func-
tion associated with the solution of Fibonacci recurrence relation.
92 7 Recurrence Relations

Example 7.5 Solve the following homogeneous recurrence relation by generating function
method.

Fn − 2Fn−1 + Fn−2 = 0, n ≥ 2 with


F0 = 0, F1 = 1

Solution: Consider,
Fn − 2Fn−1 + Fn−2 = 0 (7.4)
Rewrite (7.4) as
Fn+2 − 2Fn+1 + Fn = 0 (7.5)
Multiply (7.5) throughout by x n+2 and make the summation from n = 0 to ∞. Then (7.5)
becomes
∞ ∞
 ∞

Fn+2 x n+2 − 2 Fn+1 x n+2 + Fn x n+2 = 0 (7.6)
n=0 n=0 n=0


Let f (x) = Fn x n . (7.6) becomes,
n=0

( f (x) − x F1 − F0 ) − 2x f (x) + 2x F0 + x 2 f (x) = 0

Hence,
x x
f (x) = =
1 − 2x + x 2 (1 − x)2
Investigating f (x), we get

f (x) = x(1 − x)−2




=x (n + 1)x n
n=0
= x(1 + 2x + 3x 2 + 4x 3 + · · · )
= (x + 2x 2 + 3x 3 + · · · )

 ∞

= nx n = nx n
n=1 n=0
∴ Fn = n, n ≥ 0.

Example 7.6 Solve


Fn − 5Fn−1 + 6Fn−2 = 0, n ≥ 2
where F0 = 0, F1 = 1.
7.1 Generating Function Method 93

Solution: Consider the recurrence relation equivalent to the given as,

Fn+2 − 5Fn+1 + 6Fn = 0, n ≥ 0

Multiplying throughout by x n+2 and taking sum from 0 to ∞



 ∞
 ∞

Fn+2 x n+2 − 5 Fn+1 x n+2 + 6 Fn x n+2 = 0 (7.7)
n=0 n=0 n=0



Let f (x) = Fn x n
n=0
(7.7) becomes

( f (x) − F1 x − F0 ) − 5x( f (x) − F0 ) + 6x 2 f (x) = 0

By using initial conditions F0 = 0, F1 = 1,


 
x
f (x) =
1 − 5x + 6x 2
x
=
(1 − 2x)(1 − 3x)
1 1
= −
1 − 3x 1 − 2x
Using inverse of f (x), we get

Fn = (3n − 2n ), n ≥ 0

Example 7.7 Solve the recurrence

Fn = 2Fn−1 + 1, F0 = 0

Solution: Rewrite the above recurrence relation as,

Fn+1 − 2Fn − 1 = 0

The linear recurrence which is not homogeneous. Multiplying the equation through by x n+1 ,
and summing from n = 0 to ∞, we get,

 ∞
 ∞

Fn+1 x n+1 − 2 x n+1 Fn − x n+1 = 0 (7.8)
n=0 n=0 n=0
94 7 Recurrence Relations

Let


Fn x n = f (x).
n=0
Then (7.8) becomes


( f (x) − F0 ) − 2x f (x) = x n+1
n=0

x
(1 − 2x) f (x) =
1−x
1 1 1
f (x) = = −
(1 − 2x)(1 − x) 1 − 2x 1−x
Using inverse of f (x), we get

Fn = 1.2n − 1
= 2n − 1

Remark 7.8 From the above example we get the definition of a non homogeneous recur-
rence relation and the same generating function method of solving it.

Example 7.9 Show that a Fibonacci number Fn is even if and only if n is a multiple of 3.

Solution: The proof is by induction on k where n = 3k. For k = 1, F1 = 1, F2 = 1 which


are odd numbers. So F3 is even.
Assume for n = 3k and it is true that F3k is even. As F3k−1 and F3k−2 and F3k are related
by,
F3k = F3k−1 + F3k−2 ,
both F3k−1 and F3k−2 must be odd.
Now induction step is that

F3(k+1) = F3k+3 = F3k+2 + F3k+1

and to prove F3k+3 is even. Now F3k+2 = F3k+1 + F3k being odd and F3k+1 = F3k + F3k−1
being odd F3k+3 is even. Hence, the result.

Example 7.10 Let pk (n) denote the number of partitions of the integer n into atmost k-parts,
then show that
∞ k
1
pk (n)x n =
(1 − x i )
n=0 i=1
7.1 Generating Function Method 95

Solution: Let us take an example that n = 10 and k = 3. Then, it can written as


1 + 9, 2 + 8, 3 + 7, 4 + 6, 5 + 5 (2-parts partitions)
1 + 1 + 8, 1 + 2 + 7 and so on (3-parts partitions)
10 (1-part partition)
∞
pk (n) counts the total. The right hand side product is
n=0


k
1
= (1 + x + x 2 + · · · )(1 + x 2 + x 4 + x 6 + · · · ) · · · (1 + x k + x 2k + · · · )
(1 − x i )
i=1

The problem is to determine the coefficient of x n in the product. That is we need to choose
t terms such that each x iki comes from different terms and 1k1 + 2k2 + · · · + tkt = n. A
term from the ith parenthesis is of the form x iki , that is i + i + · · · + i, (ki copies of i).
Hence, we obtain the coefficient to be partition of n having atmost k partitions.
By the same assignment as above, we can see that each time, the coefficient of x n from
the product on the right hand side, gives the partition of n into atmost k parts and conversely.

Remark 7.11 In the above example, if p(n) denotes the number of partitions of n, then

 ∞
 1
p(n)x n = .
1 − xk
n=0 k=1

We now see few examples where we use exponential generating functions for solving
recurrence relations.

Example 7.12 Solve the recurrence relation

Fn+1 = (n + 1)(Fn − n + 1), if n ≥ 0

where F0 = 1.


 xn
Solution: Let f (x) = Fn be the exponential generating function for the given recur-
n!
n=0
rence relation.
x n+1
Multiply the given recurrence relation throughout by (n+1)! and sum from n = 0 to ∞.
Then
96 7 Recurrence Relations


  ∞  ∞
x n+1 x n+1 x n+1
Fn+1 = Fn (n + 1) − (n + 1)(n − 1)
(n + 1)! (n + 1)! (n + 1)!
n=0 n=0 n=0

 ∞
 x n+1  ∞
x n+1 x n+1
Fn+1 = Fn − (n − 1)
(n + 1)! (n)! (n)!
n=0 n=0 n=0
( f (x) − 1) = x f (x) − x e + xe x
2 x

 ∞
 x (n+1) ∞
1
f (x) = + xe x = xn +
1−x n!
n=0 n=0

xn
Hence, the coefficient of n! in f (x) will be n! + n

Example 7.13 Determine the number of ways to color the squares of a 1 × n diving board
using colours white, black and red if an even number of squares are coloured black.

Solution: Let Fn be the number of ways of coloring satisfying the given conditions in the
problem. Let F0 = 1. Each such coloring is nothing but a permutation of three objects W
(white), R (red) and B (black) where we allow repetition. Here, ‘B’ must appear even number
of times. Then using the exponential generating function for the occurrence of each color
∞
xn
as , we get the product exponential function as
n!
n=0


 ∞ 2
 x 2n  xn
f (x) =
(2n)! n!
n=0 n=0

where the first term is for the even occurrences of ‘black’ color.
Hence,
 x 
e + e−x
f (x) = (e2x )
2
1
= (e3x + e x )
2

1 n xn
= (3 + 1)
2 n!
n=0

3n +1
Hence, Fn = 2 , n ≥ 0.
7.2 Other Methods of Solving Recurrence Relations 97

7.2 Other Methods of Solving Recurrence Relations

We have seen how generating functions can be used in solving recurrence relations. We will
now discuss two more methods of solving a recurrence equation. We will stick on only to
linear recurrence relations throughout. The choice of the method of solving a recurrence
may vary from problem to problem. The first method that we discuss now is called the direct
substitution method.

1. Direct method

In this case we start with the initial term of the sequence given by the initial conditions
specified by the recurrence relation problem. Then we proceed to generate a few more
terms using the relation. If possible guess the possible pattern of the nth term of the
sequence. Then, we may check whether the guessed solution is correct, using some proof
technique learned earlier. This method is also called as ‘forward substitution’ method.

Example 7.14 Let c be a circle. The construction is to draw diameters on the circle. If n
diameters are drawn, find the number of sectors formed on the circle.

Solution: Let Fn be the number of sectors formed in the circle when n diameters are drawn.
The problem is to find Fn .
We have, for
n = 1, F1 = 2
n = 2, F2 = 4
n = 3, F3 = 6
n = 4, F4 = 8
When one diameter is drawn, the circle is divided into 2 sectors. Each additional diameter
will split the existing two sectors into two. Hence the recurrence relation that Fn will satisfy
will be Fn+1 = Fn + 2.
Now from the initial terms written above, the guessed value for Fn will be 2n. It can be
shown that Fn = 2n for Fn+1 = Fn + 2 by mathematical induction.
For n = 1, F2 = F1 + 2 = 4 = 2n. Assume for n = k that Fk = 2k. Consider Fk+1 =
Fk + 2 = 2k + 2 = 2(k + 1).
Hence, Fn = 2n.

Example 7.15 Solve the recurrence relation Fn+1 = 3Fn − 4 where F1 = 5.

Solution: We approach for the solution to this recurrence relation by what is known as direct
method of substitution. The method is,
98 7 Recurrence Relations

Fn+1 = 3Fn − 4
= 3(3Fn−1 − 4) − 4
= 32 Fn−1 − 4(1 + 3)
= 32 (3Fn−2 − 4) − 4(1 + 3)
= 33 Fn−2 − 4(1 + 3 + 32 )
= 34 Fn−3 − 4(1 + 3 + 32 + 33 )
..
.
= 3n F1 − 4(1 + 3 + 32 + · · · + 3n−1 )
 n 
3 −1
= 3n F1 − 4
3−1
= 3n F1 − 2(3n − 1)

If F1 = 5, then Fn+1 = 3n+1 + 2. i.e., Fn = 3n + 2.

2. Characteristic Equation Method

In the direct substitution method, we did not use any big method of reaching the solu-
tion. We simply either guessed the solution or, iteratively substituted forward to reach
the solution. However such methods may not be always useful. For example, for the
recurrence relation an+2 − 4an+1 + 3an = 0 with a1 = 1, a2 = 1, the above method is
not suitable for the known reasons of complication. We need a general method to solve
such recurrences. The motivation comes from methods of solving differential equations.
Consider the differential equation

d2 y dy
−4 + 4y = 0.
dx2 dx
This can also be written differently as

D 2 y − 4Dy + 4y = 0.

Here, ddx or D is known as the differential operator.


The solution for the differential equation

D 2 y − 4Dy + 4y = 0

is solved using the characteristic equation

m2 − 4 m + 4 = 0
7.2 Other Methods of Solving Recurrence Relations 99

The roots of this equations are 2, 2 and the solution is y = C1 e2x + C2 xe2x .

We follow the same method for solving recurrence relations. We understand the under-
lying auxiliary equation by defining a recurrence operator T from a vector space V to a
vector space V . The elements of V are functions from integers to set of complex numbers.
Let
T (g(n)) = g(n + 1), T 2 (g(n)) = g(n + 2), . . . , T k (g(n)) = g(n + k)
where k is any positive integer.

Example 7.16 Let g(n) = 2n + 3 and g(n) ∈ V where T : V → V . Consider the applica-
tion 2T 2 − 3T + 3 to g(n). That is,

(2T 2 − 3T + 3)(g(n)) = 2T 2 (g(n)) − 3T (g(n)) + 3g(n)


= 2g(n + 2) − 3g(n + 1) + 3g(n)
= 2(2(n + 2) + 3) − 3(2(n + 1) + 3) + 3(2n + 3)
= 4n + 8.

Already we have defined both homogeneous and non homogeneous recurrence relations.
We only need to know how to write the recurrence relation using the operator T .

Example 7.17 Let {Fn }∞n=0 be a sequence that satisfies the recurrence relation Fn+1 = 3Fn
where F0 = 1. Write the sequence in terms of the operator T and hence solve for Fn .

Solution: Let g(n) = Fn for n ≥ 0. Then g(0) = 1 and

T (g(n)) = 3g(n)
i.e. (T − 3)(g(n)) = 0

Since T is an operator similar to D, the solution to g(n) = c.3n where c is a constant. Now
the initial condition F0 = 1, gives c = 1. Hence, g(n) = 3n (= Fn ).

Remark 7.18 From the above discussion and examples, now on we will proceed with
examples, where we solve a linear recurrence relation with constant coefficient by what is
known as characteristic equation method.

Example 7.19 Solve the recurrence relation Fn+2 − 4Fn+1 + 3Fn = 0 by characteristic
equation method given the fact that F1 = 1 and F2 = 2.
100 7 Recurrence Relations

Solution: Let Fn = g(n) for n ≥ 0. Then g(1) = 1, g(2) = 2. Then the recurrence relation
in terms of T will be

T 2 (g(n)) − 4T (g(n)) + 3g(n) = 0


(T 2 − 4T + 3)(g(n)) = 0 (7.9)

The auxillary equation is

(T 2 − 4T + 3) = (T − 3)(T − 1)

Its roots are 3, 1 and are distinct and real. Hence, the solutions of

(T − 3)(g(n)) = 0 and (T − 1)(g(n)) = 0

g(n) = C1 3n and g(n) = C2 (1n )


Hence, the general solution is
g(n) = C1 3n + C2 .
Substituting F1 = 1 and F2 = 2, we get

3n−1 + 1
g(n) = .
2

Example 7.20 Solve the recurrence relation Fn+2 − 4Fn+1 + 3Fn = 3n with the initial
conditions F1 = 1 and F2 = 3

Solution: The given recurrence relation is a non homogeneous recurrence relation. We


proceed by the same way of solving a non homogeneous differential equation.
First consider the homogeneous recurrence relation,

Fn+2 − 4Fn+1 + 3Fn = 0.

By the previous example, its solution will be Fn = C1 3n + C2 where C1 and C2 are con-
stants.
Now consider the given recurrence relation whose right hand side is 3n . As the underlying
homogeneous recurrence has 3n as its solution, we must try with Fn = C3 n3n as a possible
solution for the given recurrence relation.
7.2 Other Methods of Solving Recurrence Relations 101

Substituting it in the recurrence relation

C3 (n + 2)3n+2 − 4C3 (n + 1)3n+1 + 3C3 n3n = 3n


C3 (9n + 18 − 12n − 12 + 3n) = 1
6C3 = 1
1
C3 =
6
Hence the solution will be
1
Fn = C1 3n + C2 + n3n
6
where
1 3
C1 = − and C2 =
12 4
Hence the complete solution will be
1 n 3 1 n
Fn = − 3 + + n3
12 4 6
3n (2n − 1) 3
= +
12 4
3n−1 (2n − 1) 3
= +
4 4

Example 7.21 Solve the recurrence relation Fn+2 − 3Fn+1 + Fn = 0 n ≥ 1 given F0 = 1


and F1 = 2

Solution: Let g(n) = Fn . Then writing the recurrence relation in terms of the operator T ,
we get,

T 2 (g(n)) − 3T (g(n)) + g(n) = 0


(T 2 − 3T + 1)g(n) = 0
√ √
The roots of T 2 − 3T + 1 = 0 are α, β where α = 3+2 5 and β = 3− 5
2 .
Hence,  √ n  √ n
3+ 5 3− 5
g(n) = C1 + C2
2 2
102 7 Recurrence Relations

Given g(0) = 1, g(1) = 2

C1 + C2 = 1
√ √
3+ 5 3− 5
C1 + C2 = 2
2 √ 2 √
1+ 5 5−1
C1 = √ , C2 = √
2 5 2 5
 √  √ n  √  √ n
1+ 5 5+3 5−1 3− 5
∴ Fn = √ + √
2 5 2 2 5 2

Example 7.22 Solve the recurrence relation Fn − 2Fn−1 − Fn−2 + 2Fn−3 = 0, n ≥ 3 with
the initial conditions F0 = 1, F1 = 2 and F2 = 0.

Solution: Let Fn = g(n). Then the auxiliary equation in terms of the operator T will be

T 3 − 2T 2 − T + 2 = 0
i.e.(T − 2)(T + 1)(T − 1)g(n) = 0

Then, the solution is,


g(n) = C1 (−1)n + C2 + C3 2n
Using initial conditions we get,

C1 + C2 + C3 = 1
C1 − C2 + 2C3 = 2
C1 + C2 + 4C3 = 0.
−2 −1
Solving the above by a little computation we get, C1 = 2, C2 = 3 , C3 = 3 .
Hence,
2 1
Fn = 2(−1)n − − 2n .
3 3

Example 7.23 Solve the following difference equation,

Fn − Fn−1 = 3n 2 − 5n 3 , n ≥ 1, F0 = 2.

Solution: Consider the underlying homogeneous recurrence relation

Fn − Fn−1 = 0.
7.3 Some Sorting Methods 103

Let g(n) = Fn . Then the recurrence can be written down as,

Fn+1 − Fn = 0

and

T (g(n)) − g(n) = 0
(T − 1)g(n) = 0.

Hence, the solution for this will be g1 (n) = C1 (1)n = C1 .


Now consider the equation

Fn − Fn−1 = 3n 2 − 5n 3 .

The solution will be of the form



n
g2 (n) = C2 (3k 2 − 5k 3 )
k=1

Hence, the solution will be




g(n) = C1 + C2 (3k 2 − 5k 3 )
k=1
g(0) = 2 ⇒ C1 = 2

Let C2 = 1, then
3n(n + 1)(2n + 1)
g(n) = 2 +
6
 
n(n + 1) 2
= −5
2

(Note C2  = 0).

7.3 Some Sorting Methods

Sorting numbers, strings, symbols etc. occurs very often in algorithms. By sorting we mean
an ordering or positioning some data of information for computational purposes. The method
of sorting differs for different data types. Also there are different techniques for sorting.
Commonly used sorting algorithms are for numbers so that the numbers are put in ascending
or descending order. There is also an ordering in a collection of strings or words called
dictionary ordering. This dictionary ordering is totally dependent on the alphabet ordering
over which the strings are made.
104 7 Recurrence Relations

For example one needs to order only two numbers, then simple comparison and exchange
positions will work. But if the input is a set of numbers whose cardinality is more than 2,
then there are different techniques to sort these numbers. The first method that is presented
below is known as “Bubble Sort” method.

Bubble Sort

Let {n 1 , n 2 , . . . , n t } be the set of numbers to be sorted. The method goes in steps by com-
paring adjacent numbers and swapping if required. That is the algorithm compares n 1 and
n 2 . If n 1 > n 2 , then swap n 1 and n 2 . Update the input incorporating the change. Now a
comparison of second and third number is done and update the input as before. t steps of
comparisons, updates the input of t numbers so that the largest number is in the tth position.
Now in the updated list the above said procedure is once again carried out for (t − 1)
numbers. The updated list of numbers will have t th and (t − 1)th positions filled as required.
This is done (t − 1) times to completely obtain a sorted list.
When we discuss the computational steps, the comparisons made are to be counted. If at
is the number of comparisons made, then

at = (t − 1) + at−1 .

This will be the recurrence relation for the count of comparisons. One can easily see that

t(t − 1)
at = .
2
The best case running time occurs when the input numbers are already sorted. The worst
case running time occurs when the input numbers are completely reversed. So, we say safely
on an average case, its complexity will be O(t 2 ).

Insertion Sort

The name of the method suggests a technique of inserting numbers at the appropriate posi-
tions. In the beginning, the first number n 1 of the input list n 1 , n 2 , . . . , n t is taken and it is
sorted. Now the numbers are read in sequence. In the first step consider n 1 and n 2 , compare
them and sort their positions. Update the list where the first two numbers are in order. Now
as a next step, consider the next unvisited number which is the third one here. Now compare
this number with the previous number. Now positions are swapped or remain unchanged
based on the comparison. If they are swapped, then the highest value number from the first
three numbers is now in the third position. But the number in the second position may be
smaller than the first one. Hence another comparison is needed with the first number to sort
the first three numbers. In the next pass the number in the fourth position is compared with
the first three numbers as before. The correct index or position of the fourth number is found
and it is inserted. The procedure continues till the input list is completely sorted.
7.3 Some Sorting Methods 105

Example 7.24 Let the numbers be,

14, 13, 15, 4, 5

First step: 14 , 13 , 15, 4, 5


14 and 13 are compared. As 14 > 13 the numbers are swapped. Now the new updated list is

13, 14 , 15 , 4, 5

Second step: Now comparing 15 and 14, as 15 > 14, there will be no swapping and hence
the list now will be,
13, 14, 15 , 4 , 5
Third step: Comparing 4 and 15, 15 < 4 and hence they swap their positions. Since there is a
swapping step, 4 will be compared with 14 and successively with 13. Each time comparison
shifts the position to the first which is the correct position for 4. After this step, the list looks
as below.
4, 13, 14, 15, 5
Fourth step: The number 5 is compared with 15, 14, 13 and 4 and it is inserted between 4
and 13. Now the updated list is sorted.

The following is the algorithm for insertion sort. We can understand the recursion and
hence its complexity from a brief analysis.

Insert-Sort Algorithm
Ins-Sort (M)
1. for i = 1 to t
2. key = M[i]
3. ∗ M[i] to be inserted in the correct position in the sorted list
M[1]M[2] . . . M[i − 1] ∗
4. j = i − 1
5. while ( j > 0 and M[ j] > key)
6. M[ j + 1] = M[ j]
7. j ← j − 1
8. M[ j + 1] ← key

Here ‘∗’ indicates that it is a comment statement and hence takes only no time.
Step ‘1’ runs for t times
Step ‘2’ runs for (t − 1) times
Step 3 is a comment statement and is run only once
Step ‘4’ runs for (t − 1) times
106 7 Recurrence Relations


t 
t
Step 5, 6, 7 are within a loop. So Step 5 runs n j times and hence Step 6 runs (n j − 1)
j=2 j=2
times. Step 7 also runs the same number of times as Step 6. Step 8 runs for (t − 1) times.
Clearly the recursion occurs in the while loop. Suppose step i takes ci units for each
iteration. So the total time units will be,


t
A(t) = c1 t + c2 (t − 1) + c0 0 + c4 (t − 1) + c5 nj
j=2

t 
t
+ c6 (n j − 1) + c7 (t j − 1) + c8 (t − 1).
j=2 j=2

In the best case, the input array is already sorted. So the computation of A(t) will be of
the form t + m where , m are constants. So we say A(t) is a linear function of t.
In the worst case, the list is reversely sorted. So every recursive step in 5, 6 and 7 are run
for all possible indices in the loop. That is


t
(t + 1)t
j= −1
2
j=2

t
t(t − 1)
( j − 1) =
2
j=2

Hence it is not difficult to see that A(t) will be of the form t 2 + mt + k.


So we say that the time complexity of insertion sort is in O(t 2 ).
In simple terms, one can understand that in the jth iteration, the list or array from index
1 to j − 1 is sorted. So we understand the recurrence relation involved in calculating the
number of time steps will be,
A(t) = A(t − 1) + t,
where ‘t’ denotes the time needed to insert the last element in the list of sorted (t − 1)
elements.

Merge Sort

Let A = {n 1 , n 2 , . . . , n t } be the list of input numbers. Now in merge sort, we apply a


technique called ‘divide-and-conquer’ technique. Briefly the technique is to divide a list of
t-numbers into two lists of each having 2t elements each. Then sort the two divided sublists.
Finally merge the two sorted sublists to get one final sorted list. We have a pseudocode of
the merge sort as below.
7.3 Some Sorting Methods 107

Merge-Sort (A, m, n)
if m < n
i = m+n
2
Merge-Sort(A, m, i)
Merge-Sort(A, i + 1, n)
Merge(A, m, n)

Here Merge(A, m, n) is the procedure that sorts the numbers from index m to index n.
The sub-program ‘merge-sort’ sorts the subarrays before merging.
If A(t) is the number time units totally taken to sort the ‘t’ numbers, then the recursion
will be  
t
A(t) = 2 A + t.
2
We saw that a recurrence relation will be an expression describing a function in terms of
smaller input values. Many sorting algorithms have their running time dependent on recursive
call of subproblems and hence a recurrence, relation on its running time is encountered.
Exercise

1. Solve the recurrence relation Fn = 5Fn−1 − 6Fn−2 , n ≥ 2 where F0 = 1, F1 = −2.


2. Solve the recurrence relation Fn − 6Fn−1 + 7Fn−2 = 1 where F0 = 0, F1 = 1.
3. Find the recurrence relation for the number of ways of decorating a n-feet long rod
such that 4 color stickers of the following sizes are to be used. Red stickers are of size
2 feet long, yellow, green and orange stickers are of size 1 feet long each.
4. A student has to climb up a staircase of n steps to reach his classroom. At each step,
the student climbs either one step or two steps up. Find the recurrence relation to the
number of ways of climbing the n steps and solve the recurrence relation.
5. Let Fn be the number of ways to pay a ‘n rupees’ bill using 10 rupee coins, five rupee
coins and one rupee coin only. Find the ordinary generating function for Fn . Solve for
Fn explicitly.
6. Solve the recurrence relation with the initial condition F0 = 2, Fn = (Fn−1 )2 , n ≥ 1.
7. Determine the number an of a n digit (in base 10) numbers with each digit being odd.
Also a condition that digit 1 and 3 must occur even number of times.
8. Find Fn in terms of n in the following recurrence relations.

(i) Fn+2 − 4Fn+1 + 4Fn = 0, F1 = 1, F2 = 2


(ii) Fn+2 − 4Fn+1 + 4Fn = 2n , F1 = 1, F2 = 2
108 7 Recurrence Relations

9. Solve the following recurrence relations by direct method of substitution.

(i) Fn − Fn−1 = n 2 where F0 = 2


(ii) Fn − Fn−1 = n2n where F0 = 1
(iii) Fn − Fn−1 = n + n 2 where F0 = 1

10. Solve the following recurrence relations by characterstic equation method.

(i) Fn+2 − 5Fn+1 + 6Fn = 0 where F0 = 0, F1 = 1


(ii) Fn+2 + Fn+1 − 12Fn = 0 where F0 = 0, F1 = 2
(iii) Fn+4 + 2Fn+3 − 12Fn+2 + 14Fn+1 + 5Fn = 0 where F0 = 0, F1 = 2, F2 = 1,
F3 = 1

11. Write down the following recurrence relations in terms of the operator T .

(i) Fn+2 − Fn+1 − 3Fn = 0


(ii) Fn − Fn−1 − 3Fn−2 = 2n+1 − n 2
(iii) Fn+3 − 5Fn+1 + Fn = 2n

12. For each of the recurrence relations written in terms of the operator T , find its general
solution.

(i) (T − 2)(T + 3)g(n) = 0


(ii) (T 2 − 5T + 4)g(n) = 0
(iii) (T 3 − 3T 2 + 3T + 1)g(n) = 0

13. Solve the following non homogeneous equations.

(i) (T − 5)(T + 4)g(n) = 2n


(ii) (T 2 − 2T + 1)g(n) = 4n
(iii) (T − 2)(T − 3)2 g(n) = 2n + 3

14. Find the number of 10 digit positive integers that satisfy the following two conditions.

(i) Each digit is either 1 or 2


(ii) There exist exactly two consecutive 1’s

15. Find the number of ways that the numbers 1, 2, . . . , 2004 can be arranged in a row
such that, except for the first number, each number differs from some number on its left
by 1.
7.3 Some Sorting Methods 109

16. A circle C is given. Chords are drawn inside the circle which split the interior region
of the circle into smaller regions. Find Fn , the largest number of regions that can be
formed by n chords.
17. Let Fn be the number of expressions for the positive integer n as sum of positive integers.
For example,

3 = 0 + 3, 3 = 1 + 2, 3 = 2 + 1, 3 = 1 + 1 + 1.

So, F3 = 4. We can check F4 to be 8.


n−1
(i) Show that F1 = 1 and Fn = 1 + Fk for n ≥ 2.
k=1
(ii) Also, prove from (i) that F1 = 1, Fn = 2(Fn−1 ), n ≥ 2.
(iii) Solve for Fn .

18. Consider the sequence {an }∞n=0 where a0 = 1, an+1 = (n + 1)(an − n + 1). Find the
direct formula for an using exponential generating funtion.
19. Solve the following recurrence relation using generating function method.

an − an−1 − 2an−2 = 2n , n ≥ 2, a0 = 2, a1 = 1

20. Solve for {an }∞


n=0 if

n
at an−t = 1
t=0
where a0 = 1.
21. Find a simple expression for the generating function

 xn
B (x) = Bn
n!
n=0

where B0 = 1, B1 = 1,


Bn+1 = C(n, t)Bt
n=0
for n > 1. Bn ’s are the Bell numbers.
22. Solve for an explicity if

an+1 = 2an + 3n , n ≥ 0, a0 = 15

23. Let an denote the number of strings over {0, 1} that do not contain the substring ‘11’.
Find a recurrence relation for an .
Inclusion Exclusion Principle
8

8.1 The Principle of Inclusion-Exclusion

This section is concerned with events which are defined in terms of other events
A1 , A2 , . . . , Ak . Of the k events, one, two or more can occur simultaneously. This means
there can be overlapping events. For example if A1 and A2 are two events, then A = A1 ∪ A2
denotes that either A1 or A2 or both can occur. Here A = A1 ∪ A2 ∪ · · · ∪ Ak and the prob-
lem is to find |A|. We can in the beginning find the cardinality of A by some direct method.
But what is obtained is only an approximate counting. We need to subtract off an overcount-
ing, as the events A1 , A2 , . . . , Ak are overlapping. This method will be named as ‘method of
Inclusion-Exclusion’ or ‘Principle of Inclusion-Exclusion’ (PIE). PIE is one of the important
and basic tools in enumerative combinatorics.

Example 8.1 There are 14 students in a class who are good in mathematics and 17 students
who are good in physics. Four students are good in both mathematics and physics. How
many students are good atleast in one of the subjects?

Solution: The situation can be described using a Venn-diagram.


Clearly 14 + 17 − 4 = 27 are good in at least one of the subjects (Fig. 8.1).
The situation that the students are tested for their knowledge in three subjects becomes
more complicated but manageable.

Example 8.2 Suppose in a class, there are 14 students who are good in mathematics, 17
students are good in physics and 18 students are good in chemistry. Four students are good
in maths and physics, three students are good in maths and chemistry, and five students are
good in physics and chemistry. There is one student who is good in all the three subjects.
How many students are good in at least one of the subjects?

© Ane Books Pvt. Ltd. 2025 111


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_8
112 8 Inclusion Exclusion Principle

Fig. 8.1 .
Math Phy

10 4 13

Fig. 8.2 . Maths Physics

8 3 9
1
2 4

11

Chemistry

Solution: Adding the number of students who are good in maths, physics and chemistry
14 + 17 + 18 = 49 results in an over counting. We have to subtract the number of students
who are good in two subjects i.e. the modified count will be 49 − 4 − 3 − 5 = 37. This
number is also an approximate value as this does not include one student who is good in
all the three subjects, but the student has been subtracted three times (once for each pair of
subjects). It means, this student together with 37 is the required answer. By Venn-diagram
it means (Fig. 8.2).

Remark 8.3 From the previous example, it is clear to analyse the situation, by repeatedly
including and excluding the events for the correct counting.

Theorem 8.4 Let A1 , A2 , . . . , An be subsets of some finite set A. Then


n 
|A1 ∪ A2 · · · ∪ An | = (−1) j−1 |Ai1 ∩ Ai2 ∩ · · · ∩ Ai j | (8.1)
j=1 i 1 ,i 2 ,...,i j

where (i 1 , i 2 , . . . , i j ) ranges all j-element subsets of an n-element set X .

Proof By looking at the left hand of (8.1) we can see that the union counts each element
of Ai exactly once. We need to show that each element on the LHS is counted exactly
8.1 The Principle of Inclusion-Exclusion 113

once on the RHS of (8.1) also. Let x ∈ A1 ∪ A2 ∪ · · · ∪ An . Let A be a subset of indices.


Let A satisfy the condition that x ∈ Ai if and only if i ∈ A. Let the cardinality of A be t.
Clearly t ≥ 1. Then x ∈ Ai1 ∩ Ai2 ∩ · · · ∩ Ait if and only if (i 1 , i 2 , . . . , i t ) ⊆ A. It means
that x ∈ Ai1 ∩ Ai2 , x ∈ Ai2 ∩ Ai3 ∩ Ai4 and so on. That is the RHS of (8.1) counts x once
for each of these subsets with alternating signs. Hence x is counted

t − C(t, 2) + C(t, 3) − C(t, 4) + · · · + (−1)t−1 C(t, t) = 1 (8.2)

times. That is one time. To see this subtract 1 from both sides of (8.2),

1 − t + C(t, 2) − C(t, 3) + · · · + (−1)t C(t, t) = 0

which is true due to binomial theorem. 

Example 8.5 Suppose there are 200 graduate students in total. In this 100 students opted
for logic and 70 students opted for computability courses. If there are 50 students who opted
for both the courses, how many students take neither of the course?

Solution: Let
p: be the property that the student has opted for logic
q: be the property that the student has opted for computability.
Now N = 200, N ( p) = 100, N (q) = 70, N ( pq) = 50. Then by PIE

N = N − [N ( p) + N (q)] + N ( pq)
= 80

Therefore there are 80 students who do not opt for both the courses.

Example 8.6 Find the number of numbers between 1 and 104 that are not divisible by 6, 7
or 8.

Solution: Let
p: the property that n is divisible by 6
q: the property that n is divisible by 7
r : the property that n is divisible by 8.
4
Then N ( p) =  106  = 1666,

N (q) = 1428, N (r ) = 1250

104
N ( pq) =   = 238, N (qr ) = 178,
6.7
114 8 Inclusion Exclusion Principle

104 104
N ( pr ) =  =  = 416
lcm(6, 8) 24

104 104
N ( pqr ) =  =  = 59
lcm(6, 7, 8) 168
Then by PIE, the number of numbers satisfying p, q, r will be

[N ( p) + N (q) + N (r )] − N ( pq) − N ( pr ) − N (qr ) + N ( pqr ) (8.3)

But we need the numbers which do not satisfy p, q and r . Hence it will be

N = 104 − expression (8.3) = 6429

Example 8.7 Let a bag contain 7 balls of 7 different colours and let there be three different
boxes B1 , B2 , B3 (say). Find the number of ways of placing the balls into the three different
boxes so that each box contains at least one ball.

Solution: Let N be the total number of ways to distribute the balls into the boxes and N = 37 .
Let
p: the property that B1 has no balls.
q: the property that B2 has no balls.
r : the property that B3 has no balls.
The problem is to find
N − (N ( p) ∪ N (q) ∪ N (r )

N ( p) = N (q) = N (r ) = 27

N ( pq) = 17 = N (qr ) = N ( pr )

N ( pqr ) = 0
∴ The required count will be, by PIE

37 − [3.27 − 3.17 + 0] = 1806.

Example 8.8 How many integers in the set {1, 2, 3, . . . , 180} have atleast one prime divisor
in common with 180?

Solution: The prime divisors of 180 are 2, 3 and 5. i.e. 180 = 22 · 32 · 5. Let E i be numbers
between 1 to 180 that have divisor i, i = 2, 3, 5. The problem is to find |E 2 ∪ E 3 ∪ E 5 |. We
use PIE for the calculations.
8.2 Euler’s Phi-Function 115

180 180
|E 2 | =   = 90, |E 3 | =   = 60
2 3

180 180
|E 5 | =   = 36, |E 2 E 3 | =   = 30
5 6
180 180
|E 2 E 5 | =   = 18, |E 3 E 5 | =   = 12
10 15
180
|E 2 E 3 E 5 | =  =6
30
therefore

|E 2 ∪ E 3 ∪ E 5 | = 132.

Example 8.9 How many integers in the set {1, 2, . . . , 180} are relatively prime to 180?

Solution: From the previous example it will be 180 − 132 = 48. Hence we have the fol-
lowing.
If n is an integer and if p1 , p2 , . . . , pt are the prime factors of n, then the number of
integers which are less than ‘n’ and relatively prime to ‘n’ can be found by PIE. That is
known as Euler’s φ-function and is denoted by φ(n).
    
1 1 1
φ(n) = n 1 − 1− ··· 1 − .
p1 p2 pt

8.2 Euler’s Phi-Function

Prime Numbers

The numbers 1, 2, 3, 4, . . . are called natural numbers. Number theory will deal with such
numbers, properties and relationships between certain subsets of these. Natural numbers can
be grouped as below:
Even Numbers: 2, 4, 6, 8, 10, …
Odd Numbers: 1, 3, 5, 7, …
Squares: 1, 4, 9, 16, …
Composite Numbers: 4, 6, 8, 9, 10, 12, 14, …
Prime Numers: 2, 3, 5, 7, 11, 13, 17, …
Fibonacci Numbers: 1, 1, 2, 3, 5, 8, …
116 8 Inclusion Exclusion Principle

Many of these are already well known subsets of natural numbers. Here after number
means natural number.

Example 8.10 Is it possible to find numbers x, y and z such that x 2 + y 2 = z 2 ? Such a


triplet will be called as ‘Pythagorean Triplet’. This is a property of numbers. Not every
triplet satisfies this property. For example (3, 4, 5) is a Pythagorean Triplet.

Definition 8.11 A prime number p is a number whose only factors are p and 1.

Example 8.12 17, 19 are prime numbers. This is a property of numbers. Naturally, we want
to see in the whole set of natural numbers, is the subset containing all the primes infinite? If
so how to list them? How to find whether a given number is prime or not?

Before we proceed further, let us understand integer divisibility.

Definition 8.13 Let m, n be two integers such that m = 0. We say ‘m divides n’ if there
exists an integer k, such that n = km. We say m is a factor of n or n is a multiple of m.

Notation 8.14 The standard notation is, if we write ‘m|n’, then we mean m divides n. If
we write m | n, then we mean ‘m does not divide n’.

Example 8.15 (i) For the subset ‘E’ of even numbers, 2 divides m, where m ∈ E. i.e., 2|m.
(ii) For the subset ‘O’ of odd numbers 2 does not divide m , where m ∈ O. 2 | m .

Remark 8.16 We include 0 wherever required. For any n ∈ N, we see n|0.

We state the following simple theorem without proof.

Theorem 8.17 Let n 1 , n 2 , n 3 , p and q be integers. If n 3 |n 1 and n 3 |n 2 , then n 3 |( pn 1 + qn 2 ).

We now see what a division algorithm is. When two numbers are multiplied, we get
another number. Multiplication is nothing but repeated addition. Likewise division is
repeated subtraction. So we have the following divison theorem which proposes and defines
division of an integer by another number.

Theorem 8.18 Let m and n be two numbers with m > 0. Then there exists unique numbers
q and r such that n = qm + r , 0 ≤ r < m. If m | m, then r = 0.

Proof Since division is a repeated subtraction, we define the following sequence for m and
n as below.
8.2 Euler’s Phi-Function 117

n − m, n − 2 m, n − 3 m, n − 4 m, . . .
Clearly each element is distinct. Choose the smallest nonnegative number in this sequence,
which is r here. Let it be, n − qm = r .
The elements r , and q can be shown to be unique, by using method of contradiction. 

Remark 8.19 The above theorem is true for any two integers and it is also called as division
algorithm.

Example 8.20 If m = 5, n = 73, then 73 = 14 × 5 + 3. Here q = 14, r = 3.


The following properties can be verified easily.

1. If m, n, s and t are integers with m, s = 0 such that m|n, s|t, then ms|nt.
2. If m and n are positive integers and m|n, then m ≤ n.
3. If m, n and s are integers such that ms|ns, then m|n.
4. If m and n are integers such that m|n and n|m, then m = ±n.

Divisors

By division algorithm, for any two integers m and n, we have n = qm + r where 0 ≤ r < m.
When r = 0, we say that m divides n or m is a divisor of n.

Definition 8.21 If a number t is a divisor of two integers m and n. We call t as a common


divisor. For m, n = 0, the number of common divisors of m and n will be a finite set. The
number in the set of divisors of m, n which has the maximum value is called as the greatest
common divisor.

Notation 8.22 For m, n ∈ N, div(m, n) = d means that d is a divisor of m, n; gcd(m, n) =


d means that d is the greatest common divisor of m and n.

Definition 8.23 For any integers m, n if gcd(m, n) = 1, then we call m and n as relatively
prime to each other.

Example 8.24 The gcd(4, 10) = 2. Then 2 = s1 4 − s2 10 where s1 = 3, s2 = 1.


In general for any two integers m and n, we have

m =1·m+0·n
n =0·m+1·n

A linear combination set will be {s1 m + s2 n|s1 , s2 are integers}. This set is not empty. By
well-ordering property it has a least d such that d = s1 m + s2 n. The following theorem
118 8 Inclusion Exclusion Principle

presents the idea that the gcd of two integers m, n can be represented as a linear combination
of m and n, provided both are not zero.

Theorem 8.25 Let m, n be two integers, both not zero. Then the gcd(m, n) = d = s1 m +
s2 n where s1 and s2 are some integers.

Remark 8.26 The idea of gcd can be extended to k numbers. The above theorem will be
true for k numbers.

Definition 8.27 Let m 1 , m 2 , . . . , m t be integers such that not all of them are zero. Then

(i) The gcd of m 1 , m 2 , . . . , m t is the largest number that is a divisor of all the t numbers
(ii) If gcd(m 1 , m 2 , . . . , m t ) = 1, then the t numbers are said to be mutually prime to each
other.
(iii) The t numbers are said to be pairwise relatively prime, if any two numbers ai , a j are
relatively prime for i = j.

Remark 8.28 Relatively prime pairs are also called as co-prime pairs. The following prop-
erties can be proved easily.

1. For any integer s, the gcd(sm, sn) = sgcd(m, n).


2. If gcd(s, m) = gcd(s, n) = 1, then gcd(s, mn) = 1.
3. For any integer s, gcd(m, n) = gcd(m, −n) = gcd(m, n + sm)
4. If for integers m, n and t, t|mn, and t and n are co-prime, then t|m.

The definition and properties of divisors gave a basic understanding on the integers and
divisibility. Now by Euclidean Algorithm we come across a method that determines the gcd
of two input numbers m and n. We have seen that the gcd(m, n) can be written down as a
linear combination of m and n. That is, gcd(m, n) = s1 m + s2 n, s1 , s2 are integers. We also
noted that gcd(m, n) = gcd(m, −n). We state the following lemma which follows directly
from properties of gcd.

Lemma 8.29 Let m and n be two integers. If m = pn + r where p and r are integers, then
(m, n) = (n, r ).

The following is called the Euclidean algorithm which states that the gcd of two integers
m and n is the last non-zero remainder obtained by repeated division.
8.2 Euler’s Phi-Function 119

Theorem 8.30 Let m and n be two positive integers where m ≥ n. Define

ri = ri+1 qi+1 + ri+2 where 0 ≤ ri+2 < ri+1

Starting with r0 = m, r1 = n, the successive applications of division algorithm for all i =


0, 1, 2, . . . , t − 2 will terminate in rt = gcd(m, n). Here rt+1 = 0.

Proof The proof is straightforward. However, let us write down the steps obtained by apply-
ing of division algorithm

r 0 = r 1 q1 + r 2 0 ≤ r 2 < r 1
r 1 = r 2 q2 + r 3 0 ≤ r 3 < r 2
......
rt−2 = rt−1 qt−1 + rt 0 ≤ rt < rt−1
rt−1 = rt qt

The final step will be the one where the remainder term is zero as all the remainders are
integers and every remainder in the next step being less than the remainders in the previous
step. So,

gcd(m, n) = gcd(n, r2 ) = gcd(r2 , r3 ) = · · · = gcd(rt , 0) = rt .




Example 8.31 Find the gcd of 11468 and 3137 using Euclidean Algorithm.

Solution:

11468 = 3137 × 3 + 2057


3137 = 2057 × 1 + 1080
2057 = 1080 × 1 + 977
1080 = 977 × 1 + 103
977 = 103 × 9 + 50
103 = 50 × 2 + 3
50 = 3 × 16 + 2
3=2×1+1
2=2×1
gcd(11468, 3137) = 1.

Remark 8.32 Note that 1 can be expressed as a linear combination of 11468 and 3137.
120 8 Inclusion Exclusion Principle

Product of Primes

We will now see that every number can be represented as product of primes. Such a repre-
sentation is called as ‘prime decomposition’ of the number. Given a number, finding such
a decomposition is a difficult problem. For example consider the number 1425. It can be
written as 3 · 52 · 19. We consider 3 · 19 · 52 is the same as 3 · 52 · 19. The order of the prime
powers does not matter. So we will see that such a decomposition is unique for each number.

Proposition 8.33 Let n be a natural number. Then it has a prime decomposition.

Proof If n = 1, then it is the null product of prime. If n is prime, then n is the prime
decomposition of itself. Suppose n is composite. Then n = n 1 · n 2 where n 1 , n 2 < n. Then
it can be established by induction that n 1 and n 2 are products of primes. So n has a prime
decomposition. 

Now the problem is given a number n,

(1) Is the prime decomposition unique?


(2) Does there exist a polynomial time algorithm to perform the decomposition?

We will see first Question (1). The following theorem is known as the Fundamental
theorem of arithmetic.

Theorem 8.34 Every positive integer n( = 1) can be represented uniquely as a product of


primes.

Proof We know for any positive integer n there is a prime decomposition. If possible let n
have two decompositions

n = p1 p2 . . . pk ,
n = q1 q2 . . . qt .

As p1 |n = q1 (q2 . . . qt ), we have either p1 = q1 or p1 |(q2 . . . qt ). Note that p1 = qi for


some i. Now cancel p1 and its equivalent term qi . Repeating this procedure, we see that the
two representations are the same. 

Question (2) above still is an open problem except a polynomial time algorithm using
quantum computers being proposed by Peter Shor.
8.2 Euler’s Phi-Function 121

Integers Modulo n

Numbers can be grouped based on certain property. For example we can make two sets of
numbers as prime number set and compositive number set. We also saw several divisibility
properties of numbers. Congruence is a property of divisibility. Congruency, groups numbers
based on their divisibility with respect to a particular number n. We directly give the following
definition.

Definition 8.35 Let a, b, n be integers. If n|(a − b), then we say that a and b are congruent
with respect to n. We also call it as a and b are congruent modulo n. We write down here
the standard notation which is a ≡ b mod n.

Remark 8.36 As n|(a − b), a = tn + b for t ∈ Z.

Example 8.37

21 ≡ 5 mod 8
21 ≡ 4 mod 17
21 ≡ 3 mod 9

We now state the following simple properties of congruence relation and prove some of
them.

Theorem 8.38 Let a, b, c and d be any integers. Let n be a positive integer. Then

(1) If a ≡ b mod n then b ≡ a mod n.


Proof: By a ≡ b mod n. We mean a = tn + b. That is (a − b) = tn and (b − a) =
(−t)n. So b ≡ a mod n.
(2) If a ≡ b mod n then b ≡ c mod n then a ≡ c mod n. That is the relation congruence is
transitive.
Proof is left as an exercise.
(3) If a ≡ b mod n then (a + c) ≡ (b + c) mod n.
Proof: By definition, a ≡ b mod n means a = tn + b. Now,

(a + c) = tn + (b + c)

which means (a + c) ≡ (b + c) mod n.


(4) If a ≡ b mod n then (a − c) ≡ (b − c) mod n.
Proof is left as an excercise.
122 8 Inclusion Exclusion Principle

(5) If a ≡ b mod n then ac ≡ bc mod n.


Proof: By definition a = tn + b. So ac = (tc)n + bc. So ac ≡ bc mod n.
(6) If a ≡ b mod n then c ≡ d mod n, then ac ≡ bd mod n.
Proof is left as an excercise.

Definition 8.39 Let m and n be two positive integers. The least common multiple m, n is
the smallest positive integer that is a multiple of both.

Notation 8.40 We denote lcm of m, n as lcm(m, n) or < m, n >.

Example 8.41 < 3, 9 >= 9, < 7, 6 >= 42.

Theorem 8.42 If a ≡ b mod n and a ≡ b mod m then a ≡ b mod (lcm(n, m)).

Proof Since a ≡ b mod n, a = tn + b and since a ≡ b mod m, a = tm + b. That is (a −


b) = tn, (a − b) = tm. That is lcm(n, m)|(a − b). Hence

a ≡ b mod (lcm(n, m)).

Now we can see that ‘≡’ relation is defined on set of numbers. It can be seen that it is an
equivalence relation. We now define what is called as residue classes.
Suppose that n is a number and a, b are two given integers. By writing a ≡ b mod n, we
mean a = tn + b, 0 ≤ b < n. We can call ‘b’ as residue of a when divided by n. Also it
may be that a ≡ 0 mod n, a ≡ 1 mod n, ..., a ≡ (n − 1) mod n.

Definition 8.43 A residue class modulo n is a set of integers such that every integer is
congrument to some b mod n for one b between 0 and (n − 1). We denote this class by [b].
Thus every integer belongs to one residue class and there will be ‘n’ residue classes
totally with respect to modulo n.

Example 8.44 The 5 residue classes of modulo 5 will be [0], [1], [2], [3] and [4]. Also
every integer in N belongs to exactly one residue class. So [0] ∪ [1] ∪ [2] ∪ [3] ∪ [4] =
N and [i] ∧ [ j] = φ, if i = j.
In general, the complete residue classes of modulo n are [0], [1], . . . , [n − 1].
Let a, b ∈ Z and n ∈ Z. We write a ≡ b mod n which means n|(a − b). That is (a − b) =
tn. By writing nZ. We mean the subsets of Z consisting of all multiples of n.

Definition 8.45 The set Z|nZ denotes the integer modulo n residue classes of the integer
n.
8.3 Derangements 123

Example 8.46

Z/2Z = {{... − 2, 0, 2, 4, ...},


{... − 3, −1, 1, 3, 5, 7, ...}}
Z/3Z = {{... − 3, 0, 3, 6, ...},
{... − 2, 1, 4, 7, ...}
{... − 1, 2, 5, 8, ...}}.

Definition 8.47 (1) By writing (a + nZ) +n (b + nZ) we mean it is equal to (a + b) + nZ.


(2) By writing (a + nZ) ×n (b + nZ) we mean (a × b) + nZ.

Example 8.48 (1 + 3Z) +3 (2 + 3Z) = (1 + 3 · t) + (2 + 3 · t ) for t, t being multiple of


3. So it is 3 + 3(t + t ). So (1 + 3Z) + (2 + 3Z) = 3 + 3(t + t ) = 3(t + t + 1). So it
belongs to 3Z. Similarly (1 + 3Z) ×n (2 + 3Z) = 2 + 3Z.

Euler’s φ Function

The function that counts the number of positive integers less than a given number n and
relatively prime to n is called the Euler’s φ function. It is denoted by φ(n). It can be shown
by the method of inclusion-exclusion that
    
1 1 1
φ(n) = n 1 − 1− ... 1 −
p1 p2 pt

where p1 , p2 , . . . , pt are the distinct prime divisors of n.

Example 8.49 φ(9) = 6 as the numbers 1, 2, 4, 5, 7, 8 are relatively prime to 9. So we


conclude that the number elements in a least residue system will be φ(n). We state the
following theorem without proof.

Theorem 8.50 If x1 , x2 , . . . , xφ(n) is a least residue system modulo n and if t and n are
relatively prime, then t x1 , t x2 , . . . , t xφ(n) is a least residue system modulo n.

8.3 Derangements

Derangement of a set is a permutation where no element occupies its original place. For
example the some derangements of the set {a, b, c, d} are {b, a, d, c}, {d, c, b, a} and so on.
The number of derangements of a set with n-elements is called the nth derangement
number or renontres number or the subfactorial of n. It is denoted by Dn or !n. One should
124 8 Inclusion Exclusion Principle

understand the expression x!y properly. If it is derangement, then it is x(!y). The !n satisfies
the recurrence

!n = n(!(n − 1)) + (−1)n


!n = (n − 1)(!(n − 1)+!(n − 2))

In general,

n
(−1)k
!n = n!
k!
k=0
For example,

3  
(−1)k 1 1 1 1
!3 = 3! =6 − + − =2
k! 1 1 2 6
k=0

n (−1)k
Theorem 8.51 For any integer n ≥ 0, (!n =)Dn = n! k=0 k! .

Proof This can be proved by the PIE. First (n!) gives the number of arrangements of the
n elements in all possible ways. From this one has to subtract the number of arrangements
in which each element appears in its original place. Hence the new count will be n! −
C(n, 1)(n − 1)!. Then in the next step, we must add back the number of permutations in
which each set of two elements stay in their original places, as we subtracted them twice.
Now the modified count will be

n! − C(n, 1)(n − 1)! + C(n, 2)(n − 2)!

The modification continues and alternate terms subtract and add to give the following.

n! − C(n, 1)(n − 1)! + C(n, 2)(n − 2)! + · · · + (−1)n (8.4)

Now
n!
C(n, k) =
k!(n − k)!
Equation (8.4) becomes

n! n! n!
n! − + − · · · + (−1)n
1!
 2! n! 
1 1 1
= n! 1 − + − · · · + (−1)n
1! 2! n!
n
(−1) k
= n! .
k!
k=0


8.4 Counting Combinations by PIE 125

Example 8.52 A meeting was attended by 10 people who left their shoes outside the meeting
hall. After the meeting ended the people came out and due to power failure could not identify
their respective shoes properly. When they went back home, none of them wore their own
shoes. Find the number of ways that this could happen.

Solution: The problem is clearly a derangement problem of a set of size n = 10. Hence the
direct answer will be  
1 1 1 1
!10 1 − + − + · · · − .
1 2! 3! 10!

8.4 Counting Combinations by PIE

Counting arrangements of n objects in a specified manner is a general problem in arrange-


ment. There may or may not be restrictions in such arrangements. But one can always
consider a specific arrangement where some elements occur only in certain positions.
Suppose the numbers {1, 2, 3, . . . , n} are to be permutated, what we get an assignment
of the numbers 1, 2, . . . , n to positions 1, 2, . . . , n such that each number is assigned one
position between 1 and n. For example for the numbers 1, 2, 3, 4 one permutation will be 4
1 2 3. It means the number 4 is given the first position, the number 1 is given the second
position, and so on. There is no restriction here on the arrangement. Clearly the number of
permutations will be n!.
Let us consider a generalisation of the above situation. Let A1 , A2 , . . . , An be the subsets
of S = {1, 2, . . . , n} where each |Ai | ≥ 0, 1 ≤ i ≤ n and Ai ∩ A j = ∅. Consider permuta-
tions a1 a2 . . . an of the set S such that ai is not in Ai . That is ai can be any number in Ai .
Let A be the set of all such permutations. The problem is to find |A|.

Example 8.53 Let S = {1, 2, 3, 4, 5} and A1 = {1}, A2 = {2, 3}, A3 = {3, 4}, A4 = {4},
A5 = {1, 5}. Here
  
 a1 = 1, a3 = 3, 4, a5 = 5

A = a1 a2 a3 a4 a5 
a2 = 2, 3, a4 = 4,

Some permutations are


2 1 5 3 4, 3 4 1 5 2, 4 5 2 3 1.
126 8 Inclusion Exclusion Principle

Example 8.54 Let S = {1, 2, 3, 4, 5, 6} and

A1 = {1, 2, 3, 4}
A2 = {2, 3, 4, 5}
A3 = {3, 4, 5, 6}
A4 = {4, 5, 6, 1}
A5 = {5, 6, 1, 2}
A6 = {6, 1, 2, 3}

We now draw a grid of size 6 × 6 as below. In the grid the symbol ‘∗’ indicates ‘not to be
used’ and ‘blank’ indicates ‘can be selected’.

Table 8.1 6 × 6 grid


A1 A2 A3 A4 A5 A6
1 ∗ ∗ ∗ ∗
2 ∗ ∗ ∗ ∗
3 ∗ ∗ ∗ ∗
4 ∗ ∗ ∗ ∗
5 ∗ ∗ ∗ ∗
6 ∗ ∗ ∗ ∗

Clearly in forming a1 a2 a3 a4 a5 a6 , a1 ∈ {5, 6}, a2 ∈ {1, 6}, a3 ∈ {1, 2}, a4 ∈ {2, 3}, a5 ∈
{3, 4}, a6 ∈ {4, 5}, with a condition each number is chosen only once against a position. So
the permutations are
6 1 2 3 4 5, 5 6 1 2 3 4.

We use the principle of inclusion-exclusion for counting the above event which is
explained in the next section.

8.5 Rook Polynomials

Consider a m × m grid of squares. Let the rows be numbered from 1 to m in a top down
way. Columns are numbered from left to right as 1, 2, . . . , m. We defined a board B to be a
subset of this m × m grid. The problem is to understand how to place k non-attacking rooks
in B . By non-attacking rooks we mean no two rooks should share a row or column. If k = 0,
we understand that there is only way of placing k(= 0) rooks in B . Let us understand the
way of placing k non-attacking rooks in a board B . That is, if sk denotes the number of ways
of placing exactly ‘k’ non-attacking rooks in a board B , then we can write
8.5 Rook Polynomials 127


gB (x) = sk x k (8.5)
k∈[n]

and this polynomial gB (x) is defined for any board B of size n × n, 1 ≤ n ≤ m.


The subproblem of placing k non-attacking rooks in a board B is to be understood
carefully.
Let us now go back to our problem of forming permutations with forbidden positions.
Refer Table 8.1. The ∗ positions indicate the ‘not-to-be-used’ indices in forming permuta-
tions on the input set S. Also the problem was to count the possible permutations of the
elements of S with the forbidden set condition. We use the method of inclusion-exclusion
for this counting.
We already know what is derangement. We also saw permutations with forbidden sets.
For any permutation a1 a2 . . . an of set S = {1, 2, . . . , n}, one can associate placement of
non-attacking rooks in a n × n grid. That is we say the rook positions are (1, a1 ), (2, a2 ),
. . . , (n, an ) i.e., (i, ai ) corresponds to the position i th row aith column in the grid. So the
forbidden set A1 for each i corresponds to the squares on the grid where the non-attacking
rooks cannot be put. For example, consider the example of the previous section. The 5 × 5
grid with the forbidden subsets A1 , A2 , A3 , A4 and A5 is drawn as below

A1 A2 A3 A4 A5
1 ∗ ∗
2 ∗
3 ∗ ∗
4 ∗ ∗
5 ∗

∗ indicates forbidden positions. For each set A j , we say that a set B j corresponds to the
placement of a rook in the jth column which contains a ‘∗’, that is the column position is
indicated by A j . So, A j indicates the set of squares in the jth column that are not marked
with ‘∗’. This description is for all j, 1 ≤ j ≤ n.
Hence if F(A1 , A2 , . . . , An ) denote the set of all permutations of S with A1 , A2 , . . . , An
as forbidden sets, then
|F| = |B 1 ∩ B 2 · · · ∩ B n |
Using the principle of inclusion exclusion we can write

|B 1 ∩ B 2 ∩ · · · ∩ B n |
 
= n! − |Bi | + |Bi ∩ B j | − · · · + (−1)n |B 1 ∩ B 2 ∩ · · · ∩ B n |
128 8 Inclusion Exclusion Principle

Here |Bi | stands for the number of ways to place n non-attacking rooks in row i in the
positions (i, ti ) where ti ∈ Ai . It can be done in |Ai | ways. Rest of the rooks are sent to
remaining (n − 1) positions in a non-attacking manner. Hence

|Bi | = |Ai |(n − 1)!, 1 ≤ i ≤ n.

Let  
 n 
 
|s1 | =  Ai 
 
i=1
and 
|Bi | = s1 (n − 1)!
|Bi ∩ B j | corresponds to the number of ways to place n non attacking rows where rook in row
i and rook in row j occupy the ‘∗ed’ location indicated by the sets Bi and B j respectively.
Remaining (n − 2) rooks can be placed in (n − 2)! ways in a non-attacking fashion. Hence

|Bi ∩ B j | = s2 (n − 2)!

where ‘s2 ’ indicates the number of ways of placing two non-attacking rooks on the ∗ed
positions indicated by Bi and B j , 1 ≤ i, j ≤ n. In general

|Bi1 ∩ Bi2 · · · ∩ Bit | = st (n − t)!

for i k ∈ {1, 2, . . . , n} and 1 ≤ t ≤ n. We state the following result which counts the number
of ways of placing n non attacking rooks in a n × n grid.

Theorem 8.55 The number of ways of placing n non-attacking rooks in a n × n grid with
forbidden grid positions is given by

n! − s1 (n − 1)! + s2 (n − 2)! − · · · + (−1)n sn .

This is the count of number of permutations of S with the forbidden sets A1 , A2 , . . . , An .

Let B is a grid of size n × n. We now marked on B with ∗’s indicating forbidden sets
A1 , A2 , . . . , An . Suppose st (B ) denote the number of ways of placing ‘t’ non attacking
rooks on B . Here t will vary from 1 to n. We understand the calculation of st (B ) through
different subsets of B . Each of this subset will be a bound by itself.
Two subsets B1 and B2 of B are said to be disjoint if they do not share any squares on B .
Consider

gB (x) = s0 + s1 x + s2 x 2 + . . . (8.6)
8.5 Rook Polynomials 129

This gB (x) is called the rooks polynomial. Here ‘sk ’ stands for placing k-rooks on B . Suppose
B has some ‘∗’s marked on it. One can consider B to contain subsets with ‘∗’s and those
without ‘∗’s. Let B1 , B2 , . . . , B be the subsets of B with ‘∗’s on them. Then sk (Bi ) denotes
the number of ways of placing ‘k’ rooks on Bi in a non-attacking way. So we can write a
polynomial g Bi (x) as in equation (8.6) for every i, 1 ≤ i ≤ m. Then their product gives the
required rooks polynomial for the board B .
Exercise

1. Let there be 15 chairs for 15 students in a hall where a lecture is delivered. Find the
number of the students sit in the chair in which they did not sit in the previous class.
2. Find the number of derangements of the integers 10–20 both inclusive such that

(1) 10, 11, 12, 13, 14 are in a derangement


(2) 15–20 are in derangement

3. 20 students in a class are given a class test. The teacher collects the answer papers,
corrects and distributes back the papers one to each so that none of them get their own
paper. In how many ways it can happen?
4. Find the rooks polynomial for the following boards.

∗ ∗
∗∗
∗ ∗ ∗

(a) (b) ∗ ∗
∗∗
∗ ∗
∗∗

5. Find the number of ways of rearranging the symbols in the word FCBBCF so that no
symbol appear in its original position.
6. Find the number of permutations of {1, 2, . . . , 7} in which atleast one even integer in
its natural position.
7. Find the number of words of English alphabet that do not contain the sequence words
‘DULA’, ‘PART’ and ‘TABLE’ in them. The words are constructed using all 26 letters
exactly once.
8. Find the positive integers which are less than 150 which are relatively prime to 150.
9. A box contains 20 red balls, 20 blue balls, 20 green balls and 20 orange balls. You are
allowed to draw one ball in every minute. How long will it take to ensure that you have
atleast 12 balls of same color drawn by you?
10. Find the number of positive integers less than or equal to 500 that are not divisible by
any of the following numbers {3, 6, 25}.
11. Find the number of ‘onto’ functions from a set {a, b, c} to itself.
Partial Order and Lattices
9

9.1 Partial Order Relation

We have seen what a set is and how to handle the elements of a set. For example in the chapter
on ‘Algebraic structures’ we saw how to look for some structure among the elements of the
set. Throughout we had the definition of binary operations defined between any two elements
of the set. Also looked at relating the elements as ‘x Ry’ which means x and y are related
by a relation R. The relation R was looked at, from the following three aspects.

(i) R being reflexive


(ii) R being symmetric
(iii) R being transitive

Then we went on to define an equivalence relation R. Logically we can write down the
expression as follows:

x Ry : x and y are related by R.


¬(x Ry) : x and y are not related.
x Rx : x is related to x.
It means R is reflexive.
∼ (x Rx) : R is irreflexive.
x Ry Rz : R is transitive.
(x Ry) ∧ (y Rx) : symmetric.
(x Ry) ∧ (y Rx) ⇒ x = y : Antisymmetric

© Ane Books Pvt. Ltd. 2025 131


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_9
132 9 Partial Order and Lattices

Definition 9.1 Let (S, ≤) be a set with the binary relation ≤. If the following conditions
are satisfied, then (S, ≤) is said to be a partially ordered set or poset (in short).

(i) ∀x ∈ S, x ≤ x (reflexive).
(ii) (x ≤ y) ∧ (y ≤ x) ⇒ x = y (Antisymmetry).
(iii) (x ≤ y) ∧ (y ≤ z) ⇒ x ≤ z (Transitivity).

The relation ‘≤’ is either read as ‘less than or equal to’ or ‘x is included in y’. The relation
‘≤’ is properly called as order relation.

Remark 9.2 (i) The relation ‘inclusion’ or ‘less than’ need not be defined for each pair of
elements x, y ∈ S.
(ii) The statement ¬(x ≤ y) does not imply x > y.

Example 9.3 Let S be a set and P(S) be the power set of S. Consider (P(S), ⊆). Here
A ⊆ B, A, B ∈ P(S) means that the subset A is included as a subset of B which may or
may not be proper. (P(S), ⊆) is a poset.

Example 9.4 Let (P(S), ⊂) be the given set P(S), with a ‘ pr oper ’ inclusion between two
sets A and B. Is (P(S), ⊂) a poset? Note that there is no set S such that S ⊂ S .

Remark 9.5 The reader is advised to refer the topic ‘well-ordering’ of a set and axiom of
choice.

Example 9.6 Consider (R, ≤). This is both partially ordered and totally ordered set.

Definition 9.7 A totally ordered set is called as a chain. So, in a chain (S, ≤), for any two
elements x, y ∈ S, either x ≤ y or y ≤ x.

Example 9.8 (R, ≤) is a chain, ≤ is usual ‘less than or equal to’.

Remark 9.9 In a poset (S, ≤), any two elements x, y ∈ S, are either comparable like, either
x ≤ y or y ≤ x, or they are incomparable.

Notation:

(i) For two elements x and y that are comparable, we denote it by x ∼ y


(ii) For two elements x, y that are not comparable, we denote by ¬(x ∼ y).
9.2 Hasse Diagrams 133

9.2 Hasse Diagrams

A poset can be diagramatically represented using the methods of graph theory. Each element
of the poset will be a vertex of the graph and the edges and paths are defined in such a way
that there is a 1–1 correspondence between the representation of the poset as a graph and
the poset. That is from the graph, writing down the poset description can be done uniquely.

Definition 9.10 Let (S, ≤) be a poset. If for any two elements x, y ∈ S, x ≤ y and there
is no z ∈ S such that x ≤ z ≤ y, then we say that x is covered by y in S and is denoted by
x  y.

In x  y, y is also called the upper bound for x. In a Hasse diagram, there will be an edge
between two vertices x and y if x  y. The vertex ‘x’ is plotted below the vertex ‘y’. So, by
x ≤ y, we mean one can traverse from x to y via edges in the upward direction. However,
the Hasse diagram is not a directed graph (Figs. 9.1, 9.2 and 9.3).

Fig. 9.1 Hasse diagram

Fig. 9.2 Another Hasse


diagram

Fig. 9.3 Not a chain


134 9 Partial Order and Lattices

Fig. 9.4 Power set

Example 9.11 (Hasse diagrams)


(a)
(b) (S, ≤) is a poset which is totally unordered or an anti-chain, where
S = {x1 , x2 , . . . , x5 }.
(c) ((x1 , x2 , y1 , y2 ), ≤) where x2 ≤ y1 , x1 ≤ y1 , x1 ≤ y2 , x2 ≤ y2 . It is not a chain (Why?)
(d) This is the Hasse diagram corresponding to a (P(S), ⊆) where S = {a, b, c}. It is not a
chain. Here A1 = φ, A2 , A3 , A4 are 1-element subsets A5 , A6 , A7 are 2-element subsets.
Definition 9.12 Two posets (S, ≤) and (T , ≤ ) having the same Hasse diagram are said to
be isomorphic.

Definition 9.13 Let S be a set. If in S, for any two elements x and y if x ≤ y, we say that
x is contained in y or x is less than or equal to y. We can also say that either ‘y contains x’
or y is greater than or equal to x. This is known as ‘duality principle’ in lattice theory. We
call ‘≤’ as dual of ‘≥’. If (S, ≤) is a poset, then (S, ≥) is also a poset.

It is clear that a poset has some ordering of elements of a set, using a binary relation.
Also the following facts are realizable ones.
Fact 1: Any poset (S, ≤) has an element e such that e ≤ x, ∀ x ∈ S, then e is called the least
or null element of S.

Remark 9.14 A poset may or may not contain e. Figure ??c above, this lattice has no e.
However, if it is there then it must be unique.

Fact 2: Any poset, we can define an element ‘F’ such that for all x ∈ S, x ≤ F. F is called
the full or universal element and if S has one, then it is unique.

Definition 9.15 Let S̃ be a subset of S where (S, ≤) is a poset. We now define least upper
bound (l.u.b) and greatest lower bound (g.l.b) for S̃ in S
9.2 Hasse Diagrams 135

(i) An element x ∈ S such that y ≤ x for all y ∈ S̃, then x is said to be an upper bound for
S̃. x is said to be l.u.b if there does not exist an element x ( = x) in S such that x ≤ x
and x is an upper bound of S̃.
(ii) An element being a greatest lower bound of S̃ can be identically defined.

Remark 9.16 The g.l.b and l.u.b are computed from the binary relation defined on the set.
The l.u.b may or may not belong to S̃.

Next we define what are known as minimal and maximal elements of a poset (S, ≤).
An element σ is said to be a minimal element of a poset (S, ≤) if ∀ x ∈ S, σ ≤ x ⇒
σ = x.
An element τ is said to be a maximal element of (S, ≤) if ∀ x ∈ S τ ≤ x ⇒ τ = x.

Example 9.17 (i) We know (Z, ≤) is totally ordered but does not have a maximal element.
(ii) If S = {a, b, c} then we know (P(S), ⊆) is a poset. The maximal element is ‘S’ itself
and the minimal element is ‘φ’.
(iii) This poset has two minimal and two maximal elements.

We know that a chain is totally ordered. Any totally ordered S with a property that every
nonempty subset of S has a minimal element is called well ordered.

Example 9.18 (Z, ≤) is not well ordered as it has no minimal element.

Fact: All finite totally ordered sets are well ordered.

Example 9.19 Let S = {a}. S ∗ is the set of strings {λ, a, aa, aaa, · · · } where λ is the empty
string and minimal (S ∗ , lx) is well ordered where ‘lx’ is the lexicographic ordering. The
strings on any subset of S ∗ can be arranged in the increasing order of their length. Hence
every subset of S ∗ is totally ordered and has a minimal string.

Well ordering principle is one by which every set can be well ordered. And also assume
that every chain in S has an upper bound. That is let S be the set. If S = φ, then there is
a c0 ∈ S. c0 is maximal then, {c0 } is well-ordered, otherwise we can build a chain from c0
as c0 < c1 < c2 . . . . This chain will eliminate the maximal element. Then it has a upper
bound say t0 . We already saw this t0 need not be in the set {c0 , c1 , c2 , · · · }. From t0 , build
a new chain recursively as t0 , t1 , t2 , . . . and this chain will reach a maximal element say s0 .
Continue building chains of the set S. We hope to reach through every element of S by this
process. If there is a C̄ which goes on and on without an upper bound, then for all x ∈ S,
there is an element on the chain say ‘ p’ so that ‘x and p’ are incomparable. But this cannot
happen as C̄ must have upper bound (say) P̄ so that ∀ x ∈ C̄, x ≤ P̄. Hence a chain cannot
136 9 Partial Order and Lattices

continue without an upper bound. Hence the elements of ‘S’ can be well-ordered. We now
state Zorn’s lemma without proof.

Lemma 9.20 (Zorn’s lemma) Let S be non empty poset such that every chain C in S has
an upper bound in S. Then S has a maximal element.

Remark 9.21 (i) A proof of Zorn’s lemma will be to show that well-ordering principle and
Zorn’s lemma are equivalent. We already discussed how well-ordering takes care of the
maximal element.
(ii) The proof of Zorn’s lemma can be given using compactness theorem of K. Gödel which
says that ‘A set of well formed formula is satisfiable’ if and only if it is finitely satisfiable.

9.3 Lattices

In the earlier section, we saw several interesting aspects of partially ordered sets. It will
be interesting to observe that posets are endowed with some more structures which arise
naturally in algebra. This is due to the fact that in a poset, we already have a binary relation,
we denote this in posets generally as ‘≤’ which we denoted as ∗ in groups. So we now
briefly see how to look at a poset with special properties as a semi group.
Let (S, ∗) be an idempotent semigroup where for all a, b, c ∈ S

(i) a ∗ a = a
(ii) a ∗ b = b ∗ a
(iii) a ∗ (b ∗ c) = (a ∗ b) ∗ c

That is ‘∗’ with ≤ has the following transformation.

(i) a ∗ a = a means a ≤ a (symmetry).


(ii) a ∗ b = b ∗ a means a = a ≤ b = b ≤ a = b (irreflexive).
(iii) a ∗ (b ∗ c) = (a ∗ b) ∗ c means a ≤ (b ≤ c) = (a ≤ b) ≤ c. So a ≤ b and b ≤ c
means a ≤ c (transitive).

Remark 9.22 So a semilattice is one in which every pair of elements {x, y} are incompa-
rable.

Definition 9.23 (i) For any two elements {x, y}, the l.u.b{x, y} is called the join of x and
y and it is denoted by x ∨ y.
(ii) For any two elements {x, y}, the g.l.b{x, y} is called the meet of x and y and it is denoted
by x ∧ y.
9.3 Lattices 137

Example 9.24 (i) In any chain any pair of elements have both meet and join.
(ii) The following posets are on which either have a meet or a join, but not both.

Definition 9.25 A lattice (S, ∨, ∧) is a nonempty set L where every pair of elements x and
y has both meet and join in S and satisfying following conditions on ∨ and ∧.

(i) ∀ x, y, z ∈ S, x ∨ (y ∨ z) = (x ∨ y) ∨ z, x ∧ (y ∧ z) = (x ∧ y) ∧ z. These are known


as associativity w.r.to ∨ and ∧.
(ii) ∀ x, y ∈ S, x ∨ y = y ∨ x and x ∧ y = y ∧ x. These are known as commutative w.r.to
∨ and ∧.
(iii) ∀ x, y, z ∈ S, x ∨ (x ∧ y) = x and x ∧ (x ∨ y) = x. These are known as absorption
laws.

Remark 9.26 Basically the set S defined above is a poset in which every pair of elements
has a g.l.b and l.u.b in S (Figs. 9.5 and 9.6).

Example 9.27 1. Consider the Hasse diagram in Fig. 9.7.


It is a lattice.
2. Figure 9.8 is not a lattice as the pair (x2 , x6 ) has three upper bounds x3 , x4 , x5 but no
l.u.b.
Example 9.28 Let S be a set. Let P(S) be the power set of S. Define for any two elements
A, B ∈ P(S), A ∧ B = A ∩ B and A ∨ B = A ∪ B. Then (P(S), ∨, ∧) is a lattice.
For example if S = {a, b, c} refer Fig. 9.4 which is a lattice with φ as the least and S as
the greatest element of the lattice (P(S), ∨, ∧) (Fig. 9.9).

The following is a simple direct property of a lattice.

Proposition 9.29 (i) Let (S, ≤) be a poset in which every pair of elements x, y has g.l.b
and l.u.b. Then (x ≤ y iff x ∨ y = y)] and (x ≤ y iff x ∧ y = x). These are called laws
of consistency.

Fig. 9.5 A poset


138 9 Partial Order and Lattices

Fig. 9.6 Poset example

Fig. 9.7 A lattice

Fig. 9.8 Not a lattice

Fig. 9.9 Bounded lattice

(ii) Conversely let (S, ∨, ∧) be a lattice. Define for every pair x, y ∈ S, x ≤ y iff x ∨ y = y
(or) x ≤ y iff x ∧ y = x. Then (S, ≤) will be a poset.
9.3 Lattices 139

9.3.1 Bounded Lattices

A lattice (S, ∨, ∧) is said to be bounded below if there is an element e ∈ S such that e ∧ x = e


and e ∨ x = x ∀ x ∈ S. Here ‘e’ is called the lower bound. A lattice (S, ∨, ∧) is said to be
bounded above if there is an element u ∈ S such that u ∧ x = x and u ∨ x = u ∀ x ∈ S.
Then ‘u’ is called the upper bound. A bounded lattice is one which is both bounded above
and below.

Example 9.30 (i) (P(S), ∨, ∧) in Example 9.28 is a bounded lattice.


(ii) ([0, 1], ∨, ∧) such that x, y ∈ [0, 1], x ∨ y = y, x ∧ y = x is a bounded lattice.
(iii) ((0, 1), ∨, ∧) is an unbounded lattice.

Example 9.31 The lattice given below by means of Hasse diagram is bounded

9.3.2 Modular and Distributive Lattices

We have a simple lemma below which motivates to define a distributive lattice.

Lemma 9.32 In any lattice (S, ∨, ∧), we have x ∧ (y ∨ z) ≥ (x ∧ y) ∨ (x ∧ z) for x, y, z ∈


S.

Proof For x, y, z ∈ Z,
x ∧ (y ∨ z) ≥ x ∧ y
(9.1)
x ∧ (y ∨ z) ≥ x ∧ z
Combining the above two equation, we get

x ∧ (y ∨ z) ≥ (x ∧ y) ∨ (x ∧ z)


Example 9.33 Consider the Hasse diagram in Fig. 9.10. Here 2 ∧ (3 ∨ 4) ≥ (2 ∧ 3) ∨ (2 ∧
4).

Definition 9.34 A lattice (S, ∨, ∧) is modular for all x, y, z ∈ S, x ≥ z imply x ∧ (y ∨


z) = (x ∧ y) ∨ z.

Example 9.35 Consider the following lattice. This lattice is not modular because,

2 ∧ (3 ∨ 5) = 2 ∧ 1 = 2
(9.2)
(2 ∧ 3) ∨ 5 = 3 ∨ 5 = 1
140 9 Partial Order and Lattices

Fig. 9.10 A lattice 5

2 3 4

Lemma 9.36 Let (S, ∨, ∧) be a lattice. For x, y, z ∈ S, for all x ≥ z, x ∧ (y ∨ z) ≥ (x ∧


y) ∨ z.

Proof Since x ≥ z, x ∧ z = x. Hence from the previous lemma the result follows. 

Definition 9.37 Let (S, ∨, ∧) be a lattice. It is said to be distributive if for all x, y, z ∈ S,


x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧ z).

Theorem 9.38 Every distributive lattice is modular.

Proof Since the given lattice is distributive we have ∀x, y, z x ∧ (y ∨ z) = (x ∧ y) ∨ (x ∧


z). If x ≥ z ⇒ x ∧ (y ∨ z) = (x ∧ y) ∨ z. Hence the lattice is modular (Figs. 9.11, 9.13,
9.14, 9.15, 9.16, 9.17, 9.18, 9.19, 9.20 and 9.21). 

Remark 9.39 The converse of the above theorem is in general not true.

Fig. 9.11 Not a modular lattice 1

3 5

4
9.4 Basic Results 141

Fig. 9.12 Modular lattice 5

2 3 4

Fig. 9.13 Complete lattice

Fig. 9.14 A lattice

Example 9.40 Consider the lattice given in Fig. 9.12.


This lattice is not distributive, but it is modular.

9.4 Basic Results

Definition 9.41 A lattice (S, ∨, ∧) is said to be a complete lattice if any subset of S has glb
and lub.

Remark 9.42 By Zorn’s lemma, a complete lattice must have a unique least and greatest
element. Let us denote them by ‘e’ and ‘u’ respectively.
142 9 Partial Order and Lattices

Fig. 9.15 Dual lattice

Fig. 9.16 A poset 30

15 6

3
5 2

Fig. 9.17 A poset 0

1 1

−1 −1 −1

Fig. 9.18 A Hasse diagram 5

2 3 4

1
9.4 Basic Results 143

Fig. 9.19 A Hasse diagram 1

9
4
8
5
6
7

Fig. 9.20 A Hasse diagram


9 10

6 8
5

3
2 4

Fig. 9.21 A Hasse diagram


9

6 8
7
5
4
2 3

1
144 9 Partial Order and Lattices

Example 9.43 The lattice (P(S), ∨, ∧) where P(S) is the power set of a finite set S and ∨
and ∧ are as defined in Example 9.28.

Proposition 9.44 Let (S, ≤) be a poset. If S has greatest element ‘u’ and if every nonempty
subset S̃ of S also has glb in S, then (S, ∨, ∧) with usual ‘∨’ and ‘∧’ definition is a complete
lattice.

Remark 9.45 The proposition holds true for least element also.

We now look for some simple properties of complete lattices.

Example 9.46 Let (S, ∧, ∨) be a lattice with N̄ = N ∪ {0}. Then (S, ≤) is a poset and
(S, ∨, ∧) is complete with ‘0’ as the lower bound. Note that (S, ≤) is also a bounded lattice.

Example 9.47 Consider the following lattice L = {x1 , x2 , x3 , x4 , x5 , x6 , x7 } where the


operations ∧ and ∨ are given by the following Cayley table.

∨ x1 x2 x3 x4 x5 x6 x7
x1 x1 x1 x1 x1 x1 x1 x1
x2 x1 x2 x1 x2 x2 x1 x2
x3 x1 x1 x3 x1 x3 x3 x3
x4 x1 x2 x1 x4 x2 x1 x4
x5 x1 x2 x3 x2 x5 x3 x5
x6 x1 x1 x3 x1 x3 x6 x6
x7 x1 x2 x3 x4 x5 x6 x7

∧ x1 x2 x3 x4 x5 x6 x7
x1 x1 x2 x3 x4 x5 x6 x7
x2 x2 x2 x5 x4 x5 x7 x7
x3 x3 x5 x3 x7 x5 x6 x7
x4 x4 x4 x7 x4 x7 x7 x7
x5 x5 x5 x5 x7 x5 x7 x7
x6 x6 x7 x6 x7 x7 x6 x7
x7 x7 x7 x7 x7 x7 x7 x7
9.4 Basic Results 145

The corresponding Hasse diagram will be


This is a complete lattice which is finite. The binary relations are x2 ≤ x1 , x3 ≤ x1 ,
x5 ≤ x2 , x5 ≤ x3 , x4 ≤ x2 , x7 ≤ {x4 , x5 , x6 }.

We state the following theorem which will be useful for us to define what are known as
‘dual’ lattices.

Theorem 9.48 Let (S, ∨, ∧) be a lattice where (S, ≤) is the corresponding poset. For any
two elements x, y ∈ S. We have the following statements being equivalent

(i) x ≤ y
(ii) x ∧ y = x
(iii) x ∨ y = y.

Proof Follows directly from the definitions of ≤, ∧, ∨. 

Definition 9.49 Let (S, ∨, ∧) be a lattice. Consider the corresponding poset (S, ≤). ‘≤’
satisfies the following property: for any x, y ∈ S, x ≤ y iff x ∧ y = x.

Remark 9.50 (i) We have seen in the previous theorem that x ≤ y is also equivalent to
x ∨ y = y.
(ii) ≤ is antisymmetric iff x ≤ y and y ≤ x imply x = y iff x ∧ y = x and x ∧ y = y
imply x = y.
(iii) ≤ is transitive iff x ≤ y and y ≤ z imply x ≤ z iff x ∧ y = x and y ∧ z = y imply
(x ∧ y) ∧ z = x ∧ z and x ∧ (y ∧ z) = (x ∧ y). It means (x ∧ z) = x.

The points given in the above remark also imply that ∧ and ∨ are both commutative and
associative. If in any formula involving elements of S and ∨, ∧ if we replace ∨ by ∧ and ∧
by ∨ we get a new expression involving elements of S, which evaluate new bounds for the
variables in the formula. Hence we can define duality in lattices.
In (S, ≥) we have ∨ and ∧ defined as follows. For x, y ∈ S, if x ∨ y = c, x ∧ y = d,
then in dual lattice (S, ∨ , ∧ ) x ∨ y = d, x ∧ y = c. So if F is a valid expression involving
elements of S, ∧ and ∨ then its dual F is obtained by replacing in F every ∧ by ∨ and every
∨ by ∧. Recall that we have defined earlier in Logic, what are ‘well-formed formulas’ and
their negations.

Definition 9.51 Let (S, ∨, ∧) be a lattice and let (S, ≤) be the corresponding poset. The
lattice (S, ∨ , ∧ ) corresponding to the poset (S, ≥) is called the dual lattice.

Example 9.52 Consider the lattice described by the following Hasse diagram.
Its dual will be
146 9 Partial Order and Lattices

Example 9.53 Find the dual of the lattice given in Example 9.47.

We state the following theorem without proof.

Theorem 9.54 The dual of every complete lattice is complete in which the glb and lub are
reversed.

9.5 Mobius Inversion

Let n be a positive integer and consider the set S = {1, 2, . . . , n}. 2 S denotes the power set
of S and we say for two subsets A, B of S, A ⊆ B if A is a subset of B. It is not difficult to
see (2 S , ⊆) is a poset. Define a real-valued function

f : 2 S → R.

For any poset (A, ≤) and functions f , g defined from A to R,



if f (x) = g(x), then
y≤x

the problem now is to find g using f .


For example, let f : 2 S → R, such that

f (A) = g(T ) (9.3)
T ⊆A

where A is a subset of S. Now the problem is to find g in terms of f . It is a type of inversion


and Mobius inversion will help to find a solution.
We have some definitions that are useful in understanding Mobius inversion.

Definition 9.55 Let (A, ≤) be a poset. Then an incidence algebra of this poset is the set

I (A) = { f : A × A → R/ f (x1 , x2 ) = 0 unless x1 ≤ x2 }

Note that f maps pairs (x1 , x2 ) to R. Here x1 , x2 ∈ A.


I (A) is closed under scalar multiplication. That is if α ∈ I (A), then cα ∈ I (A), where ‘c’
is a scalar. Also I (A) is closed under addition 
and multiplication. Here for any f , g ∈ I (A),
multiplication as defined to be f g(x, y) = f (x1 , z)g(z, y2 ).
x1 ≤z≤x2
For x1 , x2 ∈ A,
9.5 Mobius Inversion 147

e(x1 , x2 ) = 1 for x1 = x2
= 0 for x1 = x2

we can call ‘e’ to be the multiplicative identity.

Definition 9.56 The function given by



1 if x1 ≤ x2
ζ (x1 , x2 ) =
0 if x1  x2

is called the zeta function.


Clearly ζ belongs to the incidence algebra of a poset (A, ≤).

Mobius Function: A function μ in I (A) defined as below is called the Mobius function.

μ(x1 , x2 ) = 1 if x1 = x2
= 0 if x1 < x2

=− μ(x1 , s)
x1 ≤s<x2

Remark 9.57 Consider

μζ (x1 , x2 ) = μ(x1 , x2 )ζ (x1 , x2 )



1 for x1 = x2
=
0 otherwise
= e(x1 , x2 )

Proposition 9.58 A function f ∈ I (A) is invertible if and only if f (x, x) = 0 for all x ∈ A.

Remark 9.59 The inverse of ζ is μ.

Example 9.60 Consider the number n = 30. Its divisors are 1, 2, 3, 5, 6, 10, 15 and 30.
One can draw a Hasse diagram for the divisors of 30 as below.
For the diagram, we mark the calculation of μ(x, y) as below. Here ‘1’ is chosen to be
the least element of the poset.

Example 9.61 Let A and B be two subsets of S = {1, 2, . . . , n}. We note that (2 S , ⊆) is a
poset. Then
148 9 Partial Order and Lattices

μ(A, B) = (−1)|B|−|A| if A ⊆ B
=0 A  B.

Solution: Consider A = ∅. Then μ(∅, B) = (−1)|B| . This can be proved by induction on


|B|. If |B| = 0, then it is trivially true as ∅ is the least element of (2 S , ⊆). Assume the
result to be true for |B| = k elements. Then |∅ − B| = |B| and for every subset C ⊆ B,
μ(∅, C) = (−1)|C| . Consider

μ(∅, B) = − μ(∅, C)
C⊂B

=− (−1)|c|
C⊂B
|B|
= (−1)

By replacing ∅ by any set A, it can be shown that

μ(A, B) = (−1)|B|−|A| if A ⊆ B
= 0 otherwise

Inclusion-Exclusion formula can be obtained using Mobius inversion.


Let S1 , S2 , . . . , Sn be subsets of a finite set S. Define f (A) to be the number of elements
of S that belong to sets Si such that i is forbidden index. The forbidden index set is A ⊂
{1, 2, . . . , n}. That is for any element x ∈ S, x is counted by f with a conclusion that x ∈ / Si
for every i ∈ A. Clearly x ∈ S j for every j ∈ / A. Then the function

g(A) = f (C)
C⊆A

enumerates the elements of S satisfying the above condition. That is



f (A) = (−1)|A|−|C| g(C)
C⊆A

So the count of S̄1 ∩ S̄2 · · · ∩ S̄n will be



| S̄1 ∩ S̄2 · · · ∩ S̄n | = (−1)n−|C| g(C)
C∈2 S

= (−1)|C̄| g(C̄)
C̄∈2 S
 
 
  
= (−1)|C̄|  Si 
C̄∈2 S
i∈C̄ 

This is equivalent to the inclusion-exclusion formula given in ??.


9.5 Mobius Inversion 149

Exercise

1. Show that the following sets are posets.

(a) (N+ , × f ) where x × f y means x and y have a common factor.


(b) (R, ≤), ≤ has the usual arithmetic meaning.
(c) (A, ≤) where A is the set of people in a city where x ≤ y means x and y are the same
person or x is related to y.

2. Let S = {1, 2, 3, 4, 5, 6, 8, 9, 12, 15, 18}. Let ÷ be the binary relation such that x ÷ y
means x divides y. Show that (S, ÷) is a poset. Draw its Hasse diagram. Write down
all its subsets which are ‘chains’.
3. Let Dn = {m | m is a divisor of n}. Show that (D16 , ≤) where for d, d̄ ∈ D16 , d ≤ d̄
means d is a divisor of d̄, is a poset. Draw its Hasse diagram.
4. Draw the Hasse diagram for the poset S = {a, b, c, d, e, f , g, h} with

(a) a < b, a < d, b < e, c < e, f < g, d < g, d < h, e < a, e < g.
(b) a < c, c < e, e < g, b < d, d < f , f < h.

5. Draw all the posets of a set with 4 elements which are non-isomorphic.
6. Let S = {1, 2, 3, 4}. Show that P(S) is a poset. Identify the minimal and maximal
elements of the subset {1, 3}.
7. Let there be three distinct balls to be distributed in three boxes. Enumerate all possible
distributions by indicating only the nonempty boxes. Take this set and define an ordering,
so that the following Hasse diagram is reached.
8. Extract the maximal and minimal chains from the following Hasse diagram.
Define length of a finite chain C to be l(C) = |C| − 1 and rank of a finite poset S to
be, r (S) = max{|C| − 1 | C is a chain }. Find l(c) and r (S) for the above poset.
9. Find the glb and lub of {2, 3, 4}, {3, 5, 6}, {1, 3, 5, 7}, {9, 10} in the following Hasse
diagram.
10. Check whether the following Hasse diagram form a lattice or not. Justify your answer.
11. Given T = T1 × T2 of two posets (T1 , ≤) and (T2 , ≤) with ≤ being dictionary ordering,
show that (T , ≤) is a poset.
12. Prove that every finite lattice is a complete lattice.
13. Let (S, ≤) be a poset and let A ⊆ S. Can x ∈ S be the least upper bound of A? Justify
your answer.
14. Consider Z+ , the set of positive integers. Consider the set (Z+ × Z+ , ∼) such that
(x, y) ∼ (u, v) if x divides u and y divides v. Is (Z+ × Z+ , ∼) a poset? Justify your
answer.
150 9 Partial Order and Lattices

15. Let ≤ be a relation on the set S = {1, 2, 3, 6, 7, 8} with x ≤ y if xy is odd. Is (S, ≤) a


poset? Justify your answer.
16. Does there exist a lattice without minimum element? Justify your answer.
17. Let S = {a1 , a2 , a3 , a4 }. How many lattices can be formed using ‘S’ with some ordering
‘≤’. List all of them.
Polya’s Theory
10

10.1 Permutation Group

In this section we define groups. Basically every monoid is also a semigroup. Every semi-
group is a groupoid. Now, we consider a monoid with one more property. So, a group is a
set with a binary operation ∗ defined on the elements of the set. In monoids and semigroups
also, an operation is applied on any two elements of the set S and the nature of the output
is studied in S itself. For example for any a, b ∈ S, a ∗ b ∈ S is known as closure property.
Groups of finite order are useful in coding theory, and cryptography.

Definition 10.1 A group is a set S with a binary operation ∗ such that

1. for any two elements a, b ∈ S, a ∗ b ∈ S. That S is said to satisfy ∗-closure.


2. for any three elements a, b, c ∈ S,

(a ∗ b) ∗ c = a ∗ (b ∗ c).

That is, ∗ is associative.


3. there exists an element e ∈ S called the identity element w.r.to ∗. That is, for any a ∈ S,
a ∗ e = e ∗ a = a.
4. for any a ∈ S, there exists an element a ∈ S such that a ∗ a = a ∗ a = e. a is called the
inverse of a and is usually denoted by a −1 .

Notation: We call (S, ∗) as a group which imply that S is a group w.r.to the binary
operation *.

© Ane Books Pvt. Ltd. 2025 151


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_10
152 10 Polya’s Theory

Example 10.2 1. The set Z with the usual + operation is a group. We know that (Z, +) is
a monoid. Since for every n ∈ Z, −n ∈ Z such that n + (−n) = 0, 0 being the identity,
(Z, +) is a group.
2. The set R w.r.to + is a group.
3. The set R\{0} is a group w.r.to multiplication.
4. Let (M2×2 (N), +) is a group where M2×2 (N) is the set of 2 × 2 matrices
 with every
00
entry being in N. + is the usual matrix addition. Clearly the matrix is the identity.
00
   
n n −n 1 −n 2
For any matrix 1 2 , is the inverse.
n3 n4 −n 3 −n 4
The next example is a special type of group which is more popular. Before we go with
what are known as symmetric groups, we define abelian group.

Definition 10.3 A group (S, ∗) is said to be an abelian group or commutative group if for
any x, y ∈ S, x ∗ y = y ∗ x.

All the four groups defined in the previous examples are abelian groups.
Table

Example 10.4 (Symmetric groups) Let S = {1, 2, 3} and let f : S → S be a mapping which
is bijective. For example, if

f (1) = 2
f (2) = 3
f (3) = 1

is a mapping. It is something like distributing three distinct balls in 3 boxes such that no box
is empty. The number of ways of doing this will be 3! = 6. Here there are exactly 6 distinct
mappings that map the elements of S to itself in a bijective manner. We may also write the
above mapping as  
123
231
which is called a permutation. Let us denote the 6-distinct permutations in a set denoted by
S3 . The following table gives all the members of S3 .

Remark 10.5 (Sn , ◦) can be shown to be a group called the permutation group.
10.1 Permutation Group 153

mapping permutation
 
123
e
1 2 3
123
f1
1 3 2
123
f2
3 2 1
123
f3
 1 3
2
123
f4
 3 1
2
123
f5
312

Now (S3 , ◦) is a group where ◦ is the composition of functions. The composition table
w.r. to the set S3 is as below:

◦ e f1 f2 f3 f4 f5
e e f1 f2 f3 f4 f5
f1 f1 e f4 f5 f2 f3
f2 f2 f5 e f4 f3 f1
f3 f3 f4 f5 e f1 f2
f4 f4 f3 f1 f2 f5 e
f5 f5 f2 f3 f1 e f4

From the above table, we see that e is the identity element of S3 . Also entries in the table
where e is present indicate the inverses. For example, 5th row last column element is e and
so f 4 is the inverse of f 5 and vice versa. Hence (S3 , ◦) is a group but not commutative. It is
called the symmetric group.

Remark 10.6 Similar to (S3 , ◦), (Sn , ◦) can be defined. The operation table given above is
also called as Cayley table.

Example 10.7 Show that Sn has n! elements.


154 10 Polya’s Theory

Solution: By combinatorial argument it can be shown that |Sn | = n!.


Next we see a definition which talks about the cardinality of a set S in (S, ∗).

Definition 10.8 Let S be any set. For any group (S, ∗), the cardinality of (S, ∗) is the
number of elements in S. It is also called as order of the group (S, ∗).
The order can be finite or infinite. For example (Z, +) is infinite order group whereas
(S3 , ◦) is finite order group.

Canonical Form of Permutations

When we write each k cycle by writing its largest value in the first and then writing the
product in the increasing of their first element, then what we get is called the canonical form
product of permutations. We observe that such a representation is unique of its nature.
We state the following theorem without proof.


k
Theorem 10.9 Let n 1 , n 2 , . . . , n k be integers with each n i ≥ 0, 1 ≤ i ≤ k. Let i·
i=1
n i = m. That is in n i ’s, there may be a repetition. Then the number of permutations of
length m with n i cycles of length i where 1 ≤ i ≤ m will be n 1 !n 2 !···n k !·2
m!
n 1 2n 2 ···2n k

Notation: If a m-permutation p has n 1 cycles of length 1, n 2 cycles of length 2, n 3 cycles


of length 3 and so on, n k cycles of length k, then we denote (n 1 , n 2 , n 3 , . . . , n k ) as p-type
permutation.

Example 10.10 The number of permutations having one cycles is of (0, 0, 0, . . . , 0, 1)-type
 
(n−1) times
and is equal to (n − 1)!.

Definition 10.11 The number of m-permutations with t-cycles are also called as s(m, t),
where s(m, t) is the Stirling number of first kind without sign. If c(n, t) denote the number
of such permutations, then
s(m, t) = (−1)m−t c(m, t)

By the recurrence relation given earlier, we have the following theorem.

Theorem 10.12 Let m and t be two positive integers such that m ≥ t. Then

c(m, t) = c(m − 1, t − 1) + (m − 1)c(m − 1, t)


10.1 Permutation Group 155

Stirling Numbers

There are two types of Stirling numbers. They are Stirling number of first kind and Stirling
number of second kind

Stirling Numbers of First Kind

Consider the product


x(x + 1)(x + 2) · · · (x + m − 1).
The coefficients of x t , 0 ≤ t ≤ m, in the product is known as ‘Stirling Numbers’. The
product expands as a polynomial in x and it can be written as


m
p(x) = (−1)m−t s(m, t)x t .
t=0

The numbers s(m, t) are known as unsigned Stirling numbers of first kind.
The following recursion is satisfied by Stirling numbers of first kind.

s(m, t) = s(m − 1, t − 1) − (m − 1)s(m − 1, t)

This recursion is given with the initial condition

s(m, 0) = 0, m ≥ 0

Given that

s(m, t)x t = Pm (x)
t≥0

= (x + m − 1)Pm−1 (x)
= x Pm−1 (x) + (m − 1)Pm−1 (x)
 
= s(m − 1, t)x t+1 + (m − 1)s(m − 1, t)x t
t≥0 t≥0

Comparing the coefficient of x t on both sides

s(m, t) = s(m − 1, t − 1) + (m − 1)s(m − 1, t).

By using this recurrence relation for various sample values of m and t we have s(m, t) values
as
156 10 Polya’s Theory

m\t 0 1 2 3 4 5 6
0 1000 0 0 0
1 1 1 2 6 24 120
2 1 3 11 50 274
3 1 6 35 225
4 1 10 85

Where do these Stirling numbers of first kind seen?

Definition 10.13 Let S be an n-element set. Any permutation can be viewed as a function
f : S → S. That is the permutation 312 for a set S = {1, 2, 3} can be viewed as f : S → S
such that f (1) = 3, f (2) = 1, f (3) = 2.

Usual compositions of functions can be defined on sets having the same cardinality which
are usually called as product of permutations. The group with a multiplication operation
will be called as permutation group which will be seen later. In permutations one can define
what are known as cycles. Before we give the following simple result, by f 2 we mean
f 2 = f ◦ f = f f is the product permutation.

Proposition 10.14 Let f : S → S where S is a set having n elements. Let a ∈ S be any


element. Then there exists a positive integer 1 ≤ i ≤ n such that f i (a) = a.

The proof can be given using PHP. We have the definition of k-cycles where k ≤ n.

Definition 10.15 Let f be a function from the set S to S such that #S = n. Let a ∈ S and
let k be the least positive integer such that f k (x) = x. Then the elements a, f (a), f 2 (a),
· · · , f k (a) form a k-cycle or cycle of length k of f .

The following result is very useful and popular.

Proposition 10.16 All permutations can be decomposed into the disjoint union of their
cycles.
10.2 Burnside’s Lemma 157

Example 10.17 Consider a permutation 321465, i.e., f (1) = 3, f (2) = 2, f (3) = 1,


f (4) = 4, f (5) = 6, f (6) = 5. Then the (31), (65) are 2-cycles. (2) and (4) are 1-cycles or
fixed points of f . By writing the product

(31)(2)(4)(65),

we mean, we have written a cycle decomposition of (321465).

10.2 Burnside’s Lemma

Multiplication of permutations is nothing but a composition of permutations. That is for


any two permutations π1 and π2 , π1 ◦ π2 is nothing but composition of two bijective func-
tions from X = {1, 2, . . . , n} to itself. So, π1 ◦ π2 (a) = π1 (π2 (a)) for a ∈ {1, 2, . . . , n}.
We know Sn is the set of permutations of X and |Sn | = n!.
We now define action of a group G on a set X . It is defined as a function f : X → X
with the following properties.

(i) f (g(x)) = f ◦ g(x), x ∈ X , f , g ∈ G


(ii) e(x) = x for all x ∈ X .

‘e’ is an element of G and by condition (ii) above ‘e’ maps any element x ∈ X to itself. But
it may not be true for every f ∈ G.

Definition 10.18 If for an element g ∈ G, G acting on a set X , g(x) = x, then ‘g’ is said
to fix x ∈ X . Let
F(g) = {x ∈ X | g(x) = x}
denote the elements of X fixed by g ∈ G. The set O(x) = {g(x)|g ∈ G} will be called as
the orbit of the element x ∈ X .
The set T (x) = {g ∈ G|g(x) = x} is called the stabilizer set of an element x ∈ X . This
is the set of elements of G which fix an element x ∈ X . The following lemma is simple and
direct from the definitions.

Lemma 10.19 For all x ∈ X ,


|T (x)||O(x)| = |G|.

Remark 10.20 Above lemma is known as orbit counting lemma.

Let G be a group acting on X and ‘∼’ be a relation defined on X as x ∼ y if and only if


there exists an element g ∈ G such that g(x) = y, for all x, y ∈ X . It is not difficult to see
158 10 Polya’s Theory

that ∼ is an equivalence relation. Now we give Burnside lemma which counts the number
of equivalence classes of X .
1 
Burnside Lemma: The number of equivalence classes of ∼ is equal to |F(g)|.
|G|
g∈G

Proof Let S = {( f , x) ∈ G × X | f (x) = x}.


Now one can get the cardinality of S either by looking at the sum

|F(g)| or
g∈G

by looking at those x ∈ X such that 


|T (x)|.
x

Here |F(g)| is a summation over ‘g’ where g fixes some elements of X .
g∈G

orbits |number
of orbits||G|
Consider |T (x)| = .
|number of orbits|
x∈X
Here we can see that T (x) is a subgroup of G and hence
|G|
|T (x)| =
|number of orbits of X |
Hence the number of equivalence classes is equal to
1 
|F(g)|.
|G|
g∈G

It is nothing but number of orbits. 

Example 10.21 (Beads Necklace Symmetry) The problem is to arrange in a circular fashion,
n beads where some are black in color and some are white in color. Here n is prime. Two
such necklaces are considered to be the same if one can be seen as the other by means of
circular rotation. Otherwise they are different. How many different necklaces can be made
from ‘n’ beads for any n?

Solution:
Number of necklaces that can be got by using ‘n’ beads is 2n and let K be the set of these
arrangements. In these two necklaces α, β ∈ K are identical if α can be seen to be the same
by rotating β. Otherwise they are different. For example bwww will be same as wbww,
wwbw, wwwb. Such necklaces are to be counted only once. By Burnside’s lemma,
10.2 Burnside’s Lemma 159


t|G| = |F(g)|
g∈G

where ‘t’ is the number of orbits. Let us understand that we want to find ‘t’. Before we
proceed, let us understand about the arrangements of beads in detail

(i) A necklace that is completely white or completely black means that every position of
the bead (white or black) is fixed by every element of G.
(ii) Consider the necklaces are not fixed by any g ∈ G except the identity element of G say
‘e’ of G. Now we must understand G as a group

G = (Zn , +) where Zn = {0, 1, 2, . . . , n − 1}

and + is addition modulo n operation. Let the necklaces be denoted by (x1 , x2 , . . . , xn ).

Consider a necklace such that

(x1 , x2 , . . . , xn ) = g(x1 , x2 , . . . , xn ), g ∈ G.

Then
g(x1 , x2 , . . . , xn ) = (x1 , x2 , . . . , xn ).
Iterative use of ‘g’ and the definition of G, imply that

tg(x1 , x2 , . . . , xn ) = (x1 , x2 , . . . , xn ).

If ‘n’ is prime, then we see

(x1 , x2 , . . . , xn ) = f g −1 g(x1 , x2 , . . . , xn )

for t = f g −1 . That is

(x1 , x2 , . . . , xn ) = (x1+ f , x2+ f , . . . , xn+ f )

Hence the chosen necklaces are same which is a contradiction. So when

g = e, F(g) = 2n
g = e, F(g) = 2.

Now
160 10 Polya’s Theory

 
tn = F(g) = F(e) + F(g)
g∈G g =e
g∈Z+n

= 2n + 2 = 2n + 2(n − 1)
g =0
g∈(Z+
n)

2n + 2(n − 1)
⇒t = orbits
n

10.3 Equivalent Colorings

This section is a continuation of the previous section where we look for assignment of colors
to the elements of a set X and identify non equivalent outputs under the action of a group G
that identify symmetries in coloring. This section gives different examples to illustrate the
concept of equivalent colorings.

Example 10.22 Let n students sit in a circular fashion and let there be n! ways of seating.
We can see that by cyclic rotation for every possible sitting, there are ‘n’ cyclic rotations of
the sitting. This means each equivalence class will contain ‘n’ elements. Hence the number
of equivalence classes will be n!/n = (n − 1)!.

Example 10.23 Suppose we understand the arrangement of 8 chairs in a circular fashion.


Let the chairs be only of two types.
Suppose the position of chairs are at equi-distant from each other. So we can see that
there are 8 possible ways of placing the chairs. In the circular arrangement one can use

(i) Two chairs of type-1 and one chair of type-2.


(ii) Two chairs of type-2 and one chair of type-1.
(iii) All three chairs of same type.

The cyclic rotations are considered to be equivalent.

For example the arrangement

is equivalent to
10.3 Equivalent Colorings 161

Hence the number of equivalent classes will be 4 which can be directly counted.
Suppose G is a group of permutations formed from the elements of X . Let ζ be the
set of colors assigned to elements of X . Suppose ζ (1), ζ (2), . . . , ζ (n) be the coloring of
the elements of X . For example ζ = {blue, yellow} and ζ (i) may be blue if i is odd, ζ (i) =
yellow when i is even. Then ζ assigned colors to every element of X . Consider a permutation
σ ∈ G such that  
1 2 3 ... n
σ =
j1 j2 j3 . . . jn
Suppose G acts on X . Then action of σ on any color s ∈ ζ is denoted as σ ∗ s such that
 
1 2 3 ... n
σ ∗s =
s( j1 ) s( j2 ) s( j3 ) . . . s( jn )

Only requirement is that for every σ ∈ G and for every s ∈ ζ , σ ∗ s must also be in ζ . For
any two permutations σ1 , σ2 ∈ G

(σ1 ◦ σ2 ) ∗ s = σ1 ∗ (σ2 ∗ s).

Example 10.24 Consider G = (σ, σ 2 , σ 3 , σ 4 ) where


 
1234
σ =
2341
 
1234
σ =σ ◦σ =
2
3412
 
1234
σ3 = σ2 ◦ σ =
4123
 
1234
σ4 =
1234

G is a permutation group S4 . Suppose ζ = {c1 , c2 } are the colors assigned to 1, 2, 3 and 4.


σ 4 ∗ ζ = γ . Then σ, σ 2 , σ 3 are obtained by cyclic rotation of (1 2 3 4). Hence we can
easily see the action of G under ζ .
If c1 = (r , b, b, r ), then
σ 4 ∗ c1 = (r , b, b, r )
σ ∗ c1 = (b, b, r , r )
and so on.
162 10 Polya’s Theory

If c2 = (r , b, r , b), then
σ 4 ∗ c2 = (r , b, r , b)
σ 2 ∗ c2 = (r , b, r , b)
and so on.

One can see that the colorings fall in one class by means of coloring function defined on
the set X . Also the equivalence relation defined on X for counting the equivalent classes
is any equivalence relation defined on X and G is any group acting on X . But in our
present discussion we have a permutation group and the equivalence relation is induced by
the permutations of G. Hence usage of Burnside lemma for counting equivalent coloring
classes will not help.
Let us have one more example of coloring of permutation group.

Example 10.25 Let a square of unit length be given as below where the corners are well
marked.

Find the number of ways we can construct squares by placing two flags, a black flag and
a white flag so that the flagged squares are distinct. Suppose we allow counter clockwise
rotation of a particular square about its center. We can say that the square is rotating and
taking positions by 0◦ , 90◦ , 180◦ and 270◦ .
Now a flagged square

is same as the flagged square

Here α when rotated by 90◦ we get β. We indicate the rotation by R and denote the rotation
relation between α and β as α Rβ. Here ‘R’ will be equivalence relation. There are 3 options
of flagging the corners of the square. They are
10.4 Cycle Index 163

1. All four corners get the same color flag.


2. Three corners are flagged with same color and one corner gets a different color.
3. Two corners get the same color flag and the other two corners get the other color flag.

Based on rotation, the flagged squares can be arranged as equivalent ones.


Any equivalence rotation partitions the set on which it is acting on. Since we look for
equivalent coloring for a set, one has to observe operations on the set that induce equivalent
colored elements of the set. That is if X is a set and ζ is the set of coloring assignments
assigned to elements of X . Let R be an equivalence relation on X . For any two elements
α, β ∈ X , let C(α), C(β) be the coloring class where C ∈ ζ . We say C(α) = C(β) if α Rβ.

10.4 Cycle Index

We know for a set X = {1, 2, . . . , n} what a permutation group Sn is. We also know that
any permutation in Sn can be written as the product of disjoint cycles. For example the
permutation  
123
π=
321
can be written as product of cycles (13) (2). Here (13) is a 2-cycle and (2) is cycle of length
one.

A permutation x1 x2 . . . xn is a permutation in Sn and it is a cycle of length n. For
   
example 2 3 4 1 is a cycle of length 4 and it is the same as 3 4 1 2 , 4 1 2 3 , 1 2 3 4 .
Let τ be a permutation written as a product of cycles. Let there be t1 cycles of length 1,
t2 cycles of length 2 and so on tk cycles of length k in this unique product. One can encode
‘τ ’ by using the expression x1t1 x2t2 . . . xktk . This encoding can be done for every element of a
permutation group G. This leads to an encoding of the group G itself by summing up the
individual encoding of each permutation in G. If ‘k’ is the length of the longest cycle in the
cycle decomposition of any τ in G, then
1  t1 t2
PG (x1 , x2 , . . . , xk ) = x1 x2 . . . xktk
|G|
τ ∈G

is called the cycle index of G.


Consider the permutation group Sn . Let us find all the permutations with their cycle
decompositions or product of cycles. Let us do it in the following manner.
Suppose the integer partition of n is 1t1 2t2 . . . k tk and let us denote this as α. Clearly
t1 + 2t2 + · · · + ktk = n.
We have the following theorem.
164 10 Polya’s Theory

Theorem 10.26 The number of permutations with cycle type α is

n!

1≤ j≤k j t j (t j !)

Example 10.27 Consider n = 7.


α = 10 22 31
        
Then the permutations may be 1 2 3 4 5 6 7 , 1 3 2 4 5 6 7 , 1 4 2 3 5 6 7
and so on. Totally there are 7! such products. But all these 7! permutations are not distinct
as rotational or cyclic symmetry will lead to the same permutation. For example in the cycle
  
5 6 7 , 6 7 5 , 7 5 6 are falling under rotational symmetry.
So two permutations σ1 , σ2 give rise to the same permutation if

(i) rotation of each cycle can be done and it can be done by in ways
(ii) also permute all the cycles of same size.

Let us use the following notation



Zα = j t j (t j !)
1≤ j≤k

So in the above theorem number of permutations with cycle type α is n!


Zα .
Hence the cycle index polynomial for Sn will be

1  n!  t j
PSn (x1 , x2 , . . . , xk ) = xj
n! α Z α
1≤ j≤k

where α is an integer partition of n.


t
  x jj
=
α 1≤ j≤k
jtj tj!

Suppose G is a permutation group. i.e., G ⊆ Sn . Its cycle index polynomial is defined by


1   m i (τ )
Z G [y1 , y2 , . . . ] = yi
|G|
g∈G i∈P

where m i (τ ) = number of cycles of length i in τ .



Let σn be a permutation in Sn and let σn = 1 2 3 . . . n , a n-cycle. Let G be the permu-
tation group and G =< σn >, the group generated by σn . i.e., G = {σ, σ 2 , . . . , σ n−1 , σ n =
e}. For any t ∈ N, the cycle of n under σ k consists of
10.5 Polya’s Theorem 165


n
{s ∈ {1, 2, . . . , n}|s = at + bn, a, b ∈ Z} = .gcd(t, n)| = 1, 2, . . . , .
gcd(t, n)

Hence the cycle type of σ k is (e, e, . . . , e).


 
gcd(t,n)
Recall the cycles type of a permutation is a list consisting of length of the cycles in the
product representation of the cycle and written as a s-tuple. Here s is the number of cycles in
the product representation of the permutation. Now number of such t’s such that gcd(t,n)n
=e
such that the cycle is (e, e, e, . . . , e) for σ is to be determined.
k

Consider the poset (divisors of n, /) the divisors of ‘n’ with partial ordering as divisibility
‘1’. Now consider
  
  n 

Fd =  t ∈ {1, 2, . . . , n}  = e 
gcd(t, n)
  
  n 
Hd =  t ∈ {1, 2, . . . , n}‘e divides 
gcd(t, n) 
=e

Using Mobius inversion,


  e
Fd = μ( , e) = μ . = φ(e) (Euler φ)
|e |e

1 n
Z G [y1 , y2 , . . . ] = φ(e)yee
n
e|n

10.5 Polya’s Theorem

We defined and discussed what a cycle index polynomial was.


Let G be a permutation group. Let [k] = {1, 2, . . . , k} denote set of k different colors.
A coloring function assigns colors to elements of X = {1, 2, . . . , n}. We already have seen
what we mean by equivalent coloring. Two colorings C1 and C2 are said to be equivalent
under the action of G if there exists a permutation τ ∈ G such that

C1 (τ (x)) = C2 (x) where τ ∈ G

We denote this by C1 ∼ C2 . Let ζk (X ) denote the set of all k-colorings of X . Let G|ζk (X )
G
denote the set of equivalent colorings induced by G.

Example 10.28 Let X = {1, 2, . . . , n}. Consider the permutation σ = 2 3 4 . . . n . σ is a
cyclic permutation and its length is n. Let G =< σ >= {σ, σ 2 , . . . , σ n−1 , e} where σ n = e.
G is a permutation group. Now the k-colorings on X under the action of G gives the equivalent
166 10 Polya’s Theory

k-colorings. This is nothing but the equivalence of necklaces with n beads formed using k-
colors.

Now consider C ∈ ζk (x). Let ti = |{x ∈ X |C(x) = i}|, i = 1, . . . , k. That ti gives the
number of elements of X that are given color i. So that k-tuple αC = (t1 , t2 , . . . , tk ) ∈ Nk
is called the mode of a coloring τ ∈ ζ . Also t1 + t2 + · · · + tk = |X | = n. If τ ∼ τ̄ , then
G
αC = αC̄ . Let us do a more refined counting. For that consider α ∈ Nk with |α| = n = |X |.
Let ζα (x) = {C ∈ ζk (x)|αC = α} which is the colorings of X with mode α. The problem
is to determine the number of G-equivalence classes of colorings of X with k-colors in the
mode of α.

Definition 10.29 (Power Sum Symmetric Polynomial) A polynomial g(x1 , . . . , xk ) is said


to be symmetric if

g(x1 , x2 , . . . , xk ) = g(xw(1) , xw(2) , . . . , xw(k) }

where w ∈ Sk .

Example 10.30 Consider the polynomial

g(x1 , x2 , x3 ) = x13 + x23 + x33 = p3 (x1 , x2 , x3 )

This is a 3r d power symmetric polynomial.


Consider an integer partition τ = (τ1 , τ2 , . . . , τm ) and let

pτ (x1 , x2 , . . . , xk ) = (x1τ1 + x2τ1 + · · · + xkτ1


(x1τ2 + x2τ2 + · · · + xkτ2
(x1τk + x2τk + · · · + xkτk

m
= pτi (x1 , x2 , . . . , xk ).
i=1

These are called as power sum symmetric polynomial for the partition τ .

Consider now a permutation τ ∈ Sn . μ(τ ) denote the cycle type of τ . That is μ(τ ) =
(τ1 , τ2 , . . . , τm ) where τ1 , τ2 , . . . , τm are the size of the cycles of τ . Now for every permu-
tation σ ∈ S we try to associate a polynomial pτ (μ) in Polya enumeration theorem.

Lemma 10.31 Let τ be any permutation. Then


10.5 Polya’s Theorem 167


|ζα (x)τ |x1τ1 x2τ2 . . . xmτm = pμ(τ ) (x1 , x2 , . . . , xm ).
τ1 +τ2 +···+τm =|X |
(τ1 ,τ2 ,...,τm )∈Nm

Proof A τ -invariant coloring is one that is distinctly coloring the cycles of x. So,


k
μ
pμ(τ ) (x1 , x2 , . . . , xm ) = (x1 1 + · · · + xmμk )
i=1
m 
m 
m
μ μ μ
= ··· x j11 x j22 . . . x jkk
j1 =1 j2 =1 jk =1

where μ(τ ) = (μ1 , μ2 , . . . , μk ).


 μ μ μ
= x j11 x j22 . . . x jkk
( j1 , j2 ,..., jk )∈[m]k

Each of the k-tuple ( j1 , j2 , . . . , jk ) determine the coloring of x which is invariant under the
action of G. This is because if we color all the elements u ∈ x in the cycle of length μi with
the color j1 and if this coloring has shape α, then
μ μ
x j11 . . . x jkk = x α .

Hence
 1 
|ζα (x)\G|x1t1 x2t2 . . . xktk = (ζα (x))τ x1t1 x2t2 . . . xktk
α
|G| α
τ ∈G
1 
= pμ(τ ) (x1 , x2 , . . . , xm )
|G|
τ ∈G
(by reversing the order of summation)

Polya Enumeration Theorem

Let x be a finite set and G ⊂ Sn be a permutation group. Consider the summation



|ζα (x)\G|x1t1 x2t2 . . . xktk
t1 +t2 +···+tk =n
(t1 ,t2 ,...,tk )∈Nk

where |ζα /G| denotes the number of equivalence classes of ζα (x) under the action of G.
Here α = (t1 , t2 , . . . , tk ). This summation is equal to
168 10 Polya’s Theory

1 
pμ(τ ) (x1 , x2 , . . . , xk ).
|G|
τ ∈G

Proof By the orbit counting lemma


1 
|ζα (x)\G| = |ζα (x)τ | (10.1)
|G|
τ ∈G

where ζα (x)τ is the stabilizer of X under τ ∈ G.


We use the above lemma and we get

|ζα (x)|G|x1t1 x2t2 . . . xktk
τ ∈G
1 
|ζα (x)τ |x1t1 x2t2 . . . xkk
t
=
|G| α
τ ∈G
1 
= pμ(τ ) (x1 , x2 , . . . , xk )
|G|
τ ∈G

Example 10.32 Let X = {1, 2, 3, 4}.



Let τ = 1 2 3 4 .
   
G =< τ >= {e, 1 2 3 4 , 1 3 2 4 , 4 3 2 1 }
So,
1 
pμ(τ ) (x1 , x2 , x3 , x4 )
|G|
τ ∈G
(We assume there are 4-colors here).
1
= (x1 + x2 + x3 + x4 )4 + 2(x14 + x24 + x34 + x44 )
4

+(x12 + x22 + x32 + x42 )2 .
= x14 + x13 x2 + 2x12 x22 + 3x13 x2 x3 + 6x1 x2 x3 x4 + x24 + x23 x3 + · · ·

So the number of necklaces with two beads of color 1, one bead of color 2, one bead of
color 3 is 3 (verify). If one use all 4 colors different then 6 different necklaces can be made.

Exercise:

1. Show that every permutation on the set X = {1, 2, . . . , n} can be uniquely expressed
as a product of transpositions.
10.5 Polya’s Theorem 169

2. Prove that the number of permutations of X = {1, 2, . . . , n} with odd number of


cycles is equal to the number of permutations of X with even number of cycles.
3. Let σ and τ be permutations in S3 such that
 
123
σ =
321
 
123
τ=
213

Find σ τ (1), σ τ (2), σ τ (3).


4. Show that (S3 , ◦) is a group. Write down explicitly the identity element of S3 . Also
find the inverse of the permutation.
 
123
τ=
312

5. Find the number of ways of arranging k distinct objects in a circular fashion.


6. Let D be a square with its corners labeled as a, b, c, d (i.e., corners distance) and
its sides labeled as s1 , s2 , s3 , s4 . The following figure illustrates D.

The rotational symmetry happens when D is rotated about its center through angles
0◦ , 90◦ , 180◦ and 270◦ . Determine the rotation symmetry group of S4 .
7. In the square D considered in question 6, there are four reflection symmetrices about
the diagonals ‘ac’ and ‘bd’. This operation happens in space. Show that the reflection
symmetries about the diagonal form a group.
8. Suppose the square D is such that the corners 1, 2, 3, 4 are colored using 3 colors red,
blue and green.
(i) Determine the number of non equivalent colorings of the corners under the action
of rotation symmetry group defined in question 6.
(ii) Determine the number of non equivalent colorings of the corners under the action
of reflection symmetry group defined in question 7.
9. How many non equivalent ways are there to color the corners of a pentagon using 2
colors, red and blue?
10. A dihedral group on {1, 2, . . . , n} is a symmetry group. The symmetries are rotational
symmetry and reflection symmetry. It is denoted as Dn and it is a group on n-sided
regular polygon for n ≥ 3.
(i) Show that Dn is an abelian permutation group.
170 10 Polya’s Theory

(ii) Express each permutation in D4 as a product of cycles. Write down their cycle
types.
(iii) Find the cycle index of Dk , for k ≥ 3.
11. Using the Burnside’s Lemma find the number of non-isomorphic graphs on 5-vertices.
12. Find the cycle index polynomial PS5 (x1 , x2 , x3 , x4 , x5 ) of K 5 , the complete graph on
5-vertices.
13. Find x in the following equation
 2  
1234 1234
x=
4132 1342

14. Check whether the following statements are true or false with justifications

(i) If τ is an odd cycle of a permutation, then τ 2 is also a cycle.


(ii) For S = {1, 2, 3, 4, . . . , n} any permutation σ ∈ Sn can be written as a finite product
of the following permutation.

15. Let S = {1, 2, 3, 4, 5}. Let G = {(1)(2)(3)(4)(5), (3 4 1)(2)(5), (2 3 4 5)(1)}. Find

(i) the orbit of 1, 3, 5


(ii) the fix of all the permutations in G
(iii) the stabilizer of every element of S.
(iv) verify Burnside Lemma.
More on Counting
11

11.1 Catalan Numbers

Catalan numbers are following sequence of numbers Fn that satisfy the recursive formula

F0 = 1 F1 = 1
Fn = F0 Fn−1 + F1 Fn−2 + · · · + Fn−1 F0

n
= Fi−1 Fn−i , n ≥ 1
i=1

The first few numbers are 1, 1, 2, 5, 14, 42, 132, 429, 1430, . . .
Catalan numbers come out as answer to several combinatorial problems. We list some of
them here.

Remark 11.1 We use for Catalan numbers notation Fn instead of Cn to avoid confusions
in notations

Problem 1: Well formed sequences of parentheses

We define a string first over {(, )}. The set {(, )} has two elements. One is the left
parenthesis ’(’and the other is the right parenthesis ’)’. One can form strings by placing the
parentheses one by the side of the other. For example (( )), )) (( are strings over {(, )}. Out
of these two, only one is well formed where the other is not. We now have the following
recursive definition of Well Formed Parentheses (WFP).

© Ane Books Pvt. Ltd. 2025 171


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_11
172 11 More on Counting

Definition 11.2 A sequence or a string of parentheses is WFP if it can be formed by applying


the following sequence of rules.

1. The empty set or sequence is well formed.


2. If  F  is a WFP, then (F) is a WFP.
3. If F and F  are WFP, then the concatenation F F  is WFP

Notation: The length of a WFP  α  is the number of parentheses occurring in it and it is


denoted by |α|.

Example 11.3 Find 2 WFPs of length 6 such that one is well formed and the other is not.

Solution:
α = (())() is WFP.
β =)())() is not a WFP.
α satisfies the recursive rules and above, whereas β does not.

Remark 11.4 1. Any WFP will be of even length as there must be equal number of left
and right parentheses.
2. If we replace every left parentheses by 0 and right parentheses by 1, what we obtain is a
string over {0, 1} that have equal number of 0’s and 1’s

We will first solve the recurrence relation satisfied by Catalan numbers using generating
functions technique.

Example 11.5 Solve the recurrence relation given by


n
Fn = Fi−1 Fn−i , F0 = 1, n ≥ 1 (11.1)
i=1

Solution: We solve the recurrence relation by generating function method.


Let
∞
f (x) = Fn x n with F0 = 1
n=0
be the generating function.
11.1 Catalan Numbers 173

Multiplying the recurrence relation (11.1) throughout by x n and taking the sum from 1
to ∞, we get

 ∞
 
n
Fn x =
n
x n
Fi−1 Fn−i
n=1 n=1 i=1
 
= Fi Fn−i+1 x n
i≥0 n≥i−1

f (x) − F0 = x f 2 (x)
Assuming F−1 = 0,
⇒ x f (x) − f (x) + 1 = 0, as F0 = 1
2

We have to solve for f (x).


√ √
1+ 1 − 4x 1 − 1 − 4x
f (x) = ,
2x 2x
which of the two f (x) we√ take to find Fn . The function f (x) has a constant term which is
1. As x → 0, f (x) = 1− 2x1−4x → ∞ and we consider only

1+ 1 − 4x
f (x) =
2x
whose expansion will give a constant term.
1
Now expand (1 − 4x) 2 using binomial theorem, we get


1 C(2n − 2, n − 1)
(1 − 4x) 2 = −2 xn
n
n=0

Hence Fn = C(2n,n)
n+1 , n ≥ 0.
Now we come back to our WFP problem.

Theorem 11.6 The number of WFP of length 2n is the Catalan number Fn

Proof We write down a direct method of reaching the recurrence relation satisfied by Fn as
follows.
174 11 More on Counting

By recursive definition, for

WFP Number of ways


n=1 () 1
n=2 (()), ()() 2
n = 3 ((())), (())(), ()()() 5
()(()), (()())
n=4 (((()))), … 14 (check)

Let us write down F0 = 1, F1 = 1, F2 = 2, F3 = 5, F4 = 14, . . . , Fn when 2n parentheses


denotes the number of WFP with n-left parentheses and n-right parentheses.
Let us assume that we already have all WFP’s of length 2(i − 1) and their count is Fi−1 .
Any WFP will always begin with  ( . As we have WFP, somewhere in the expression of
WFP there must be a matching  ) for the left (. Hence the WFP is now of the form

(E 1 )E 2

where E 1 and E 2 are WFPs. Both E 1 and E 2 can now have (n − 1) matching parentheses.
If E 1 contains t-pairs, then E 2 contains (n − t − 1) pairs. Here either E 1 or E 2 may be nil.
So now the counting will begin as, E 1 may contain 0-pair, E 2 contains (n − 1) pairs E 1
may contain 1-pair, E 2 may contains (n − 2) pairs and so on. Summing up, we get the total
number of n-balanced WFPs of length 2n. That is,

E1 = E0 E0
E2 = E1 E0 + E0 E1
E3 = E2 E0 + E1 E1 + E0 E1
..
.
E n = E n−1 E 0 + E n−2 E 1 + · · · + E 0 E n−1

which is nothing but the same as the recurrence satisfied by the Catalan numbers. Hence,

c(2n, n)
En =
n+1
There are several counting problems which sum up to Catalan numbers. Some of the
popular ones are polygon triangulation problem, non-crossing handshakes counting, tree
counting problem, diagonal avoidance paths. Later in the graph theory chapters, we will
discuss tree counting problem. 
11.2 Integer Lattice Points 175

11.2 Integer Lattice Points

Integer lattice is a set of points in the x y-coordinate plane where the co-ordinates of such
points are always integers. For any two points (x1 , y1 ), (x2 , y2 ) with x1 ≤ x2 and y1 ≤ y2 ,
a lattice path from (x1 , y1 ) to (x2 , y2 ) will consist of horizontal, vertical steps. One can use
the notation ‘H ’ to indicate horizontal step ‘V ’ to denote the vertical step. For example, we
can consider the plotting of lattice paths as below (Fig. 11.1).

Example 11.7 So the path from (2, 2) to (4, 4) is described by V H V H .


One always considers the shortest of such paths. No matter how one uses the ‘H ’ steps
and ‘V ’ steps, the total number of such steps will be always ‘4’ for all paths from (2, 2) to
(4, 4).
In general a rectangular lattice path from (x1 , x2 ) to (y1 , y2 ) will always use (y1 − x1 )
‘H ’ steps and (y2 − x2 ) ‘V ’ steps. For each such path, the sequence is unique. Once the
‘H ’ steps are known, the option for ‘V ’ steps is frozen. Hence out of (y1 − x1 ) + (y2 − x2 )
steps, choose (y1 − x1 ) ‘H ’ steps in

C(y1 − x1 + y2 − x2 , y1 − x1 )

ways. Hence we have the following result.

Proposition 11.8 The number of rectangular lattice paths from (x1 , x2 ) to (y1 , y2 ) is equal
to the binomial coefficient
C(y1 − x1 + y2 − x2 , y1 − x1 )

Remark 11.9 Each path is uniquely determined by a string over H and V . That is the string
corresponding to the path in Example 11.7 will be ‘V H V H ’.

Fig. 11.1 Lattice paths


5

4
(4,4)
3

2
(2,2)
1

0
1 2 3 4
176 11 More on Counting

Suppose ‘H ’ corresponds to ‘1’ and ‘V ’ corresponds to ‘0’, then each path will uniquely
correspond to a binary string of length equal to the length of the path.

Example 11.10 Suppose one starts at (0, 0) and end at (6, 6) using only H and V steps.
Total number of such paths will be C(12, 6). Suppose there is a restriction that one can move
from (x, y) to (x + 1, y) and (x, y) to (x, y + 1) without crossing the line y = x at every
step. Then the total number of such restricted paths will not be C(12, 6). One such path is
marked in the following diagram (Fig. 11.2).
The path is H V H V H V H V H V H V .
The path ‘H V H V V V H H V H V H ’ is a bad path where this path crosses the line y = x.
Consider the bad path in Fig. 11.3
For any good path the first step cannot be a vertical one. Hence it should be a ‘H ’ step.
Also any prefix of a good path will contain more ‘H ’ steps than ‘V ’ steps and they can be
equal. For example in the bad path above ‘H V H V V ’ is the substring that contains more

Fig. 11.2 One lattice path

2
1

0
1 2 3 4 5 6

Fig. 11.3 Bad path (6,6)

2
1

0
1 2 3 4 5 6
11.3 Eulerian Numbers 177

‘V ’ steps than ‘H ’ steps. So this tells the position where the path crossed the line y = x.
Mark the whole bad path as w1 w2 where ‘w1 ’ is a prefix indicating that crossing of y = x
line for the first time. Now construct a new path w1 w2 where w2 is obtained from w2 by
swapping H with V and ‘V ’ with H . Clearly this path will contain one H less than the
previous count. Hence there is a one to one correspondence between bad paths w1 w2 with
the newly constructed w1 w2 paths. All such w1 w2 paths will contain one ‘V ’ more than that
of w1 w2 . Hence the total number of paths that do not cross the line y = x will be

C(2n, n) − C(2n, n − 1)

where the paths are constructed to move from (0, 0) to (n, n).

Definition 11.11 Catalan number Cn counts the number of lattice paths using only H and
V steps that do not cross y = x.

Example 11.12 Find C4 .

Solution:

C4 = C(4, 2) − C(4, 1)
4! 4!
= −
4 3!
=2

11.3 Eulerian Numbers

We know Sn is the set of permutations on the set {1, 2, . . . , n}. We can denote the values in
any permutation τ ∈ Sn by τi or τ (i), 1 ≤  i ≤ n. As asingle line notation we can express
12345  
τ as product of cycles. For example if τ = , we can write τ as 1 3 2 4 5 as a
34251
single cycle. Here τ (1) = 3, τ (2) = 4, τ (3) = 2, τ (4) = 5, τ (5) = 1.

Definition 11.13 Let τ ∈ Sn . We can define ascent and descent in τ as below.

(i) A descent of τ is a number i ∈ {1, 2, . . . , n} such that τ (i) > τ (i + 1). The set of all
descents of τ is usually denoted as des(τ ).
(ii) An ascent of τ is a number i ∈ {1, 2, . . . , n} such that τ (i) < τ (i + 1). The set of all
ascents of τ is usually denoted as asc(τ ).
178 11 More on Counting

Example 11.14 Consider S3 . The members of S3 are


           
123 , 1 23 , 12 3 , 1 2 3 ,
    
132 , 13 2
  
For τ = 1 2 3 , |asc(τ )| = 1, |dec(τ )| = 1
   
For τ = 1 2 3 , |asc(τ )| = 2, |dec(τ )| = 0
  
For  = 1 3 2 , |asc()| = 0, |dec()| = 2

Definition 11.15 A number




E(n, k) = {τ ∈ Sn |dec(τ )| = k}

is called as an Eulerian number. That is number of permutations in Sn with ‘k’ descents is


the Eulerian number E(n, k).

Example 11.16 Consider S3 . We can find the Eulerian numbers of the permutations of S3
as in the following table.

|dec(τ
   )|
 =0 |dec(τ
   )| = 1 |dec(τ
 )| = 2
τ: 1 2 3 1 23 13 2
1
 2 3
2 3 1
312

Hence E(3, 0) = E(3, 2) = 1


E(3, 1) = 4.

Remark 11.17 One can see that ‘dec’ is a function from the set Sn to set of integers
{1, 2, . . . , n − 1}. Also number of ascents of a permutation τ in Sn will be equal to the
number (n − 1) − |dec(τ )|. Hence E(n, k) = E(n, n − k − 1).

We now prove a linear recurrence which resembles Pascal-identity of binomial coeffi-


cients.

Theorem 11.18

E(n, k) = (n − k)E(n − 1, k − 1) + (k + 1)E(n − 1, k)

for any k and n ≥ 1.


11.3 Eulerian Numbers 179

Proof If τ ∈ Sn with ‘k’ descents, then removing ‘n’ from τ , results in a permutation
τ ∈ Sn−1 . This τ will have either ‘k’ descents or (k − 1) descents.
Also if τ is a permutation in Sn−1 with ‘k’ or (k − 1) descents, one can insert ‘n’ into
this τ to form a permutation τ in Sn with k descents.
Assuming that there are (n − 1) students of different heights in a class. Also suppose that
these students are linearly arranged so that there are (k − 1) descents in this arrangement.
Now insert the tallest student into this arrangement so that the number of descents is either
‘k’ or (k − 1). This can be done in (n − 1 − (k − 1)) = (n − k) ways.
Identically if τ is a permutation in Sn−1 with ‘k’ descents, then forming a permutation τ
in Sn with ‘k’ descents can be done in (k + 1) ways. Hence the recurrence. 

Example 11.19
E(4, 1) = 3E(3, 0) + 2E(3, 1)
In S3 there are 4 permutations with ‘1’ descent. They are
         
(i) 1 2 3 , 1 2  3 , 2 3 1 , 1 3 2       
In τ = 1 2 3 with ‘1’ descent, the permutations 1 2 3 4 , 1 3 2 4 are in S4
with ‘1’ descent.
        
(ii) For τ = 1 2 3 with ‘1’ descent, the permutations in S4 are 2 4 1 3 and 1 2 3 4
with 1 descent.
      
(iii) For τ = 2 3 1 with ‘1’ descent we have the permutations 2 3 4 1 and 1 2 3 4
are in S4 with 1 descent.
       
(iv) For τ = 3 1 2 with ‘1’ descent in S3 , we have 1 3 2 4 and 1 3 2 4 in S4 with
1 descent.
            
(v) For τ = 1 2 3 with ‘0’ descent in S3 , we have 4 1 2 3 , 1 2 4 3 , 1 2 3 4
are the permutations in S4 with 1 descent.

This example illustrates the direct method of constructing permutations in S4 with ‘1’
descent from permutations in S3 that have either ‘0’ or ‘1’ descent. This gives the recurrence
procedure given in Theorem 11.18.
The following table of Eulerian numbers can be shown to be true using the above recur-
rence relation.

n\k 0 1 2 3 4 5
1 1
2 1 1
3 1 4 1
4 1 11 11 1
5 1 26 66 26 1
6 1 57 302 302 57 1
180 11 More on Counting

Fig. 11.4 Recurrence 1


relation—weighted graph
1 1

1 1
1 2 2 1

1 4 1
1 3 2 2 3 1

1 11 11 1
1 4 2 3 3 2 4 1

1 26 66 26 1

Clearly
E(4, 2) = 2E(3, 1) + 3E(3, 2).
Here one can think of 2 and 3 as weights of edges. Hence we can draw the following graph
with weighted edges to illustrate the recurrence relation (Fig. 11.4).
One can associate polynomials with Eulerian numbers as seen below

G 1 (x) = 1
G 2 (x) = 1 + x
G 3 (x) = 1 + 4x + x 2
G 4 (x) = 1 + 11x + 11x 2 + x 3
G 5 (x) = 1 + 26x + 66x 2 + 26x 3 + x 4

Assume G 0 (x) = 1.
For some fixed value ‘n’. We can have the generating function for the Eulerian numbers
E(n, k) as

G n (x) = x |dec(τ )|
τ ∈Sn


n−1
= E(n, t)x t (11.2)
t=0


n−1
G n (x) = t E(n, t)x t−1 (11.3)
t=1

From (11.2) we have,


11.3 Eulerian Numbers 181


n−1
(1 + nx)G n (x) = (1 + nx) E(n, t)x t
t=0

n−1 
n
= E(n, t)x t + n E(n, t − 1)x t (11.4)
t=0 t=1

From (11.3) we have,


n−1
(x − x 2 )G n (x) = (x − x 2 ) t E(n, t)x t−1
t=1

n−1 
n−1
= t E(n, t)x t − t E(n, t)x t+1
t=1 t=1

n−1 
n
= t E(n, t)x t − (t − 1)E(n, t − 1)x t (11.5)
t=1 t=2

So,

(1 + nx)G n (x) + x(1 − x)G n (x)



n−1 
n
= E(n, t)x t + n E(n, t − 1)x t
t=0 t=1

n−1 
n
+ t E(n, t)x t − (t − 1)E(n, t − 1)x t (11.6)
t=1 t=2

Coefficient of x t will be

(n + 1 − t)E(n, t − 1) + (t + 1)E(n, t) (11.7)

By the recurrence in Theorem 11.18 we have (11.7) to be E(n + 1, t). We can write
the following theorem which gives a linear recurrence relation for the generating function
G n (x).

Theorem 11.20 If G n (x) is the generating function for the Eulerian numbers E(n, t), we
have
G n+1 (x) = (1 + nx)G n (x) + (x − x 2 )G n (x).
182 11 More on Counting

11.4 Narayana Numbers

A permutation τ ∈ Sn is a function f from {1, 2, . . . , n} to {1, 2, . . . , n}. A permutation of


the form  
1 2 3 ... n
∈ Sn
τ1 τ2 τ3 . . . τn
can be written simply as ‘τ1 τ2 . . . τn ’ with the understanding
  that f (i) = τi , 1 ≤ i ≤ n. For
1234
example the permutation 4 3 1 2 ∈ S4 stands for ∈ S4 . A sub-permutation of a
4312
permutation is of the form τi τ j τk for i < j < k, 1 ≤ i, j, k ≤ n. Here i, j, k need not be
consecutive. If τi < τk < τ j , then we say that the sub-permutation τi , τ j τk if of 132-pattern.
If τk < τi < τ j , then we call the sub-pattern τi < τ j < τk as 231-pattern. For example
 
τ = 6 4 5 2 3 1 has 231-pattern as ‘452’ as its subpermutation. We can understand the
pattern avoidance by looking for permutations that avoid certain patterns. For example the
 
permutation 3 2 1 5 4 will not have a subpattern of the type ‘231’. We can draw a grid to
show how the permutation function can be plotted. Also, from this plotting, one can easily
look for subpermutations of certain patterns being present.
For f : {1, 2, . . . , 6} → {1, 2, . . . , 6} with τ = 3 6 2 5 4 1 we have the grid.

Definition 11.21 Let τ be a permutation in Sn . If τ = τ1 τ2 τ3 . . . τn with no 231-pattern,


then τ is a 231-avoiding permutation.

Example 11.22 Some 231-avoiding permutations in S4 are

1 2 3 4, 2 1 3 4, 3 2 1 4, 4 3 2 1, 1 3 2 4.

Notation: Let sn (231) denote the number of permutation of Sn that avoid 231-pattern.
11.4 Narayana Numbers 183

Theorem 11.23 Let Sn be a set of permutations on {1, 2, . . . , n}. Then sn (2 3 1) satisfy the
following recurrence relation.


n−1
sn (2 3 1) = si (2 3 1)sn−i−1 (2 3 1)
i=0

Proof Let τ be a permutation in Sn such that τi = n, for τ = τ1 τ2 . . . τn . The values


τ1 , τ2 , . . . , τi−1 must be smaller in value than those entries τi+1 , τi+2 , . . . , τn . If this is
not true, then there exists an entry τ with  < i and τk with k > i such that τk < τ .
This means τk < τ < τi which is not possible. Hence τ1 τ2 . . . τi−1 form a 231-avoiding
permutation and τi+1 τi+2 . . . τn also form a 231-avoiding permutation. Hence sn (2 3 1) =

n−1
si (2 3 1)sn−i−1 (2 3 1). 
i=0


n−1
Remark 11.24 As Catalan number Cn satisfy the recurrence relation Cn = Ci Cn−i−1
i=0
and hence sn (2 3 1) = Cn ,

Definition 11.25 The numbers




E (n, k) = {τ ∈ Sn (2 3 1)|dec(τ )| = k}
231

are called as Narayana numbers.

Example 11.26 The Narayana numbers for n = 1, 2, 3, 4, 5 with k = 0, 1, 2, 3 are given


in the following table.

n\k 1 2 3 4 5
1 1
2 1 1
3 1 3 1
4 1 6 6 1
5 1 10 20 10 1

The following is the formula that computes E (n, k)


231

1
E (n, k) = C(n, k)C(n − 1, k)
231 k+1
184 11 More on Counting

Note that the set of permutations that avoid 231-pattern can be an interpretation for
describing Catalan numbers. We have seen an interpretation of Catalan numbers in terms of
lattice paths earlier.

11.5 Schroder Numbers

In combinatorics the Schroder numbers Sn can be used to count several combinatorial objects.
For example the n th Schroder number counts the number of distinct ways of subdividing
a polygon of (n + 1) sides into smaller polygons by drawing diagonals. Also n th Schroder
number counts the number of lattice paths from (0, 0) to a point (n, n) such that each such
path lie below the diagonal y = x. We will define more on Schroder numbers using the
lattice paths problem.
For this we need the definitions and details of lattice paths which we recall from Sect. 12.1.
In Sect. 12.1 we had the discussion on rectangular lattice paths that use only ‘H ’ and ‘V ’
steps. In addition to these steps, suppose we consider diagonal steps also, we can name such
paths as (H , V , D) lattice paths (Fig. 11.5).
Example 11.27 The string corresponding to the (H , V , D) lattice path is H V D H V D D.
Number of lattice paths from (0, 0) to (x1 , x2 ) which uses r -H -steps, s-v steps and k-D-
steps will be denoted by L(r , s, k). Such paths will use k diagonal steps x1 − k H steps and
x2 − k ‘V ’ steps. Hence
(x1 + x2 − k)!
L(r , s, k) =
(x1 − k)!(x2 − k)!k!

Definition 11.28 A large Schroder number Sn is the number of lattice paths from (0, 0) to
(n, n) that can use V , H and D steps but none of the paths rise above the line y = x.
For 0 ≤ n ≤ 9, first 10 large Schroder numbers are

1, 2, 6, 22, 90, 394, 1806, 8558, 41586, 206098.

Some Schroder paths for n = 3 are (Fig. 11.6)

Fig. 11.5 Lattice path (5,5)


5

2
1

0
1 2 3 4 5
11.5 Schroder Numbers 185

(3,3) (3,3) (3,3)

(0,0) (0,0) (0,0)

Fig. 11.6 Schroder paths

Fig. 11.7 Small Schroder path (3,3)

(0,0)

Let L(n, n) denote the number all paths from (0, 0) to (n, n) that use H , V , D steps and
that do not cross the line y = x.


n
1 (2n − t)!
Sn = L(n, n) =
(n − t + 1) t!((n − t)!)2
t=0

Here ‘Sn ’ are the large Schroder numbers.


A small Schroder, lattice path from (0, 0) to (n, n) is a path that uses V , H , D steps, do
not cross y = x and do not use in ‘D’ steps to lie on the line y = x.

Example 11.29 Consider the following grid (Fig. 11.7).


H V H DV is a small Schroder path.

Definition 11.30 A small Schroder number sn is the number of lattice paths from (0, 0) to
(n, n) that use V , H and D steps but none of the paths rise above the line y = x and none
of its ‘D’ step lie on the line y = x.
Some small Schroder numbers are

1, 1, 3, 11, 45, 197, 903.

Comparing the sequence of small Schroder numbers with large Schroder numbers, one can
intutively see that Sn = 2sn , n ≥ 1, with S0 = 1. But this need to be proved.
Consider the following Schroder path (Fig. 11.8).
186 11 More on Counting

Fig. 11.8 Primitive Schroder (5,5)


5
path
4

2
1

0
1 2 3 4 5

We can define primitive Schroder path as follows:

1. Every ‘D’ step on y = x is primitive.


2. Every Schroder path following a ‘V ’ or ‘H ’ step is primitive.

So one can write down the generating function of a primitive Schroder path as X +
Xg(X ). So the generating function for all paths from (0, 0) to (n, n) will be

 1
g(X ) = (X + Xg(X ))t =
1 − X − Xg(X )
t=0

For small Schroder paths ‘D’ steps on the diagonal are not allowed. So the generation
function will be
1
f (x) = .
1 − Xg(X )


So g(X ) = Sn X n and
t=0


f (X ) = sn X n
t=0
Also

1− X −1 − 6X + X 2
g(X ) =
√2X
1 + X − 1 − 6X + X 2
f (X ) =
4X
11.5 Schroder Numbers 187

Exercises

1. If 2n students are sitting around a table, in how many ways can they all shake their
hands so that there is no crossover of hands?
2. Consider a rectangular grid of size 2 × m. Find the number of ways of filling the holes
with numbers {1, 2, . . . , 2n} such that the entries are monotonic both row wise and
column wise.
3. Consider the recurrence relation on the numbers Fn .


n
Fn+1 = Fi Fn−i , F0 = 1
i=0

(i) Find the values of F2 , F3 , F4 and F5 .


(ii) Prove that Catalan numbers do satisfy the above recurrence relation.
4. Show that there exists a lattice path from (1, 1) to (n, n) that lie below the line y = x + 1
corresponding to a lattice path from (0, 0) to (n, n) that completely lie below the diagonal
y = x.
5. Suppose that a prefix of a binary string contains number of 0’s less than number of 1’s
by 1. If every 0 is changed as 1 and every 1 is changed as 0 in this prefix, what will be
ratio of 0’s and 1’s in the newly formed string.
6. Consider a convex polygon Pn+1 on (n + 1) sides. Let the sides be denoted as
B, a1 , a2 , . . . , an where ‘B’ is the base of the polygon and the labelling of the sides start
with a1 and go up to the last side an in a clockwise manner. By disecting the interior
of Pn , we mean that diagonals are drawn inside Pn in a non cross over manner. Note
that the interior need not be completely disected. Show that bracketing of the string
a1 a2 . . . an has 1–1 correspondence with disections of Pn .
Also show that the number of disections of Pn is equal to the small Schroder number
sn .
7. How many different rooted binary trees are there on n-vertices? (Hint: Use Catalan
numbers)
8. Find the number of permutations in S3 that avoid the patterns ‘132’.
9. Let m, n be natural numbers. Let S = {(x, y)|0 ≤ x ≤ m, 0 ≤ y ≤ n} be the set of
lattice points in the grid [0, m] × [0, n]. Find the number of lattice paths between
[0, m] and [n, 0] that do not meet any point in S.
10. Draw all Dyck paths from (0, 0) to (6, 0) with no peaks (an upstep followed immediately
at height 3).
11. Show that Sm (132, 123) = 2m−1 .
188 11 More on Counting

12. Sketch all the lattice paths from (0, 0) to (6, 6) that do not run above the line y = x.
Use only steps H and V . i.e., H = (1, 0), V = (0, 1).
13. Let α = a1 · a2 · · · · · an where ai ∈ R. In order to compute α, one can multiply two
factors at a time. We can use brackets to indicate such products. For example t =
a1 (a2 a3 ) is the product of a1 with a2 a3 . Find the number of ways we can bracket the
expression a1 a2 . . . an to compute α.
Discrete Probability
12

12.1 Activity and Outcomes

Consider the activity or sometimes we may call it as experiment of tossing a coin twice. The
outcome of each tossing may turnout to be ‘Head’ or ‘Tail’. We cannot predict the outcome
with certainty. We will refer all such activities or experiments as ‘random experiments’.
Going back to our coin tossing activity, the outcome may be any of the 4 strings.

A = {H H , H T , T H , T T }

where a string H H mean we get in both the tosses ‘Head’ as the outcome. Similarity we
can interpret the strings H T , T H , T T . We also call the set A to be the sample space.
If the number of tosses of the coin increases, the size of the sample space will also
increase. The sample space gives all possible outcomes of the experiment. For example,
instead of two times, if we toss the coin 4 times, the sample space

A = {H H H H , T H H H , H T H H , H H T H , H H H T , T T H H ,
T H T H , T H H T , . . . , T T T T }.

The size of A will be 24 = 16.


One requires to know how big the sample size will be and what subset of the sample
space is required.

Example 12.1 Consider the activity of rolling two dice. Then the sample space will be

A = {mn | m, n ∈ {1, 2, 3, 4, 5, 6}}

© Ane Books Pvt. Ltd. 2025 189


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_12
190 12 Discrete Probability

where in the string ‘mn’, m denotes the outcome of rolling the first dice and n is the outcome
of rolling the second dice. Only in some activities, we can write the sample space explicitly,
as in the case of previous example, but look at the following example.

Example 12.2 In a game of bridge, each player is distributed with 13 cards from a deck of
52 cards. The distribution method is not known. In such cases it is not possible to explicitly
list the sample space of all possible hands. We can only say how many members will be in
the sample space. It is
52!
C(52, 13) =
13!39!
which is a very large number.

Many times, we may not require the full sample space to be explicitly written and it is
not possible also. Note that each element of the sample space is distinct. We may need to
extract only a subset of the sample space.

Example 12.3 Consider the activity of tossing a coin 4 times whose sample space S is of
size 24 = 16. Let B be a subset of S such that each member of B is a string over {H , T } of
length 4 and has exactly 2 heads will be

B = {H H T T , H T H T , H T T H , T H T H , T H H T , T T H H }.

The subset ‘B’ is called an event.

Definition 12.4 Let H be an activity whose sample space is S. Any subset of S will be
called an ‘event’.

Example 12.5 Recall the sample space of rolling two dice. The following subset B =
{22, 33, 44, 55} will be an event.

Example 12.6 Suppose the activity is to distribute three distinguishable balls in three boxes
then the sample space will be of size 27. The set

B = {(a, b, c), (a, c, b), (b, a, c), (b, c, a), (c, a, b), (c, b, a)}

is an event that each box has exactly one ball.

Example 12.7 Suppose three indistinguishable balls are to be distributed in 3 urns, then
the sample space is simply of size 10. (The event {(a, a, a)} has exactly one element. That
is the activity is to distribute the balls such that no urn is empty.
12.1 Activity and Outcomes 191

Example 12.8 Suppose an elevator starts in the ground floor with ‘t’ passengers. Suppose
the building has m floors. The different ways of discharging the passengers is nothing but
the number of ways t balls can be distributed in m urns. The sample space is accordingly
computed. We do not distinguish each individual person here.

Example 12.9 The activity is to collect a sample of 1000 people who are diabetic for
some purpose. Here we are interested only in the number of such persons even though each
individual is a distinct person. So we have the sample space as tuple (D, N D) where D
stands for diabetic and N D stands for non diabetic. A set of people who are female will be
subset of {(D, N D)}.

The above examples are given with the purpose of understanding that probability theory
will deal with real activities whose outcome is not predictable with certainty. Many call
such activities as ‘random’ experiments. What maximum can be done is to find a measure
or number that indicates the happening of the event when the activity is carried out large
number of times. The sample space may be described in more than one way. The description
will vary by varying the conceptions. For example while rolling a ‘dice’, initially we look
for sample space {1, 2, 3, 4, 5, 6}. But if we include the state of the dice that stand on its
edges, as ‘e’, then the sample space will be {1, 2, 3, 4, 5, 6, e}. It may so happen that the
dice will roll off and lost so now the sample space will be {1, 2, 3, 4, 5, 6, e, b}.
From the example it is clear that we cannot give rules to the construction of the sample
space. It is different for different problems and different situations.
We now have more information on events which we defined earlier to be subsets of sample
space. An event is also a description of the activity. When we say an event ‘A’ has occurred,
we mean that the outcome of the activity under consideration is a member of A. Since events
are subsets of sample space, all subset operations become meaningful. That is event A ∪ B
is said to occur when the outcome is either a member of A or a member of B. Similarly
A ∩ B, Ac can be defined in terms of occurrence of the outcome. An usual property of sets
which will be used very often will be De-Morgan’s law. An impossible event is denoted by
the empty set ∅.
Also two events A and B that cannot occur simultaneously are said to be mutually
exclusive events. When the activity is carried out, the outcome is either a member of A or a
member of B, but not both. For example, the sample space of the activity of rolling a ‘die’
will contain either 2 or 4 as outcome. It cannot be both. The situation of defining equality
of events also need to be done carefully in terms of outcomes. We can define first an event
A being a subset of an event B and then we may proceed to define A = B.

Example 12.10 Let a game of tossing coins be played by two persons P1 and P2 . The
tossing is done alternatively. P1 will receive Rs. 10/- for each tossing when head turns up.
Find the sample space for P1 for tossing the coins 5 times.
192 12 Discrete Probability

Solution: In all the five times, head may not turnup, head may turnup once head may turn
up twice and so on. Hence the sample space will be

{0, 10, 20, 30, 40, 50}.

That is, P1 may receive no money or Rs. 10, or Rs. 20, or Rs. 30 and so on.

12.2 The Definition of Probability Function

In the previous section we have seen what is known as ‘sample space’ of an experiment.
We also saw several mathematical notions of such sets. Now in this section we are ready to
describe the mathematical model of the random experiment. A chance or random outcome
is having the property that the outcome under the given situation does not guarantee any
information in the future outcome. However a random event must guarantee, in a long
repeated activity of a randomly selected situations, approaches a stability through outcome.
Let A be a random event. We say that A satisfies a random property if there exist numbers
between 0 and 1 which represent the frequency of possible outcomes that happen in a long
repetition of the activity. This property is called as ‘statistical stability’.

Example 12.11 Suppose a coin is tossed 500 times. The following table is called the fre-
quency table and the associated number between 0 and 1.

Tosses Number of Heads Proposition


(w.r.to 100)
1–100 54 .54
101–200 53 .53
201–300 51 .51
301–400 51 .51
401–500 52 .52

The statistical stability is the proportion which is near 21 .

Now we define what is known as probability function. The probability function is defined
from the event sets to a number between 0 and 1. An event A is mapped to a number p(A)
which is a number, which can be got only by performing an activity or experiment repeatedly
large number of times the members of A. Every time performing an experiment for a large
number of times may not be practical. Moreover the probability function should be defined
exhaustively for all events of the sample space. Hence the probability function has to be
mathematically well defined for simpler events so that we can proceed to look for such
functions for all situations. With this background now we formally give the definition of
probability functions.
12.2 The Definition of Probability Function 193

Definition 12.12 A probability function p is a function from the sample space S to a real
number between 0 and 1 such that the following axioms are satisfied

(i) p(A) ≥ 0 for every event A.


(ii) p(S) = 1 for the one event S.
(iii) p(A ∪ B) = p(A) + p(B), where A and B are events and A ∩ B = ∅.

If n A is the number of occurrences of the event A, then p(A) = nnA where n = |S|. So axiom
(i) must be true. Also p(S) = nn = 1, so (ii) must be true. Finally if the number of occurrences
of A and B be respectively, n A and n B , then p(A ∪ B) = p(A) + p(B) = (n A +n n
B)
. Hence
axiom (iii) is satisfied as A ∩ B = ∅.
So, in order to speak of the probability of an event, all that we need is

(a) A sample space of the activity on which events of which the probability can be defined.
(b) A and B be any two events in S.
The space S that satisfy axioms (i), (ii) and (iii) defined above will be referred to as
probability space. The following results can be proved easily using the basic definitions
and the definitions of set theory.

Theorem 12.13 Let S be a probability space. Let A, B be any two events in S.

(i) p(∅) = 0.
(ii) p(Ac ) = 1 − p(A).
(iii) p(A ∪ B) = p(A) + p(B) − p(A ∩ B).
(iv) p(A ∩ B c ) = p(A) − p(A ∩ B).
(v) p(A ∩ B c ) = p(A) − p(B) if A ⊂ B.
(vi) p(A) ≤ p(B) if A ⊂ B.

Example 12.14 Two coins are tossed. Find the sample space. Find the probability of all the
events of the sample space.

Solution: The sample space will be S = {H H , H T , T H , T T }. Then the events are ∅, {H H },


{H T }, {T H }, {T T }, {H H , H T }, {H H , T H }, {H H , T T }, {H H , H T , T H },
{H H , T H , T T },{HT, TH, TT},{HT, TH, TT},{HT, p(∅) = 0, p(S) = 1
p({H H }) = 41 (= p({H T }), p({T H }), p({T T }))
p({H H , H T }) = ( p{H H , T H }) = p({H H , T T }) = p({H T , T H }) = p({H T , T T }) =
p({T H , T T })
= p({H H }) + p({H T })
= 41 + 41 = 21
Similarly other probabilities can be written down.
194 12 Discrete Probability

Definition 12.15 (i) Two events A and B are said to be independent if


p(A ∩ B) = p(A). p(B)
(ii) If events A1 , A2 , . . . , Am are independent, then for all t, 2 ≤ t ≤ m, we have

p(A j1 ∩ A j2 ∩ A j3 ∩ · · · ∩ A jt ) = p(A j1 ). p(A j2 ) . . . p(A jt ),


1 ≤ j1 < j2 < j3 · · · < jt ≤ m.

Remark 12.16 The definition of independent events of an infinite set of events can
be defined similarly. That is if {A1 , A2 , A3 , . . . } is an infinite set of events, and if
{A1 , A2 , . . . , Am } are independent for every m ≥ 2, then {A1 , A2 , A3 , . . . } is said to be
independent.

12.3 Finite Probability Space

So far we have seen some basic concepts on sample spaces that lead us to define what is
known as probability functions. The probability function need to satisfy the three axioms
that are defined on events. We may denote the probability space S in terms of its members
a1 , a2 , . . . , an where each {ai } is called an event with single member. In the tossing of
a fair coin S = {H , T } and {H }, {T } are called singleton events. When two fair coins
are tossed, S = {H H , H T , T H , T T } and {H H }, {H T }, {T H }, {T T } are called singleton
events. So a singleton event is an event which contains only one outcome. For example
‘H H ’ is an outcome and {H H } is an event. If A1 , A2 , . . . , At are singleton events and
A = A1 ∪ A2 ∪ A3 · · · ∪ At . Then p(A) = p(A1 ) + p(A2 ) + · · · + p(At ).
A sample space S is said to have equally likely outcomes if the singleton events of S have
the same probabilities.

Useful notation

An n-tuple (t1 , t2 , . . . , tn ) is simply an array of n-symbols t1 , t2 , . . . , tn . t1 is called the first


element, t2 is called the second element, and so on, tn is called the n th element. This is called
an ordered n-tuple as the ordering is important.

Example 12.17 (1, 1), (1, 2), (2, 1), (2, 2) are ordered 2-tuples.
Equality of two n-tuples: (t1 , t2 , . . . , tn ) and (t1 , t2 , . . . , tn ) are said to be equal iff ti = ti ,
1 ≤ i ≤ n.
12.3 Finite Probability Space 195

Ball-Box Distribution

Suppose there is a box that contains m balls which are numbered from 1 to m. Suppose the
activity is to draw a ball from the box, until a collection of n balls is noted.
There are two cases here. We say that the new bag is a sample.
Case (i): The sample is drawn with replacement. That is the sample of size ‘n’ is made where
after each draw of a ball, the drawn ball information is recorded and the ball is returned to
the box.
Case (ii): The sample is drawn without replacement. That is the sample of size ‘n’ is made
where after each draw of a ball, the ball drawn is not put back in the box.
In each draw, more than one ball may be drawn.

Example 12.18 Let a box contain 3 distinct balls. If a sample of size 2 is made (i) with
replacement (ii) without replacement. Find the sample space.

Solution: Let the 3 balls be numbered as ‘1, 2, 3’.


(i) With replacement case
The probability sample space will be ordered 2-tuple where the first element indicates
the first draw, second element indicates the second draw. The space will be

{(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)}

(ii) Without replacement case

{(1, 2), (1, 3), (2, 1), (2, 3), (3, 1), (3, 2)}

Remark 12.19 (1) We have seen earlier that the number of ways of collecting n balls from a
box containing m distinguishable balls is m(m − 1)(m − 2) . . . (m − n + 1) if the draw
is made without replacement, and it will be m n if it is done with replacement.
(2) The number of events of a sample space S having n elements will be 2n which includes
the impossible event ∅.
(3) The number of ways in which a sample space having n elements can be partitioned into
t ordered (subsets) events in such a way that the first event contains n 1 elements, the
second event has n 2 elements and so on will be
n!
C(n, n 1 ).C(n − n 1 , n 2 )C(n − n 1 − n 2 , n 3 ) · · · C(n − n 1 − n 2 · · · − n t−1 , n t ) = .
n 1 !n 2 ! . . . n t !

We just list the four possible situations arise in any ball-box distribution activity. We can
see that we have enumerated them earlier in chapters (combinatorics).
196 12 Discrete Probability

(1) The balls are distinct and the boxes are also distinct. The number of ways of distributing
t balls into m boxes where no box is empty will be the number of integer partitions of
the integer ‘t’ into ‘m’ parts where no part is zero.

C(t, i 1 , i 2 , . . . , i m )
i 1 +i 2 +···+i m =t
i j ≥1

(2) The balls are distinct and the boxes are identical. The number of ways of distributing t
balls into m boxes where no box is empty will be s(m, t), Stirling numbers of second
type.
(3) The balls are identical and the boxes are distinct. The number of ways of distributing t
balls into m boxes so that no box is empty will be C(t − 1, t − m).
(4) The balls are identical and the boxes are also identical. The number of ways of distribut-
ing t balls into m boxes where no box is empty will be the number of integer partitions
of the integer ‘t’ into ‘m’ parts where no part is zero.

We defined p(A ∪ B) when A ∩ B = ∅. However when A and B are events, they may or
may not contain outcomes which are common to both A and B. In combinatorial problems
we address ‘A ∩ B’ to be the part which is counted twice. Hence we have the theorem.

Theorem 12.20 For any two events A and B we have,

p(A ∪ B) = p(A) + p(B) − p(A ∩ B)

Proof The event A ∪ B means that it is the union of outcomes of A and B. An outcome
may occur either in A or in B or in both. Hence

p(A ∪ B) = p(A) + p(B) − p(A ∩ B).

If A and B are mutually exclusive, then

p(A ∪ B) = p(A) + p(B).

Example 12.21 Two fair coins of different sizes are tossed. The probability sample space
will be {(H , H ), (H , T ), (T , H ), (T , T )}.
In the pair (a, b), a denotes the outcome of the smaller coin, b the outcome of the larger
coin.
Let A = {outcome such that the smaller coin is Head}.
B = {outcome such that the larger coin is head}.
12.3 Finite Probability Space 197

Then

A = {(H , H ), (H , T )}
B = {(H , H ), (T , H )}
A ∪ B = {(H , H ), (H , T ), (T , H )}
p(A ∪ B) = p(A) + p(B) − p(A ∩ B)
1 1 1 3
= + − =
2 2 4 4

Boole’s Inequality

Let A1 , A2 , . . . , Am be m events, then

p(A1 ∪ A2 ∪ . . . Am ) ≤ p(A1 ) + p(A2 ) + · · · + p(Am ).

Note 12.22 If A1 , A2 , . . . , Am are mutually exclusive events then

p(A1 ∪ A2 ∪ · · · ∪ Am ) = p(A1 ) + p(A2 ) + · · · + p(Am ).

Example 12.23 A two digit number is formed using the digits {1, 2, 3, 4, 5}, where repe-
titions of the digit is not allowed. Assume that all the outcomes are equally likely. Find the
probability that

(i) the number formed is an odd number.


(ii) the number formed is an even number.

1
Solution: The probability space has 20 elements. The probability each outcome will be 20 .

(i) The event that the number will be odd will be numbers
O = {13, 15, 23, 25, 35, 45}.
p(0) = 20
6
= 108
.
(ii) E = {12, 14, 24, 32, 34, 42, 52, 54}.
p(E) = 208
= 25 .
198 12 Discrete Probability

Conditional Probability

The definition of probability given earlier is based on a direct situation with respect to
probability space and events.

Example 12.24 Let a box contain 15 balls out of which 5 are red balls and 10 are white
balls. Find the probability of selecting a red ball from the box?

In the above example the solution is approached directly. The number of possible ways
a ball is selected is 15 and number of ways a red ball is selected is 5. Hence the probability
of selecting a red ball will be 13 .
Suppose we have the following situation.

Example 12.25 Let a box contain 15 balls out of which 5 are red balls and 10 are white
balls. Two balls are drawn from the box. Find the probability that the second ball drawn is
white?

We need to understand the probability space in steps as the above activity has two steps.
In the first step one ball is drawn. It may be either white or red. One more ball is drawn in the
second step. This may also be white or red. But our event should include only those outcomes
which will be white in the second draw. Since the activity is so called ‘ball-box’ activity,
there will be two situations where we look for samples with replacement and samples without
replacement. We will write down the solution to this example later.

Definition 12.26 Let S be a probability space. Let A and B be any two events in S. The
conditional probability of the event B, given that the event A has occurred is the ratio p(A∩B)
p(A)
and it is denoted by p[B | A].

Notation: In the subject probability theory, writing A ∩ B as product AB is a standard


notation. Here after we will use the product AB to denote (A ∩ B).

Example 12.27 Let a box contain 3 distinct balls. If a sample of size 2 is made (i) with
replacement (ii) without replacement. Find the sample space.

Solution: Since it is a ‘ball-box’ activity we discuss the solution in two cases.


Case (i): Let the activity be done without replacement.
Clearly the number of elements in the sample space will be 15 × 14. Let A be the event
that the first is red and the second ball is white. This can be done in 5 × 10 ways. Let B be
the event that the first ball is white and the second ball is also white. This arrangement can
be done in 5 × 4 ways. Hence the probability of second ball being white will be
12.3 Finite Probability Space 199

5 × 10 5×4
p(A) + p(B) = +
15 × 14 15 × 14
70 1
= = .
15 × 14 3
The argument for Case (ii) where we consider the activity where a ball drawn is replaced
can be argued combinatorially.

Remark 12.28 For such problems it will be easier to use n tuple notation where each of
i th component indicates the i th draw where sum of the components will be ≤ n, the total
number of balls in the box. We are computing here any conditional probability as the two
draws are independently done.
The case where the balls are replaced can be argued in similar lines.

Now we modify the Example 12.27 further as below.

Example 12.29 Let a box contain 15 balls out of which 5 balls are red in color and rest are
white in color. Two balls are drawn from the box without replacement. Find the probability
that both the balls drawn are white.

Solution: We understand the situation as before using 2-tuple notation. Let (b1 , b2 ) denote
the balls drawn where b1 is the ball drawn in the first draw and b2 is the ball drawn in the
second. We know that the sample space S will be set of all 2-tuples (b1 , b2 ) where b1 , b2
are any two balls in the box. Hence the activity is done without replacement, the cardinality
of S will be 15 × 14. Now the cardinality of (b1 , b2 ) will be 10 × 9. Hence the answer will
10×9
be 15×14 = 37 .
In terms of probability space and events, let A be the event where the first draw is white
and B be the event where the second draw is white. It is clear that
10
p(A) = = p(B)
15
3
p(AB) = = p(A). p(B).
7
In the case of activity with replacement it will be p(A). p(B) = p(A.B). Why?

Example 12.30 In a town T , there are 100 scooters. There are three scooters in red color.
There are 20 scooters having registration numbers being odd. Given the probability that
the scooter is red in color and the registration number being odd is 13 , find the conditional
probability that the registration number is odd, given that the scooter is red in color.
200 12 Discrete Probability

Solution: Let A be the event that the scooter is red in color. Hence
3
p(A) = = 0.03
100
Let B be the event that the registration number is odd. Hence
20 1
p(B) = =
100 5

Given p(AB) = 13 = 0.333.


Hence by formula
p(AB) 0.333
p(B | A) = = = 0.0449
p(A) 0.03
Next we state a small useful result.

Lemma 12.31 Let A and B be two events where p(A) = 0. Then A and B are independent
if and only if p(B | A) = p(B).

Proof Let A and B be the two events which are independent. By A, B being independent,
it implies p(AB) = p(A). p(B). Hence

p(AB)
p(B | A) = = p(B).
p(A)
Conversely if p(B | A) = p(B).
Then
p(AB)
p(B | A) = = p(B)
p(A)
⇒ p(AB) = p(A). p(B)

Hence A and B are independent. 

Example 12.32 Let a box contain 10 balls of 5 different sizes. Each ball is either green or
red. Find the probability of drawing a smallest ball and that it is colored red.

Solution:
Let the ball sizes be denoted by s1 , s2 , s3 , s4 , s5 , where size si < si+1 , 1 ≤ i ≤ 4. The green
and red color are denoted by g and r . The object ‘s1 g’ means the ball of size s1 is green.
The sample space will be

s1 g, s1r , s2 g, s2 r , s3 g, s3r , s4 g, s4 r , s5 g, s5r


12.3 Finite Probability Space 201

Let A be the event that the randomly drawn ball is in color red. Let B be the event that the
ball is the smallest one of size ‘s1 ’. Note that A and B are not independent.

5 1
p(A) = =
10 2
2 1
p(B) = =
10 5
1 1 1
p(AB) = . =
2 5 10
1
0.1 1
p(B | A) = 10
1
= = .
2
0.5 5

Extension of Independent Events

So far we have seen two events being independent. Suppose we have three events A, B and
C defined on a probability space. What is the meaning of conditional probability of the event
A given that B and C have happened? We can very well take the notation as p[A | BC].
Then the definition of p[A | B, C] will be

p[A | B, C] = p[A | BC]

Suppose the event A is independent of B and C. For defining this we need to extend the
definition of independent events to A, B, C.

Definition 12.33 Three events A, B, C are independent if

p(AB) = p(A) p(B)


p(AC) = p(A) p(C)
p(BC) = p(B) p(C)
p(ABC) = p(A) p(B) p(C).

If all the above used probabilites are non zero, then we get the following.

p(A | B, C) = p(A | B) = p(A | C) = p(A)


p(B | A, C) = p(B | A) = p(B | C) = p(B)
p(C | A, B) = p(C | A) = p(C | B) = p(C).

Remark 12.34 The conditional probability can be extended to n events A1 , A2 , . . . , An .


202 12 Discrete Probability

Total Probability Theorem

Before proceeding further, let us understand more about independent events. Suppose we are
given two sets of events say A and B . The sets of events A and B are said to be independent
if for any A ∈ A and B ∈ B , A and B are independent, where A and B are events. We call
A and B to be mutually independent sets of events.
Next we define what are known as ‘trials’. Let S be a probability space. Then we know
that any member of S may have a tuple description. For example for tossing two fair coins,
elements of S will be of the form (ζ1 , ζ2 ) where ζ1 is the outcome on the first coin and ζ2
is the outcome in the second coin. Then we say that S is madeup of 2 trials. Similarly if S
has a n-tuple for n trials. Further suppose in the coin tossing set up mentioned above, one
looks for the event A where ζ1 = H , then we say that A is dependent on the first coin output
which must be a ‘head’. We see that event ‘A’ depends on a trial.
Next we give the definition of independent Bernoulli trials. There are problems in prob-
ability theory which involve a random activity or experiment which will have exactly two
possible outcomes. For example while tossing a coin, there can be only two possible out-
comes. The appearance of ‘head’ or the appearance of a tail will be the possible outcomes.
If two coins are tossed, then the outcome will be a tuple (ζ1 , ζ2 ) or ζ1 ζ2 where each trial
ζi , i = 1, 2 will have only two categories of outcome. Such activities or experiments will
be called ‘Bernoulli trial’ experiments. The general definition can be easily understood as
problems in probability theory that have independent trials whose outcomes are only two.
Usually such outcomes are called as “success” and ‘failure’. For example while tossing a
coin, the appearance of ‘head’ can be categorized as ‘success’ and the appearance of ‘tail’
as ‘failure’. If ‘ p’ is the probability of the outcome ‘success’, then (1 − p) will be the
probability of the outcome ‘failure’.

Example 12.35 A fair coin is tossed 5 times whose probability of the outcome head is ‘ p’
where 0 < p ≤ 1. Find the probability of an event A that the coin shows up ‘head’ in the
first three trials and shows up ‘tail’ in the last two trials.

Solution: Let S be the sample space whose members are (ζ1 , ζ2 , ζ3 , ζ4 , ζ5 ) where ζi is
the outcome of the i th trial which may be ‘head (H)’ or ‘tail (T)’. Hence |S| = 25 . Here
A = {(H , H , H , T , T )} which is a singleton. Hence the probability will be p 3 (1 − p)2 .

Binomial Coefficient Law

Consider a problem event that has n independent repeated Bernoulli trials. Let the probability
of a ‘success’ trial be p and the probability of a ‘failure’ trial be q. Then the probability of
such an event will be C(n, k) p k q n−k where the event has k successes and (n − k) failures.
12.3 Finite Probability Space 203

Clearly

p+q =1

n
( p + q)n = C(n, k) p k q n−k = 1.
k=0

Example 12.36 (“Odd man out” Problem) A game is played by a group of people. The
game is to choose a ball from a bag that contains two identical balls of different colors say
red and green. Each person has to close their eyes while playing. If the outcome is that there
is a person ‘A’ who has picked a different color ball and all others have chosen the same
color, then ‘A’ is the ‘odd man out’. Find the probability that any game will have an ‘odd
man out’ situation.

Solution: Let there be n people in the group. Each person picks a ball independently by
closing their eyes. If (ζ1 , ζ2 , . . . , ζn ) is a member of the sample space, then each ζi = R
or G, (Red or Green). The ζi ’s are independent Bernoulli trials. Let the probability of
ζi = R be p. Then the probability of ζi = G is 1 − p = q (say). Then we need to look for
members like (R, R, R, . . . , R, G), (R, R, R, . . . , R, G, R, . . . , R) etc. where exactly one
of the ζi is G and the rest are ‘R’ or the other way. Hence the associated probability will
be C(n, 1) p n−1 q or C(n, 1) pq n−1 . That is in the n-tuple only one of the trial ‘ζi ’ is fixed
with different color from the remaining (n − 1) of them. Hence the total probability will be
C(n, 1) p n−1 q + C(n − 1) pq n−1 .

Remark 12.37 One define in a probability space whose members are n-tuples what is
known as ‘dependent’ trial. Simply dependent trials are trials which are dependent.

Example 12.38 Let a box contain 10 balls out of which 4 are green balls, the rest of the
balls are red in color. Let a collection of 3 balls be made. Find the probability that all the
balls are green. Assume the drawing is done without replacement.

Solution: We have taken this example to understand what are known as ‘dependent’ trials.
Let Ai be the event that ball drawn at the i th instance is green. There are three events
A1 , A2 , A3 under consideration. That is A1 is the event that the first ball drawn is green and
its probability is p(A1 ) = 10
4
= 25 .
Then A2 is the event that the second ball drawn is green. But we want the first ball is
green and the second will be green. That
204 12 Discrete Probability

p(A1 A2 ) p(A1 ) p(A2 )


p(A2 | A1 ) = =
p(A1 ) p(A1 )
3
= .
9

Similar p(A3 | A1 , A2 ) = 14 .

Example 12.39 A coin is tossed three times. What is the probability of an event that

(i) all the three outcomes are tails


(ii) out of the three outcomes, there are exactly two tails
(iii) given the fact that the outcome has atleast one tail, the outcome that there are atleast
two tails?

Solution: The tosses of the coin are independent activities. The outcomes will be the tuple
(ζ1 , ζ2 , ζ3 ) where each trial ζi will be either ‘head’ (H) or ‘tail’ (T).

(i) The event containing {(T , T , T )} has the probability


1
p(T , T , T ) = p(T ). p(T ). p(T ), [∵ p(H ) = ] = p(T )
2
1
=
8
(ii) The event for this situation will contain three outcomes B = {(T , T , H ), (H , T , T ),
(T , H , T )}.
Hence
3
p(B) = p((T , H , T )) + p((H , T , T )) + p((T , T , H )) =
8
(iii) Let A be the event that has atleast one tail. From the method of indirect counting we
have

A = S − {(H , H , H )}
7
#S = 23 = 8 and p(A) =
8
Let B be the event such that the outcomes contain atleast two tails. By direct counting
# B = #{(H , T , T ), (T , H , T ), (T , T , H ), (T , T , T )}.
1
p(B) = .
2
p(A1 A2 )
So p(A2 | A1 ) = p(A1 ) = 21 . 87 = 47 .
12.3 Finite Probability Space 205

The discussions and examples given above are towards what is known as ‘total probabil-
ity’ theorem. We state the theorem without proof.

Theorem 12.40 Let A1 , A2 , . . . , Am be mutually non-overlapping events such that S =


A1 ∪ A2 · · · ∪ Am with p(Ai ) > 0, for 1 ≤ i ≤ m. [By mutually non-overlapping events we
mean each outcome of S appears exactly in one Ai ]. Then for any event K ,

p(K ) = p(A1 ∩ K ) + p(A2 ∩ K ) + · · · + p(Am ∩ K )


= p(A1 ) p(K | A1 ) + p(A2 ) p(K | A2 ) + · · · + p(Am ) p(K | Am )

Example 12.41 A math question paper, has three categories of questions. Half the number
of questions are tough and the probability of answering any one of them correctly is 13 . One
fourth of the questions are slightly twisted and the probability of answering any one of them
correctly is 14 . The remaining questions are such that the probability of answering any one
of them correctly is 21 . Student M chooses a question. Find the probability that M gets the
correct answer.

Solution: Let the questions be divided into three mutually disjoint events A, B, C such that
A is the event of selecting a question from the tough set, B is the event of selecting a question
from the slightly twisted set, C is the event of selecting a question from the rest. Let K be
the event that a question is chosen by M randomly is answered correctly. Then K may be
in A or B or C. That is,

K = (A ∩ K ) ∪ (B ∩ K ) ∪ (C ∩ K )

Hence
p(K ) = p(A ∩ K ) + p(B ∩ K ) + p(C ∩ K )
Now

p(A ∩ K ) = p(A) p(K | A)


p(B ∩ K ) = p(B) p(K | B)
p(C ∩ K ) = p(C) p(K | C)

1 1 1
p(K | A) = , p(K | B) = , p(K | C) =
3 4 2
206 12 Discrete Probability

Hence using total probability theorem,

p(K ) = p(A). p(K | A) + p(B). p(K | B) + p(C) p(K | C)


1 1 1 1 1 1
= . + . + .
2 3 4 4 4 2
1 1 1 17
= + + = .
6 16 8 48

Example 12.42 A box contains three coins. In these coins, two coins are regular coins and
one coin has tail printed on both sides. The activity of picking a coin from the bag is randomly
performed and tossed. (i) Find the probability that a ‘tail’ turns up. (ii) By randomly picking
a coin and tossing, ‘Tail’ turns up. Find the probability that the coin is a ‘two-tailed’ coin (a
coin with tail printed on both sides).

Solution: The sample space is the union of two events A and B such that, A is the event that
a regular coin is chosen and tossed, and B is the event that the two-tailed coin is chosen and
tossed. Hence we use conditional probability rule in two steps.
1
p(T | A) =
2
p(T | B) = 1.

Hence, using the law of total probability,

p(T ) = p(T | A) p(A) + p(T | B) p(B)


1 2 1
= . + 1.
2 3 3
2
= .
3
(ii) In the second part, we need to find the probability that such chosen coin is ‘two-tailed’.
So by conditional probability condition, and Bayes’ theorem, we have

p(T | B) p(B)
p(B | T ) =
p(T )
1. 13 1
= 2
= .
3
2

The above problem can be understood as follows. The activity is to select a question
from a set of questions which belongs to a larger set of questions. We realize that it is
simply an activity of selecting a question from the larger set itself. Bayes’ theorem which
connects conditional probabilities p(A | B) with p(B | A) is an interesting consequence of
total probability theorem.
12.3 Finite Probability Space 207

Bayes’ Theorem: Let A1 , A2 , . . . , Am be mutually disjoint events such that S = A1 ∪ A2 ∪


· · · ∪ Am and Ai ∩ A j = ∅ for i = j, 1 ≤ i, j ≤ m. Given that p(Ai ) > 0, for 1 ≤ i ≤ m,
for any event K of S, we have

p(Ai ) p(K | Ai )
p(Ai | K ) =
p(K )
That is
p(Ai ) p(K | Ai )
p(Ai | K ) =
p(A1 ) p(K | A1 ) + p(A2 ) p(K | A2 ) + · · · + p(Am ) p(K | Am )
Verifying the above equality is simple and direct from the definition of conditional proba-
bility.

Example 12.43 A box contains 5 white balls, 4 red balls and 3 yellow balls. Four balls are
drawn one after the other without replacement. Find the probability of the event that the first
and third drawn balls are white, second drawn ball is yellow and the 4th drawn ball is red.

Solution: The sample space will be the tuple (ζ1 , ζ2 , ζ3 , ζ4 ) where each ζi is one among 12
balls drawn at the i th draw. We need to find the probability of the event A = {(W , Y , W , R)}.

5 3 4 4
p(A) = . . . .
12 11 10 9
From Bayes’ Theorem we have,

p(A) = p(W ) p(Y | W ). p(W | W Y ). p(R | W Y W )

where P(Y | R) means probability of drawing a Yellow ball, while a white ball being drawn
in the first step. Similarly p(W | W Y ), p(R | W Y W ) can be defined.

Example 12.44 Two cards are drawn successively from a standard deck of 52 cards. Find
the probability of

(i) drawing a spade in the second draw given that the first card drawn is a spade.
(ii) that the first card drawn is a space given that the second card drawn is a space.

Solution: Let A be the event of drawing a spade in the first draw and B be the event of drawing
a spade in the second draw. Clearly p(A) = 52 13
. Also if A is the event that a spade is not
drawn first, then p(A) = 52 . So in the second draw we need to draw a spade irrespective of
39

the first draw. So


(i) p(B | A) = p(B). p(n)
p(A) = 12
51
p(B). p(A)
(ii) p(A | B) = p(B) = 12
51 .
208 12 Discrete Probability

Also note that

p(B) = p(B | A). p(A) + p(B | A). p(A)


13
= = p(A).
52

12.4 Ball-Box Distribution: Cases and Analysis

We have seen several problems involving ball-box activity where the balls are picked in
order and are not replaced. Also more importance was given to the situation in which a
distinction is made in the instances of drawing the balls. That is we discussed the ordered
n-tuple (z 1 , z 2 , . . . , z m ) mean that z i is the result of i th draw.
Now the discussion will be on instances where the balls are replaced and then a fresh
draw is made. Clearly there is nothing like first draw, second draw and so on. Hence the
required balls can be extracted all at one time. If ‘t’ balls are to be taken from a box that
contains distinct m-balls, then the outcome will be something like a set {z 1 , z 2 , . . . , z t } of
numbers between 1 and m. We call the set {z 1 , z 2 , . . . , z t } as an ‘unordered sample’.

Example 12.45 A box contains 3 distinct balls and two balls are drawn from the box. Then
we may draw one ball at a time, or pick two balls and then one ball and so on. So let the
balls be numbered as {1, 2, 3}. Hence our unordered sample will be

{1, 1}, {2, 2}, {3, 3}


{1, 2}, {1, 3}, {2, 3}.

Remark 12.46 The unordered partition can be written down to situations, where the balls
are handled with or without replacement.

Proposition 12.47 (i) Let the activity be to draw t balls with replacement from a box that
contains m balls. Then the size of the sample space will be |S| = C(m + t − 1, t).
(ii) Let the activity be to draw t balls without replacement from a box that contains m balls.
Then the size of the sample space will be |S| = C(m, t).

Proof The proof directly comes from elementary counting methods. 

The following example enumerates all situations.

Example 12.48 Let there be m boxes B1 , B2 , . . . , Bt and an activity of distributing m balls


is to be carried out, where t < m. Find the probability that a boxes B1 , B2 , . . . , Bt will each
contain exactly one ball.
12.4 Ball-Box Distribution: Cases and Analysis 209

Solution: The boxes are distinct. For balls, we have two cases.

(i) Balls are distinct: While distributing the m balls labelled {1 , 2 , . . . , t } a box may be
chosen at most one time or any number of times.

(a) The box is chosen at most one time. It can be shown using combinatorial argument
m!
that the (probability) sample space will be of size (m−t)! .
Let A be the event where each box is distributed with exactly one ball. Then |A| = t!.
Hence p(A) = t!(m−t)!
m! .
(b) The box is chosen any number of times to receive the ball, then the size of the
probability space will be m t and as before |A| = t!. So p(A) = mt!t .

(ii) Balls are not distinct:

(a) The box is chosen atmost one time. Then the size of the probability space S will be
C(m, t). Here |A| = 1. Hence p(A) = C(m,t)
1
.
(b) The box is choosen any number of times. Then the size of the sample space S will be
C(m + t − 1, t), |A| = 1. Hence p(A) = C(m+t−1,t)
1
.
Remark 12.49 Sometimes we write the probability space as sample space.

Example 12.50 A group of 10 people living in a 5-storied building enters a lift at the
basement to reach their homes. At each floor, when the lift stops, some residents get in and
some get out. The lift can hold only 10 people at any point of time. Find the probability that
the lift is always full.

Solution: Let xi be the number of people who leave the lift at floor i-clearly xi people will
enter the lift at the same time. Then we have

x1 + x2 + x3 + x4 + x5 = 10 where xi ∈ N ∪ {0}

The size of the sample space will be the number of integral solutions of this equation which
1
will be C(14, 4). The probability is C(14,4) .

Example 12.51 A box contains 5 white balls, 5 red balls and 6 green balls. Find the prob-
ability of choosing 4 balls so that there is atleast one white, one red and one green ball in
them.
210 12 Discrete Probability

Solution: First we have to find the total number of ways 4 balls can be chosen from 16 balls.
It is C(16, 4). Let A be the event that 4 balls are selected with one ball in each color. It is
same as the number of integer solutions of

x1 + x2 + x3 = 4 where xi ≥ 1

⇒ x1 + x2 + x3 = 1, xi ≥ 0
Hence
|A| = C(4, 1)
Hence
C(4, 1) 4
p(A) = = .
C(16, 4) C(16, 4)
[The solution is given using the fact that the balls are not distinct and the box may be chosen
any number of times].

12.5 Random Variables

We know what a function f : X → Y means for X and Y being set of numbers. That is
f (t) is called the function for a value t in X . The definition of functions are widely used
and studied in calculus. How else a function be viewed? Here the input is a single value
or parameter ‘t’. One may also define functions which takes more number of parameters.
For example ‘area of the rectangle’ is a function which can compute the area for a pair
(x, y) where x and y are length and breadth of the rectangle. The number of cars that pass a
signal in every 30 min is a function that outputs a positive integer. The number of passengers
arriving at a railway counter in every 30 min duration is a function. Note that the functions
that we deal with in calculus do not have any ‘random phenomena’ associated with them.
But look at the few examples that we have here, that compute area of a rectangle, cars
passing a signal, passengers arriving at a railway counter. They have random phenomena
associated with them. We now understand the definition of what are known as ‘random
variables’ which associates itself to a number where the so called variable will be function
similar to ‘passengers arrive at a railway counter’, ‘area of a rectangle’. Before we proceed
for formal definition let us take an example.

Example 12.52 A coin is tossed n number of times. The ‘number of times head turns up’
is a function that outputs the number for n Bernoulli trials. Let h be the number. Clearly
there are 2n elements in the sample space S and the function ‘number of times head turns
up’ will map every element in S to a number which indicates the ‘heads’.
So in one line we write the definition of a random variable as a function that maps a
sample space to a real number, that has some random phenomena in it.
12.5 Random Variables 211

Definition 12.53 A random variable x is a function from the probability space S to R, set
of real numbers. That is here x ∈ R and x is a random phenomena.

(i) If X is finite or countable, then the random variable is said to be discrete.


(ii) If X is continuous, then there exists a function ‘ f ’ called the density function such that
b b 
f (x)d x ≥ 0, for a < b, p(X ) = f (x)d x for a < X < b and f (x)d x = 1.
a a
That is the axioms of probability are satisfied here.

Example 12.54 The following are random variables

(i) Number of ‘heads’ in n Bernoulli trials.


(ii) Number of combinations of outcome whose sum is 9 while rolling two dice.
(iii) Number of Indians whose earning is less than 2 lakhs per month taken in a particular
year.
(iv) Number of odd numbers formed using the numbers {1, 2, 3, 4, 5}.
(v) The number of combinations of two numbers n and r
(vi) Number of aces in hand in a game of bridge.

Example 12.55 From a college a sample of 100 students is taken and their average weight is
recorded. The table will show different averages as the samples differ. Here the ‘averaging’
is the random function and the average weight is a random variable.
Sometimes the ‘random function’ is referred to as probability function of a random
variable X . X may assume different values x1 , x2 , . . . (something like range). These together
assume a real value f (xi ), for i = 1, 2, . . . . That is, we write it as

p(X = xi ) = f (xi ).

Sometimes we may write it as p X (xi ) = f (xi ). It is called the probability mass function.

Example 12.56 Let a fair coin be tossed two times. Let ‘X ’ be the random variable that
gives the number of heads in the tosses. Then we can see that the number of times head turns
will be 0, 1, 2. So,
1
p(X = 0) = (‘0’ head)
4
1
p(X = 1) = (‘1’ head)
2
1
p(X = 2) = (‘2’ heads)
4
212 12 Discrete Probability

Sometimes we write a situation

p(X = t) = 0 otherwise


2
Clearly p(X = i) = 1 which is the total probability condition.
i=0

Definition 12.57 Let X be a random variable. Clearly for the values x1 , x2 , . . . that the
variable X may assume, we have,

p(X = xi ) > 0 for i = 1, 2, . . .


p(X = xi ) = 0 otherwise. Also


p(X = x1 , x2 , . . . ) = p(xi ) = 1
i=1

Next we look into two basic random variables. They are (i) The Bernoulli random variable
(ii) The Poisson random variable.
The Bernoulli Random Variable: We have already seen what a Bernoulli trial means. Now
we just understand Bernoulli random variable is the variable that takes only two values p or
q. That is 
p if x = 
p(X = x) =
q = 1 − p if x = ¬
For example if a coin is tossed, the outcome will be either ‘head’ or ‘tail’. Here the
random variable 
1 if ‘head’
X=
0 if ‘tail’
So

p(X = 1) = p
p(X = 0) = q = 1 − p
p(X = t) = 0, otherwise

will be the probability mass function. Bernoulli random variables are very simple and found
to be more useful.
From Bernoulli random variable, we define what is popularly known as ‘Binomial Ran-
dom Variable’. Suppose a fair coin is tossed as stated above. The same description is borrowed
to define the Binomial random variable, where the trials are only with two probabilities. Let
Hn be the random variable with n-tosses of a fair coin showing ‘heads’. Then Hn is a bino-
mial random variable with parameters (n, p). The probability mass function of this variable
12.5 Random Variables 213

will be

p(Hn = i) = C(n, i) pi (1 − p)n−i , i = 0, 1, 2, . . . , n


= 0 otherwise


n
Clearly p(Hn = i) = 1.
i=0

Example 12.58 Let three fair coins be tossed. Find the probability that the outcome has
two heads and one tail.

Solution: Let H3 be the random variable and is equal to the number of ‘heads’ in the three
tossed coins. Clearly H3 is a binomial random variable.
 2  
1 1
p(H3 = 2) = C(3, 2) 1−
2 2
1 3
= 3. = .
8 8

Example 12.59 Let a die be rolled 6 times. The probability that an odd number turns up
on a die is 0.3. Let X be the random variable that indicates the number of odd numbers that
turns up in the rolling activity. Find

(i) p(X = 3)
(ii) p(X = 2)
(iii) p(1 < X ≤ 3)

Solution:
(i) p(X = 3)
Here n = 6, p = 0.3, q = 0.7
p(X = 3) = C(6, 3)(0.3)3 (0.7)3
p(X = 2) = C(6, 2)(0.3)2 (0.7)4
p(1 < X ≤ 3) = p(X = 2) + p(X = 3)

Example 12.60 In an examination, the examiner sets a question paper in which any student
passing the test is with probability 0.3. If 3 students appear for the test, find the probability
that at most 1 student will pass the test.
214 12 Discrete Probability

Solution: Let X be the random variable which indicates the number of students who pass the
test. The possibilities are only two, ‘pass’ or ‘fail’. Hence X is a binomial random variable.
Hence

p(X = 0, 1) = p(X = 0) + p(X = 1)


= C(3, 0)(0.3)0 (0.7)3 + C(3, 1)(0.3)1 (0.7)2

Notation:
(i) Let X and Y be random variables on the same sample space S. Then X + Y , k X and X Y
are functions defined on S such that

(X + Y )(x) = X (x) + Y (x) ⎬
(k X )(x) = k X (x) where x ∈ S

(X Y )(x) = X (x).Y (x)

(ii) p(t1 ≤ X ≤ t2 ) = p({x | t1 ≤ X (x) ≤ t2 }).


Notation: Let X be a Binomial random variable with parameters (m, p) or (k, m, p) where
random variable is associated with the number X = k. Here m is the total number of trials,
p is the probability of ‘success’, for any k ≥ 0 and X is discrete. Here (m, p) or (k, m, p)
are called the Binomial distributions.

Geometric Random Variable

Consider an activity consisting of independent Bernoulli trials until a ‘success’ is reached.


For example two coins are tossed simultaneous until both the coins turn up ‘head’ is a
Bernoulli trial repeated until a condition of ‘success’ is reached. Let X be the Bernoulli
random variable. Then clearly

range of X = {0, 1, 2, 3, 4, . . . }.

That is,

p(X = t) = p(first ttrials are failures and (t + 1)th trial is a success).

Then the probability computation will be

p(X = t) = (1 − p)t . p


The distribution must satisfy the condition that p(1 − p)i = 1.
i=0
12.5 Random Variables 215

Example 12.61 Two fair coins are tossed until two ‘heads’ turn up. Let the probability that
two heads turn up be 0.2. Let X be the random variable that denote the number of trials
made prior to a success trial ‘H H ’. What is the probability that the fifth trial is a success?

Solution: The random variable can take values as 0, 1, 2, 3, 4, . . . .

p(X = 4) = p(first 4 trials are failures). p


= (0.8)4 (0.2)

Example 12.62 In a university network, a person can log in successfully with a probability
0.9. Several log-in attempts are made independently and each attempt has the probability of
success. Mr. K logs in repeatedly until Mr. K succeeds. Find the number of attempts made
by Mr. K prior to his successful attempt.

Solution: Let X be the random variable that indicates the trials made before a successful
log in is made. Hence X can take values 0, 1, 2, 3, . . . .
Now

p(X = t) = p(1 − p)t


= 0.9(1 − 0.9)t
= 0.9(0.1)t
0.9 9
= t = t+1
10 10
Hence
9 9 9 9
+ 2 + 3 + ··· + m = 1
 10 10 10 10 
9 1 1 1
1+ + + · · · + m+1 = 1
10 10 102 10
9 0.1
1 m
=1
10 1− 10
9 10m
. =1
102 10m − 1m
9.10m−2 = 10m − 1
10m−2 (100 − 9) = 1
1
10m−2 =
91
1
(m − 2) = log
91
216 12 Discrete Probability

The Poisson Random Variable

The random variable that is defined below is called Poisson random variable. As before let
X count the number of events that take place in a given space X is said to be Poisson random
variable with parameter ‘λ’ if

λm
p(X = m) = e−λ m = 0, 1, 2, . . .
m!
Here λ > 0. Clearly

 ∞
 λt
p(t) = e−λ = e−λ .eλ = 1.
t!
t=0 t=0
Hence the defined ‘ p’ is a probability mass function.
The Poisson probability mass function and Binomial probability mass functions are
related as below:
λk ∼
p(X = k) = e−λ . = C(n, k) p k (1 − p)n−k , k = 0, 1, 2, . . . , n.
k!
for λ = np, n being very large and p is very small.
Hence depending on the problem situations, that depending on p and n values, a suitable
random variable may be chosen.

Example 12.63 Suppose in a hospital child birth occurs randomly at an average rate of 2
per hour. Find the probability of observing 6 births in a given hour.

Solution: Let X be the Poisson random variable which is the number of child births in a
given hour. Here λ = 2, which is the mean rate of birth.

26
p(X = 6) = e−2 .
6!

Example 12.64 Suppose in a railway booking counter passengers arrive at the counter at
the rate of 3 per minute. Find the probability of 4 persons arrive at a given minute.

Solution: Identical to the previous question.


12.6 Joint Distributions 217

12.6 Joint Distributions

So far we have seen activities handled using one discrete random variable. Suppose there
are two random variables defined on some sample spaces S1 and S2 respectively. The joint
probability mass function is denoted by p(X = x1 , Y = y1 ) and is defined as p(x1 , y1 ) =
p(X = x1 , Y = y1 ). It satisfies the 3 axioms

1 , 
(i) p(x y1 ) ≥ 0.
(ii) p(x1 , y1 ) = 1.
y1 ∈S2 x1 ∈S1 
(iii) p((X , Y ) ∈ A) = p(x, y)
x∈X
y∈Y
(x,y)∈A
where A is a subset of (S1 , S2 ).

Remark 12.65 (i) Many standard books on this topic refer S1 as support of X , S2 as support
of Y .
(ii) The joint probability function can be denoted as f (x, y) instead of p(x, y) for better
clarity.

Next we define the independence of the two random variables X and Y .

Definition 12.66 Two random variables X and Y are said to be independent if and only if

p(X = x, Y = y) = p(X = x) × p(Y = y)

for every pair (x, y) ∈ S1 × S2 where S1 is the sample space of X and S2 is the sample space
of Y . Otherwise, they are dependent.

Example 12.67 Suppose two fair coins of different sizes are tossed. Find the probability
that both coins turn up ‘head’.

Solution: Here clearly the tossing is an independent activity.


Let X be the random variable of associated with the appearance of head or tail by the
smaller coin.
Similarly Y can be taken. The probability space of X is {0, 1}, 0 indicates ‘tail’ appearance,
1 indicates ‘head’ appearance. The probability space of Y is also {0, 1}. The joint probability
space of X and Y will be

S1 × S2 = {(0, 0), (0, 1), (1, 0), (1, 1)}

Hence p(X = 1, Y = 1) = 41 .
218 12 Discrete Probability

Table 12.1 Probability mass function


Small coin
f (x, y) 0 1 f (X = 0, Y = y)
Large coin 0 1 1 2
4 4 4
1 1 1 2
4 4 4
f(X = x, Y = 0) 2 2 1
4 4

If f (x, y) is the joint probability mass function, then we have the following table w.r.to
f and X , Y .
Clearly,

p(X = 1, Y = 1) = p(X = 1) × p(Y = 1)


1 1 1
= . =
2 2 4

Remark 12.68 In the above Table 12.1, a calculation of the probability distribution values
of X and Y are given. It is seen that the sum of the probabilities of X (Y ) is 1. These entries
are called as ‘marginal distributions’.

Example 12.69 Two balls are to be distributed in two boxes. Construct the tables for the
joint distribution where X i denote the number of balls in the box i.

Solution: Let X i be the random variable as given in the problem. Here we assume the boxes
are distinct. Total number of ways to distribute the two balls will be

Box 1 Box 2 Box 1 Box 2 Box 1 Box 2


00 00 0 0
(i) (ii) (iii)
Let Y be the random variable which takes 1 for (i) & (ii) and 2 for (iii). Clearly
2
p(Y = 1) =
3
1
p(Y = 2) =
3
12.7 Expectations 219

One can construct joint distribution table for (Y , X 1 ) and (X 1 , X 2 ). The table for (Y , X 1 )
is as below

X1
f (x, y) 0 1 2 p(Y = 1, Y = 2)
Y 1 1 0 1 2
3 3 3
2 1
0 3 0 1
3
p(X 1 = x) 1 1 1 1
3 3 3

Similarly the table for (X 1 , X 2 ) can be constructed.

12.7 Expectations

The probability mass function of a random variable X describes the distribution of values
of the random variable that they may take. There is an elaborate way of describing the
distributed values. It is desirable to describe, if possible a few representative values of the
distribution for simplicity in using them. Look at the following example.

Example 12.70 A die is rolled m times. The probability that the numbers 1 to 6 turn up be
p1 , p2 , . . . , p6 . If the sum of the numbers in the m rolling is even, then you win the game.
What will be the number of rollings you expect to be made so that you win the game.

In this example we are seeing for the first time the word ‘expect’ in the question. The
interpretation will be as follows. If in the m rolls, let 1 occur t1 times, 2-occur t2 -times 3
occur t3 times and so on.
So, t1 + 2t2 + 3t3 + 4t4 + 5t5 + 6t6 is even and
t1 + 2t2 + · · · + 6t6
=n
m
will be the average. Also pi is approximately equal to mti , i = 1, 2, . . . , 6. So n will be
approximately equal to t1 p1 + t2 p2 + · · · + t6 p6 for any large m.
Now we formally define expectation.

Definition 12.71 The expected value or the mean value of a random variables X with a

probability mass function p(x) is defined as x p(x) provided p(x) > 0 and the series
converges absolutely. It is denoted by E[X ].


Remark 12.72 If x p(x) diverges, then X is said to have no expectation.
220 12 Discrete Probability

Example 12.73 The activity is to roll a six sided die. If X is the random variable which
indicates the number that turn up, find E[X ].

Solution: Clearly p(X = 1) = p(X = 2) = · · · = p(X = 6) = 16 .


So
1 1 1 1 1 1
E[X ] = 1. + 2. + 3. + 4. + 5. + 6.
6 6 6 6 6 6
7
=
2

Example 12.74 Let two independent coins be tossed. The probability that a head turns up
in each coin is 21 . Let X be the random variable to indicate that a head is obtained. Find
E[X ].

Solution: First let us write the probability mass function as below.


1 1 1
p(X = 0, X = 0) = . =
2 2 4
[Two coins being tossed = p[X = 0] × p[X = 0]
p(X = 0, X = 1) = p(X = 0). p(X = 1)
1 3 3
= 2. . =
4 4 8
 2
3 9
p(X = 1, X = 1) = ( p(X = 1))2 = =
4 16

Hence  2  
1 3 9 3
E[X ] = 0. + 1. + 2 =
4 8 16 2
If m random variables are defined on the same sample space S1 , then their sum will be a
new random variable. What is the expected value of the sum? We state the following theorems
without proof. The proof of (i) can be given using mathematical induction technique.

Theorem 12.75 (i) Let X 1 , X 2 , . . . , X m be random variables defined on S and let E[X i ]
be the expectation, 1 ≤ i ≤ m. Then

E[X 1 + X 2 + · · · + X m ] = E[X 1 ] + · · · + E[X m ].

(ii) If X and Y are two mutually independent random variables with E[X ] and E[Y ] being
finite, then E[X Y ] = E[X ].E[Y ].
12.7 Expectations 221

Example 12.76 Let X m be the number of ‘successes’ in m Bernoulli trials with the success
probability being p. Then we know

p(X m = k) = C(m, k) p k (1 − p)n−k



E[X m ] = kC(m, k) p k (1 − p)m−k
= mp (verify)

Example 12.77 Suppose the random variable X has the following probability mass func-
tion,
1 1 1
p(X = 0) = , p(X = 1) = , p(X = 2) = .
4 2 4
Calculate E[X 2 ].

Solution: Here the new random variable Y be such that Y = X 2 . The corresponding prob-
ability mass function will be,
1
p(Y = 02 ) =
4
1
p(Y = 12 ) =
2
1
p(Y = 22 ) =
4
Hence
1 1 1
E[X 2 ] = 0. + 1. + 4.
4 2 4
3
=
2
Note
 
1 1 1 2
(E[X ])2 = 0. + 1. + 2.
4 2 4
= 1 = E[X 2 ].

Example 12.78 A box contains 10 balls numbered from 1 to 10. Balls are drawn. After
noticing the numbers, they are put back in the box. Let X be the random variable which
indicates the largest numbered ball that is drawn in m drawings. Find E[X ].

Solution: We first find the probability mass function p. p(X ≤ k) means that each of the
numbers on the balls drawn in m trials are less than or equal to k in value. So p(X ≤ k) =
k m
10 . So
222 12 Discrete Probability

p(X = k) = p(X ≤ k) − p(X ≤ k − 1)


 m
k (k − 1)m
= −
10 10m
k − (k − 1)
m m
=
10m
Therefore,


10
E[X ] = t. p(X = t)
t=1
 
1 
10
= m 10 m+1
− (t − 1) m
10
t=1

12.8 Mean, Variance and Standard Deviation

There are three important quantities that are very useful. They are mean, variance and
standard deviation.

Definition 12.79 Let X be a random variable. Then

(i) Mean: μ = E[X ]


(ii) Variance: E[X 2 ] − μ2
(iii) Standard deviation: E(X 2 ) − μ2 .

Definition 12.80 Let X and Y be two random variables. The covariance of X and Y is
denoted by cov(X , Y ) and is defined by

cov(X , Y ) = E[X Y ] − E[X ].E[Y ].

Remark 12.81 If X and Y are independent random variables, then we know that E[X Y ] =
E[X ].E[Y ] and hence cov(X , Y ) = 0.

There are some properties of covariance of two random variables. We state three of them
without proof.

Property 12.82 cov(X , X ) = var (X ).

Property 12.83 cov(X , Y ) = cov(Y , X ).


12.8 Mean, Variance and Standard Deviation 223

Property 12.84 cov(k X , Y ) = k cov(X , Y ), k being a scalar.

Property 12.85 cov(X , Y + Z ) = cov(X , Y ) + cov(X , Z ).

Proof Consider

cov(X , Y + Z ) = E[X (Y + Z )] − E[X ]E[Y + Z ]


(By definition)
= E[X Y ] + E[X Z ] − E[X ]E[Y ] − E[X ]E[Z ]
= C O V (X , Y ) + C O V (X , Z ).

Property 12.86 Let X 1 , X 2 , . . . , X m be independent and have the same type of probability
distribution with mean μ and variance σ 2 . Let X = X 1 +X 2m+···+X m . Then

(i) E[X ] = μ(mean).


(ii) V (X ) = σm .
2

(iii) cov(X , X j − X ) = 0 for j = 1, 2, . . . , m.

Remark 12.87 The random variable X − μ of a random variable X is called the deviation
of X from the mean μ. In general if X is a random variable with probability mass function
p(X = x j ) and let r ≥ 0 be an integer, then

E[X r ] = x rj p(X = x j ).

This is called the r th moment of X . First moment is the ‘mean’.

Example 12.88 Find the variance of X if X is the random variable that indicates the number
turns up when a die is rolled.

Solution: We have seen earlier E[X ] = 27 .


   
1 1 1 1 1 1
E[X 2 ] = 1. + 22 . + 32 . + 4 2 . + 52 . + 62 .
6 6 6 6 6 6
1  91
= 1 + 2 2 + 32 + 4 2 + 52 + 62 =
6 6
 2
91 7 35
Variance of X = − =
6 2 12
Notation: Let us denote variance of X as V ar (X ).
224 12 Discrete Probability

Example 12.89 Let X be a random variable which has probability mass function defined
as below. 
1
for x = −3, −2, −1, 0, 1, 2, 3
p(X = x) = 6
0 otherwise
Find E[X ] and V ar (X ).

Solution:
1 1 1 1 1 1 1
E[X ] = −3. + −2. + −1. + 0. + 1. + 2. + 3 = 0
 6 6 6 6 6 6 6
1 1 1 14
E[X 2 ] = 2 9. + 4. + 1. =
6 6 6 3
14 14
V ar (X ) = − 02 =
3 3

12.9 Law of Large Numbers

So far we have seen that from the probability distribution or probability law, one can deter-
mine mean and variance which are very important measures. However from the known mean
and mean of a distribution it is not possible to determine the probability law or mass func-
tion. Also small variance indicates that nothing about the large deviations from the mean. If
it is possible to have some information on the probability distribution like it is a binomial
distribution, with parameter m, k and Poisson distribution with parameter λ then one can
relate the known parameters the type of distribution mean and variance. Otherwise the mean
and variance makes a rough estimate of the probability distribution (mass) function. The
following important theorem is very useful for the above mentioned purpose.
Chebyshev Inequality
Let X be a random variable with mean μ and variance σ 2 . Then for any value k > 0,
1
p(|X − μ| ≥ kσ) ≤ .
k2

Proof We know that E(X ) = μ, V ar (X ) = σ 2 .



σ2 = (xi − μ)2 p(X = xi ) (12.1)
i

where xi ’s are in the domain of X . Consider the xi ’s in the domain of (X − μ) such that
|X − μ| ≥ kσ. That is (xi − μ)2 ≥ k 2 σ 2 .
12.9 Law of Large Numbers 225

So
 
(xi − μ)2 p(X = xi ) ≥ (xi − μ)2 p(X = xi )
i |X −μ|≥kσ

≥ k 2 σ 2 p(X = xi )

= k 2 σ2 p(X = xi )
|X −μ|≥kσ

= k σ p(|X − μ| ≥ kσ)
2 2

Hence p(|X − μ| ≥ kσ) ≤ 1


k2
. 

Example 12.90 Let X be a random variable with mean μ = 42 and standard deviation
σ = 7. Using Chebyshev inequality comment on the probability mass function near the
mean for k = 2 and k = 4.

Solution: Here μ = 42, σ = 7.


For k = 2.

|X − μ| ≥ kσ means
μ + kσ ≥ X ≥ μ − kσ
μ − kσ = 42 − 2.7 = 28
μ + kσ = 42 + 14 = 56

Hence p(28 ≤ X ≤ 56) ≤ 1 − 41 = 43 .


That is the probability that the values of X that lies between 28 and 56 will be atleast 43 .
Similarly discuss for k = 4.
We state the following theorem without proof which is called as Chernoff Bounds.

Theorem 12.91 Let a sequence of Bernoulli trials be conducted n times with the usual
notation of ‘success’ probability p. Let the trials be independently conducted. Let X be a
random variable that counts the total number of ‘successes’ in the n trials. Then

p(X ≥ 6μ) ≤ 2−6μ .

Example 12.92 Let an unbiased coin be tossed 100 times consecutively and the ‘success’
be the appearance of ‘head’. Let the ‘success’ probability be given as 25 in each toss. Find the
upper bound on the probability that there will be atleast 80 heads appear in the total tossing.
226 12 Discrete Probability

Solution:

μ = E[X ] = n. p(we have seen earlier)


2
= 100. = 40.
5
By Chernoff bounds,

p(X ≥ 80) = p(X ≥ 6μ) ≤ 2−6.μ


= 2−6.40 = 2−240 .

Finally we now see what is known as ‘law of averages’ which is also called as ‘law of
large numbers’ of discrete random variables.
Let X 1 , X 2 , . . . , X m be a set of identically distributed random variables with mean,
μ1 , μ2 , . . . , μm and variance σ12 , σ22 , . . . , σm
2 . Let

Y = X1 + X2 + · · · + Xm
μ = E[Y ] = μ1 + μ2 + · · · + μm
σ12 + σ22 + · · · + σm
2
s 2 = V ar (Y ) =
m
Using Chebyshev inequality we obtain

s2
p(|Y − μ| ≥ ) ≤ for any  > 0.
m.2
s2
Clearly as m → ∞, for a fixed , m.2
→ 0. Thus we have,
The weak law of large numbers
Let X 1 , X 2 , . . . , X m be independent random variables that have identical probability distri-
bution, with mean μ as computed above. Then for every  > 0, we have the following:
  
 X1 + X2 + · · · + Xm 
p(|Y − μ| ≥ ) = p   
− μ ≥ 
m
→ 0 as m → ∞.

Remark 12.93 As m becomes larger and larger, the distribution of Y is near μ, the mean.

Example 12.94 Let a fair coin be tossed n times. Let X be the random variable that denotes
the number of times ‘head’ turns up. Then Snn denotes the number of times ‘head’ turns up
which will be a fraction between 0 and 1. The law of large numbers tells that the outcomes
of the random variable X will be having the probability 21 when n → ∞.
12.9 Law of Large Numbers 227

Example 12.95 Let X 1 , X 2 , . . . , X n be the random variables which follow Bernoulli dis-
tribution with probability 0.3 for ‘success’ and 0.7 for ‘failure’. Here X j = 1 for success and
X j = 0 for failure. Define An = X 1 +X 2n+···+X n , find p(|A100 − 13 | ≥ 0.1), p(|A1000 − 13 | ≥
0.1).

Solution: Clearly

1 s2 V ar (An )
p(|An − | > ) ≤ =
3 n.2 n.2
.21
V ar (An ) =
n
n = 100
0.21
p(|A100 − 0.3| ≥ 0.1) ≤ = 0.21
100 × 0.1
n = 1000
p(|A1000 − 0.3| ≥ 0.1) ≤ 0.21
Exercise

1. For each of the following events draw a Venn diagram and shade the area corresponding
to the events.
(i) A ∪ B c (ii) Ac ∩ B c (iii) (A ∪ B)c (iv) Ac ∩ B.
2. Let S = {1, 2, 4, 6, 8, 10, 12, 14, 16}, A = {1, 2, 10, 14}, B = {10, 16}. Find the mem-
bers of the event A ∪ B, A ∩ B, A ∪ B c , Ac ∩ B.
3. An activity of rolling two dice is carried out. Find the sample space. List the members
of the events
A = {sum of numbers shown on dice = 8}
B = {sum of numbers shown on dice ≤ 5}
Are A and B disjoint? Justify.
4. Let the sample space of an activity be S = {1, 2, 3, 4}. Find the set of all possible events
of S.
5. A coin is tossed until a head turns up. What is the sample space?
6. A four sided die is rolled until a 3 comes up. Find the same space. Find the members
of the event of getting a 2 in the first three rolls.
7. A student of a college may or may not choose general science. Even if the student
chooses general science, the student may or may not choose Mathematics. Even if
the student chooses Mathematics, he may or may not take the elective ‘commutative
algebra’. Consider the activity of selecting a student and determine whether the student
is a science student and the student has not chosen ‘commutative algebra’.
228 12 Discrete Probability

8. Let A, B, C be three events. Show that

p(A ∪ B ∪ C) ≤ p(A) + p(B) + P(C)

whatever A, B, C may be.


9. Extend the above inequality to m events and prove it using mathematical induction on
m.
10. A box contains 9 balls of different sizes. A ball is chosen at random.

(i) Find the probability that the smallest ball is chosen.


(ii) Find the probability that the largest ball is chosen.
(iii) Find the probability of choosing any two balls.

11. Let a fair coin be tossed 5 times. List the elements of the event that contains ‘four tails
and one head’ in the total of 5 tosses. Interpret the event and find its probability.
12. Let there be m persons in a group and assume that no body is born on 29th February.
Find the probability sample space. What is probability that two or more persons have
the same birthday?
13. Let A and B be two events. Define (B − A) as the event that contains all those elements
which are in B, but not in A. Write (B − A) in terms of S and Ac .
14. If A and B are two independent events. What can you say about (B − A)?
15. Three players p, q, r play the game of tennis (singles matches) as per rules. In the
beginning p and q play a match. The winner of this match is to play with player r .
The winner of the second match has to play with the loser of the first match. The
matches continue, until a player wins two successive matches. Write down the infinite
probability sample space.
16. A box contains 100 balls. Suppose the balls are numbered as either 1 or 2. Two balls are
drawn from the box (i) with replacement (ii) without replacement. Find the probability
of

(i) both the drawn balls are numbered ‘1’


(ii) both the drawn balls are of different numbers
(iii) atleast one ball drawn is numbered ‘1’
(iv) exactly one ball drawn is numbered ‘1’.

17. A fair coin is tossed m times. Find the probability that the

(i) all the m coins show ‘head’


(ii) all the m coins show ‘tail’
(iii) there is exactly one head shown up.
12.9 Law of Large Numbers 229

18. Consider that there are three boxes B1 , B2 , B3 . Box B1 contains 2 green and 4 blue
balls, Box B2 contains 3 green and 2 blue balls, Box B3 contains 2 green and 2 blue
balls. Two balls are drawn from the boxes. Find the probability that the 2 drawn balls
are green.
19. Eight persons are arranged in a circular manner. Let A and B are two persons in the
arrangement. Find the probability that A and B are adjacent to each other.
20. Let a three digit number be formed using {1, 2, 3, 4, 5}. A number is to be assigned to
a number plate of a scooter. Suppose the scooter owner is asked to choose a number
and the number is an odd number. Find its probability.
21. A fair coin is tossed three times in sequence. Let A be the event that more tails turn up
than heads. Let B be the event that in the first toss, head turns up. Find p(A | B).
22. A competition is conducted between two teams to suggest a model for a car. One team
has more experienced engineers whose success probability is 2/3. The other team’s
success probability is 1/2. Also the models suggested by one of the teams is always
successful and its probability is 3/4. If there is a situation where both the teams’ car
models are successful and in which case, then the model suggested by the experienced
engineers is taken. If there is a situation that there is exactly one successful design model.
What is the probability that it was designed by the team of experienced engineers?
23. Assume the multiplication principle

p(A1 ∩ A2 ∩ · · · ∩ An ) = p(A1 ) p(A2 | A1 ) . . .


p(An | A1 ∩ A2 · · · ∩ An−1 ) (12.2)

Solve the following problem.


From a deck of 52 cards 4 cards are drawn. Find the probability that none of the cards
is a spade.
24. An elective class consists of 15 undergraduate students and 5 graduate students. The
whole class is divided in to 5 groups to make a group project. What is the probability
that each group has a graduate student?
25. A fair coin is tossed 4 times

(i) Find the probability of the event that has outcomes that have atleast one ‘head’.
(ii) Find the probability of the event that has outcomes that have all the four heads.
(iii) Given that the first three tosses are having the outcome tail, find the probability of
such an event that the last toss gives a ‘head’.

26. I know that a friend of mine has two kids. The friend brought one child to my family
function and that child is a girl. What is the probability that the other kid is also a girl?
27. A three digit number is formed using the numbers {1, 2, 3, 4, 5}. Find the probability
that the number is odd number, given the information that the first decimal place has
230 12 Discrete Probability

an even number and the second decimal place contains an odd number. Use direct
combinatorial argument to verify your computation.
28. Let S be a probability space and A and B are events on S. Given p(A) = 12 1
, p(B) = 13 ,
p(AB) = 52 1
. Find (i) p(A | B) (ii) p(B | A).
29. Box B1 contains 4 white balls and 4 black balls. Box B2 contains 6 white balls and 8
black balls. A ball is transferred from box B1 to box B2 . From box B2 a ball is drawn.
Find the probability that the ball is white in color?
30. Three dice are rolled on a table. The first die shows 5 and the second die shows 4. One
die falls under the table. What is the probability that the number of the die rolled under
the table is 3?
31. A book shelf in a library has 8 maths books, 6 physics books and 7 general knowledge
books. If M selects two books at random, find the probability that both the selected
books are of different subjects.
32. Two dice are rolled. Find the probability that the sum of the two dice will be greater
than 7 given that one die shows 4.
33. M has to clear two qualifying exams for a medical seat in a medical university. The
probability for M to clear the first qualifying test is 45 . The probability for M to get
a seat is 23 . Find the probability of M clearing the second qualifier given that she has
cleared the first test.
34. Two dice are rolled. Let A be the event that the outcome of the first die is {1, 2, 3}.
Let B be the event that the outcome of the second die is {3, 4, 5}. Let C be the event
that the sum of the two dice is 8. Find p(A ∩ B ∩ C) and show that it is not equal to
p(A). p(B). p(C).
35. 6 dice are thrown simultaneously. Find the probability that each number appears exactly
twice.
36. A deck of 52 cards are distributed to 4 people. Find the probability that a hand consists
of four spades, three hearts, five diamonds and one club?
37. An elevator starts at floor 1 with 9 passengers and stops at all 10 floors. What is the
probability that no two passengers leave at the same floor?
38. A die is rolled 4 times. Find the probability of getting a sum ‘6’ atleast in one roll?
39. 10 balls are to be distributed in 5 boxes. Find the probability that

(i) a box may be empty


(ii) atleast one ball in each box
(iii) each box contains exactly two balls

Discuss the solution by assuming all the 4 cases, where boxes distinct and boxes iden-
tical, balls distinct and balls identical.
40. Using three a’s, four b’s and six c’s, a word of length 5 is formed. What is the probability
that the word may contain
12.9 Law of Large Numbers 231

(i) all four b’s?


(ii) all c’s?
(iii) atleast one letter from each category?

41. Let X be a discrete random variable with the following probability distribution function


⎪ 0.2 for x = 0




⎨0.3 for x = 1

p(X = x) = 0.4 for x = 2



⎪ 0.1 for x = 3



⎩0 otherwise.

(i) Write down the range of the variable X .


(ii) Find p(X < 3).
(iii) Find p(1 ≤ X < 3).

42. Let two dice be rolled. Let X and Y be the numbers that turn up.

(i) Find range of X , range of Y , probability mass function of X and Y .


(ii) Let Z = X Y . Find the range and probability mass function of X Y .
(iii) Find p(X = 3 | Z = 12).

43. A fair coin is tossed repeatedly until two consecutive tails turn up. If X is the total
number of times the coin is tossed, find p(X = k) for k = 0, 1, 2, . . . .
44. A box contains 6 green balls, 4 yellow balls and 10 white balls. Two balls are drawn
randomly from the box.

(i) Find the sample space of the activity.


(ii) If X is a random variable that indicates number of white balls selected. Find the
range of X .
(iii) Find p(X = 0) and p(X = 2).

45. A students writes an examination that consists of 20 multiple-choice questions. The


number of options for each question is 4. Assume that the student knows answers to
50% of the questions and the answers to the remaining questions are picked randomly.
Each correct answer is given 1 mark. Let X denote the possible ‘marks’ scored by any
individual (i) Find the range of X and the probability mass function (ii) Find p(X > 12).
46. Let the number of cars crossing a ‘t’-junction be a Poisson variable. On an average 20
cars pass the t-junction in one hour duration. Find the probability that the number of
cars crossing the ‘t’-junction at a peak hour is more than 20 but less than 30.
232 12 Discrete Probability

47. A box contains three distinctly by numbered balls. Two balls are drawn at random
without replacement. Let X be the random variable that indicates the number on the
first ball and Y be the random variable that indicates the number on the second ball.
Then construct the joint distribution table indicating the marginal distributions.
48. Five balls are distributed at random in five boxes. Let X i denote the number of the box
that contain exactly i balls. Construct joint probability distribution tables of (X 1 , X 2 ),
(X 2 , X 3 ) indicating the marginal distributions.
49. Find E[X ] where X is binomially distributed random variable with parameters n, k and
p.
50. Find E[X ] where X is a Poisson random variable with parameter λ.
51. Suppose n people go for a night party wearing their hats. The leave their hats in a basket
that is kept outside. Sudden power failure occurs. They come out and each person picks
a hat before leaving. Let X be the random variable that indicates the number of persons
who takes their hats. Find E[X ].
52. Suppose a box contains 10 red balls and 15 green balls. A random sample of 8 balls is
drawn without replacement. Let X t be the random variable that indicates by assigning
value 0 or 1 according as the t th ball drawn is black or not for t ≤ 8. Find the mean and
variance of X t .
53. Let a box contain three balls numbered 1, 2, 3. Two balls are drawn at random from
the box without replacement. Let X be the random variable that indicates the number
on the first ball and Y be the random variable that indicates the number on the second
ball. Find cov(X , Y ).
54. Let a box contain balls of K colors. A ball is drawn at random and such a ball can have
any of the K colors. Find the expected number of balls to be drawn so that the selection
has atleast a ball from each color (Assume the draw being done without replacement).
55. A box originally contains ‘t’ green balls. A multiple step activity is conducted as below:
At each step, a ball is randomly taken from the box. If the ball taken is a green one,
then a yellow ball is put back in the box replacing the green ball. If the ball taken is
yellow one, then it is returned to the box.
Find the probability of drawing ‘t’ green balls in n trials. If p(n, t) denote this answer,
find its connection with Stirling numbers of second kind?
56. A teacher conducts a surprise test to a class of n students. After the test is over, the
teacher decides to distribute the answer papers to the same set of students for correction
so that no student is get to receive his/her own answer paper. Find the probability of
this occurrance? Make a remark on the probability thus optained related to the size of
the class?
57. 15 balls are distributed into 5 boxes.

(i) Find the probability that the first box will contain 2 balls.
(ii) Find the probability that each box contains three balls.
12.9 Law of Large Numbers 233

58. A box contains 5 green balls and 4 yellow balls. The activity is to draw 3 balls at random
from the box without replacement.

(i) Find the sample space.


(ii) Find the probability that the first ball drawn being green.
(iii) Find the probability that atleast one out of the three balls is yellow.
(iv) Find the conditional probability that the last ball drawn is a green one given that
the first two balls drawn being yellow.

59. A fair die of six sides is rolled 8 times and the outcomes are recoved in order. Find the
probability that the outcome is ‘4’ atleast two times.

Problems and Solutions—Combinatorics

1. Prove that

m
m(m + 1)(2 m + 1)
t2 =
6
t=0
for all natural numbers m.

Solution:
The equality in the question is established using mathematical induction. For m = 0, 1 the
equality is true. Assume the equality to be true for m = n. That is


n
n(n + 1)(2n + 1)
t2 = (12.3)
6
t=0

We now show that it is true for m = n + 1.


Consider the summation


n+1
t 2 = 02 + 12 + 22 + · · · + n 2 + (n + 1)2
t=0

n
= t 2 + (n + 1)2
t=0
n(n + 1)(2n + 1)
= + (n + 1)2 , using (12.3)
6
1
= (n + 1)(2n 2 + 7n + 6)
6
1
= (n + 1)(n + 2)(2n + 3)
6
234 12 Discrete Probability

2. Are the following true? Justify your answer.

(i) n 2 > n + 1, ∀ n ∈ N.
(ii) n! > n 2 , ∀ n ≥ 4.

Solution:
Both (i) and (ii) can be proved using mathematical induction.
(i) No.
For n = 2, 22 > 2 + 1.
Assume the inequality to be true for n = m. That is

m 2 > (m + 1). (12.4)

Consider

(m + 1)2 = m 2 + 2 m + 1
> (m + 1) + (2 m + 1), using (12.4)
= 3 m + 2 > m + 1 for m ≥ 1.

(ii) Left as an exercise.

3. Are the following sets countable? Justify your answer.

(i) X = {(e, o)|e ∈ {0, 2, 4, 6, 8, . . . }, o ∈ {1, 3, 5, 7, . . . }}


(ii) Y = { n12 |n ∈ N}
(iii) T = (0, 0.5].

Solution:
(i) X is countable as X being the cartesian product of two countable sets.
(ii) Y is countable as there exists a one-to-one correspondence from N to Y .
(iii) T is uncountable as it is in the form of semi open interval.

4. If S = {(x, y)|x 2 + y 2 = 16} and T = {(x, y)|x 2 + 9y 2 = 81}, then find |S ∩ T |.

Solution:
The set S describes the set of points (x, y) lying on a circle with center ‘O’ and radius 4. The
2 2
set T describes the set of points lying on an ellipse x92 + 3y2 = 1. Clearly these two curves
intersect at 4-points. Hence |S ∩ T | = 4.
12.9 Law of Large Numbers 235

x 4 −1
5. Consider the function f (x) = x 4 +1
for x ∈ R. Find the minimum value of f (x).

Solution:
Consider
x4 − 1
f (x) =
x4 + 1
2
=1−
x4 + 1
Here
2
< 2 as x 4 + 1 > 1
x4+1
2
⇒1− 4 ≥1−2
x +1
⇒ f (x) ≥ −1 and f (x) < 1.

So, −1 is the minimum value of f (x).

6. Let S be a set which is countable and infinite. Then show that there exists a bijection
between S and the set of natural numbers.

Solution:
Define a function f : S → N, as f (s) = n, such that s is the n th smallest element of S.
As there are only finitely many natural numbers less than ‘s’, f is well defined. Also for
s1 , s2 ∈ S, f (s1 ) = f (s2 ) = n is impossible. So f is clearly a one-to-one mapping. f is
also onto as S is infinite.

7. Let f (x) = x 2 − 2x. Find

(i) f (−4)
(ii) f (t − 1)

Solution:
(i) f (−4) = (−4)2 − 2(−4)
= 24.
(ii) f (t − 1) = (t − 1)2 − 2(t − 1)
= t 2 − 4t + 3.
236 12 Discrete Probability

 
f
8. Let f (x) = x + 1 and g(x) = x 2 + 2x − 1. Find ( f − g)(x), f ◦ g(x) and g (x)

Solution:

( f − g)(x) = x + 1 − x 2 − 2x + 1
= −x 2 − x + 2

f ◦ g(x) = f (x 2 + 2x − 1)
= x 2 + 2x − 1 + 1
= x 2 + 2x

f f (x) x +1
(x) = = 2
g g(x) x + 2x − 1

9. Let f (x) = x + 1 and g(x) = x1 . Find the domain of (g − f )(x).

Solution:

(g − f )(x) = g(x) − f (x)


1 √
= − x +1
x
The domain is (0, ∞) ∪ (−1, 0).

10. Let f be a function defined on an interval [0, 1] such that

f (0) = f (1) = 1 and


| f (x) − f (y)| < |x − y| ∀ x = y, x, y ∈ [0, 1].

Show that | f (x) − f (y)| < 21 .

Solution:

| f (x) − f (y)| = | f (x) − f (1) + f (0) − f (y)|


≤ | f (x) − f (1)| + | f (0) − f (y)|
≤ |x − 1| + |0 − y| (12.5)

If |x − y| ≤ 21 , | f (x) − f (y)| < 21 .


If |x − y| > 21 , using (12.5), | f (x) − f (y)| < 1
2
So | f (x) − f (y)| < 21 .
12.9 Law of Large Numbers 237

11. Let n be a positive integer. Let π(n) denote the product of non zero digits of n. Suppose
‘n’ is a single digit number, then π(n) = n. If

S = π(1) + π(2) + · · · + π(99),

then what is the largest prime factor of S?

Solution: The positive integers less than 100 are

1, 2, 3, 4, . . . , 9, 10, 11, 12, . . . , 99.

These are written as

01, 02, 03, 04, 05, 06, . . . , 09, 10, 11, 12, . . . , 99.

Now the sum of the product of the digits of these numbers will be

(0 · 0 + 0 · 1 + 0 · 2 + 0 · 3 + · · · 9 · 9) − 0 · 0
= (0 + 1 + 2 + · · · + 9)2 − 0 · 0 (12.6)

Now by definition of π(n), the sum of these digits can be found by replacing ‘0’ by 1 in
the expression (12.6) above as we need to ignore ‘0’s. This is equivalent to considering ‘1’s
in the products. Note that 0 · 0 in the above expression is contributing ‘1’ to the count as it
is changed as 1 · 1. So,

Z = (1 + (1 + 2 + · · · 9))2 − 1
= 462 − 1 = 3 · 3 · 5 · 47

So 47 is the largest prime in Z.

12. Let f (n) and g(n) be asymptotic positive functions. Prove or disprove the following
equations.

(i) f (n) = O(g(n)) ⇒ g(n) = O(g(n))


(ii) f (n) = O(g(n)) ⇒ g(n) = ( f (n))
(iii) θ(g(n)) = o( f (n)) + f (n)

Solution:
(i) Suppose f (n) = 2n + 3 and g(n) = n 3 .
Given 2n + 3 ∈ O(n 3 ) or 2n + 3 = O(n 3 ).
But n 3 ∈/ O(n).
So (i) is false.
238 12 Discrete Probability

(ii) By definition, f (n) = O(g(n)) means 0 ≤ f (n) ≤ kg(n) for all n ≥ n 0 , k being con-
stant, n 0 > 0. This inequality can be rewritten as
1
0≤ · f (n) ≤ g(n)
k
⇒ g(n) = ( f (n))

Hence (ii) is true.


(iii) Let g(n) = o( f (n)).
This means there exists a positive constant k and n 0 > 0, such that

0 ≤ g(n) < k f (n) ∀ n ≥ n 0 .


⇒ f (n) ≤ f (n) + g(n) < (1 + k) f (n).
⇒ f (n) ≤ f (n) + o( f (n)) < (1 + k) f (n).

This means f (n) + o( f (n)) ∈ θ( f (n)), and hence (iii) is true.


13. Using mathematical induction show the following equality
    
1 1 1 n+1
1− 2 1 − 2 ··· 1 − 2 = .
2 3 n 2n

Solution:
For n = 2, the equality is true. Assume the equality to be true for n = m. That is
    
1 1 1 m+1
1− 2 1 − 2 ··· 1 − 2 = . (12.7)
2 3 m 2m

Consider the product for n = m + 1


     
1 1 1 1
1− 2 1 − 2 ··· 1 − 2 1−
2 3 m (m + 1)2
 
m+1 1
= 1− by using (12.7)
2m (m + 1)2
 
(m + 1) (m + 1)2 − 1
=
2m (m + 1)2
m2 + 2 m m+2
= =
2 m(m + 1) 2(m + 1)
Hence the equality is true for n = m + 1 and hence for all n.

14. Show by mathematical induction that (m 3 − 7m + 3) is divisible by 3 for integers m ∈ Z,


m ≥ 0.
12.9 Law of Large Numbers 239

Solution:
For m = 0, the statement is true. Assume the statement to be true for n = m
That is m 3 − 7m + 3 is divisible by 3.
Consider the expression for n = m + 1.

(m + 1)3 − 7(m + 1) + 3 = (m 3 − 7 m + 3) + (3 m 2 + 3 m − 6)
= A + B (say)

A = m 3 − 7m + 3 is divisible by 3 by assumption. 3m 2 + 3m − 6 is also divisible by 3.


So the expression (m 3 − 7m + 3) is divisible by 3 for all m.

15. Let r be a real number with r > −1. Prove that

(1 + r )n ≥ 1 + nr ∀ n ∈ N.

Solution:
The inequality is true for n = 1. Assume the inequality to be true for n = m. That is

(1 + r )m ≥ 1 + mr (12.8)

Consider

(1 + r )m+1 = (1 + r )m (1 + r )
≥ (1 + mr )(1 + r ) by (12.8)
= 1 + (m + 1)r + mr 2
≥ 1 + (m + 1)r .

So the inequality is true for m + 1 and hence for all n.

16. A tennis tournament has 20 participants. It is a singles tournament and any two players
play one game against each other. Show that at time ‘t’ there are two players who played
against same number of participants.

Solution:
Each player can finish either no game or one game or two games and so on. Upto (n − 1)
games which totals to n possibilities. If there is a player who finished (n − 1) games, then
there cannot be a player who finished zero game. This means ‘0’ and ‘n − 1’ cannot occur in
the list of played games. Hence, by direct argument there must be 2 players in the n players
who at some time ‘t’ played the same number of matches. Note that PH - principle cannot
be used as there are n players and n possibilities.
240 12 Discrete Probability

17. There are 80 sports bikes in a shop. Each bike has no more than 60 spokes in its wheels.
Show that there are atleast two bikes that have the same number of spokes in their wheels.

Solution:
Let a bike be put in room ‘t’ if it has ‘t’ spokes. So as per the statement of the problem
there must be 60 rooms into which the bikes are put. The shop actually has 80 bikes. So
by PH - principle there must be a room containing atleast 2-bikes. Hence the solution follows.

18. Show that among any 5 numbers, it is always possible to find two numbers whose dif-
ference is divisible by 5.

Solution:
Let n 1 , n 2 , n 3 , n 4 , n 5 be the five numbers when each n i is divided by 5, they leave a remainder
which is either 0, 1, 2, 3 or 4. Hence by PH - principle, out of the 5 numbers, two of them will
give the same remainder when divided by 5. Let these numbers be n i and n j , 1 ≤ i, j ≤ 5.
That is

n i = 5t1 + r
n j = 5t2 + r , t1 , t2 ∈ N
⇒ (n i − n j ) = 5(t1 − t2 )

Hence n i − n j is divisible by 5.
19. Let n 1 , n 2 , . . . , n t be positive integers. Show that if

n1 + n2 + n3 + · · · + nt − t + 1

balls are distributed into ‘t’ boxes, then either the first box contains atleast n 1 balls or 2nd
box contains n 2 ball and so on, the t th box contains atleast n t balls.

Solution:
Suppose that the ‘then’ claim is not true. This means that when

n1 + n2 + · · · + nt − t + 1

balls are distributed in t boxes, then box 1 contains (n 1 − 1) balls, box 2 contains (n 2 − 1)
balls and so on, box t contains (n t − 1) balls. Then the total number of balls in the t-boxes
will be n 1 + n 2 + · · · + n t − t. But this count is not correct. Hence the conclusion follows.

20. If n 1 , n 2 , . . . , n t 2 +1 is a sequence of real numbers, then show that this sequence contains
a subsequence of length (t + 1) which is either an increasing or a decreasing one.
12.9 Law of Large Numbers 241

Solution:
Let there be no decreasing subsequence of length t + 1. Then we need to show that there
exists a subsequence of length t + 1 which is increasing.
Let ‘s f ’ be the length of the longest subsequence which is decreasing and let the subse-
quence start with the number ‘n f ’ where 1 ≤ f ≤ t 2 + 1. By our assumption on decreasing
subsequences we have, 1 ≤ s f < t + 1 for all ‘ f ’. By the previous problem, we have that
the (t 2 + 1) integers must contain (t + 1) integers such that

s f1 = s f2 = s f3 = · · · = s f(t+1) ,

where 1 ≤ f 1 ≤ f 2 ≤ · · · < f (t+1) ≤ t 2 + 1. If there is one f i such that n fi+1 > n fi , then
any decreasing subsequence of length s fi+1 that begins with n fi+1 will lead to a subsequence
of length s fi+1 , which can starts with the term n fi by appending n fi in the beginning. Hence
we have s fi > s fi+1 which is a contradiction as s fi = s fi+1 . Hence we have

n f1 ≥ n f2 ≥ · · · ≥ n ft+1

which is increasing subsequence of length (t + 1).

21. In the month of April, a maths instructor conducts atleast one surprise test but plans to
conduct no more than 46 such tests. Show that there must be a period of some ‘t’ number
of consecutive days during which the teacher conducts 14 surprise tests.

Solution:
Let ti denote the number of tests conducted on day ‘i’ in April. So the total number of tests
conducted starting from day ‘s’ and ending on day ‘ f ’ will be

M = ts + ts+1 + · · · + t f .

Now we look for partial sums as follows. That is

n 1 = t1
n 2 = t1 + t2
n 3 = t1 + t2 + t3
···
n 30 = t1 + t2 + · · · + t30 .

Clearly M = n f − n s−1 .
Now to show M = 14 for some f and s, where 1 ≤ f , s ≤ 30. Clearly n i ≤ 46 ∀ i. Also the
instructor conducts atleast one test on each day. Hence n 1 , n 2 , . . . , n 30 are distinct integer
from {1, 2, . . . , 46}.
242 12 Discrete Probability

Now we treat the distinct integers n i ’s to be the number of pigeons. The aim is to fix the
pigeonholes satisfying the condition that M = 14. The possibilities are

(1, 15), (2, 16) . . . (14, 28)


(29, 43), (30, 44), (31, 45), (32, 46)
{33}{34} . . . {42}.

So the total number of holes will be 28. Hence two n i ’s must be in the same hole. It
means we have n i , n j such that n j − n j = 14.

22. Let n, t be nonnegative integers. Show that


n
tC(n, t) = n · 2n−1
t=1

Solution:

n
We can see that the summation C(n, t) will occur as coefficients of (1 + x)n with x = 1.
t=1
That is

n
(1 + x)n = C(n, t)x t
t=1

d d 
n
(1 + x)n = C(n, t)x t
dx dx
t=1

n
n(1 + x)n−1 = tC(n, t)x t−1
t=1

For x = 1, we get,

n
tC(n, t) = n2n−1 .
t=1
23. Show that

(x + y + z)4 = 1(x 4 + y 4 + z 4 ) + 4(x 3 y + x 3 z+


x y 3 + y 3 z + x z 3 + yz 3 ) + 6(x 2 y 2
+ x 2 z 2 + y 2 z 2 ) + 12(x 2 yz + x y 2 z + x yz 2 )

Solution:
Coefficient of x 4 , y 4 , z 4 is 1 when x, y, z from each term in the product (x + y + z)(x +
y + z)(x + y + z)(x + y + z) is taken. Hence it is 1.
12.9 Law of Large Numbers 243

Coefficient of x 3 y is 4. This is because one has to take three terms in the product (x + y +
z)(x + y + z)(x + y + z)(x + y + z) to form x 3 and y from the single term. The argument
will be identical for the terms x 3 z, x y 3 , y 3 z, zx 3 , yz 3 as well.
Coefficient of x 2 y 2 is 6. This is because one has to take two terms in the product (x +
y + z)4 to form x 2 and y 2 from the remaining two terms.
Coefficient of x 2 yz being 12 can be identically seen as above.

24. Find the expansion of (1 + t)k , k = 3, 4, 5, 6.

Solution:
The coefficients of the terms in the expansion of (1 + t)3 can be seen to occur in the 3r d
row of Pascal triangle. So
(1 + t)3 = 1 + 3t 2 + 3t + t 3
Similarly, by referring the Pascal triangle, we have

(1 + t)4 = 1 + 4t + 6t 2 + 4t 3 + t 4
(1 + t)5 = 1 + 5t + 10t 2 + 10t 3 + 5t 4 + t 5

25. Prove the following


n
(i) C(n, k) = 2n
t=0
(ii) The sum of the entries in column ‘i’ (i ≥ 0) of Pascal’s triangle starting from row ‘0’
upto row ‘n’, equals the ((n + 1), (i + 1))th entry. That is


n
C(t, i) = C(n + 1, i + 1)
t=0
Solution:
(i) Consider

n
(1 + x)n = C(n, t)x n
t=0
Substitute x = 1, we get

n
2n = C(n, t)
t=0
(ii) We prove this by using induction on the ‘row number’ m.
The sum entry below row ‘0’ will be 1 in column i = 0. The entries from row ‘0’ upto
row m in any other column will be ‘0’.
244 12 Discrete Probability

So, 
1 if i = 0
C(1, i + 1) =
0 otherwise.
Hence the result is true for m = 0. Assume the result to be true for some m = n. That is for
n ≥ 1,

n−1
C(t, i) = C(n, i + 1)
t=0
Now consider


n 
n−1
C(t, i) = C(t, i) + C(n, i)
t=0 t=0
= C(n, i + 1) + C(n, i)
= C(n + 1, i + 1).

26. Prove the following


n
(i) C(n, t)2t = 3n .
t=0

n
(ii) tC(n, t) = n · 2n−1 .
t=1

Solution:
(i) Let X = {1, 2, . . . , n}.
A subset A of X of size ‘t’ can be chosen in C(n, t) ways.
A subset A of A can be chosen in 2t ways.
 n
Hence there are C(n, t)2t ways are the number of pairs (A, A) with A ⊆ X which is
t=0
the left hand side expression.
For the right hand side count, we observe the following.
For every element x ∈ {1, 2, . . . , n} the following are the possibilites for forming the pair
(A, A), A ⊆ X .

(i) The element x ∈ A and A.


(ii) The element x ∈ A but not in A.
(iii) The element x ∈
/ A and hence not in A.

Hence the total of pairs (A, A) will be 3n .


(ii) This problem can also be seen as a selection and combination problem.
12.9 Law of Large Numbers 245

For the term tC(n, t), we can say that from a set of n elements, we choose a t-element
subset A and then choose an element x from A as a representative. For all possible ‘t’ values,
n
we have C(n, t) to give the count of the pairs (A, x) in every possible way.
t=1
The right hand side counts the same pair by choosing a representative x from an ‘n’
element set and then pick a subset A of size (t − 1). Then add x to A to form a ‘t’ element
subset. Hence this can be done in n · 2n−1 ways.

27. Show that


    3 
√ √ 1 1 1 1 1 1 2 1 1 1
7= 6 1+ · · − · + · · + ···
1! 2 6 2! 4 6 3! 8 6

Solution:
Consider

7 = (6 + 1)1/2
∞  t
√  1 1
= 6 C( , t)
2 6
t=0
  2 
√ 1 1 1 1 1 1
= 6 1+ · · − · + ···
1! 2 6 2! 4 6

28. Find the binomial expansion of (1 + x)−1 . Is the expanded series convergent? Justify
your answer.

Solution:


(1 + x)−1 = C(−1, t)(x)t
t=0
∞
(−1)t 1 · 2 · 3 · · · t t
= ·x
t!
t=0
= 1 − x + x2 − · · · xn + · · ·

This series converges ∀ x such that |x| < 1.

29. Let n and t be non negative integers. Show that

C(n, t) + C(n − 1, t) + C(n − 2, t) + · · · + C(t, t) = C(n + 1, t + 1).


246 12 Discrete Probability

Solution:
From C(n + 1, t + 1), we can see that we count the number of subsets of (n + 1) having
(t + 1) elements.
This can be done via a system which selects ‘t’ elements from t + i elements t + i ≤ n
such that a (t + 1) element subset can be formed by taking a ‘leading’ element of the set
being t + i + 1. Note t + i + 1 is like a ‘leader’ of the group of (t + i) elements. We have
the left hand side of the equation for 0 ≤ i ≤ n. Note that this left-hand side summation can
be seen to be sum of the diagonal elements whose first position being the left most entry in
the row corresponding to ‘t’. The summation leads to the right hand side, an entry in the
same diagonal where we started at.

30. Expand 1 − 9x as s power series.

Solution:
√ 1
1 − 9x = (1 − 9x) 2 .
Using Newton’s Binomial theorem we have


1 1
(1 − 9x) 2 = C( , n)(−9x)n
2
n=0

Here
−1 −3
1 1
· · · · −2n+3
·
C( , n) = 2 2 22
2 n!
1 · 3 · 5 · 7 · · · (2n − 3)
= (−1)n−1
n! · 2n
So


1 1 · 3 · 5 · 7 · · · (2n − 3) n
(1 − 9x) 2 = 3n · ·x
n! · 2n
n=0
31. A sequence of numbers a0 , a1 , . . . , an is said to be unimodal if there is an integer ‘t’
with 0 ≤ t ≤ n such that

a0 ≤ a1 ≤ · · · ≤ at , at ≥ at+1 ≥ at+2 ≥ · · · ≥ an .

Such an ‘at ’ need not be unique. Consider the sequence C(n, 0), C(n, 1), . . . , C(n, n), the
binomial coefficients for ‘n’ being a positive integer. Show that this sequence is unimodal.

Solution:
We know
n!
C(n, t) =
t!(n − t)!
12.9 Law of Large Numbers 247

The ratio
C(n, t) n! (t − 1)!(n − t + 1)!
= ×
C(n, t − 1) t!(n − t)! n!
n−t +1
= (12.9)
t
We have,

C(n, t − 1) < C(n, t), C(n, t − 1) = C(n, t)


or C(n, t − 1) > C(n, t).

This means, by (12.9)

t < n − t + 1, t = n − t + 1 or t > n − t + 1

If t < n − t + 1, then t < n+12 and if t < 2 ⇒ t < n − t + 1.


n+1

If n is even, we have t ≤ 2 .
n

If n is odd, we have t ≤ n−1


2 .
Hence the binomial coefficients increase as seen below for n even.
n
C(n, 0) < C(n, 1) < C(n, 2) < · · · < C(n, )
2
n n
C(n, ) > C(n, + 1) > · · · > C(n, n).
2 2
For ‘n’ being odd we have,
n+1
C(n, 0) < C(n, 1) < · · · < C(n, )
2
n+1 n+1
C(n, ) > C(n, + 1) > · · · > C(n, n).
2 2
For t = n − t + 1, imply 2t = n + 1. If n is even, we can see that the two consecutive coef-
2 ) and C(n, 2 )
ficients at the middle being equal. For n odd also we can see that C(n, n−1 n+1

being the same.

32. Show that the number of surjective functions f from a set X = {1, 2, . . . , n} to a set
X = {1, 2, 3, . . . , t} is t!S (n, t).

Solution:
From the definition of f , we can see that the elements of X are partitioned to ‘t’ blocks.
The blocks are labelled and there are exactly t of such blocks. If we place the elements of X
into the ‘t’ blocks in S (n, t) ways, there are t! ways to form t member subsets of X . Hence
the number of surjective functions will be t!S (n, t).
248 12 Discrete Probability

33. Show that


 S (n, t)x n (e x − 1)t
=
n≥t
n! t!

Solution:
We show the equality using mathematical induction on ‘t’.
 n
For t = 1, S (n, 1) = 1 and hence the equality n≥1 xn! = (e x − 1) is true.
Assume the equality to be true for t = m − 1. Then,
Consider
(e x − 1)m 1 (e x − 1)m−1
= (e x − 1) ·
m! m (m − 1)!
⎛ ⎞⎛ ⎞
1  n
x ⎠⎝  S (n, m − 1) n ⎠
= ⎝ x
m n! n!
n≥1 n≥(m−1)

Consider S (n, t) = 0 for all n < t, we have


⎛ ⎞⎛ ⎞
(e x − 1)m 1 ⎝ x n ⎠ ⎝ S (n, m − 1) n ⎠
= x
m! m n! n!
n≥1 n≥1

xn
Coefficient of n! will be

n!  S (n − j, m − 1) 1 
n−1 n−1
= C(n, j)S (n − j, m − 1) (12.10)
m (n − j)! j! m
j=1 j=1

Now

S (n, t) = C(n − 1, 0)S (n − 1, t − 1) + C(n − 1, 1)S (n − 2, t − 1)


+ · · · + C(n − 1, n − 2)S (1, t − 1)

n−1
i.e., S (n, t) = C(n − 1, j − 1)S (n − j, t − 1) (12.11)
j=1

S (n, t) means the number of partitions of X = {1, 2, . . . , n} into ‘t’ arbitrary sets. The
part ‘ j’ that contains ‘n’ of an arbitrary partition means that there are C(n − 1, t − 1) choices
of the remaining elements in that part. Note that S (n − j, t − 1) gives the number partitions
of the remaining (n − j) elements into (t − 1) parts. Hence we have (12.11).
12.9 Law of Large Numbers 249

From (12.11) we can see that the rhs of (12.10),

1 
n−1
1
C(n, j)S (n − j, m − 1) = [S (n + 1, m) + S (n, m − 1)]
m m
j=1

= S (n, t).

34. How many 4 letter words can be formed from the first 7 letters of English alphabet that
always includes ‘a’ in it (The words need not be meaningful).

Solution:
We need to include always ‘a’ in the word. The letter a can be in any of the 4 positions.

a − − − , − a − − , − − a − , − − − a.

There are P(4, 1) ways = 4. The remaining 3 positions will use the letters {b, c, d, e, f , g}.
This can be done in P(6, 3) ways. Hence the total number of words will be

P(4, 1) × P(6, 3) = 4 × 120 = 480.

35. How many 5 letter words can be formed using the letters in the word ‘S A U S E L I
T O’ that contains atleast one vowel.

Solution:
The number of vowels in ‘S A U S E L I T O’ is 5. The total number of symbols in the
given word is 9. Hence totally there are P(9, 5) words of length 5 can be formed. That is
15120 words of length 5 are there and every such word must use a vowel as there are only
4 non-vowels in the given word.

36.

(i) A bag contains 6 wooden balls. A ball is taken out randomly and painted with any one
of 6 distinct colors. Find the number of ways the 6 balls be selected.
(ii) There are 9 flowers plants placed in 9 different pots in a garden. Find the number of
ways can 4-plants be placed side-by-side near the entrance of the house.

Solution:

(i) Once a ball is taken out it is painted. So there are P(6, 6) ways to pick a ball. Hence
there are 720 ways to do so.
(ii) The problem is a permutation problem where 4 plants to be selected from 9 plants to
be placed side-by-side. Hence the answer will be P(9, 4) = 9 × 8 × 7 × 6 = 3024.
250 12 Discrete Probability

37. A mathematics course has 20 students. The course instructor conducts a surprise quiz.
Four students who did not prepare want to leave the class on the quiz day. They leave the
class one after another telling some health reasons to the course instuctor. Find the number
of ways can this happen.

Solution:
There are 20 students who are in the class while at the start of the quiz.
Any one among the 4-students will leave the class first by saysing a lie to the instructor.
After this time, the class will have 19 students and the next student will leave the class. This
continues till all the 4 students leave the class. Hence there are P(20, 4) ways that this can
happen.

38.

(i) Find the number of 4-digit numbers that can be formed using only the numbers
{1, 2, 3, 4, 5, 6, 7, 8, 9}.
(ii) Find the number of 4-digit odd numbers that can be formed using the digits
{1, 2, 3, 4, 5, 6, 7, 8, 9}.
(iii) Find the number of 4-digit even numbers that can be formed using the digits
{1, 2, 3, 4, 5, 6, 7, 8, 9}.
(iv) Find the number of 4-digit numbers that can be formed using the digits
{1, 2, 3, 4, 5, 6, 7, 8, 9} and always end with either 5 or 6.

Solution:

(i) P(9, 4) = 3024.


(ii) If the four digit number ‘a1 a2 a3 a4 ’ is odd, then the last digit a4 = {1, 3, 5, 7, 9}. In
this case a1 a2 a3 can be any number from the set {1, 2, 3, 4, 5, 6, 7, 8, 9}. Hence there
are 5 × P(8, 3) such numbers.
(iii) 4P(8, 3).
(iv) This is a subcase of (ii) and (iii). The count is 2P(8, 3).

39. Show that the following statements are equivalent.

(i) Number of ways of distributing 12 balls in three identical boxes.


(ii) Number of non-negative integer solutions (x, y, z) of the equation x + y + z = 12.

Solution:

(i) Let ‘x’ be the number of balls put in box 1, y be the number of balls put in box 2 and z
be the number of balls put in box 3. So we have to find out the number of tuples (x, y, z)
12.9 Law of Large Numbers 251

satisfying the equation x + y + z = 12 which is nothing but statement (ii). Here x ≥ 0,


y ≥ 0, z ≥ 0. The answer will be C(14, 12) = 91.
(ii) implying (i) can be identically proved.

40. A worker has to work in a company for 3 d in March. However the worker is not permitted
to work on consecutive days in the company. Find the number of choices for the worker.

Solution:
The worker must make sure that his choice does not include two consecutive days. Let
x1 , x2 and x3 be the three days choosen by him, in the order that he will work on day
x1 , following day x2 and then day x3 . Clearly 1 ≤ xi ≤ 31, i = 1, 2, 3. Also x2 = x1 + 1,
x3 = x2 + 1. So we have 1 ≤ x1 < x2 − 1 < x3 − 2 ≤ 29. That is the choice must be such
that 1 ≤ x1 < x2 − 1 < x3 − 2 ≤ 29. That is simply choosing the 3 d of {1, 2, 3, . . . , 29}
which is C(29, 3).

k
41. Let r1 , r2 , . . . , rk be positive integers with ri < n. Then show that
i=1

r1 !r2 ! . . . rk ! < n!

Solution:

k
Let us suppose ri < n. Then
i=1
n!
D=
r1 !r2 ! . . . rk !
is nothing but arrangement of n elements in a row so that the object ‘i’ is repeated ri -

k
times. Hence D is a positive integer. Hence n! ≥ r1 !r2 ! . . . rk !. Hence if ri < n, then
i=1
r1 !r2 ! . . . rk ! < n!.

42. Find the coefficient of x 96 in the generating function F(x) given below.

(i) F(x) = 1
1+2x
(ii) F(x) = 1
(1+3x)2

Solution:
(i)

F(x) = (1 + 2x)−1
= 1 − 2x + 22 x 2 − 23 x 3 + 24 x 4 − · · · .
252 12 Discrete Probability

Coefficient of x 96 is +296 .
(ii)
F(x) = (1 + 3x)−2
= (1 + 3x)−1 (1 + 3x)−1
= (1 − 3x + 32 x 2 − 33 x 3 + · · · )
(1 − 3x + 32 x 2 − 33 x 3 + · · · ). (12.12)

x 96 can be seen to be obtained from the product (12.12) as

t x 96 = t0 1x 96 + t1 x x 95 + t2 x 2 x 94 + t3 x 3 x 93 + · · · + t95 x 95 x + t96 x 96 1

Here,

t0 = (−3)96
t1 = (−3)(−3)95
t2 = (−3)2 (−3)94
···
t95 = (−3)95 (−3)
t96 = (−3)96

t = t0 + t1 + t2 + · · · + t96 = 97 · 396 .
43. Find the number of integer solutions of x1 + x2 + x3 = 7, 1 ≤ x1 ≤ 2, 1 ≤ x2 , x3 ≤ 4.

Solution:
The generating function for the condition 1 ≤ x1 ≤ 2 will be f 1 (x) = x + x 2 .
Similarly the generating functions for x2 , x3 will be,

f 2 (x) = x + x 2 + x 3 + x 4
f 3 (x) = x + x 2 + x 3 + x 4

Hence the product generating function F(x) will be

F(x) = f 1 (x) f 2 (x) f 3 (x)


= (x + x 2 )(x + x 2 + x 3 + x 4 )2
= x 3 (1 + x)(1 + x + x 2 + x 3 )2

Coefficient of x 7 will be coefficient of x 4 in the product (1 + x)(1 + x + x 2 + x 3 )2 . It will


be 7.
12.9 Law of Large Numbers 253

44. Find the closed form expression for the generating functions of the following sequences.

(i) 2, 2, 2, 2, 2, . . .
(ii) 7, 0, 7, 0, 7, 0, . . .
(iii) 1, 6, 19, 40, . . . , 1 + n + 4n 2 , . . . .

Solution:
(i) The generating function for 2, 2, 2, . . . is

2 + 2x + 2x 2 + 2x 3 + · · ·
= 2(1 + x + x 2 + · · · )
2
= .
1−x
(ii) The generating function for 7, 0, 7, 0, 7, . . . is

7 + 0x + 7x 2 + 0x 3 + 7x 4 + · · ·
= 7(1 + x 2 + x 4 + x 6 + · · · )
7
= .
1 − x2


(iii) nth term of this sequence is 1 + n + 4n 2 . So the generating function is xt +
t=0

 ∞

t xt + 4 t2xt .
t=0 t=0
We now try to write 1 + n + 4n 2 as sum of Binomial coefficients. That is

1 + n + 4n 2 = a + bC(n + 1, 1) + dC(n + 2, 2)

For n = 0,

a+b+d =1 (12.13)

For n = 1,

a + 2b + 3d = 6 (12.14)

For n = 2

a + 3b + 6d = 19 (12.15)

a = 4, b = −11, c = 8
254 12 Discrete Probability


 ∞
 ∞
 ∞

(1 + n + 4n )x = 4
2 t
x − 11
t
C(n + 1, 1)x + 8
t
C(n + 2, 2)x t
t=0 t=0 t=0 t=0
4 11 8
= − +
(1 − x) (1 − x)2 (1 − x)3
45. Find the number of ways of placing n balls into 2 boxes such that no box contains exactly
3 balls.

Solution:
Number of ways distributing n balls into 2 boxes such that no box contain exactly 3 balls
means that the generating function associated will be

(1 + x + x 2 + x 4 + · · · )2
= [1 + x + x 2 + x 4 (1 + x + x 2 + · · · )]2
= [1 + x + x 2 + x 4 (1 − x)−1 ]2

The coefficient of x n will be the number of ways of placing the n balls in 2 boxes satisfying
the given condition.

46. A gardener arranges n flower pots in a row. The owner of the garden splits the arranged
flower pots at different positions on the row, there by forming a smaller non empty group of
pots for using them in turn for decoration. Find the number of ways the owner can do this.

Solution:
Let an be the number of ways the gardener can arrange the pots in a row.
If an = 1, for n ≥ 1, there is one way which is the original arrangement itself. For the
original arrangement, if the number of splits make ‘t’ groups, then the owner chooses one
of the ‘t’ groups for decoration. Let bn be the number of ways to choose the subset of pots
for decoration by the owner and let b0 = 1. Clearly bn = 2n as the owner simply makes a
choice on the set of groups. Hence
x
F(x) = x + x 2 + x 3 + · · · =
1−x
1
G(x) = 1 + 2x + 22 x 2 + · · · = .
1 − 2x
This means F(x) is the generating function for the arrangements of the gardener and G(x)
is the generating function for the group being chosen by the owner from the arrangement
of the gardener. So choice of the owner is dependent on the arrangements by the gardener.
Hence the generating function K (x) corresponding to the final choice of the owner will be
composition of F and G. That is
12.9 Law of Large Numbers 255



x
K (x) = G(F(x)) = G
1−x
1
=
1 − 1−x
2x

1−x 1 x
= = −
1 − 3x 1 − 3x 1 − 3x

 ∞
= 3k x k − 3k−1 x k
k=0 k=1


=1+ 2 · 3k−1 x k .
k=1

So there are 2 · 3n−1 ways for the owner to his choice.

47. Find a direct expansion for at if a0 = 0 and at+1 = at + 2t , t ≥ 1 using generating


function method.

Solution:


Let F(x) = at x t be the generating function for the sequence {at }∞
t=0 .
t=0
Consider

at+1 = at + 2t (12.16)

Multiply (12.16) throughout x t+1 and sum over from 0 to ∞.



 ∞
 ∞

at+1 x t+1 = at x t+1 + 2t x t+1
t=0 t=0 t=0

 ∞
=x at x t + x (2x)t
t=0 t=0
x
So F(x) = x F(x) +
1 − 2x
x
i.e., F(x) =
(1 − x)(1 − 2x)
= x(1 + x + x 2 )(1 + 2x + 22 x 2 + · · · )

Coefficient of x t is

t−1
at = 2 j = 2t − 1.
j=0
256 12 Discrete Probability

48. Solve the following recurrence relation using generating functions.

an + an−1 − 6an−2 = 0, n ≥ 2, a0 = 1, a1 = 3

Solution:


Let F(x) = ak x k be the generating function of the sequence {ak }∞
k=0 .
k=0
Multiply throughout x k+2 and sum the recurrence relation from 0 → ∞.

 ∞
 ∞

ak+2 x k+2 + ak+1 x k+2 − 6 ak x k+2 = 0
k=0 k=0 k=0
i.e., (F(x) − a1 x − a0 ) + x(F(x) − a0 ) − 6x 2 F(x) = 0
(1 + x − 6x 2 )F(x) − x(a1 + a0 ) − a0 = 0

Substitute a0 = 1, a1 = 3, we get
1 + 4x
F(x) =
1 + x − 6x 2
1 + 4x 6 1
= = −
(1 − 2x)(1 + 3x) 5(1 − 2x) 5(1 + 3x)
∞ ∞
6 k k 1
= 2 x − (−3)k x k
5 5
k=0 k=0

Hence
6 k 1
ak = 2 − (−3)k
5 5

 an x n
49. Solve the following recurrence relation using the generating function with
n!
n=0
a0 = 2.
an+1 − an − nan−1 = 0, n ≥ 2.
Solution:
For n = 0, the recurrence relation reduces as a1 − a0 = 0 ⇒ a1 = a0 .
n
Now multiply throughout the recurrence relation by xn! we get,

xn xn an−1 x n
an+1 − an −n =0
n! n! n!
12.9 Law of Large Numbers 257

Taking summation throughout from n = 0 to ∞ we get



 ∞ ∞
xn  xn  xn
an+1 − an −x an−1 =0
n! n! (n − 1)!
n=0 n=0 n=1
F (x) − F(x) − x F(x) = 0
F (x)
⇒ = (1 + x)
F(x)
Integrating throughout and using the value F(0) = 0 we get
 2

x+ x2
F(x) = e
 2
  x+ x2
x2 2
=1+ x + + + ···
2 2!
n
Coefficient of xn! will give an .
50. Consider the recurrence relation

an+1 = (n + 1)an + 2, a0 = 1.

 xn
Using the generating function G(x) = an , find an explicit formula for the generating
n!
n=0
function G(x).
Solution:
an+1 = (n + 1)an + 2


  ∞  x n+1 ∞
x n+1 x n+1
an+1 = (n + 1)an +2 (12.17)
(n + 1)! (n + 1)! (n + 1)!
n=0 n=0 n=0


 x n+1
Clearly an+1 = G(x) − 1 as a0 = 1. Hence (12.17) can be written as
(n + 1)!
n=0


∞ 
 xn  xn
G(x) − 1 = x an +2 −1
n! n!
n=0 n=0
= x G(x) + 2(e x − 1) + 1
258 12 Discrete Probability

Hence
2(e x − 1) + 1 2e x 1
G(x) = = −
1−x 1−x 1−x
 ∞ n ∞ ∞
x
=2 xn − xn
n!
n=0 n=0 n=0
x∞ n ∞  n  ∞

x xn
=2 n! − n!
n! n! n!
n=0 n=0 n=0

 
n ∞

xn xn
=2 C(n, t)t! − n!
n! n!
n=0 t=0 n=0

 n
xn
= 2 C(n, t)t! − n!
n!
n=0 t=0

 
n
2 xn
= n! −1
(n − t)! n!
n=0 t=0

Therefore

n
2
an = n! −1 .
(n − t)!
t=0
51. Solve for an explicity if

an+1 = an + 5n , n ≥ 0, a0 = 13.

Solution:
Here
an+1 = an + 5n
By repeated substitution, we get

an = an−1 + 5n−1
= an−2 + 5n−2 + 5n−1
......
= a0 + 50 + 51 + · · · + 5n−1
5n − 1 1
= 13 + = [5n − 51].
5−1 4
52. (Tower of Brahma) It is given that there are three rod stands, and n number of disks of
different diameter can slide on to any rods. Initially one rod contains all the n disks in the
descending order of their diameter from bottom to top. The problem is to find the number of
moves required to move the present arrangement of disks on to a new rod with the following
conditions.
12.9 Law of Large Numbers 259

(i) Only one disk can be moved at a time.


(ii) Only the topmost disk can be moved.
(iii) Always, an arrangement of any of the three rods be such that a disk of larger diameter
being on the top of a disk of a smaller diameter is not permitted.

Solution:
The conditions imply that at any intermediate stage of moves, all the three rods have proper
arrangement as per conditions. Let the disks be numbered as 1, 2, 3, . . . , n such that number
1 is given to a disk of the smallest diameter and the disks are numbered in the increasing
order of their diameter. Number ‘n’ is given to the disk of largest diameter. Let the rods
be named as R1 , R2 and R3 . The problem is to move the disks from R1 to R3 say. Let an
denote the number of moves required to do this. First we move (n − 1) disks from R1 to R2
which are properly arranged in an−1 moves and then move the nth disk to R3 . Now using
the vacant R1 , move the disks in R2 to R3 which needs an−1 moves. The recurrence relation
will be
an = 2an−1 + 1.
Solving by repeated substitution method we have

an = 2an−1 + 1, n ≥ 1, a1 = 1
= 2(2an−2 + 1) + 1
......
= 2n−1 a1 + (1 + 2 + · · · + 2n−2 )
= 2n − 1.

53. Find the number of ways of selecting 5 cards so that the selection has atleast one card
from each category.

Solution:
The total number of ways selecting 5 cards is C(52, 5). Let Ni denote the set of all possible
5 cards being selected from the deck that will not contain a card from category i, 1 ≤ i ≤ 4.
So,

#Ni = C(39, 5), 1 ≤ i ≤ 4


#Ni ∩ N j = C(26, 5), 1 ≤ i, j ≤ 4, i = j
#(Ni ∩ N j ∩ Nk ) = C(13, 5), 1 ≤ i, j, k ≤ 4, i = j = k
#(Ni ∩ N j ∩ Nk ∩ Nt ) = 0
260 12 Discrete Probability

Using PIE (Principle of Inclusion, Exclusion) we have,


4 
#N = C(52, 5) − #Ni + #(Ni ∩ N j )
i=1 1≤i, j≤4

− #(Ni ∩ N j ∩ Nk ) + 0
1≤i, j,k≤4

= C(52, 5) − 4 C(39, 5) + 6 C(26, 5) − 4 C(13, 5).

54. How many integers are there in the set {1, 2, 3, . . . , 180} that are not relatively prime to
180.

Solution:
The prime factors of 180 are 2, 3, 5. Let A2 , A3 and A5 denote the numbers that have
prime factors 2, 3 and 5 respectively and they are less than 180. We need to compute
|A2 ∪ A3 ∪ A5 |. By PIE,

|A2 ∪ A3 ∪ A5 | = |A2 | + |A3 | − A3 − |A2 ∩ A3 | − |A2 ∩ A5 |


− |A3 ∩ A5 | + |A2 ∩ A3 ∩ A5 |
! " ! "
180 180 180 180 180
= + + − −
2 3 5 2×3 2×5
! "
180 180
− +
3×5 2×3×5

55. In a fine arts class, it is known that out of 50 students

30 students know to sing


18 students know to dance
26 students know to paint
9 students know to sing and dance
16 students know to sing and paint
8 students know to dance and paint
47 students know atleast one of the art.

(i) Find the number of students who know none of the three arts.
(ii) Find the number of students who know all the three.
12.9 Law of Large Numbers 261

Solution:
(i) 3 students do not know any of the art.
(ii) Let A, B, C denote the three sets of students of the class who know singing, dancing
and painting respectively.

|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∪ B| − |B ∩ C| − |A ∩ C| + |A ∩ B ∩ C|


47 = 30 + 18 + 26 − 9 − 8 − 16 + |A ∩ B ∩ C|
⇒ |A ∩ B ∩ C| = 6.

So there are 6 students who know all the three arts.

56. Consider the following Hasse diagram of the set S = {1, 2, 3, 4, 5, 6, 7, 8, 9}. Find the

(i) upper and lower bounds of {4, 5, 6}, {1, 3}, {2, 3}, {7, 9}.
(ii) glb and lub of the same sets given in (i) (Fig. 12.1).

Solution:
(i) Lower bound of {4, 5, 6}, {1, 3}, {2, 3} is ∅.
Upper bound of {4, 5, 6}, {7, 9} is also ∅.
Upper bound of {1, 3} is 8.
Upper bound of {2, 4} will be {4, 7}.
Lower bound of {7, 9} is 5.
The least upper bound does not exist for {4, 5, 6}, {7, 9}.
The greatest lower bound of {4, 5, 6} and {1, 4} does not exist.
The lub of {1, 3} is 8.
The lub of {2, 4} is 4.
The glb of {2, 4} is 2.
The glb of {7, 9} is 5.

Fig. 12.1 A Hasse diagram 8


7 9

4 5 6

1 2 3
262 12 Discrete Probability

57. Check whether the following Hasse diagrams are Lattices or not. Justify your answer
(Figs. 12.2 and 12.3).

(i)
Fig. 12.2 Hasse diagram for (i)
7

3 5 6
4

1 2

(ii)
Fig. 12.3 Hasse diagram for
9
(ii)

8
5 6 7

3
2 4

Solution:

(i) is not a Lattice as {1, 2} does not have a lub.


(ii) Yes as every pair {i, j} has both lub & glb for 1 ≤ i, j ≤ 9.

58. Let (P , ≤) be a finite lattice. Then is it always true that it has a minimum and a maximum
element?

Solution:
We prove by method of contradiction by assuming that P does not have minimum element.
Then there must be two minimal elements u, v in P such that u = v. By definition u ∧ v has
to be either less than u, v or u ∧ v = u, u ∧ v = v. Since both u, v being minimal elements
12.9 Law of Large Numbers 263

u ∧ v must be equal to both u, v forcing u = v which is not true. Hence P has a minimum
element. Identically one can show that P has a maximum element.

59. Let X , Y be two sets such that X ⊆ Y . Show that



 1, X = Y
|A|−|X |
(−1) =
X ⊆A⊆Y
0, X = Y

Solution:
When X = Y , the result is true as the set X is the only subset between X and X .
So consider X ⊂ Y and let A be a subset of Y containing X and let |A| − |X | = t. Here
t can be between 0 and |Y | − |X | = m. Number of such subsets A will be C(m, t). Hence
the following summation on the ‘t’ such subsets of Y containing X will be

 
m
|A|−|X |
(−1) = (−1)t C(m, t) (12.18)
X ⊆A⊆B t=0

Here the RHS of (12.18) is nothing but a binomial expansion of (−1 + 1)m which is ‘0’ for
m ≥ 1.

60. Show that the relation ‘≤’ on N given by x ≤ y iff y = 3t x for some integer t ≥ 0 is a
partial order.

Solution:
First, for any natural number n ∈ N one can see n = 30 n. Hence for any natural n, ‘n ≤ n’.
So ≤ is reflexive.
Next, we consider n, m ∈ N with n ≤ m and m ≤ n. This means n = 3t1 m and m =
3 n. This means n = 3t1 +t2 n and hence t1 = t2 = 0. So we get m = n. This means ‘≤’ is
t 2

antisymmetric.
Finally for n, m, q ∈ N with n = 3t1 m, m = et2 q imply n = 3t1 +t2 q. So n ≤ q. So ‘≤’
is a partial order relation.

61. Find the number of non-isomorphic graphs on 4 vertices.

Solution:
We know that there are totally 24 graphs on 4 vertices. But this count does not exclude
isomorphic graphs. So we can understand the graph G on 4-vertices with some edges present
and some edges absent between a pair of vertices. That is consider the graph K 4 and color
its edges either with black or with white. The graph G is the graph with only black colored
edges in it. The white colored edges are left out.
264 12 Discrete Probability

There will be six edges in K 4 and we can understand that the edges of K 4 are induced
by a permutation of vertices of the graph. This permutation group S4 will contain (4!=) 24
elements. The induced permutation group on edges of K 4 be S 4 . It will has its elements
edges of K 4 .

S4 = {(1)(2)(3)(4), (1 3)(2 4), (1 4)(2 3), (1 2)(3 4), (1)(2 3 4), (2)(1 3 4),
(3)(1 2 4), (4)(1 2 3), (1)(2 4 3), (2)(1 4 3), (3)(1 4 2), (4)(1 3 2),
(1)(2 3)(4), (1)(2)(3 4), (1 2)(3)(4), (2)(3)(1 4), (1)(2 4)(3),
(1 2 3 4), (1 3 2 4), (1 4 2 3), (1 2 4 3), (1 3 4 2), (1 4 3 2),
(4 3 2 1)}

Here S 4 will have 61 elements which are edges (i j) of G with 1 ≤ i, j ≤ 4. Here the
element ψ(i j) will be mapped to the pair (π(i), π( j)) where ψ is the permutation in S 4 and
π is a permutation in S4 . Hence we count the number of cycles in each permutation ψ in S 4
to know the presence of an edge.
Case (i): The identity permutation on vertices induces an identity permutation in S 4 . This
identity permutation has all one cycles. Hence every element in S 4 can get either of the two
colors. So it will be 26 possible ways of coloring.
Case (ii): For a permutation π ∈ S4 that is a 4-cycle, S 4 will have an induced permutation
comprising of a product of a 4-cycle and a two cycle. There are totally 6 four cycles in S4 .
Hence there will be 6.22 possible ways of coloring edges.
Case (iii): For permutations π ∈ S4 that are product of a 3-cycle and one 1-cycle will have a
induced permutation in S 4 with two 3-cycles. Hence there are 4.2 = 8 different permutations
of vertices leading to 8.22 possible coloring.
Case (iv): For permutations in S4 that are product of two 2-cycles. The induced permuta-
tions are one with product of two 2-cycles and two 1-cycles. Hence there are 3.24 possible
colorings.
Case (v): Finally a permutation with two 1-cycles and a 2-cycle induces a permutation with
two 1-cycles and two 2-cycles. The possible coloring will be 6.24 .
So the number of distinct colorings of G will be the sum of all possible colorings discussed
in the above 5 cases. It will be
1 6 264
(2 + 6.22 + 8.22 + 3.24 + 6.24 ) = = 11
24 24
Hence using Burnside’s Lemma there are 11 non-isomorphic graphs on 4-vertices.

62. Find the number of distinct colorings of the vertices of a regular pentagon modulo D5 so
that there is exactly one vertex in white color, two in black color and two in yellow color?
12.9 Law of Large Numbers 265

Solution:
Here D5 is the group acting on the coloring to fix the equivalent colorings. D5 is the dihedral
group. Using Polya enumeration theorem it will be
1  1 
pμ(r ) (x1 , x2 , . . . , xk ) = |F(r )|
|D5 | |D5 |
r ∈D5 r ∈D5

where F(r ) is the permutation r that fixes one white, two black and two yellow colors to
the vertices of the pentagon.
By identical argument above we can show that there are 4 different colorings of the ver-
tices with the given condition.
   
1234 1234
63. Let σ = and τ = . Find σ ◦ τ and τ ◦ σ. Here ‘◦’ is the composi-
2341 2143
tion operation.

Solution:
One need to understand the composition operation ‘◦’ in a systematic manner. We write

σ ◦ τ = σ(τ (x)) for x ∈ S = {1, 2, 3, 4}.

That is
 
1234
σ◦τ =
3214
τ ◦ σ = τ (σ(x))
 
1234
=
1432

It is not wrong if one considers σ ◦ τ directly as τ (σ(x)).


 
12345
64. Find the inverse σ −1 of σ = .
21453
Solution:  
12345
Note σ ◦ σ −1 = the identity permutation. So σ −1 can be computed by observ-
12345
ing the entries of σ in the upside down manner. That is,
 
−1 12345
σ =
21534
266 12 Discrete Probability

65.Find thecycle representations of the following permutations


1234
(i)
4123
 
12345
(ii)
21435
 
123456
(iii)
451263
Solution:
 
1234
(i) = (4 3 2 1)
4123
 
12345
(ii) = (2 1)(4 3)(5)
21435
 
123456
(iii) = (4 2 5 6 3 1)
451263
66. Let
G = {(1)(2)(3)(4)(5)(6)(7), (1, 7)(2, 6)(3, 5)(4)}
be a subgroup of S7 . If ‘∼’ is an equivalence relation induced by G, then
(i) is 1 ∼ 3?
(ii) is 3 ∼ 5?
(iii) is 4 ∼ 7?

Solution:
(i) No. 1  3
(ii) Yes
(iii) No.

67. Find the equivalence classes in G of the previous question.

Solution:
E = {{1, 7}, {2, 6}, {3, 5}, {4}}.

68. For the set S = {1, 2, 3, 4, 5, 6, 7} and the question 66 above, find the orbit of 2 and fix
of the permutations of G. Also find the stabilizer of 2.

Solution:
O(2) = {2, 6}
F(i) = S is the identity permutation.
12.9 Law of Large Numbers 267

For τ = (1, 7)(2, 6)(3, 5)(4)


F(τ ) = {4}
T (2) = i, the identity permutation.

69. Find all the lattice paths from (0, 0) to (2, 2).

Solution:

70. Let d3 (n) denote the number of permutations τ ∈ Sn with no decreasing subsequence
of length 3. Find d3 (3).

Solution:
The lattice paths that avoid 321 pattern in any permutation of S3 can be drawn as below
(Figs. 12.4 and
 12.5).

123
Here τ : .
231
Other lattice paths are
Hence d3 (3) = 5.

Fig. 12.4 Lattice paths (2,2)


(2,2)

(0,0) (0,0)
(2,2) (2,2)

(0,0) (0,0)
(2,2) (2,2)

(0,0) (0,0)
268 12 Discrete Probability

(3,3)

(0,0)
Fig. 12.5 321 pattern avoiding path

(2,2) (0,3)

(3,0) (3,0)
(0,3) (0,3)

(3,3) (3,0)
Fig. 12.6 Other lattice paths

71. Consider the cartisian coordinate points (0, 0), (4, 0). Using the steps (1, 1), (1, −1) (the
diagonal steps) draw all the lattice paths from (0, 0) to (4, 0) that do not fall below x-axis.
Such paths are called as ‘Dyck’ paths.

Solution:

72. Let Sn (132, 123) denote all permutations of Sn that avoid both 132 and 123. Show that
|Sn (132, 123)| = 2n−1 (Figs. 12.6 and 12.7).
12.9 Law of Large Numbers 269

y
3
2
1
x
(0,0) (1,0) (2,0) (3,0) (4,0)
Fig. 12.7 Dyck paths

(0,0) (4,0) (0,0) (4,0)

(0,0) (4,0)
Fig. 12.8 Other Dyck paths

Solution:
The proof is by method of induction on n.
For n = 3, the permutations
           
123 123 123 123 123 123
, , , , ,
123 132 321 213 231 312

There are 4 here which avoid both 132 and 123 patterns.
Let |Sn (132, 123)| = 2n−1 be true for n = m − 1. That is |Sm−1 (132, 123)| = 2m−2
(Fig. 12.8).
Consider any one permutation of Sm−1 that avoid both these patterns. Now new m-
permutations are formed as below:
For  
1 2 3 ... m − 1
τ= ∈ Sm−1
a1 a2 a3 . . . am−1
270 12 Discrete Probability

that avoid both the above patterns new permutations on m-element are formed as below.
 
1 2 3 ... m − 1 m
τ=
a1 + 1 a2 + 1 a3 + 1 . . . am−1 + 1 1
 
1 2 3 ... m − 1 m
τ=
a1 + 1 a2 + 1 a3 + 1 . . . 1 am−1 + 1

Clearly both τ and τ are in Sm (132, 123). This procedure gives all permutations in
Sm (132, 123). The insertion of ‘1’ in the last and last-but-one position guarantees the count
of Sm (132, 123) to be 2m−1 .2 = 2m . ‘1’ inserted anywhere else will give a permutation of
Sm having either 132 or 123 pattern. Hence the solution.

73. Find the decents and ascents of the permutations.


(i) 3412567
(ii) 534216

Solution:
(i) For τ = 3412567
dec(τ ) = {2}
asc(τ ) = {1, 3, 4, 5, 6}
(ii) σ = 534216
dec(σ) = {1, 3, 4}
asc(σ) = {2, 5}

Note: By writing a one-line notation a permutation π = p1 p2 . . . pn ∈ S, we mean π( j) =


p j for 1 ≤ j ≤ n.

74. Definition: Let P = p1 p2 . . . pn ∈ Sn and let P have k decents. P can be written as


the union of (k + 1) increasing subsequences of consecutive entries. Such subsequences are
called as the “runs” or ascending runs of P.

Express the following permutations as the union of ascending runs.


(i) 2415367
(ii) 342176

Solution:
(i) Let τ = 2415367
dec(τ ) = {2, 4}
The ascending runs are
24, 15, 367
τ = {24, 15, 367}.
12.9 Law of Large Numbers 271

(ii) σ = 342176
dec(σ) = {2, 3, 5}
The ascending runs are
34, 2, 17, 6
Then σ = {34, 2, 17, 6}.

75. Definition: A strict ballot sequence α of length (2n + 1) is a sequence of +1 and −1


such that ‘α’ contains (n + 1) 1’s and the remaining ‘n’ as −1’s with the condition that
every non-empty partial sum being positive.

Definition: Given a sequence α = a1 a2 . . . ak we define a cyclic shift or conjugate of ‘α’


as a sequence
as as+1 . . . ak a1 . . . as−1
There can be k such shifts of α. All such sequences need not be distinct.
Using the above two definitions show the following.
Let α = a1 a2 . . . a2n+1 be a sequence with (n + 1) 1’s and remaining as −1’s. Then all
the (2n + 1) cyclic shifts of α are distinct and exactly one of them is a strict ballot sequence.

Solution:
For example if
α = 1 1 1 − 1 − 1 1 − 1 − 1 1, n = 4, n + 1 = 5
some cyclic shifts are 1 1 1 1 − 1 − 1 1 − 1 − 1, −1 1 1 1 1 − 1 − 1 1 − 1, −1 −
1 1 1 1 1 − 1 − 1 1. Here 1 1 1 1 − 1 − 1 1 − 1 − 1 is one with every partial sum being
positive.
Now we prove the result by mathematical induction on ‘n’. Note that n, n + 1 are always
relatively prime to each other.
For n = 0, α = 1. Hence it is a strict ballot sequence.
Assume the result to be true for ‘n’, that is, if ‘α’ is a sequence of length (2n + 1) having
(n + 1) 1’s and the remaining as -1, the result is true.
Consider α = a1 a2 . . . a2n+3 which has (n + 2) 1’s and the remaining as −1’s. Clearly
there will be a position ‘t’ such that at = 1 and at+1 = −1, t < 2n + 3.
For t = 2n + 3, consider t mod (2n + 3). Now consider a new sequence
α = b1 b2 . . . b2n+1 obtained from ‘α’ by deleting at and at+1 from α. Now for ‘β’ being
of length (2n + 1), the induction assumption is true. That is β has a unique cyclic shift
say β = bs bs+1 . . . b2n+1 b1 . . . bs−1 which is a strict ballot sequence. If bs = a f , then in
a f a f +1 . . . a f −1 every partial sum is positive as this subsequence matches with β upto at .
Now add at = 1 and at+1 = −1, in α, the partial sums remain positive. Such an α is unique
as the cyclic shift beginning with at will have partial sum to be 0 and the cyclic shift begin-
ning with at+1 will have partial sum −1. Making another cyclic shift of α at some b j ( j = t)
272 12 Discrete Probability

will have its partial sums that include all the partial sums of the cyclic shift b j b j+1 . . . b j−1
of α. By induction, one of the partial sums calculated must be negative. Hence the solution.

76. Definition: A ballot sequence of length 2n is a sequence equal number of 1’s and −1’s
such that every partial sum is non negative.
Show that the Catalan number Cn is the count of ballot sequences of length 2n.

77. Let a box contain, one orange ball. A ball is drawn at random (as a first trial there will
be only one chance) then the ball drawn is put back in the box along with a green ball. The
procedure is repeated n times. A successful trial is one when an orange ball is drawn. Find
the probability of t-successes in n trials.

Solution:
Let As be the event of picking an orange ball in trial s. So, p(A1 ) = 1 as an assumption.
Now our aim is to compute p(As ). We know when we start sth trial, the box has one orange
ball and (s − 1) green balls.
Hence
1
p(As ) = .
s
1 s−1
p(As ) = 1 − = .
s s
The ‘n’ trials are independent and we need t-successes in these n trials. Hence the total
probability will be

Ts = p(As1 ) p(As2 ) . . . p(Ast ) p(Ast+1 ) . . . p(Asn )

Here the summation will be taken over the collection K of all possible (n − t) subsets
{st+1 , st+2 , . . . sn } of the set {2, 3, 4, . . . , n}. First trial is always successful. So
1 
Ts = (st+1 − 1)(st+2 − 1) . . . (sn − 1)
n!
K

[Here the sum is Stirling number of first kind without sign]

78. Find the probability that an arrangement of the symbols in the word ‘TIRUCHIRA-
PALLI’ has
(i) 6 consecutive vowels?
(ii) no consecutive vowels?
12.9 Law of Large Numbers 273

Solution:
(i) Total length of the given string ‘TIRUCHIRAPALLI’ is 14. In this 6 vowels must occur
as a single block. The word has 5 vowels. The remaining symbols are T, R, C, H, R, P, L,
6!
L and there are two R’s and two L’s. For a block of vowels of length 6, we have 3!2! = 60
arrangements.
For the two positions of R’s we have C(8, 2) ways and for two L’s we have C(6, 2) ways
to fix positions for R, R, L, L.
For T, C, H, P, we have 4! arrangements. So the total number of arrangements will be

60 × C(8, 2) × C(6, 2) × 4!

Total number of arrangements will be

C(14, 2) · C(12, 2) · 10!

So, the probability of 6 consecutive vowels in the arrangement of ‘TIRUCHIRAPALLI’ is

60 × C(8, 2) × C(6, 2) × 4!
C(14, 2)C(12, 2) × 10!
(ii) The 6 vowels can be arranged in 6! ways. The 8 non vowel symbols should be inserted
in between any two vowels and at the beginning as well as at the end of the string. Hence
there are 8! ways to insert non vowels. Hence the total arrangements will be 6! × 8!. The
associated probability will be

6! × 8!
.
C(14, 2) × C(12, 2) × 10!
79. An unbiased coin is tossed 20 times. Find the probability that
(i) the first ‘head’ occurs after exactly 15 tails
(ii) the 4th head occurs after exactly 10 tails?

Solution:
(i) When the coin is tossed 20 times, there are 220 possible out comes. The appearance of
15 tails successively followed by the appearance of a head has 220−16 ways to finish the
activity. Hence the probability will be 2−16 .
(ii) The 4th head appearance happens after tossing the coin 13 times. In this 13 tosses there
must be 10 tails and 3 heads which can happen in C(13, 3) ways. The 14th toss out come
is fixed with an ‘head’ appearance. The remaining 6 tosses are unrestricted and they can be
6
done in 26 ways. Hence the probability will be C(13,3).2
220
= C(13, 3).2−4 .
274 12 Discrete Probability

80. Definition: The probability generating function associated with any discrete distribution
is a polynomial whose coefficients are the probabilities p X (y). Here X = 0, 1, 2, . . . , is the
random variable. That is

P G X (y) = P(X = 0)y 0 + P(X = 1)y 1 + · · · + P(X = n)y n

P(X = r ) is the coefficient of y r in P G X (y).


(i) If the random variable X (r ) denote the number of appearances of heads in a fair coin
toss of n-times, find P G X (y).
(ii) Discuss about P G X (y) if the coin tossed is not a fair one.

Solution:
For a coin toss, denote the probability of head appearance as ‘ p’ and of tail as q = 1 − p.
For p(X = k) = C(n, k) p k q n−k
(i) Here p = 21 , q = 21 .

P G X (y) = C(n, 0) p(X = 0) + C(n, 1) p(X = 1)y + C(n, 2) p(X = 3)y 2 + · · · + C(n, n) p(X = n)y n
= C(n, 0)q n + C(n, 1) pq n−1 y + · · · + C(n, n) p n y n
 n  n  n
1 1 1
= C(n, 0) + C(n, 1) y + · · · + C(n, n) yn
2 2 2
 n
1  
= C(n, 0) + C(n, 1)y + · · · + C(n, n)y n
2
 n
1
= (1 + y)n .
2

(ii)

P G X (y) = C(n, 0)q n + C(n, 1) pq n−1 y + · · · + C(n, n) p n y n


[Here p = q as the coin tossed is not a fair coin]
= (q + py)n .

81. Suppose 11 indistinguishable balls are distributed in 3 indistinguishable boxes. The dis-
tribution is an independent event. Let pi be the probability of the picked ball being put in
box i, i = 1, 2, 3 with p1 + p2 + p3 = 1.
(i) Find the expected number of boxes that are empty.
(ii) Find the expected number of boxes that have exactly one ball.
12.9 Law of Large Numbers 275

Solution:
(i) Here pi is the probability of the ball being placed in the ith box. So the probability that
it is not put in box i will be 1 − pi . Hence the probability generating function for ‘t’ balls
being put in box i will be

P G X (y) = C(11, 0) pi0 (1 − pi )11−0 + C(11, 1) pi1 (1 − pi )1−0 + · · · + C(11, 11) pi11 (1 − pi )0

The box being empty will be when x = 0

C(11, 0) pi0 (1 − pi )11 = C(11, 0)(1 − pi )11



E(box empty) = x p(x)

3
= 1.(1 − pi )11
i=1

(ii)

3
C(10, 1)( pi )1 (1 − pi )10
i=1
82. A box contains 8 green balls and 5 yellow balls.
(i) Find the probability of picking 5 balls in combination of 3 green balls and 2 yellow balls.
(ii) Find the probability of (i) if one replaces the picked ball at each step of its draw.
(iii) Let the desired combination of balls drawn be that it is 2 green balls from the box.
Discuss the likelyhood of this with and without replacement.

Solution:
(i) The answer will be direct and simple for this case. It will be

C(8, 3)C(5, 2) 560


= ≈ 0.435
C(13, 5) 1287
(ii) In case of replacement the probability will be
 3  2
8 5 512 25
C(5, 3) = 10 × ×
13 13 2197 169
≈ 0.3447

(iii) Without replacement the probability will be

C(8, 2)C(5, 1) 28 × 5
= ≈ 0.490
C(13, 3) 286
276 12 Discrete Probability

With replacement, the probability will be


 2  
8 5
C(3, 1) ≈ 0.437
13 13

Hence the probability without replacement shows that it is more likely to get the desired
combination.

83. Suppose X and Y play a game by tossing two fair coins. If both the coins turn as ‘head
(H)’, or as ‘tail (T)’, then X pays one rupee to Y . Otherwise Y has to pay 2 rupees to X .
(i) Find the expected value of the game for X .
(ii) Find the expected value of the game for Y .
(iii) Discuss the fairness of the game.

Solution:
The possible outcome of the two coin toss can be drawn as a table below.
H T
H HH HT
T TH TT
(i) From the above table, one can see that two out of 4 outcomes produce HH, TT. Hence
its probability will be 21 . So Y gets one rupee in this case. With the same probability X will
get two rupees. Hence the expected value of the game for X is
1 1 1
(1) + (−2) = − .
2 2 2
So −50 paise X loses in each play or toss.
(ii) The money X loses, will be the money that Y gains. Hence Y is expected to win 50 paise
on each game the plays.
(iii) The expected value of the game being not zero, it is not a fair game.
Part II
Graph Theory
Basic Concepts
13

13.1 Introduction

We start with some examples where the discussion has graph theory base.

Example 13.1 1. Suppose a hospital has spread over 7 buildings. They are OP-unit,
Administration block, Pharmacy, ICU-unit, Canteen unit, General ward and Operation
wing. The problem is to lay roads between the units so that the distance to be covered
between them is minimum.
2. Konigsberg bridge problem.
Suppose river Pragel runs through cities. The river encloses two islands say A and
B. The banks are named as say C and D. There are seven bridges as shown below.
b1 , b2 , b3 , b4 , b5 , b6 , b7 are the bridges. The question is: Is it possible to start from any
one of land area, use the bridges to walk through A, B, C, D and come back to the
starting point such that only once each bridge is used to cross across? This is known as
Konigsberg Bridge problem and the problem is settled with a solution by Euler using
graph theory idea (Fig. 13.1).

Now we proceed for formal presentations of graphs and one can at a later point of reading,
understand the solutions to the above problems using graph theory.

Definition 13.2 A graph G is an ordered pair (V , E) where V and E are finite sets and
V ∩ E = ∅. Here V is called the vertex set of G, E is called the edge set of G. The set
E = {{x1 , x2 }/x1 , x2 ∈ V and x1 and x2 are related or joined}. Here x1 , x2 need not be
distinct. One can see that E ⊆ V × V except that the pair {u, v} is understand to be same
as {v, u}.

© Ane Books Pvt. Ltd. 2025 279


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_13
280 13 Basic Concepts

Fig. 13.1 Bridge problem

So if for e ∈ E and e = {x1 , x2 } we can say that x1 and e are incident, x2 and e are
incident with each other. One can also say that x1 and x2 are adjacent vertices. The above
definition describes an undirected graph.

Example 13.3 Let G = (V , E) where V = {1, 2, 3, 4, 5}, E = {e1 , e2 , e3 , e4 }. The follow-


ing table describes the relation between the elements of V and the elements of E.

E e1 e2 e3 e4
IG {1, 3} {1, 5} {2, 4} {4, 5}

Here IG is the incidence function. e1 and vertex 1, e1 and vertex 3 are incident. Similarly
other entries of the table can be understood.

Notation. Let |G| = |V | denote the order of G and G = |E| denote the size of G. Also
the relation {u, v} can be written simply as uv.

13.2 Pictorial Representation of a Graph

A graph can be pictorially represented as follows. The vertices are distinctly drawn on a
place and edges are indicated by curves or lines between the points.
For example if G = (V , E), V = {1, 2, 3, 4}, E = {13, 14, 23, 24}, the graph is shown
below (Fig. 13.2).

Fig. 13.2 A graph


1 2

4 3
13.2 Pictorial Representation of a Graph 281

Fig. 13.3 Non simple graph

Example 13.4 Consider the pictorial representation given below (Fig. 13.3). Here V =
{1, 2, 3, 4, 5}
E = {12, 23, 34, 43, 45, 15, 55}.
The edges e3 and e4 are called parallel edges and edge e7 is called a loop.

Definition 13.5 A graph without loops and multiedges is called a simple graph.

Remark 13.6 Mostly the topics and concepts here in this book are developed for simple
graphs.

Example 13.7 The following are the pictorial representations of simple graphs (Fig. 13.4).

Definition 13.8 Given a graph G = (V , E), the number of edges incident with a vertex v
is called its degree is denoted as d(v)or dG (v).

Example 13.9 Consider the following graph (Fig. 13.5).


Here V = {1, 2, 3, 4, 5, 6, 7, 8}
E = {12, 13, 14, 15, 16, 17, 34, 45, 56, 57, 67}.
d(1) = 6, d(2) = 1, d(3) = 2, d(4) = 3,
d(5) = 4, d(6) = 3, d(7) = 3, d(8) = 0.

The following theorem is known as the first theorem of graph theory.

Fig. 13.4 Simple graphs


282 13 Basic Concepts

Fig. 13.5 Verification

Theorem 13.10 Let G be a graph. Then



d(v) = 2|E|.
v∈V

Definition 13.11 1. Maximum degree (G) of a graph is the maximum of d(v) for all
v ∈ V . i.e.,
(G) = max d(v).
v∈V

2. Similarly, minimum degree is denoted as δ(G) and δ(G) = min d(v).


v∈V

Definition 13.12 Let d1 , d2 , . . . , dk be the degrees of vertices of a graph G = (V , E) where


|V | = k. Then the sequence (d1 , d2 , . . . , dk ) is called the degree sequence of G, where
d1 ≤ d2 ≤ · · · ≤ dk .

Remark 13.13 A graph G = (V , E) is finite if the graph is with finite set of vertices and
a finite set of edges. Otherwise, it will be mentioned as an infinite graph. Example of an
infinite graph is a graph on a plane R2 , where uv ∈ E if and only if d(u, v) = 1.

13.3 Some Special Graphs

1. A complete graph is one in which any two vertices are adjacent. A complete graph on n
vertices is denoted by K n (Fig. 13.6).
Example
2, A graph is called as an empty graph if its edge set is empty (Fig. 13.7).
Example
3. An independent set in a graph G = (V , E) is a subset I (⊆ V ) of vertices such that no
vertices of I are adjacent in G. An independent set I is said to be maximum if there is
no independent set I  of G such that |I  | > |I |. The number of vertices in a maximum
independent set is called the independent number of G and is denoted by α (Fig. 13.8).
Example I1 = {1, 5, 3} is an independent set.
I2 = {1, 5, 3, 8} is another independent set. Check whether I2 is maximum?
13.3 Some Special Graphs 283

Fig. 13.6 Some complete


graphs

Fig. 13.7 Empty graph

Fig. 13.8 A graph

4. Bipartite graph: A graph G is bipartite if the vertex set can be partitioned into two
subsets X and Y such that every edge of G has one end vertex in X and the other end
vertex in Y . We can denote G as G = (X ∪ Y , E). Clearly X and Y are independent sets.
Example The set {1, 2, 3} is an independent set and {4, 5, 6, 7} is the maximum inde-
pendent set (Fig. 13.9).
5. A complete bipartite graph is one in which every vertex in one partition is adjacent with
every vertex in the other partition. It is denoted as K m,n where order of K m,n is m + n
(Fig. 13.10).
Example
6. A graph with no edges is called as empty graph or null graph. That is size of the graph
is zero.
284 13 Basic Concepts

Fig. 13.9 Bipartite graph

Fig. 13.10 Complete bipartite


graph

Fig. 13.11 Some cycle graphs

7. In a graph G = (V , E), if the degree of each vertex is a constant r , then G is called as


r -regular graph. In general, a regular graph is one in which every vertex is of the same
degree.
8. A cycle graph G = (V , E) on n vertices is a simple graph whose vertices can be arranged
in a cyclic sequence. For vertices vi , v j if vi v j ∈ E then we say they are consecutive. In a
cycle graph if any two vertices are adjacent, then they must be consecutive. The definition
is valid for all n ≥ 3 and a cycle graph on n vertices is denoted by Cn (Fig. 13.11).
Example
Clearly a cycle Cn has always ‘n’ edges.
9. Let G = (V , E) be a graph. Then the graph G = (V , E) is said to be the complement
of G if the vertices of G and G are the same and uv ∈ E if and only if uv ∈ / E, for
13.3 Some Special Graphs 285

Fig. 13.12 Complementary graphs

Fig. 13.13 Self complementary graphs

u, v ∈ V . Clearly G = G (Fig. 13.12).


Example
Consider G = C5 which is (Fig. 13.13)

Exercises

1. Draw all simple graphs on 4 vertices.


2. Find the number edges in K 5,2 , K 5,2 . Is K 5,2 bipartite?
3. G = (V , E) is a graph on n vertices. ‘k’ vertices of G are of degree  and other |V | − k
vertices are of degree  + 1. Show that

 + 2|E| = ( + 1)n

4. Draw a graph G on 4 vertices such that (G) = 3, δ(G) = 1.


5. Let G = (V , E) be a graph such that |V | ≥ 2. Show that G contains two vertices having
equal degree.
6. Let G = (V , E) be a graph. A vertex v ∈ V is said to be an odd degree vertex if d(v)
is odd, otherwise d(v) is even and v is called an even degree vertex. Show that G has
even number of odd degree vertices.
7. For integers k and m, show that there exists a k-regular graph with n vertices if and only
if 0 ≤ k ≤ n − 1 and both k and n are not odd.
8. Let G = (V , E) be a bipartite graph on 10 vertices. Find |E| such that |E| is maximum.
286 13 Basic Concepts

9. Let G be graph on 13 vertices and 29 edges. In G there are 4-vertices of degree 4, 4


vertices of degree 3 and the remaining 5 vertices are of same degree. Find the degree
of the remaining vertices.
10. Find all 4-regular graphs on 7 vertices.
Paths Connectedness
14

14.1 Paths

Definition 14.1 A path in a graph G = (V , E) is of the form p : v0 v1 v2 v3 . . . vt where all


vi ’s are distinct and for any i ∈ {0, 1, . . . , t} vi vi+1 ∈ E.

Example 14.2 Consider the graph (Fig. 14.1)


p1 : v1 v2 v4 v5 v6 is a path.
p2 : v3 v1 v2 v4 v5 v6 is a path.

Remark 14.3 A path graph is a graph whose vertices are arranged linearly to form a single
path.

Definition 14.4 A walk in a graph G = (V , E) is of the form

w : v0 v1 v2 . . . vk where vi vi+1 ∈ E

and v0 , vk are distinct.

Example 14.5 In the above graph, w : v1 v2 v5 v4 v2 v3 is a walk.


A walk in which the initial and end vertices are same is said to be a closed walk. Note
that a walk can have both vertex repetitions and edge repetitions. If in a walk only vertices
repeat and edges are distinct then it is named as a trial.

Example 14.6 In the above graph w : v1 v2 v3 v4 v2 v5 v6 v5 v4 v3 is a walk.


t : v1 v3 v2 v4 v5 v2 is a trail.
Both w and t are open as the end vertices are distinct.

© Ane Books Pvt. Ltd. 2025 287


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_14
288 14 Paths Connectedness

Fig. 14.1 A connected graph


v1 v2 v5

G:

v3 v4 v6

Definition 14.7 A closed trail is one that starts and ends at the same vertex. A trail that
visits every edge of a graph is called as Eulerian trail. An Eulerian circuit is a closed trail.
One can define distance metric in terms of number of edges. So we can understand the
length of a path to be the number of edges in the path and its notation will be disG (x, y),
x, y are vertices in G.

Definition 14.8 Let u, v be two vertices in a graph G. Then distance between u, v in G is

disG (u, v) = min disG ( p)


p: p is a
x,y path

if there is a path from u to v in G. Otherwise disG (u, v) = ∞.

Definition 14.9 Let G = (V , E) be a graph. The eccentricity of a vertex v in G is the


distance of a vertex ‘u’ that is farthest from v. That is

eG (v) = max{disG (u, v)|u ∈ V }.

The minimum eccentricity is usually called as radius of G denoted as ‘r ’ and the maximum
eccentricity is called as diameter of G, denoted as ‘diam’. That is

r = min{eG (v)|v ∈ V }
diam = max{eG (v)|v ∈ V }.

Remark 14.10 There may be more than one vertex serving for radius and diameter.

Example 14.11 Consider the graph (Fig. 14.2)


eG (v1 ) = 5, eG (v6 ) = 5, eG (v8 ) = 5, r (G) = 3, diam(G) = 5.
14.2 Adjacency Matrix and Incidence Matrix 289

Fig. 14.2 Graph (4) v1 v2 v3 v4 v5 v6

G:
v7
v9

v8

14.2 Adjacency Matrix and Incidence Matrix

There are two representations of a graph in matrix form. Such representations are very useful
from programming point of view.

Definition 14.12 Let G = (V , E) be a graph with |V | = n. The matrix A G = (ai j ) where



1 if vi v j ∈ E
ai j =
0 otherwise.

is called the adjacency matrix of G. It is denoted by A G .

Example 14.13 Let G be the following graph (Fig. 14.3).

1 2 3 4 5
⎡ ⎤
1 0 1 1 1 0
2⎢⎢1 0 1 0 0⎥⎥
AG = 3 ⎢ 1 1 0 0 1⎥
⎢ ⎥
4⎣ 1 0 0 0 0⎦
5 0 0 1 0 0

We can see the usefullness of such a representation in a later chapter.

Fig. 14.3 Graph (5) 1 e4 4

e1 e3

2 e2 3 e5 5
290 14 Paths Connectedness

Definition 14.14 Let G = (V , E) be a graph with V = {v1 , v2 , . . . , vn }, E = {e1 , e2 , . . . ,


em }.
The n × m matrix IG = (bi j ) where

1 if vi is incident with e j
bi j =
0 otherwise

is called the incidence matrix of G.

Example 14.15 For the same example above, the incidence matrix will be

e1 e2 e3 e4 e5
⎡ ⎤
1 1 0 1 1 0
2⎢⎢1 1 0 0 0⎥ ⎥
IG = 3 ⎢ 0 1 1 0 1⎥
⎢ ⎥
4⎣ 0 0 0 1 0⎦
5 0 0 0 0 1

Remark 14.16 Note that the adjacency matrix is always symmetric.

14.3 Subgraphs

Definition 14.17 A subgraph of a graph G = (V , E) is a graph H = (U , F) such that


U ⊆ V and F ⊆ E. We denote this subgraph of G as H < G. Also G is called as super
graph of H . If in G and H , U = V , then H is called as the spanning subgraph of G and it
is denoted by H ≤ G. Also if F consists of all edges uv ∈ E then H is called the vertex
induced subgraph of G.

Example 14.18 Consider the following graph (Fig. 14.4).


H1 , H2 are subgraphs of a graph G. H1 is an induced subgraph of G.

Definition 14.19 A decomposition of a G is a set S of subgraphs of G such that each edge


appears in exactly one of the subgraphs of G in the set S (Fig. 14.5).

Example 14.20 Consider K 4 .


The two paths
P1 : 1 2 3 4
S=
P2 2 4 1 3
form a set of subgraphs and also S is a decomposition set for G.
14.3 Subgraphs 291

Fig. 14.4 Graphs and 5


subgraphs
H1 :
1 2
4 3
G: 1 2
5
H2 :
4 3

4 5

Fig. 14.5 A complete graph 1 2

4 3

Fig. 14.6 Graph (9) 1 4 6


G1 :

2 3 5 7

Decomposing a graph is in general a very difficult problem. One can analyse how to
decompose K n into set of cycles of length 3.

Example 14.21 Consider the graph (Fig. 14.6)


1 4 6

S= , ,
The set 2 3 3 5 5 7 .

Remark 14.22 A graph may or may not have cycle decomposition.


292 14 Paths Connectedness

Fig. 14.7 Graph (10-1) 1 2 5

G1 :

3 4

Fig. 14.8 Graph (10-2) 1 2

7
G2 : 6

3 4 5

Example 14.23 1. Consider the graph (Fig. 14.7).


G does not have a cycle decomposition (Justify).
2. G 2 has a cycle decomposition (Fig. 14.8).

We state the following theorem.

Theorem 14.24 (Veblen) A graph G has a cycle decomposition iff all its vertices are of
even degree.

14.4 Isomorphism
Definition 14.25 An isomorphism from a graph G = (V , E) to a graph G  = (V  , E  ) is a
bijection f from the vertex set of G to the vertex set of G  such that for u, v ∈ V , uv ∈ E
if and only if f (u) f (v) ∈ E  . Isomorphism between G and G  is denoted by G ∼ = G.

Remark 14.26 Isomorphism is a binary relation on the graphs. Isomorphism implies the
existence of a binary relation.

Example 14.27 Consider the graphs (Fig. 14.9)


G∼ = G  . Here the binary relation f : {1, 2, 3, 4} → {a, b, c, d} is such that f (1) = a,
f (2) = b, f (3) = c, f (4) = d.
14.4 Isomorphism 293

Fig. 14.9 Trees a b


1 2 3 4
G: G :

d c
Fig. 14.10 Non isomorphic 1
graphs
6 2 a d
C6 : G :
5 3
b c e f
4

Example 14.28 Consider the following two graphs (Fig. 14.10):


C6  G  . How do we prove this?
Assume C6 is isomorphic to G  . Then there exists a bijection g between the vertex set of C6
with that of G  . Note that C6 and G  have the same number of vertices and edges.
g(vi )g(v j )g(vk ) form a triangle in G  , then by adjacency preservation, vi v j vk must form
a triangle in C6 which is not true, as C6 dose not have a triangle. Hence C6  G  .

Remark 14.29 Two complete graphs K m and K n are isomorphic if and only if m = n.

Isomorphic graphs in general have the same number of vertices, same number of edges,
same length paths, same degree sequences and so on.

Definition 14.30 An isomorphism of a graph G onto itself is called an automorphism.

Remark 14.31 Every graph is isomorphic to itself and guarantees a bijection between the
vertex sets preserving adjacency.

Two graphs G and G  being isomorphic does say that their complements are isomorphic.

Definition 14.32 A graph G is self complementary if G ∼


= G.
294 14 Paths Connectedness

14.5 Connectedness

Let G = (V , E) be a graph. A vertex ‘u’ is connected to a vertex ‘v’ if there is a u − v walk


in G. Also we say that ‘v’ is reachable form ‘u’.

Remark 14.33 For any graph, reachability relation is an equivalence relation.

Definition 14.34 A graph G = (V , E) is said to be connected if and only if for every pair
of vertices u, v ∈ V , ‘v’ is reachable from ‘u’.

Remark 14.35 If in a graph G, for every pair of vertices u, v, G has u − v path, then G is
connected and conversely.

Since ‘reachability’ is an equivalence relation, this partitions the set of vertices into
equivalence classes. Each set along with the set of edges on them is called as ‘connected’
components of the graph.

Example 14.36 Consider the graph G (Fig. 14.11).


Here in G, the ‘reachability’ of vertices partitions the vertex set as

V1 = {1, 2, 3, 4, 5, 6}
V2 = {7, 8, 9, 10, 11, 12}
V3 = {13}.

Hence the induced subgraphs on V1 , V2 , V3 are the components of G. Each of this sub-
graph is also called as ‘maximal connected’ subgraphs.

Observation 14.37 Adding a new edge between two different components will connect the
two components and hence makes a single new component. Hence the new graph G + e
will have lesser number of components than G.

Fig. 14.11 Graphs (13) 2


1 8 11

G: 4 7 9 13
3

6 5 10 12
14.5 Connectedness 295

Definition 14.38 A graph G is said to be connected if any vertex ‘v’ is reachable from any
vertex ‘u’ in G. That is every pair of vertices (u, v) has a walk between them.

Remark 14.39 K n is connected whereas K n is not connected.

The following theorems are simple and can be easily proved.

Theorem 14.40 Let G be a graph with ‘n’ vertices and let δ(G) ≥ n−1
2 . Then G is con-
nected.

Theorem 14.41 A graph G = (V , E) is connected iff for any partition of V as X 1 , X 2 ,


there exists an edge between a vertex in X 1 and vertex in X 2 .

We know what a bipartite graph is. A bipartite graph can have more than one component.
Note that each component will be a bipartite graph.

Theorem 14.42 A graph G = (V , E) is bipartite if and only if it contains no odd cycles.

Proof Let G be a bipartite graph. Then the vertex set V can be partitioned into V1 and V2
such that every edge is incident with a vertex in V1 and a vertex in V2 . Consider a closed
walk v0 v1 v2 . . . , vn (= v0 ) of length n in G. Then such a walk must cross the bipartition an
even number of times as there are edges only between the partitions. Then only the walk
will become a closed one. Since every cycle is also a closed walk, the result follows that
every cycle being of even length.
Conversely let G contain no odd cycles and also assume G is connected. Note that every
closed walk of odd length contains a cycle of odd length. This can be proved by the method
of induction.
Let u ∈ V . Let w1 be a walk of odd length from u to v. Then w1 one can see that every
walk from u to v must be of odd length. Suppose this is not true. It must be true that there
is a walk w2 from u to v which is of even length. This means that w1 w2 is a closed walk
of odd length. This means G contains an odd cycle which is not true. So we conclude that
every u − v walk in G has same parity for u, v ∈ E. Now partition v based on this parity
condition as follows:
Each vertex ‘v’ with even length will be put in the set X 1 and those with odd length u − v
walk will be put in the set X 2 . Clearly X 1 ∩ X 2 = ∅ and X 1 ∪ X 2 = V is the bipartition.
So X 1 , X 2 must be independent sets. Otherwise, if a, b ∈ X 1 , ab ∈ E, then by definition of
X 1 , there exists an even u − a walk and u − b walk, so a − u − b walk has even length. If
ab is an edge, then ab together with a − u − b will be a closed walk of odd length. This is a
contradiction. Hence X 1 is an independent set. Similarly X 2 can be shown to be independent.
Hence the theorem. 
296 14 Paths Connectedness

Fig. 14.12 Two regular graphs


G:

Complete graphs K n , complete bipartite graphs K m,n , path graphs Pn , cycle graphs Cn
are all connected for n, m ≥ 0. In general if in a graph every vertex has sufficiently large
degree, then G will be connected.

Example 14.43 Consider the following graph (Fig. 14.12):


This is a 2-regular graph but not connected. If in this graph, there is atleast one vertex
whose degree is greater than 2, then the graph becomes connected.

Theorem 14.44 Let G = (V , E) be a graph on ‘n’ vertices, n ≥ 1. For any two non adja-
cent vertices u, v in V , if d(u) + d(v) ≥ (n − 1), then G is connected.

Proof Let u, v ∈ V and u = v. If u and v are adjacent, then G is connected. So, consider
u, v being not adjacent. Now d(u) + d(v) ≥ (n − 1) implies that there is a vertex ‘w’ ∈ V
such that uw ∈ E and vw ∈ E. Hence u − w − v is a path in G. Hence G is connected. 

Remark 14.45 The lower bound on d(u) + d(v) cannot be (n − 2).

Now one can look for the sensitivity of connectedness via their vertices as below.

Definition 14.46 A vertex ‘v’ of a graph G is said to be a cut vertex, if the removal of ‘v’
from G, increases the number of components of G.
By removing a vertex ‘v’ we mean that the vertex ‘v’ along with all the edges incident with
‘v’ are to be removed. One can denote this by G − {v}. By removing an edge e of a graph
G means to remove the edge ‘e’ alone. It is denoted by G − {e}.

Remark 14.47 If ‘v’ is a cut vertex of a connected graph G, then G − {v} is a disconnected
graph.

Theorem 14.48 Let G = (V , E) be a connected graph. If ‘v’ is a cut-vertex of G, then


there exist vertices u 1 , u 2 ∈ V − {v} such that every path between u 1 , u 2 passes through
‘v’ and conversely.

Proof Let G = (V , E) be a connected graph. Suppose ‘v’ is a cut vertex then G − {v} has
more components than G. Let G 1 , G 2 , . . . , G t be such components. Let G 1 = (V1 , E 1 ) and
14.5 Connectedness 297

Fig. 14.13 No cut vertex 1 2


G1 :

1
C3 :

2 3
1

G2 : 3 2

t
G2 = G i . Let u ∈ V1 and w be a vertex in G i , i = 1. Then the u − w path in G definitely
i=2
passes through ‘v’ in G. Otherwise G 1 ∪ G i will become a single component.
Conversely if for any two vertices u 1 , u 2 ∈ G − {v}, u 1 and u 2 are not connected by
a path in G − {v}. This means that they belong to different components in G − {v}, then
G − {v} is disconnected. So ‘v’ must be a cut vertex. 

The following theorem can be proved from the definition of a bridge.

Theorem 14.49 Let G = (V , E) be a connected graph. The following statements are equiv-
alent.

(i) An edge ‘e’ is a bridge of G.


(ii) For an edge e = u 1 u 2 , there is a partition of the edge set E − {e} as E 1 ∪ E 2 such
that G 1 = (V1 , E 1 ), G 2 = (V2 , E 2 ), where V1 ∪ V2 = V . Also u 1 ∈ V1 , u 2 ∈ V2 . Then
every path from a vertex in V1 to a vertex in V2 must contain e in G.
(iii) There exists vertices u 1 , u 2 ∈ V such that every u 1 − u 2 path contains e.
(iv) ‘e’ does not lie on a cycle in G.

In the following example, the graphs do not contain cut vertices and C3 , G 2 have no cut
edges.

Example 14.50 See Fig. 14.13.


298 14 Paths Connectedness

14.6 Non Separable Graphs

A connected graph may or may not contain cut vertices. We have seen an example for this
in the previous section.
Definition 14.51 A connected graph that contains no cut vertices will be called as a non
separable graph.

Example 14.52 K n , n ≥ 2 are non separable graphs.

Remark 14.53 If G is a non separable graph of order 3 or more, then δ(G) must be atleast
2.

Next is a theorem that gives a necessary and sufficient condition for a graph to be non
separable.

Theorem 14.54 Let G be a graph of order atleast 3. G is non separable if and only if any
two of its vertices lie on a common cycle of G.

Proof Let G = (V , E) be non separable. We prove the result by induction on the distance
between any two vertices of G. Let u, v ∈ V .
For dis(u, v) = 1. The edge uv cannot be a bridge. Hence ‘uv’ must lie on a cycle.
Assume the result to be true for any two vertices u, v ∈ V and dis(u, v) < k.
Let u 1 − v1 be a path of length k in G. Let w be a vertex on the u i -v1 path such that wv1
is an edge. Now u 1 − w is a path of length (k − 1) in G. By induction hypothesis u 1 and w
must lie on a common cycle C in G and w is not a cut point. Hence G − {w} is connected.
Hence there exist a u 1 − v1 path P in G not containing ‘w.
Let ‘v’ be the last vertex that lie both on P and C as shown in the following figure
(Fig. 14.14).
Such a vertex ‘v’ exists because ‘u 1 ’ is one vertex common to C and P.

Fig. 14.14 P and C paths P


v
P
P
C
u1 v1

P
14.6 Non Separable Graphs 299

Now the path P  from u 1 − v not containing w on the cycle C, path P  from v to v1 ,
edge v1 w and the path P  from w − u 1 on the cycle C form a bigger cycle containing u 1
and v1 .
Conversely let every two vertices of G lie on a common cycle of G. To show G is
connected, suppose that G has a cut vertex v. Then every path between any two vertices
u 1 , u 2 in V must pass through ‘v’. As u 1 , u 2 also lie on a cycle C in G, there will be path
between u 1 , u 2 not containing ‘v’. This is not possible as ‘v’ is assumed to be a cut vertex.


The above theorem has several uses. For example one can define paths between two
vertices u 1 , u 2 that do not share any internal vertices.

Definition 14.55 Two paths P1 , P2 between two vertices u 1 , u 2 are said to be internally
disjoint if u 1 , u 2 are the only common vertices between them.

Corollary 14.56 A connected graph G of order greater than 2 is non separable if and only
if for any two vertices u 1 , u 2 in G, there are two internally disjoint u 1 − u 2 paths.

Definition 14.57 Let G be a non trivial connected graph. A block of G is a maximal non
separable subgraph of G.

Example 14.58 See Fig. 14.15.

Theorem 14.59 Every connected graph that has cut vertices will contain atleast two blocks.

Blocks are
1
3 1 3
2 2
G: 7 2
7
2
4 4
6
5 6

5
Fig. 14.15 Blocks
300 14 Paths Connectedness

Exercises

1. If G is a simple graph on 10 vertices, what is the minimum number of edges that G can
have so that G is connected?
2. Say whether the following statements are true or false. Justify your answers.

(i) If a finite graph G has exactly two vertices of odd degree, then there must be a path
from one of these vertices to the other in G.
(ii) Let G be a graph with δ(G) = k. Then G has a path of length atmost ‘k’, k ≥ 2.
(iii) P4 , path graph on 4 vertices, is an induced subgraph of K 4,4 .
(iv) If A is an adjacency matrix of a simple graph, then the (i, i)th entry of A2 is the
degree of vi , vi is a vertex of G.
(v) Let A be an adjacency matrix of a simple graph G. Number of 3-cycles in G is
6 tr (A ) where tr (A ) is the trace of the matrix A .
1 3 3 3

3. If G 1 , G 2 are connected graphs which are 2-regular, then show that G 1 ∼= G2.
4. Draw all graphs on 5 vertices that are non isomorphic, self complementary.
5. Show that a graph on 10 vertices and 26 edges cannot be bipartite.
6. Is it true that every graph on n vertices is isomorphic to a subgraph of K n ?
7. Show that a graph G is bipartite if and only if each induced cycle of G is of even length.
8. Show that an induced subgraph of a regular graph is regular.
9. Find two non isomorphic graphs with degree sequence (3, 2, 2, 1, 1, 1).
10. Let ‘e’ be a bridge of a connected graph G. Show that G − e has exactly two components.
11. Does there exist a connected graph in which every edge is a cut edge?
12. Does there exist a connected graph with one cut vertex and no cut edges?
13. Give an example of a connected graph such that every connected subgraph is an induced
subgraph.
Trees
15

15.1 Basic Definitions and Properties

We directly start with the definition of trees. ‘Trees’ are important set of graphs that have
several applications.

Definition 15.1 A connected acyclic graph is a tree.


A graph having no cycles is called an acyclic graph.

Example 15.2 G 1 is an acyclic graph but not connected (Fig. 15.1).


G 2 is a tree (Fig. 15.2).

Remark 15.3 Any graph that is acyclic may or may not be connected. Such a graph is in
general called as ‘forest’.

G1 : 6 3
1

5 4
Example 15.4
is a tree called as ‘star’
G4 : : P5 is a path graph that is a tree
1 2 3 4 5

© Ane Books Pvt. Ltd. 2025 301


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_15
302 15 Trees

2 5 9
G1 :
4
1 3 6 7 8 10
Fig. 15.1 Trees

Fig. 15.2 Another tree 2 6


G2 :
4
1 3 7 8

G5 :

G 5 is a tree called as ‘caterpillar’.


Consider the following tree

6
1 4
8

2 3 5 7

This graph is a tree. The degree sequence of this graph is (5, 3, 1, 1, 1, 1, 1, 1). The vertices
with degree 1 are called as ‘leaves’ in any tree. Also every tree on n vertices, n ≥ 2 has
atleast 2 leaves. This fact is widely used in several properties of trees.

Theorem 15.5 The following statements are equivalent.

1. T is a tree.
2. Any two vertices u, v of T are connected by a unique path in T .
3. Every edge e of T is a bridge.
4. For any two non adjacent vertices u, v in T , T + uv contains a cycle.
15.2 Spanning Trees 303

The proof of the above theorem follows directly from the definition and they will serve
as a good exercise. Trees are said to be minimally connected and maximal acyclic. The
following corollary is simple but a useful one. A tree may be labelled or unlabelled graph.

Corollary 15.6 Let T be a tree. The vertices of T can always be enumerated. That is if
v1 , v2 , . . . , vn are the vertices of T , then the list can imply that every vi , i ≥ 2 has a unique
neighbour in {v1 , v2 , . . . , vi−1 }.

Proof The proof is by induction on i. For i = 1, choose a vertex as ‘v1 ’. Its neighbour v with
v1 v will be labelled v2 . Assume the enumeration is complete upto v1 , v2 , . . . , vi , for i < n.
Let T [v1 , v2 , . . . , vi ] be the induced subgraph of T on the vertices {v1 , v2 , . . . , vi }. Now
consider a vertex v ∈ T − T [v1 , v2 , . . . , vi ]. As T is connected, it contains a path P from
v1 to v. Choose the last vertex of P in T − T [v1 , v2 , . . . , vi ] so that vl+1 has a neighbour
in T [v1 , v2 , . . . , vi ]. 

Theorem 15.7 Let T be a tree on ‘n’ vertices. Then the number of edges will be (n − 1).

Proof We will give here an intuitive way of proof. Let T be an empty graph on ‘n’ vertices.
So T now has n components. If an edge is added between two different components reduces
the number of components by 1. So the number of components of T + e is now (n − 1). Now
once again add an edge between any two distinct components of T + e. Now the components
count is reduced by one and the number of components will be (n − 2). Proceeding like this
way of adding edges between any two components (n − 1) times, we get a tree. Hence the
number of edges will be (n − 1) in T . 

Corollary 15.8 If T is a tree and G is any graph with δ(G) ≥ |T | − 1, then T is a subgraph
of G.

Proof Using the above vertex enumeration method, trace the tree T inductively through the
vertices of G. What one gets is a copy of a tree isomorphic to T . 

15.2 Spanning Trees

We know what a spanning subgraph of a graph is. It is a subgraph that spans over all the
vertices of G.

Definition 15.9 A spanning tree of a graph G is a spanning subgraph that is a tree.


304 15 Trees

Example 15.10 Consider the following graph:


8
1 4 5 9

G:
7
10
2 3 6
The subgraph
1 4 5

T :

2 3 6 7 8 9 10
is a spanning tree.

Remark 15.11 Every connected graph has atleast one spanning tree. The tree can be got
by deleting an edge on a cycle of the graph for every cycle of the graph.

Definition 15.12 An edge of a tree T can be called as a ‘branch’ of T and an edge of G


that is not on the spanning tree T of G can be called as a ‘chord’ of G. The definition of
branches and chords are only with respect to a given spanning tree.

Example 15.13 Consider the graph G with a spanning tree T (Fig. 15.3).
Branches of T are: 12, 23, 34, 45, 48, 56, 67
Chords of T are: 24, 78, 57.
Clearly the edge set of G is the union of branches and chords of T .
Clearly T is the complement of T , whose edges are chords.

1 2 1 2

3 3
4 4
G: T :
8 5 8 5

7 6 7 6
Fig. 15.3 Spanning tree
15.2 Spanning Trees 305

Theorem 15.14 Let G = (V , E) be a graph and T be its spanning tree. Then the number
of branches of of T will be (n − 1) and number of chords will be |E| − (n − 1).

Theorem 15.15 Let G be a connected graph on n vertices. G has exactly one cycle if and
only if G has exactly n edges.

Proof A graph G with n vertices is minimally connected if G has exactly (n − 1) edges.


Suppose G has exactly one cycle. Then if ‘e’ is an edge on the cycle then G − {e} is
connected and has (n − 1) edges. So G − {e} is a tree. This means G has ‘n’ edges.
Conversely G is connected and has n edges. Consider a spanning tree T of G. T has
(n − 1) branches and one chord say ‘e’. This means T + e contains a cycle which is G. 

Remark 15.16 For any spanning tree T of G, T will be called as cotree of G.

Proposition 15.17 Let G be a connected graph and T , T  be two spanning trees of G. Let
e be an edge of tree T but not in T  . Then there exists an edge e in T  not on T such that
T  + {e} − {e } is a spanning tree of G.

Proof We know that in T and T  there is unique path between any two vertices. Let e = uv,
e = u  v  . Clearly T  − e has (n − 2) edges and is disconnected graph on n vertices. So u, v
are vertices of T  − e lying on two different components of T  − e . Hence T  − e + e will
be a tree on (n − 1) edges. 

Definition 15.18 Let u, v be two adjacent vertices of a graph G = (V , E). The edge ‘uv’ is
said to be contracted if it is deleted from G and the vertices u, v are identified. The resulting
graph is denoted by G e .

Example 15.19 Let (Fig. 15.4).

1 v 1 uv 1 uv3

G: e Ge : e Ge,e :
u
2 3 2 2

3
Fig. 15.4 Edge contraction
306 15 Trees

Remark 15.20 The edge contraction on a graph G = (V , E) can be performed until a


graph H is reached. The vertices of H is a set of elements in a partition {v1 , v2 , . . . , vt } of V
where each induced subgraph G i = (Vi , E i ) is connected and some vertex in Vi is adjacent
to some vertex in V j in G.

Notation: Let s(G) denote the number of spanning trees of G.

Theorem 15.21 Let e be an edge of graph G. Then s(G) = s(G − e) + s(G e ).

Proof If T is a spanning tree of G that does not contain the edge e, then it is also a spanning
tree of G − e. Also s(G − e) denote the number of spanning trees of G − e and hence every
such tree does not contain ‘e’.
Consider G e . A spanning tree of G e will be a tree Te obtained by contracting e in T .
So there is a 1-1 correspondence between such spanning trees and spanning trees of G
containing the edge e. Hence the result. 

We know that the number of labelled simple graphs on n vertices and m edges if
n(n−1)
C 2 , m . That is the graph on n vertices will have m edges chosen from the set
 
of all possible edges. This m can be in the set 0, 1, 2, . . . , n(n−1)
2 .

Theorem 15.22 The number of simple graphs on n vertices is 2C(n,2) .

Cayley [1889] gave a formula to count the number of distinct labelled trees on vertices.
Here he considered the vertices of G being labelled in the beginning to extract the spanning
tree from the fixed labelling.

Example 15.23 Consider the labelled graph


1

G1 :

2 3
15.2 Spanning Trees 307

Its spanning trees are


1 1 1

T1 : T2 : T3 :

2 3 2 3 2 3
1 2

G2 :

3 4
Its spanning trees are
1 2 1 2

T1 : T2 :

3 4 3 4

1 2 1 2

T3 : T4 :

3 4 3 4

The following theorem gives a formula to find the number of trees.

Theorem 15.24 (Cayley) The number of distinct labelled trees on n vertices is n n−2 .

Proof We give the proof using Prufer sequences.


Let T be a tree on ‘n’ vertices. Let the labels of the vertices be from the set {1, 2, . . . , n}.
We will form (n − 2) tuples based on T . Let x1 be a leaf vertex of T with the smallest
label. Let a vertex ‘v1 ’ be adjacent to ‘x1 ’ and remove ‘x1 ’. In the tree T − {x1 }, let ‘u 2 ’ be
the leaf vertex of smallest index, and ‘v2 ’ be the vertex adjacent to u 2 . Remove u 2 . In the
resulting tree again identify the leaf of the smallest index as u 3 . Let ‘v3 ’ be adjacent to u 3 ,
remove u 3 and continue this process till a tree with just two vertices result. Let the sequence
308 15 Trees

identified so far be v1 , v2 , . . . , vn−2 and the given tree uniquely identified the (n − 2) tuple
(v1 , v2 , . . . , vn−2 ).
Conversely for any (n − 2) tuple of {1, 2, . . . , n}, a n-vertex tree can be constructed as
below:
Let (v1 , v2 , . . . , vn−2 ) be the (n − 2) tuple. Find the first number from 1, 2, . . . , n that
do not occur in this (n − 2)-tuple. Let x1 be that number. Thus x1 v1 will be an edge of T .
Now remove v1 from the (n − 2)-tuple and x1 from the set {1, 2, . . . , n}. Now identify the
first number u 2 from {1, 2, . . . , n}\x1 that is not in the new (n − 3)-tuple resulted by the
removal of v1 . Then u 2 v2 will be an edge of T . Continue till all the elements in the tuple
(v1 , v2 , . . . , vn−2 ) are checked out. The last two elements of {1, 2, . . . , n} form an edge in
T.
So we can see that for every (n − 2) tuple of {1, 2, . . . , n} a unique tree T is identified
and conversely for every labelled tree T , there exists a unique (n − 2)-tuple. Number of
(n − 2) tuples is n n−2 . Hence number of labelled trees is n n−2 . 

15.3 Tree Decompositions of a Graph

Decomposition of a graph G = (V , E) is the set of edge-disjoint subgraphs G i = (Vi , E i ) of


 k  k
G, 1 ≤ i ≤ k such that V = Vi , Vi ∩ V j need not be empty. E = Ei ,
i=1 i=1
E i ∩ E j = ∅.

1 4

G:

Example 15.25 2 3 5 6
1 4

, ,
The subgraphs 2 3 3 5 5 6
form an edge-disjoint decomposition of G.

A graph can be decomposed into subgraphs. If each of the subgraph in the decompo-
sition is a cycle, then the decomposition will be called as cycle decomposition. If each of
the subgraph in the decomposition is a path, then such a decomposition will be called as
15.3 Tree Decompositions of a Graph 309

path decomposition. If each of the subgraph in the decomposition is a tree, then such a
decomposition will be called as tree decomposition.

Example 15.26 Consider the graph G


a b

c d

e
a b b c d

c c d e
D1 is not a cycle decomposition. Each cycle is a triangle.
a b b b

c c d c d

e
D2 is a path decomposition. It is also a tree decomposition.

Definition 15.27 A T -decomposition is a decomposition of a graph G if every subgraph in


the decomposition is isomorphic to T . If T is a tree, then it is called a tree decomposition.

Some important discussions were done on the decomposition of a complete graph into
trees such that each tree in the decomposition is isomorphic to a specified tree. The conjucture
of Ringel (1964) gained a lot of interest. The conjecture is:
The complete graph on (2n + 1) vertices can be decomposed into copies of trees such
that each tree has n-edges.
Despite several attempts to prove this conjecture, it is still open.
310 15 Trees

Example 15.28 Consider the following graph:


1 2

G:

4 3
1 2

G:

Its complement will be 4 3


G is isomorphic to G.
The two form a tree decomposition of a complete graph.

We state the following proposition without proof.

Proposition 15.29 If a graph G has a decomposition into copies of a graph H , then

(i) The number of edges in H divides number of edges in G.


(ii) (H ) ≤ δ(G).

Remark 15.30 The above conditions are not sufficient.

Proposition 15.31 A k-regular graph G can be decomposed into copies of star graphs with
k edges if and only if G is bipartite.

Proof If G is not bipartite, then G contains an odd length cycle. If G has decomposition
into copies of stars with k-edges, the centers of the stars will be some vertices on this odd
cycle. If ‘v1 ’ lying on the odd cycle is a center of a star, then all the edges incident at ‘v1 ’
are taken as one copy of the star graph. None of the k vertices appearing as leaves in this star
can be the center. Hence, choose the next alternate vertex ‘v2 ’ on the odd cycle as the center
of another star with k-edges as the next copy. By this way one can reach alternate vertices
on the cycle to identity copies of stars. However, since the cycle is of odd length, there will
be some edges left over which cannot appear in a star with k-edges. Hence G cannot be
decomposed as star-graphs with k-edges.
Conversely if G is bipartite. Consider one maximal independent set. Every vertex in this
set can serve as the center of a star graph with k-edges. Also every such edge appear exactly
once in each star. Hence the decomposition is reached. 
15.3 Tree Decompositions of a Graph 311

Regarding Ringel conjecture on decomposition of a graph, Rosa, 1907 reached a theorem


connecting graceful labelling of a tree with the decomposition of complete graph on (2n + 1)
vertices. We briefly see the approach here.

Definition 15.32 A graceful labelling of a graph G with m edges is labeling the vertices
and edges of G with numbers {0, 1, 2, . . . , m} such that

(i) distinct vertices are labeled distinctly from {0, 1, . . . , m}


(ii) edges are distinctly labeled.
(iii) The labeling is graceful if all the numbers {1, 2, . . . , m} appear on the edges of G.

Remark 15.33 Only connected graphs are considered for graceful labeling.

P4 : 1 2 3
2 1 3 0
0
K3 : 3 1

3 2 1

1 5 6

K4 : 1 6 3
2

0 4 4
Example 15.34 See graphs .

Remark 15.35 All path graphs and star graphs are graceful.

Graceful Tree Conjecture (Kotzig, Ringel, 1964):


Every tree has a graceful labeling.

Theorem 15.36 If T is a tree with m edges and admits a graceful labeling, then K 2m+1
can be decomposed into (2m + 1) copies of T .

Proof Suppose that T is graceful. Let T0 , T1 , . . . , T2m be copies of T in K 2m+1 . Then the
vertices of Tk can be labeled as k, k + 1, k + 2, . . . , k + m(mod(2m + 1)) where (k + i)
and (k + j) are adjacent in Tk if and only if vertices i and j are adjacent in the basic tree
312 15 Trees

that is labeled with 0, 1, 2, . . . , m. Hence edges of Tk has labeling from {1, 2, . . . , m}. The
edge between (k + i) and (k + j) in K 2m+1 will appear in G k as the corresponding edge.
Hence graceful labeling induces a decomposition of K 2m+1 as copies of trees with m edges.


Several attempts were made to understand graceful labeling of graphs to make some
progress on the Graceful Tree Conjecture. Some classes of graphs that are known to be
graceful are as below.

1. Caterpillar graphs.
2. Complete bipartite graphs.
3. Trees with diameter at most five.
4. Trees with atmost 4 leaves.
5. Cycle graphs of length k where k ≡ 0 mod 4 or k ≡ 3 mod 4.
6. n-dimensional hypercube Q n .

Exercises

1. Draw all the unlabelled trees on 5 vertices.


2. Does there exist a tree with 12 edges and the degree sequence (5, 4, 1, 1, 1)? Justify your
answer.
3. Show that every tree is bipartite.
4. Does there exist a tree on n vertices with exactly one spanning tree? Justify your answer.
5. For any vertex v of a connected graph G the sequence

d  (G, v) = (n 0 (v), n 1 (v), . . . , n e (v))

where e is the eccentricity of v and n j (v) = |N j (v)| where N j (v) = {u|d(u, v) = j}


for 0 ≤ j ≤ e is called the distance degree sequence of v in G (D DSv ).
Find D DSv of v in the following tree.

v
15.3 Tree Decompositions of a Graph 313

6. Show that the positive sequence (d1 , d2 , . . . , dn ) is the degree sequence of a tree iff (i)
n
di ≥ 1, 1 ≤ i ≤ n (ii) di = 2(n − 1).
i=1
7. If a sequence (4, 3, 2, 1, 1, 1, 1, 1) is the degree sequence of a tree, then find the number
of labelled trees with this degree sequence.
8. Let u be a vertex of a connected graph G. Then show that there exists a spanning tree of
G that preserves the distance from u.
Connectivity
16

The two connectivity parameters in graph theory are vertex connectivity and edge connectiv-
ity of a given graph. The question here is to find the rigidness of a graph remains connected
by removing a single vertex/edge, then we look for minimum number of vertices/edges to
be removed resulting in a disconnected graph or trivial graph. The parameters are κ (kappa)
and λ (lambda).

16.1 Vertex Connectivity

Definition 16.1 A vertex-cut of a connected graph G = (V , E) is a set S ⊆ V of G such


that G − S is disconnected. A minimum vertex cut is one that has minimum number of
vertices in S and the cardinality of such a set S is said to be the vertex connectivity or simply
connectivity of the graph G. It is denoted by κ(G) (κ is the symbol kappa) (Fig. 16.1).

Example 16.2 A complete graph does not contain any cut vertex and κ(K n ) = n − 1. So
we can see that
0 ≤ κ(G) ≤ n − 1
for any graph G.

Remark 16.3 A vertex-cut is called as separating set.

Proposition 16.4 Let K m,n be a complete bipartite graph. Then κ(K m,n ) = min{m, n}. 

Proof In a complete bipartite graph, every induced subgraph of K m,n which has atleast one
vertex from each partition of the vertex set must be a connected graph. If A and B are the

© Ane Books Pvt. Ltd. 2025 315


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_16
316 16 Connectivity

Fig. 16.1 Graph (1) v1 v2

v7 v4
G: v8 v3

v6 v5

partitions of the vertex set, then A, B are vertex cuts of K m,n . Hence κ(K m,n ) = min{m, n}
where |A| = m, |B| = n. 

Remark 16.5 A connected graph that has vertex connectivity 1 is a separable graph.

Example 16.6 Consider the following graph (Fig. 16.2).


In G removal of any one vertex does not disconnect G. Removal of S = {3, 6} disconnects
the graph and hence S is a vertex cut.

Remark 16.7 In general it will be more useful to know when and all the graph remains
connected rather than knowing its vertex cut.

Definition 16.8 A graph G is said to be k-connected if κ(G) ≥ k, for k ≥ 1.


So we can infer from the above definition that a k-connected graph is one in which
removal of t vertices, t < k never results in a disconnected graph or trivial graph. So a 1-
connected graph is simply a non trivial connected graph. A 2-connected graph does not have
a cutvertex. A graph with large number of edges will have large connectivity. The following
is a sufficient for a graph to be k-connected.

Fig. 16.2 Graph (2) 1 2

G: 6 3

7
5 4
16.2 Edge Connectivity 317

Theorem 16.9 Let G = (V , E) be a graph with |V | = n and let ‘k’ be an integer with
1 ≤ k < n. If for every vertex v ∈ V ,
 
n+k−2
d(v) ≥
2

then G is k-connected.

Proof Suppose G is not k-connected. G is also not a complete graph. So there exists a set
S ⊆ V such that S is a vertex-cut of G. Also |S| = t (≤ k − 1). G − S is disconnected and
number of vertices in G − S is n − .
Consider a component G 1 in G − S with minimum number of vertices say n 1 . Clearly
 
n 1 ≤ n−2 . Let x be a vertex in G 1 . This vertex ‘x’ can be adjacent only to vertices in S
and to other vertices in G 1 . So its degree will satisfy

d(v) ≤  + (n 1 − 1) (16.1)
 
n−
≤+ −1 (16.2)
2
   
n+−2 n+k−3
= ≤ (16.3)
2 2

which is a contradiction to the degree condition given in the theorem. Hence G is k-


connected. 

16.2 Edge Connectivity

The edge connectivity is a parameter that measures the sensitiveness of a connected graph
with respect to removal of edges.

Definition 16.10 (i) An edge-cut of a graph G = (V , E) is a subset T of E such that G − T


is disconnected.
(ii) Minimum number of edges in T  where G − T  is disconnected is known as edge
connectivity of the graph G. It is denoted by λ(G).

Example 16.11 (i) If G is a graph with atleast one cut-edge, then λ(G) = 1.
(ii) For a complete graph K n , λ(K n ) = n − 1.
(iii) In general if ‘t’ is the minimum degree of a vertex in a connected graph G, then removal
of these ‘t’ edges results in a disconnected graph. So, we can write the following
inequality
0 ≤ λ(G) ≤ δ(G) ≤ n − 1
318 16 Connectivity

Fig. 16.3 Graph G 1 5

1 e1 2
e9

e5
e8
G1 : e4 e2
e6
e7
4 e3 3 e10

Definition 16.12 A graph G is said to be k-edge-connected for k ≥ 1 if λ(G) ≥ k. Note


that a 1-edge connected graph is a connected graph. A 2-edge connected graph will not
contain any cut-edges.
Example 16.13 Consider the graph G 1 (Fig. 16.3):
κ(G 1 ) = 1, λ(G 1 ) = 1.
κ(G 2 ) = 2, λ(G 2 ) = 3 (Fig. 16.4).
G 3 : κ(Cn ) = 2, λ(Cn ) = 2.

We can see that edge connectivity of a graph is bounded above by the minimum degree
of the graph and bounded below by its vertex connectivity. This is first noticed by Hassler.
The proof is established by Whitney.

Theorem 16.14 For every graph G = (V , E)

κ(G) ≤ λ(G) ≤ δ(G).

1 e9 6

G2 : e1 e2 e6 e8 e10 e13 e12


e4 e14
e3 4 e158
2 e5 3 e7 5 e11 7
Fig. 16.4 Graph G 2
16.2 Edge Connectivity 319

Proof We have already seen that λ(G) ≤ δ(G) earlier.


To show κ(G) ≤ λ(G). We notice that if λ(G) = 0 or 1, then κ is also 0 or 1. Let
λ(G) = k ≥ 2. Let T = {e1 , e2 , . . . , ek } be the edges such that G − T is disconnected.
Let ei = u i vi , 1 ≤ i ≤ k, some of these u i , vi vertices may be identical. Let G 1 , G 2 be the
components of G − T . Let G 1 = (V1 , E 1 ), G 2 = (V2 , E 2 ). Here consider the set of vertices
V = {u 1 , u 2 , . . . , u k } and all vertices in V lie in the same connected component of G − T .
If G − V is not connected, then clearly κ(G) ≤ k.
Otherwise, a vertex say ‘u 1 ’ has atmost ‘k’ vertices adjacent to it from the set V and
some vertices from the set {v1 , v2 , . . . , vk }. These vertices form a vertex cut and hence
κ(G) ≤ k ≤ λ(G). 

Remark 16.15 We observe that vertex-connectivity is bounded above by edge-connectivity.


But edge-connectivity cannot be bounded above by vertex connectivity.

We can see that any connectivity parameter is always bounded above by minimum degree
of the graph. Now the question is ‘Is it possible to have two graphs on n, n + 1 vertices such
that both the graphs are k-connected. We state the following proposition to this effect.

Proposition 16.16 1. Let G be a k-connected graph on n vertices. If a new vertex ‘v’ is


added to G and made to be adjacent to atleast k vertices of G, then the resultant graph
G will be k-connected.
2. Let G be a k-edge-connected graph. If a new graph G is constructed by adding a new
vertex ‘v’ adjacent to atleast ‘k’ vertices of G, then G is k-edge connected. 

We know that every 2-edge-connected graph G is one with λ(G) ≥ 2. Every 1-edge-
connected graph is also 2-edge-connected.

Proposition 16.17 Let G be a 2-edge-connected graph. Then every edge of G lies on a


cycle. 

Proof Let e = x y be an edge of G. Since G is 2-edge-connected, G − e is connected. This


means there exists a path between x and y in G − e. So e = x y must be on a cycle. 

We know every 2-connected graph is also 2-edge-connected. In a 2-edge-connected graph


every pair of vertices (x, y) lie on a cycle. x, y need not be adjacent.

Definition 16.18 Let G = (V , E) be graph and H = (V  , E  ) be a subgraph of G. A path


P : uu 1 u 2 . . . u n v with the vertices u, v ∈ V  and u 1 , u 2 , . . . , u n ∈ V \V  is said to be H -ear
path of G. A H -ear decomposition of the graph G is a sequence of graphs (C, P1 , P2 , . . . , Pt )
such that
320 16 Connectivity

(i) C = G 0 is a cycle
(ii) for 1 ≤ i ≤ t, Pi is a path such that it is G i−1 -ear and G i = G i−1 ∪ Pi
(iii) G t = G.

It can be shown that H ∪ P is 2-connected if H is 2-connected for any H -ear of P. So


we state the following decomposition theorem for a 2-connected graph without proof.

Theorem 16.19 Let G be a 2-connected graph, and let C be a cycle. Then G can be
decomposed as (C, P1 , P2 , . . . , Pk ).

16.3 Local Connectivity

A graph is said to be connected if for every pair of vertices u, v there exists atleast one path
between u, v. This is generalized as below in the definition of local connectivity.

Definition 16.20 Let G = (V , E) be a graph. Let u, v ∈ V be any two non-adjacent ver-


tices. A u − v separating set S ⊆ V − {u, v} is one that puts u, v in G − S in different
components. The minimum cardinality of such a set if said to be the local connectivity of u
and v or minimum u − v separating set. It is denoted by κ(u, v).

For two adjacent vertices u, v, their local connectivity is defined to be κ H (u, v) + 1 where
H = G − uv. The local edge-connectivity can be defined similarly.
It is true that κ(G) = min{κ(u, v)/u, v ∈ V and u  = v}.
For two distinct vertices, two paths P1 , P2 between u and v are said to be uv independent
if they have only u, v as the only common vertices. A set of independent uv-paths is a set
of paths that are mutually independent. In the next theorem by Menger (1926) we can see
the connections between κ(u, v) and uv-independent paths.

Theorem 16.21 (Menger) Let G = (V , E) be a graph. Let u, v ∈ V be two nonadjacent


vertices in G. Then κ(u, v) is the maximum number of internally disjoint paths between u
and v.

Proof We give the proof of this theorem given by Dirac (1969).


Let |V | = n, |E| = m. We use induction on m + n = g (say). That is we prove that
if κ(u, v) = t is the minimum set that separates the vertices u, v then G has atleast ‘t’
uv-independent path.
For t = 1, the result is true for graphs, having n vertices and (n − 1) edges and also some
small values of g. This takes care of the basis for induction. Assume the result to be true for
g = k − 1 that κ(u, v) is the maximum number of internally uv disjoint paths in G.
16.3 Local Connectivity 321

Now let G be a graph with g = k (say).


(1) Suppose u, v ∈ V have a vertex x such that ux, vx ∈ E. Then x must be in the minimum
separating set S of G. In the graph G − x, S − x must be the minimum separating set of u, v
in G − x. Hence by induction hypothesis there will be (t − 1) independent paths between
u, v in G − x. These (t − 1) paths together with uxv form t independent paths between u
and v in G.
(2) Suppose that no vertex of S is adjacent to the vertices u, v in G. S is the minimum sepa-
rating set for u, v in G. Let G u , G v be the connected components containing u, respectively
in G − S.
Let S = {x1 , x2 , . . . , xt }. Let G u be the subgraph of G including all u − xi paths, for
1 ≤ i ≤ t in G and all these paths have only the vertex xi from S. Let G u be a new graph
obtained from G u by adding a new vertex u and edges uxi , 1 ≤ i ≤ t. In a similar manner
G v is constructed. The number of edges in G u and G v are definitely smaller than |E| = m.
Hence by induction hypothesis G v contains t internally disjoint v − v paths containing xi
and G u contains t-internally disjoint u − u paths containing x i . Let these paths be denoted
by the sets Aiu , Aiv , for 1 ≤ i ≤ t. Then the subpaths from u − xi of a path in Aiu and
subpaths xi − v in Aiv can be combined to make a u − v path in G for 1 ≤ i ≤ t. In fact the
combination will be internally disjoint.
(3) For the set S, if u is adjacent to every vertex in S not to v or v is adjacent to every vertex
in S not to u, then d(u, v) ≥ 3. Let P be the shortest path (u, u 1 , u 2 , . . . , v). Let e = u 1 u 2 .
The minimum separating set S  of G − e must contain atleast (t − 1) vertices by induction
hypothesis. We will show now that |S  | = t. If |S  |  = t, then let S  = {v1 , v2 , . . . , vt−1 } be
the minimum separating set of G − e. Then S  ∪ {u 1 } is a u − v separating set in G. But
/ E. So for each vi ∈ S  , uvi ∈ E, vi v ∈
uu 1 ∈ E, u 1 v ∈ / E for 1 ≤ i ≤ t − 1. Similarly for

S ∪ {u 2 } being a minimum u − v separating set in G, each vi is adjacent to u but not to v
means uu 2 ∈ E. This means there a shorter path P  from u − v, which is a contradiction to
our assumption that P is the shortest u − v path. Hence |S  | = t. Hence G has t internally
disjoint u − v paths. 
We can see that every block on n vertices, n ≥ 3 must be 2-connected. So we can write
the following theorem.

Theorem 16.22 Let G = (V , E) be a graph such that |E| ≥ 3. G is 2-connected if and


only if any two vertices u, v of G are connected by atleast two internally disjoint paths.
Example 16.23 G is a non-separable graph (Fig. 16.5).

are blocks of G. G is 2-connected.


322 16 Connectivity

Fig. 16.5 Non separable graph 1 2

G: 3

5 4

Exercises

1. Let G be a graph such that λ(G) = 2. Show that any two non-adjacent vertices are
connected by atleast 2 edge disjoint paths.
2. Find λ(G), κ(G) for the following graphs G
(i) K m,n (iii) Cn
(ii) K n (iv) Pn
3. Let G = (V , E) be a graph such that λ(G) = t and let |E  | = t. Then show that G − E 
results in a graph that has 1 or 2 components.
4. Let G = (V , E) with |V | ≥ 3. Let δ(G) ≥ |V2 | . Then show that G is δ-edge connected.
5. Let G = (V , E) be a graph such that G  = K n , G  = Cn , where |V | = n. Show that there
exists vertices u, v ∈ V such that G − {u, v} is connected.
6. Let T be a tree and let S be an independent set of T , with |S| ≥ 2. Is it true that the
minimum number of vertices separating the set S is equal to the maximum number of
vertex disjoint paths between two vertices, u, v ∈/ S? Justify your answer.
Eulerian and Hamiltonian Graphs
17

In this chapter we are going to see a special class of graphs which gained a lot of interest
and importance in graph theory.

17.1 Euler Graphs

We have already seen what a ‘Konigsberg Bridge Problem’ is. In that problem, the seven
land portions can be denoted by vertices, and bridges between them by edges in the graphical
representation (Fig. 17.1).
The above graph is a multi-graph.
Euler used graphs and shown the non-existence of a walk only once along the bridges,
visiting all the land portions and returning to the same starting position. In fact Euler obtained
necessary and sufficient condition for the existence of such a walk. We have defined Euler
trail in the earlier chapter.

Remark 17.1 A closed trail is called as a tour. The study of Euler trail or Euler tour is only
for connected graphs.

Definition 17.2 A graph that admits an Euler tour is said to be an Eulerian graph.

Theorem 17.3 (Euler 1736) The necessary and sufficient condition for a connected graph
G = (V , E) to be Eulerian is that each of its vertices must be of even degree.

© Ane Books Pvt. Ltd. 2025 323


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_17
324 17 Eulerian and Hamiltonian Graphs

A b4
Fig. 17.1 Non simple graph

b2 D
b5
b3 b1 b6
C b7
B

Proof Suppose G is Eulerian. Then G has an Euler tour ‘T ’ starting and ending at the vertex
‘v’ (say). Every vertex u on T contributes 2 degrees to that vertex as T is a tour and every
edge being traversed only once. If ‘v’ is one of the internal vertices (other than start vertex),
d(v) will be even. For the start vertex, the edges that is traversed in the start being different
from the edge traversed at the end to complete the tour contribute even degree to it.
Conversely let every vertex of T be an even degree vertex. Suppose there exists no Euler
tour in G. Let G be a graph with minimum number of edges. Since δ(G) ≥ 2, G has a cycle
C in G. Let ‘F’ be a tour of G of maximum number of edges. The graph with E − E(F)
edges where E(F) is the set of edges of F, also has every vertex of even degree. Let F1
be one of its components. There exists an Euler tour in F1 say F and F has a vertex ‘v’ in
common with F. So F ∪ F becomes a tour in G whose edges are more than F. This is a
contradiction. 

Definition 17.4 An open trail that contains every edge of G is an Eulerian trail.

Remark 17.5 All the concepts discussed in this chapter are true for multi-graphs.

Next we give a characterization of connected graphs that contain Euler trial. These results
are also given by Euler.

Theorem 17.6 Let G = (V , E) be a connected graph. G contains Euler trail if and only if
G has exactly two vertices of odd degree.

Proof Let G contain an Euler-trail say T : x − y. Now construct G  = G + w where w is a


new vertex added to G such that w is adjacent only to the vertices x and y. Now T together
with wx, wy form an Euler tour in G + w. Hence every vertex of G + w is even. This means
x, y are the only two vertices of odd degree in G.
Conversely let G be connected graph with exactly two vertices x, y of odd degree. Now
to G, add a new vertex w such that xw, yw are the new edges added to make a new graph
H . Now H has an Euler tour Z as every vertex of H being even. This tour must contain the
edges xw, wy as these are the only edges connecting to x and y. Now removal of w from
Z , results in an Euler trail. 
17.1 Euler Graphs 325

Fig. 17.2 Graph (1) 2 5

G: 1 6
4

Now the graph G may contain more than two odd degree vertices. If G contains more
than two odd degree vertices then G will not have an Euler tour or Euler trail .

Example 17.7 G does not have Euler Trail. This can be seen by listing all the trails of G.

The following result talks about trails in such graphs (Fig. 17.2).

Theorem 17.8 If G be a connected graph having 2n vertices of odd degree (n ≥ 1), then
G contains k pair wise edge disjoint open trails connecting two odd degree vertices such
that every edge lies on one of these trails.

Proof Let x1 , x2 , . . . , xn and y1 , y2 , . . . , yn be the 2n odd degree vertices of G. Now add


‘n’ new vertices u 1 , u 2 , . . . , u n to G such that u i xi , u i yi , 1 ≤ i ≤ n are new set of edges
added to make a new graph G  for 1 ≤ i ≤ n. G  is connected and every vertex of G  is now
even. So G  has an Euler tour Z . Now removal of the n vertices u 1 , u 2 , . . . , u n from Z splits
Z in to n open trails from xi to yi for 1 ≤ i ≤ n. Since every edge appeared only once in Z ,
these are edge disjoint open trails. 

Next is a characterization of an Eulerian graph whose edge set can be partitioned in to


disjoint cycles.

Theorem 17.9 Let G be a non-trivial connected graph. G is Eulerian if and only if G


contains pairwise edge disjoint cycles such that every edge of G lies on one of its cycles.

Proof Suppose G = (V , E) is Eulerian. We prove the cycle partitioning the edges by method
of induction on the number of edges of G. If |E| = 3, the result is true. Assume for |E| such
that |E| < m (say) m ≥ 4. G is Eulerian imply that every vertex of G is of even degree.
326 17 Eulerian and Hamiltonian Graphs

Then G contains a cycle say C1 . If G = C1 , the result is complete. Otherwise consider G 1


obtained from G by removing edges of C1 . Now in G 1 , every vertex is again of even degree.
Thus the non trivial component G 1 has fewer edges than m, and hence has a cycle partition
of its edges by our induction hypotheses. Now all the cycles of the components of G 1 and
C1 form a cycle partition of the edges of G.
Conversely suppose the edges of G can be partitioned by cycles, means every vertex of
G is even. Hence G is Eulerian. 

Definition 17.10 Let G = (V , E) be a graph. G is said to be arbitrarily traversable from a


vertex v1 ∈ V if the following procedure gives a trail which is Eulerian.
Start from the vertex v1 and move to the next vertex v2 adjacent to v1 . From v2 move to
its adjacent vertex v3 via an edge not used so far and continue to travel till all the edges in
E are used exactly once.

Note that if the procedure ends in the vertex v1 , then what is traced is an Eulerian tour.
The following is the algorithm by Fleury to construct an Eulerian trail.

Fleury’s Algorithm
1. Choose an arbitrary vertex ‘v0 ’ and let T0 = v0 .
2. For T1 = v0 e1 v1 e2 v2 e3 . . . vi such that e1 , e2 , . . . , ei are distinct choose edge ei+1 =
vi vi+1 , not a bridge unless no other option prevails.
3. Continue till step-2 becomes impossible.

Remark 17.11 Note that Fleury’s algorithm just traces one trail of the graph G. It will trace
an Eulerian trail if it exists in G.

17.2 Non Eulerian Graphs

We saw that an Eulerian graph will always have all its vertices being even degree. A graph
that is not Eulerian will have even number of odd degree vertices. We also saw that if a graph
has exactly two odd degree vertices then graph will contain an Eulerian trail.
In a non-Eulerian graph G one can attach paths between pair of vertices to obtain a graph
H which is Eulerian. H will be called as super Eulerian graph of G. The graph G then is a
spanning subgraph of H .

Definition 17.12 A graph G is said to be sub-Eulerian graph if it is a spanning subgraph of


some Eulerian graph.
17.3 Hamiltonian Graphs 327

Remark 17.13 Every graph being a spanning subgraph of an Eulerian graph is not true in
general.

The following theorem characterizes sub Eulerian graphs.

Theorem 17.14 (Boesch, Suffel, Tindell) Let G = (V , E) be a connected graph. G is sub-


Eulerian if and only if G is not spanned by a complete bipartite graph.

Definition 17.15 A non-Eulerian graph G is said to be super Eulerian if it contains a sub-


graph that is Eulerian.

The following is a result for super-Eulerian graphs which just gives a sufficient condition.

Proposition 17.16 Let G = (V , E) be graph on atleast 6-vertices. Also any two non adja-
cent vertices u, v ∈ V , d(u) + d(v) ≥ (n − 1); then G is super-Eulerian.

17.3 Hamiltonian Graphs

Eulerian graphs are one that contain a closed trail including every edge exactly once. Now
we will see graphs that contain cycles which contain every vertex of the graph.

Definition 17.17 Let G = (V , E) be a graph.

(i) If there exists a path P in G that contain every vertex of G, then P is said to be
Hamiltonian path of G.
(ii) If there exists a cycle in G including all the vertices of G, then such a cycle is said to
be a Hamilton cycle of G.
(iii) A graph that has a Hamilton cycle is said to be Hamiltonian graph. Otherwise it is said
to non-Hamiltonian.

Example 17.18 G 1 is non-Hamiltonian. But it has a Hamilton path (Fig. 17.3).

The only way to check whether a graph G 1 is Hamiltonian or not is by trial and error
technique. There are some characterizations proved for Hamiltonian graphs. To show a
graph to be non-Hamiltonian is more difficult if the number of edges are large. So in general
showing existence or non existence of a Hamilton cycle in a graph demands only exhaustive
search in all possible ways.
Following are some famous graphs that are non-Hamiltonian (Figs. 17.4 and 17.5).
328 17 Eulerian and Hamiltonian Graphs

Fig. 17.3 Graph (2) 1 2

G1 : 3 4

5
6 7 8
9
10

Fig. 17.4 Non Hamiltonian


graphs

Finding whether a graph is Eulerian or not is simple when compared to finding Hamilton
cycle in a graph. There are several characterizations of Eulerian graphs. But there is no
efficient way to analyze the graph being Hamiltonian or not. These are some necessary
conditions and some sufficient conditions to this analysis. It is more likely for a graph to
posses a Hamilton cycle if it has more number of edges.

Theorem 17.19 (Ore’s theorem) Let G = (V , E) be a graph with |E| = n, n ≥ 3. For any
two non-adjacent vertices u, v ∈ V , if minu,v∈V {d(u) + d(v)} ≥ n, then G is Hamiltonian.

Proof Suppose the condition given for G  is satisfied but G  is not Hamiltonian. Then add
as many edges as possible between non adjacent vertices of H resulting in graph G. But
G is non-Hamiltonian. We can say that G is maximal non-Hamiltonian. It means G + uv,
for u, v ∈ V being non adjacent becomes Hamiltonian. G cannot be a complete graph here
(Fig. 17.6).
Let uv be added to G enabling to get a Hamilton cycle C (say). C certainly contains
the edge ‘uv’ and G certainly has a path P : u = x1 , x2 , . . . , xn = v. P is a Hamilton path.
Here if u is adjacent to a vertex xi for 2 ≤ i ≤ n − 1, then v cannot be adjacent to xi−1 .
Otherwise will be a Hamilton cycle in G. This is not possible. So for every vertex of G
adjacent to ‘u’, there will be vertex of V − {v} not adjacent to ‘v’. This means
17.3 Hamiltonian Graphs 329

Fig. 17.5 Non Hamiltonian graphs

C ... ...
(u =)x1 x2 xi 1 xi xn 1 xn (= v)
Fig. 17.6 A situation

degG (v) ≤ (n − 1) − degG (u)


⇒ deg(u) + deg(v) ≤ n − 1,

which is a contradiction. Hence G has a Hamilton cycle. 

Definition 17.20 Let G = (V , E) be graph on n-vertices. If H is a graph obtained from G


by repeatedly adding edges between two non-adjacent vertices whose degree sum is atleast
n. That H is the smallest super graph of G having n-vertices such that d H (u) + d H (v) ≥ n
for all u, v ∈ V , uv ∈
/ E(H ).

Note that we can denote by cl(G) = H to indicate the closure of G. cl(G) is unique.

Example 17.21 Consider the following graph (Fig. 17.7).


330 17 Eulerian and Hamiltonian Graphs

G: cl(G) :

Fig. 17.7 Closure

Theorem 17.22 G is Hamiltonian iff cl(G) is Hamiltonian.

Proof Let e1 , e2 , e3 , . . . , ek be the set of edges to construct cl(G). That is G 1 = G +


e1 , G 2 = G 1 + e2 , . . . , G k = G k−1 + ek = cl(G). Now if G is Hamiltonian, then all
G 1 , G 2 , . . . , G k = cl(G) is Hamiltonian and conversely. Hence the theorem. 

Remark 17.23 For a graph G, cl(G) may or may not be a complete graph.

Example 17.24 Consider the graph (Fig. 17.8).

Many sufficient conditions for a graph to be Hamiltonian are based on the degrees of
vertices.

G:

= cl(G) = K5

Fig. 17.8 Closure


17.4 Toughness 331

Theorem 17.25 (Chvatal, 1972) Let G = (V , E) be a graph with atleast 3 vertices. Let
(d1 , d2 , . . . , dn ) be the degree sequence of G such that d1 ≤ d2 ≤ d3 ≤ · · · ≤ dn . If for
every value t < n2 either dt ≥ t and dn−t ≥ (n − t − 1). Then G is Hamiltonian.

Proof Let cl(G) = H . We show that H is a complete graph which implies that G is Hamil-
tonian by the previous theorem. Assume that H is not complete. Then H contains two
non-adjacent vertices u, v with the condition that d H (u) + d H (v) is as large as possible.
Also d H (u) + d H (v) ≤ n − 1. Let d H (u) ≤ d H (v) and d H (u) = t.
So d(v) < n − t. Also t < n−1 2 < 2 and dh (v) ≤ n − 1 − t.
n

Let U be the set of vertices in V − {u} which are not adjacent to v in H . Let X be the
set of vertices in V − {v} that are not adjacent to u in H . Then

|U | = n − 1 − d H (u) = n − 1 − t and
|X | = n − 1 − d H (v).

For every vertex x ∈ U ,

dG (x) ≤ d H (x) ≤ d H (v) ≤ n − 1 − t


⇒ dn−t−1 ≤ n − t − 1.

But dG (u) ≤ d H (u) ≤ d H (v) ≤ n − t − 1 which means dn−t ≤ n − t − 1.


This is raising a contradiction to the hypotheses of the theorem.
Hence cl(G) is complete. 

Note that the above theorem is stronger than many theorems on Hamiltonian graphs.
There are degree sequences of a graph that does not satisfy the Chvatal’s Theorem, but they
specify a Hamilton cycle in the graphs. This section gave only a few theorems that specify
sufficient conditions for a graph to be Hamiltonian.

17.4 Toughness

It is not difficult to see that every Hamiltonian graph is 2-connected. There are several
sufficient conditions for a graph G to be Hamiltonian. Regarding necessary conditions a few
of them are widely used. Regarding the number of components of a Hamiltonian graph, it is
always connected and removal of a single vertex from it results in a connected graph. The
following necessary condition of a Hamiltonian graph is a very popular one.

Theorem 17.26 If G = (V , E) is a Hamiltonian graph, then

c(G − S) ≤ |S|
332 17 Eulerian and Hamiltonian Graphs

for every subset S of V where c(G − S) is the number of components of G − S.

Proof Let Cn be the Hamilton cycle of G where |V | = n. Let Cn = v1 v2 v3 . . . vn v1 .


Suppose S ⊂ V and G − S may be connected or not connected. If G − S is con-
nected then C(G − S) ≤ |S|. Suppose G − S is not connected. Let c(G − S) = t and let
H1 , H2 , . . . , Ht be that t components of G − S. We can assume that H1 contains v1 ∈ V .
Let vl be the vertex in G l . If ‘l’ is the highest index of Cn such that vl being a vertex of G l
then vl+1 ∈ S for 1 ≤ l ≤ t. This means |S| ≥ t. 

Example 17.27 G is Hamiltonian. If S = {3} then G − S is connected. So c(G − S) ≤ |S|.


If S = {3, 4}, then G − S is not connected as seen below (Figs. 17.9 and 17.10).
c(G − S) = 2 and c(G − S) ≤ |S|

Example 17.28 Consider the following graph which is non-Hamiltonian (Fig. 17.11).
Let S = {u, v}. Then c(G − S) = 3 ≥ |S| = 2 (Fig. 17.12).

Fig. 17.9 Hamiltonian graph 1 2

4
G: 3

7 6

Fig. 17.10 Components 1 2

G−S :
5

7 6
17.4 Toughness 333

Fig. 17.11 Graph (6) 2 3

1 4
G: u v

6 5

Fig. 17.12 Components 2 3

1 4
G−S :

6 5

Now observe that if the graph G = (V , E) is Hamiltonian, then by the above theorem
we can write
|S|
≥1
c(G − S)
for any nonempty subset S of V .

Definition 17.29 A graph G = (V , E) which is not complete is said to be k-tough if the


ratio
|S|
≥k
c(G − S)
for any vertex cut S of V .

Remark 17.30 A graph G that is k-tough is also ‘t’ tough if t < k. Any Hamiltonian graph
is 1-tough.

There exists a 3-connected 3-regular graph which is 1-tough as shown below.


334 17 Eulerian and Hamiltonian Graphs

Fig. 17.13 Peterson graph 1

5 10 6 2
G:
9
7
8
4 3

Example 17.31 Consider the Peterson graph which is 3-regular, 3-connected graph
(Fig. 17.13).

For every set S, consider


|S|
.
c(G − S)
Let S ⊂ V such that |S| ≥ 3. Here in Peterson graph, |S| = 3, 4, 5, 6, 7, 8, 9, 10. For
|S| ≥ 5, it is obvious that
|S|
≥1
c(G − S)
So it remains to show the above inequality only for |S| = 3, |S| = 4. Let A = {1, 2, 3, 4, 5}
and B = {6, 7, 8, 9, 10}. Choosing the set S such that |S| = 3 or 4 can be as follows.
Case i: All vertices of S are completely in A or completely in B. Then clearly G − S remains
connected and hence
|S|
> 1.
c(G − S)
Case ii: If one vertex of S is from B, remaining vertices from A, then G − S contains a
component with minimum 5 vertices. Hence
|S|
≥ 1.
c(G − S)
Case iii: If two vertices of S are from B and remaining vertices from A, then consider G − S.
The maximum number of components can be only 4 and this can be checked directly. Hence
|S|
≥ 1.
c(G − S)
So we can see that Peterson graph is 1-tough.
|S|
The ratio c(G−S) play some role in determining the property of a graph G containing a
Hamilton cycle. The following are some definitions that talk about the ratio and its relation
to the neighbouring vertices of the vertices in S.
17.5 Other Hamiltonicity 335

Definition 17.32 1. Let G = (V , E) be a graph. For a vertex v ∈ V , neigbourhood of ‘v’


is defined to be the set
N (v) = {u ∈ V | d(u, v) = 1}.

The following theorem gives a bounding condition on N (S) for a graph to be Hamiltonian.
We omit the proof as it is too much involved.

(n+2)
Theorem 17.33 If a graph G = (V , E) is 2-connected with δ(G) ≥ 3 and |N (S)| ≥
3 (n + |S| − 1) for every subset S of V , then G is hamiltonian.
1

Definition 17.34 (i) The toughness of a graph G = (V , E) is


 
|S|
t(G) = min | S is a vertex cut of G
c(G − S)

(ii) The binding number of a graph G = (V , E) is denoted by b(G) and


 
|N (S)|
b(G) = min | S ⊆ V , S = ∅, S = V
|S|

The two measures defined above have some important role in characterising Hamiltonian
graphs. We state a few results on this topic without proof.

Theorem 17.35 1. Every Hamiltonian graph is 1-tough.


2. The binding number b(G) is the largest number ‘k’ such that

|N (S)| ≥ min{k|S|, |V | / S ⊆ V (G)}.

The t0 -tough conjecture[Chvatal]


There exists a constant t0 such that every t0 -tough graph is Hamiltonian.

Remark 17.36 If G is a graph such that t(G) ≥ t0 , then G is Hamiltonian.

17.5 Other Hamiltonicity

The problem of determining whether a graph contains a Hamilton cycle is a difficult problem.
Hence finding some sub-class of graphs containing Hamilton cycle became important. Such
class of graphs are generally called as ‘highly Hamiltonian graphs’.
Hamiltonian-connected graphs are a special type of graphs having a property on Hamilton
paths that they contain.
336 17 Eulerian and Hamiltonian Graphs

Definition 17.37 Let G = (V , E) be a graph. If for any two vertices u, v ∈ V , there is a


path which is Hamiltonian, then G is said to be Hamiltonian-connected. A Hamilton path
is one that visits all the vertices of the graph.

Example 17.38 G 1 is not Hamiltonian-connected.


G 2 is Hamilton connected.

The following theorem gives a sufficient condition for a graph to be Hamiltonian-


connected (Fig. 17.14).

Theorem 17.39 Let G = (V , E) be a graph on n vertices. For any two non-adjacent ver-
tices u, v ∈ V , if d(u) + d(v) ≥ n + 1, then G is Hamiltonian-connected.

Proof Let u, v be two non-adjacent vertices in G. Let G be a graph obtained by adding a


new vertex ‘x’ to V and adding edges xu, xv to E. Let G = (V , E) where V = V ∪ {x}
and E = E ∪ {xu, xv}. Construct G  = cl(G). In the graph G, for any two non adjacent
vertices s, t ∈ V , dG (s) + dG (t) must be atleast (n + 1). This means in cl(H ), the induced
subgraph on the vertices V of G will be a complete graph K n . Also the new vertex x of V
is adjacent to every vertex l ∈ V − {u, v} in the closure graph cl(G). Also xu, xv ∈ G and
xv, xv ∈ cl(G). So cl(G) must be a complete graph on |V | vertices. Hence G is Hamiltonian.
The Hamilton cycle C of G must contain the edges xu, xv. Removing x from C results in
a Hamiltonian path between the two vertices u, v. Hence G is Hamiltonian connected. 

We next consider a stronger property of a graph than that of hamiltonian-connected.

1
1
2 3

G1 : 4 G2 : 5 2
8
7 5
4 3
6
Fig. 17.14 Graphs (8)
17.5 Other Hamiltonicity 337

Definition 17.40 Let G = (V , E) be a connected graph. If for every pair of distinct vertices
u, v ∈ V , there exists a u − v path of length k for each k, dis(u, v) ≤ k ≤ n − 1, then G is
said to be panconnected.

Remark 17.41 Every panconnected graph is Hamiltonian connected. There are graphs
which are Hamiltonian-connected but are not panconnected.

Example 17.42 (i) K n , n ≥ 1, is panconnected


(ii) K (m, n), 1 ≤ m ≤ n is not Hamiltonian connected (for m = n, m, n = 1). K (m, n) is
also not panconnected.

The following result gives a sufficient condition for a graph to be panconnected. We state
the theorem without proof.

Theorem 17.43 Let G = (V , E) be a graph with |V | ≥ 4. If for every vertex v ∈ V , d(v) ≥


|V |+2
2 , then G is panconnected.

Remark 17.44 The above theorem gives the best condition for panconnectivity.

Definition 17.45 Let G = (V , E) be graph with |V | ≥ 3. If G contains a cycle for every


possible length k, 3 ≤ k ≤ |V |, then G is said to be pancyclic.

Example 17.46 Consider the graph, G is pancyclic (Fig. 17.15).

Definition 17.47 A graph G = (V , E) is said to be vertex pancyclic if every vertex v ∈ V


belongs to every cycle of length k, 3 ≤ k ≤ |V |

Remark 17.48 The above graph G in the example is not vertex pancyclic.

Fig. 17.15 Pancyclic graph v2 v3


G:
v1 v6 v4

v5
338 17 Eulerian and Hamiltonian Graphs

The results and study on pancyclic graphs was initiated by Bondy. Bondy studied the
importance of Ore’s sufficient condition for a graph G to be Hamiltonian. The Ore’s condition
that δ(G) ≥ n2 imply much more information on the structure of the graph G. Following are
some sufficient conditions on G being pancyclic.

Theorem 17.49 1. Let G = (V , E) be a graph with |V | ≥ 3. Also d(u) + d(v) ≥ n for


every two non adjacent vertices u, v ∈ V . Then G is either pancyclic or else complete
2
bipartite graph K n2 , n2 . In particular, if G is Hamiltonian and |E| > n4 , then G is pancylic.
2. If G = (V , E) is not a complete bipartite graph with |V | ≥ 3, and for every pair of non
adjacent vertices u, v ∈ V , d(u) + d(v) ≥ |V |, then G is pancyclic.

Exercises

1. Give examples of graph G such that

(i) G is Eulerian and Hamiltonian


(ii) G is Eulerian but not Hamiltonian.
(iii) G is non Eulerian but Hamiltonian.
(iv) G is both non Eulerian and non Hamiltonian.

2. Show that for an Eulerian graph edge connectivity is always even.


3. Give an example of an Eulerian graph with κ = 1, λ = 2, δ = 4.
4. Show that a connected graph G on n vertices, n > 1 is Eulerian if and only if every
edge of the graph lies on an odd number of cycles of G.
5. Show that if G is odd bipartite graph then G is not Hamiltonian.
6. Does there exist a graph G such that cl(G) is not a complete graph? Justify your
answer.
7. Construct if possible Eulerian graphs with n number of vertices and m number of edges
where

n 4 5 6
m 5 8 10

Justify your answers.


8. Construct a non-Hamiltonian graph on S-vertices.
9. Show that K m,n is non-Hamiltonian for (i) m + n being odd (ii) m < n.
10. Does there exist a graph G which is not pancyclic whose cl(G) is complete? Justify
your answer.
Planar Graphs
18

Planar graphs is an important class of graphs that has very nice applications. A graph
can be drawn in many ways. Some representations bringout the properties of the graphs
immediately, whereas other representations may not. A planar graph is one that can be
represented on a plane in such a manner that no two edges cross over each other.

18.1 Embedding of Graphs

A graph is said to be embedded on a surface if its vertices are mapped to distinct points on
the surface and the edges to simple curves between the corresponding pairs. The drawing is
done such that no two curves intersect each other at any interior position. It means the only
intersecting points are the end points of the curves.

Definition 18.1 Let G be a graph and F(G) be an embedding of G = (V , E) on a surface


say S.

(i) For any two points u, v on the surface S such that u, v ∈/ V and u, v ∈ (S − F(G)),
the points u, v can be related as below:
u ∼ v if and only if there is a Jordan curve joining u and v on S but does not contact
any position of F(G). Note that ‘∼’ is an equivalence relation.
(ii) The equivalence classes of ∼ are the regions of F(G).
(iii) The points, curves and regions of F(G) is one mapping of G on the surface S.
(iv) The surface ‘S’ can be a plane surface or a sphere.
(v) When G is embedded on a plane, it will be called as planar embedding. In the planar
embedding F(G) of G all the regions will be bounded except only one unbounded
region.
(vi) A graph that admits an embedding on a plane is called a ‘planar graph’.

© Ane Books Pvt. Ltd. 2025 339


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_18
340 18 Planar Graphs

Remark 18.2 From the above definition it is immediate that not all graphs admit planar
embedding.

We will consider only embedding of graphs on a plane. We will not consider any embed-
ding of a graph on a spherical surface.
For any graph embedded on a plane, the points, curves and regions will be referred
as vertices, edges and faces of the graph. When we say planar graph, it means a graph
represented on a plane.
We now give the first result on a planar graph known as Euler’s formula [?].

Theorem 18.3 If a graph G = (V , E, F) is a planar graph where |V | = n, |E| = m, |F| =


f , then

n−m+ f =k+1 (18.1)

where G has k components. Here F denotes the faces of G.

Proof Since the graph has n vertices, it can be constructed by adding edges to K n .
For K n , k = n, m = 0, f = 1. Hence (18.1) is true.
Let G i−1 be the planar graph with m edges, with k components, f faces and (18.1) is
true.
Let G i be obtained from G i−1 by adding the ith edge say e.
Case i: If the ith edge connects two different components of G i−1 , then in G i number of
edges increase by 1, number of components decrease by 1. So,

n − (m + 1) + f = k
⇒ n − m + f = k + 1.

Case ii: If the new edge ‘e’ joins any two non-adjacent vertices of the same component
without cross over, then number of edges increase by 1, number of components remain the
same, number of faces increase by 1. So,

n − (m + 1) + f + 1 = k + 1
⇒ n − m + f = k + 1.

Hence the theorem. 

We now state two corollaries which are immediate consequences of the above theorem.

Corollary 18.4 If G is a connected planar graph, then

n−m+ f =2
18.1 Embedding of Graphs 341

G1 : G2 :

G3 :

Fig. 18.1 Graphs (1)

Definition 18.5 A planar graph embedded on a plane is a plane graph.


A graph that is not planar is called as non planar graph (Fig. 18.1).

Example 18.6

G 1 is a planar graph.
G 2 is a plane graph. G 3 is a non-planar graph.

The concept of Jordan curve theorem helps to sketch a planar graph on a plane to get a
plane graph.

Definition 18.7 Let x, y be any two points on a plane. A Jordan curve from x to y is a
continuous non-self-intersecting curve in the plane. It is a closed Jordan curve if x = y.

We now state the Jordan curve theorem.

Theorem 18.8 A closed Jordan curve J on a plane S divides the plane into three parts.
The 3 parts are interior of J , exterior of J , boundary of J .

Remark 18.9 Every edge of a plane is a Jordan curve. The boundary of every region/face
is a closed Jordan curve.

Definition 18.10 The degree of a face ‘ f ’ of a plane graph G is the number of edges
bounding the face where cut edges if any are counted twice. We use the notation degG ( f )
to denote the degree of a face f in G the plane graph G (Fig. 18.2).
342 18 Planar Graphs

2 3
4
G1 : 1 f1 f2 f3 9
f4 10
5
8 7 6
Fig. 18.2 Faces

Example 18.11

In G 1 boundary of f 1 : b( f 1 ) = {12, 28, 18}


boundary of f 2 : b( f 2 ) = {23, 28, 37, 87}
boundary of f 3 : b( f 3 ) = {12, 18, 23, 37, 87, 67, 46, 45, 65}
boundary of f 4 : b( f 4 ) = {45, 46, 65, 69, 910}
deg( f 1 ) = 3, deg( f 2 ) = 4, deg( f 3 ) = 11, deg( f 4 ) = 7.

Definition 18.12 Let G be a plane graph. If G has ti faces of degree i, 2 ≤ i ≤ k, then the
sequence (2t1 , 3t2 , . . . , k tk ) is the face-degree sequence of G.

Remark 18.13 If a graph G has two different embeddings say G 1 , G 2 then their face-degree
sequence will be same.

Definition 18.14 A planar graph with each face of it being a triangle is called as planar
triangulation.
For a graph G, the embedding of G be F(G). We have a few observations as below:
Let F(G) be a plane embedding of a planar graph G.

(i) For two faces f 1 and f 2 , they are disjoint if their boundaries share no edge. If f 1 , f 2
share an edge ‘e’ then f 1 , f 2 intersect only on the edge e.
(ii) Exterior face of F(G) is unique.
(iii) Every edge e can be on atmost two different faces.
(iv) A cut-edge can belong to only one face of F(G).
(v) A non cut-edge can belong to exactly two faces of F(G).
18.2 Some Simple Properties 343

18.2 Some Simple Properties

We discussed the basic idea of plane drawing of a graph. We had Euler’s formula that relates
basic parameters of a planar graph. This formula has some nice applications as well.
Theorem 18.15 Let G be a simple connected plane graph. Let degG ( f ) ≥ k for every face
f of G. Then
k(n − 2)
m≤ .
k−2

Proof G is a connected plane graph. So every face of G is a cycle. Each edge belongs to
exactly two faces. Hence the face-degree sum of G will be 2m where m is the number of
edges of G. So, 
2m = deg( f ) ≥ k.
f ∈F(G)

where F(G) is the faces of G and |F(G)| = . By Eulers formula

n−m+=2
2 m ≥ k

Solving we get the result. 

If G is a connected plane graph with atleast 3 vertices, the following result gives an upper
bound on the number of edges.

Theorem 18.16 If G = (V , E) is a planar graph with |V | ≥ 3, then

|E| ≤ 3 V | − 6.

Proof For |V | = 3, the bound is true that |E| ≤ 3. Let G = (V , E) be a graph with |V | ≥ 4
that is a planar graph. This graph must be connected as well. Otherwise edges can be added
between the components to make it as a connected one. Suppose there are F faces for this
graph, then by Euler’s identity,

|V | − |E| + |F| = 2. (18.2)

Also we know that every edge must be shared by exactly 2 faces and so


k
|Fi | ≤ 2|E| (18.3)
i=1
344 18 Planar Graphs

where Fi is a face of G and there are k-faces for this graph. Now each face Fi must be
bounded by 3 or more edges. So


k
3k ≤ |Fi |. (18.4)
i=1

From (18.2), (18.3) and (18.4) we have

3(2 − |V | + |E|) ≤ 2|E|


⇒ |E| ≤ 3 V | − 6.

From the above theorem, we can formulate the following result for a graph with more
than 5 vertices and that does not satisfy the bound |E| ≤ 3|V | − 6.

Theorem 18.17 If G = (V , E) is a graph with atleast 5 vertices and |E| > 3|v| − 6, then
G is not a planar graph.

Corollary 18.18 Let G = (V , E) be a planar graph. Then G contains a vertex of degree 5


or less.

Proof Since G is planar, we can write |E| ≤ 3|V | − 6. If |V | ≤ 6, the result is obvious.
Suppose |V | > 6 and suppose degree of every vertex of such a graph is atleast 6. Then

2|E| = d(v) ≥ 6 V |
v∈V
⇒ |E| ≥ 3 V |
⇒ |E| > 3 V | − 6.

Then by the above theorem, G is not a planar graph. Hence G contains atleast one vertex of
degree 5 or less. 

Corollary 18.19 K 5 is non planar.

Proof Suppose K 5 is planar


10 ≤ 15 − 6 = 9
which is not true. 

Corollary 18.20 K 3,3 is non planar.


18.2 Some Simple Properties 345

G1 G2 G3
Fig. 18.3 Maximal planar graphs

Proof Suppose K 3,3 is a planar graph. We know it is a bipartite graph on 6 vertices and so
for every face f of K 3,3 , deg K 3,3 ( f ) ≥ 4. Using this in the inequality,

k(n − 2)
m≤
(k − 2)
of Theorem 18.17, we get
4(4)
9≤ =8
2
This is not true. Hence K 3,3 is non planar. 

Definition 18.21 A planar graph G is said to be maximal planar if adding a new edge
between two non adjacent vertices of G results in a non planar graph (Fig. 18.3).

Example 18.22

G 1 , G 2 , G 3 are maximal planar graphs.

Remark 18.23 Every face of a maximal planar graph will be a triangle or C3 . So every
maximal planar graph is a called triangulated graph.

Theorem 18.24 The number of edges in any maximal planar graph G = (V , E) is 3|V | −
6.

Remark 18.25 Any planar graph is a spanning subgraph of a maximal planar graph. Every
maximal planar graph is 2-connected.

Definition 18.26 A graph G = (V , E) is said to be outer planar if it has an embedding in


a plane such that all its vertices lie on the boundary of the exterior face (Fig. 18.4).
346 18 Planar Graphs

Fig. 18.4 Graphs (4)

G1 : is outer planar

G2 : is outer planar

G3 : isnon−outer planar

Fig. 18.5 Graphs (5) 1 4

G1 : 2 G2 : 5

3 6

1 4

G3 : 2 5

3 6

Definition 18.28 Let G 1 = (V1 , E 1 ), G 2 = (V2 , E 2 ) be two simple graphs. Then join of
G 1 , G 2 is defined to be a graph G = (V , E) such that V = V1 ∪ V2 , E = E 1 ∪ E 2 ∪ {x y |
x ∈ V1 , y ∈ V2 }. Join of G 1 , G 2 is denoted by G 1 ∨ G 2 (Fig. 18.5).

Example 18.29 Let

The following is a necessary and sufficient condition for a graph to be outerplanar.

Theorem 18.30 A graph G = (V , E) is outer planar if and only if G ∨ K 1 is planar.


18.3 Characterization of Planar Graphs 347

Proof Let G be outerplanar. Then it can be embedded in a plane such that all its vertices lie
on the boundary of the outer region. Then a vertex ‘t’ can be placed in the exterior region
and G ∨ K 1 can be seen as a planar graph.
Suppose G ∨ K 1 is planar. Then in the construction of G ∨ K 1 a vertex ‘x’ that is joined
to every vertex of G can be deleted to see the embedding of G such that all its vertices are
in the exterior region. Hence the theorem. 

Example 18.31

K 4 is not outer planar.

K 2,3 is not outer planar.

We state the following necessary and sufficient condition for a graph to be outer planar
without proof.

Theorem 18.32 A graph G is outerplanar if and only if it has no subgraph homeomorphic


to either K 4 or K 2,3 .

18.3 Characterization of Planar Graphs

In this section we will see a characterization of planar graphs by Kuratowski.


We have seen that K 5 and L 3,3 are non planar. So if any graph that contains either K 5
or K 3,3 as its subgraph will naturally be nonplanar. Here we make a statement that every
subgraph of a planar graph is planar.
348 18 Planar Graphs

Fig. 18.6 Graphs (7) 1

5 10 6 2
G:
9
7
8
4 3

Fig. 18.7 Graphs (8)

G: G1 :

Example 18.33 Consider the following graph (Fig. 18.6).


This is the Peterson graph and it is non-planar. But it does not contain K 5 or K 3,3 directly
as a subgraph.

Definition 18.34 An edge uv ∈ E of a graph G = (V , E) can be replaced by a path


uu 1 u 2 u 3 . . . u n v by introducing vertices u 1 , u 2 , . . . , u n into the edge uv ∈ E. This subdivi-
sion may be done in some or all the edges of G. The resultant graph is called a subdivision
graph of G denoted by s(G).

G 1 is a subdivision of G and G 1 = s(G). The following are some observations on planar


graphs (Fig. 18.7).

1. If G is a planar graph, then s(G) is also a planar graph.


2. If G is a nonplanar graph, then s(G) is also a non planar graph.
3. A graph G is planar means that every component, subgraphs, blocks are planar.
4. s(K 5 ), s(K 3,3 ) are non planar.
5. If G is planar, then G is not a subdivision of K 5 or K 3,3 or G does not contain a subgraph
H which is a subdivision of K 5 or K 3,3 .

Example 18.36 Consider the peterson graph (Fig. 18.8).


By direct argument one can show that G is non planar (Fig. 18.9).
s(K 3,3 ) is a subgraph of G.

We now state and prove Kuratowski’s characterization of planar graphs.


18.3 Characterization of Planar Graphs 349

Fig. 18.8 Graphs (9) 1

6
5 10 2
7
G:
9
8
4 3

Fig. 18.9 Division graph 1 3 7

6 10
s(K3,3 ) : 9
5
2 8 4

Definition 18.37 Let G = (V , E) be a graph with x y ∈ E. The graph obtained by contract-


ing the edge x y means, the vertices x and y are removed and a new vertex ‘w’ is added in
such a manner that every vertex that is adjacent to x or y is now adjacent to w in the modified
graph. This contraction of an edge is known as elementary contraction of an edge of G. If
H is a graph obtained from a graph G through a sequence of elementary contractions then
we say G is contractable to H . In notation we write H = ζ (G).

Example 18.38 Consider the peterson graph (Figs. 18.10 and 18.11).

Fig. 18.10 Graph (10) 1

6
5 10 2
7
G:
9 8
4 3
350 18 Planar Graphs

Fig. 18.11 Contraction 16

5 10 2
7
9 8
4 3

Contracting 27, 510, 49, 38 in sequence we reach K 5 which is non-planar.

Theorem 18.39 A graph G is planar if and only if it does not have a subgraph contractable
to either K 5 or K 3,3 .

Definition 18.40 Let G = (V , E) be a plane graph. Let V = {v1 , v2 , . . . , vn } and E =


{e1 , e2 , . . . , em } and F = { f 1 , f 2 , . . . , fr } be the sets of vertices, edges and faces of G
respectively. The dual G ∗ = (V ∗ , E ∗ ) of G is a graph with

V ∗ = { f 1∗ , f 2∗ , . . . , fr∗ }
E ∗ = {e1∗ , e2∗ , . . . , em

}

where e∗j = f s∗ f t∗ if and only if faces f s , f t are adjacent or e j is the common edge for f s
and f t of F.

The following diagram illustrates the understanding of G ∗ where the dotted lines are
edges of G ∗ (Fig. 18.12).

Remark 18.41 (i) G ∗ is a plane graph.


(ii) G ∗ is always connected.
(iii) If e is a cut edge in G, then e∗ is a loop in G ∗ and conversely.
(iv) G ∗ is always connected.
(v) Number of edges of G and G ∗ are equal. Degree of each face f will be the degree of
the vertex f ∗ in G ∗ .

The following lemma can be seen geometrically using geometric inversion.


18.3 Characterization of Planar Graphs 351

Fig. 18.12 Graphs of faces


1
f3

f1
G: 2
f2
3

f1

G :
f3 f2

Lemma 18.42 Let G = (V , E) be a plane graph. Let E be the edges bounding a face ‘ f ’
of G. Then there exists a plane embedding of the graph G where the edges E are lying on
the exterior face or outer region.

Lemma 18.43 Let G = (V , E) be a non planar graph without the subdivision of K 5 or


K 3,3 as a subgraph. Let G be a minimal such graph on |V | + |E|. Then G is 3-connected.

Proof G is connected by the assumption that |V | + |E| being minimal.


G is also 2-connected. If not, then G must have a cut vertex ‘v’ (say) and let G − v have
its connected components as G 1 , G 2 , . . . , G t . Let G  = (V , E  ), ! ≤  ≤ t. Each of the
induced subgraph on V ∪ {v} will have a plane embedding due to minimality on E and G
being non-planar. Now joining the plane embeddings of each of G  ∪ {v} at ‘v’, we arrive
at a plane embedding of G which is not true. Hence G is 2-connected.
We continue the argument to show the 3-connectedness as below.
Let S = {u, v} be the vertex separating set of G. Let G 1 = (V1 , E 1 ) and G 2 = (V2 , E 2 )
be two subgraphs of G such that E = E 1 ∪ E 2 and V1 ∩ V2 = {u, v} = S. Clearly G 1 , G 2
will contain a connected component of G − S. As G is 2-connected there exists a path P
from u to v in both G 1 and G 2 . Also u and v are adjacent to a vertex in each of the connected
components of G − S. Now let G i = G i + uv. Here uv may be an edge in E. If G 1 and G 2
are planar, then by Lemma 18.42 above, it is possible to to have an embedding of G i such
that the edge ‘uv’ lies on the exterior face or outer region. Now join G 1 and G 2 together at
the edge uv. We get a planar embedding of G as seen below (Fig. 18.13):
If one of G 1 or G 2 is non-planar, say G 1 is non planar, then |E 1 ∪ {uv}| < |E| and by
minimality condition on |V | + |E|. G 1 must contain either subdivision of K 5 or subdivision
of K 3,3 . Since G 2 contains a path from u to v, this path can be taken as a subdivision of
352 18 Planar Graphs

Fig. 18.13 A situation u

G: G1 G2

v
Fig. 18.14 Graph (11) u 1
1

e e

v 2 2
G: G e:

the edge uv and hence G must include subdivision of K 5 or K 3,3 . This is a contradiction.
Hence G must be 3-connected. 

Definition 18.44 Let G = (V , E) be a graph and let e = uv ∈ E. By contracting the edge


we mean that edge uv contracts as a vertex ‘x’ (say) such that G ∗ e is a new graph obtained
from G such that (Fig. 18.14)

VG∗e = (V − {u, v}) ∪ {x}


E G∗e = {e/e ∈ E, e is not incident with u or v} ∪ {wx/wu ∈ E or wv ∈ E}.

The following lemma can be proved by method of contradiction and we leave its proof
as an exercise to the readers.

Lemma 18.45 Let G = (V , E) be a 3-connected graph such that |V | ≥ 5. Then G ∗ e is


3-connected for some edge e ∈ E.

Lemma 18.46 Let G = (V , E) be a graph. If G ∗ e, for some edge e ∈ E contains either


a subdivision of K 5 or subdivision of K 3,3 , then G also contain such subdivisions.

Proof An elaborate proof can be given using case by case method such subdivisions of K 5
or K 3,3 . We will not get into these details. However, we can see that if G is a subdivision of
K 5 or K 3,3 in G ∗ e, then if d(w) = 2 in G for w = uv, uv = e, then the result follows.
If d(w) = 3 or 4 in G. If there is atmost one edge wx in G such that ux or vx ∈ E, then
also G will contain a subdivision of K 5 or K 3,3 , if G ∗ e does.
18.3 Characterization of Planar Graphs 353

If G is a subdivision of K 5 , and both the vertices u, v are adjacent to 3 vertices in the


subgraph of G that corresponds to G, then G must contain a subdivision of K 3,3 . 

Lemma 18.47 Let G = (V , E) be a 3-connected graph that contains no subdivision of K 5


or K 3,3 . Then G is planar.

Proof We will prove this lemma by the method of induction on the number of vertices of
the given graph.
Let G = (V , E) be a graph with |V | ≥ 5. For |V | ≤ 4, the result is true as K 4 is the only
3-connected graph which is planar.
Since G is 3-connected, by Lemma 18.45, there exists an edge e − uv such that G ∗ e
is also 3-connected. By Lemma 18.46, G ∗ e contains no subdivision of K 5 or K 3,3 . So
by induction hypothesis G ∗ e is planar and G ∗ e be the plane embedding of it where
e = {u, v}. In the embedding, consider the embedding portion of (G ∗ e) − {x} where x is
the contracted vertex. Let C be the face of that part in the embedding G ∗ e excluding the
vertex x which included the vertex ‘x’ on it. Clearly C is a cycle as G is 3-connected.
Infact embedding of G ∗ e excluding the vertex ‘x’ is nothing but an embedding of
G − {u, v}. Every neighbouring vertex of u will be a vertex on ‘C’ as well as vertex ‘v’.
Similarly every vertex adjacent to v will be a vertex on C as well as u.
Suppose d(v) ≤ d(u) in G and v1 , v2 , . . . , vt are the vertices in order on C such that
vi = u, 1 ≤ i ≤ t. Suppose Pi j is the path on C from vertex i to vertex j, then an edge vvi
can be added so that G − {u} has a plane embedding for 1 ≤ i ≤ t.
Case i: If the adjacent vertices of u other than v occur on a path Pk(k+1) for some k, then
k + 1 modulo t will be taken for the path. Here a plane embedding of G excluding u is taken
first. Then the vertex u will be planted in the interior region of the face bounded by edges
vvi , vi vi+1 , vi+1 v and then the edges to u are supplied.
Case ii: Suppose there are two vertices x, y that are adjacent to u, x, y = v. If x is a
vertex on the path Pi j and y is not on Pi j for some i, j, and x, y ∈
/ {vi , v j }. Then the vertices
{u, vi , vi+1 } ∪ {v, x, y} form a subdivision of K 3,3 .
Case (i) and (ii) imply that the set of vertices adjacent to u in G other than ‘v’ are also
adjacent to the vertex ‘v’. Hence all the vertices adjacent to ‘u’ are also adjacent to ‘v’
in G as d(v) ≤ d(u). By Case (i) above d(v) = d(u) in G. So u, v, v1 , v2 , v3 will form a
subdivision of K 5 . Hence the result. 

Theorem 18.48 (Kuratowski’s Theorem) A graph is planar if and only if it does not contain
s(K 5 ) or s(K 3,3 ).

Proof If G is planar, then G cannot contain s(K 5 ) or s(K 3,3 ) is discussed earlier.
Conversely we show that every non planar graph must contain either s(K 5 ) or s(K 3,3 ).
Suppose not for a graph G that has minimum number of edges. Then by Lemma 18.43, G
is 3-connected. By Lemma 18.47, G is planar, which is a contradiction. 
354 18 Planar Graphs

Exercises

1. Show that every subgraph of a planar graph is planar.


2. Show that Peterson graph is non planar.
3. Show that a graph is planar if and only if every block of it is planar.
4. Let G be a connected planar graph. Will G always have an unique embedding? Justify
your answer.
5. Show that a simple planar graph cannot be such that all its vertices are of degree atleast
6.
6. Let G be a simple planar graph on six vertices. What is the maximum number of edges
that it can have? Represent the graph on a plane.
7. Let G be a planar graph on 100 faces where each face is a triangle. Find the number of
vertices and edges of such a graph.
8. Let G be a planar graph with all its faces are pentagons and all the faces of its dual G ∗
being triangles. Find the number of vertices, edges and faces of G.
9. Show that a planar graph is 2-connected iff the boundary of every face is a cycle in its
plane embedding.
10. Show that a planar graph with triangulation having atleast 4 vertices is 3-connected.
Independent Sets, Coverings and Matchings
19

In this chapter we see an important graph parameter that give rise to what is known as
coverings and matchings. Vertex independents sets, edge independent sets often can be seen
to occur in many applications.

19.1 Independent Sets

Definition 19.1 Let G = (V , E) be a graph. A subset S of V is called a vertex independent


set of G if for any two vertices u, v ∈ S, uv ∈
/ E. That is no two vertices in S are adjacent
in G. The set S is said to be maximum, if there exist no vertex independent set S  of V such
that |S  | > |S|. The cardinality of a maximum vertex independent set of a graph G will be
called as independent number of G and is denoted by α(G).

Example 19.2 Consider the following wheel graph, W7 .


Here {v7 }, {v1 , v3 }, {v1 , v3 , v5 } are vertex independent sets. {v1 , v3 , v5 } is a maximum vertex
independent set and α(W7 ) = 3 (Fig. 19.1).

Definition 19.3 Let G = (V , E) be a graph. A subset K of V such that every edge e ∈ E


is incident with a vertex in K is called a vertex covering of G.
A vertex covering K is called a minimum vertex covering of G if there is no covering
K  of G such that |K  | < |K |. The number of vertices in a minimum vertex covering of G
is called as vertex covering number of G and is denoted by β(G).

Example 19.4 Consider the wheel graph W7 of the above example.


The set K = {v1 , v2 , v3 , v4 , v5 , v6 } is a vertex covering of W7 . The subset K  =
{v1 , v3 , v5 , v7 } is the minimum vertex cover and β(W7 ) = 4.

© Ane Books Pvt. Ltd. 2025 355


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_19
356 19 Independent Sets, Coverings and Matchings

Fig. 19.1 Wheel graph v6 v1

v5 v2
v7

v4 v3

Theorem 19.5 Let G = (V , E) be a graph. A subset S of V is a vertex independent set of


G if and only if V − S is a vertex covering of G.

Proof. S is a vertex independent set if and only if no two vertices in S are adjacent in G.
This means every edge e ∈ E must be incident with a vertex in V − S. By definition, then
V − S is a vertex covering. 

Corollary 19.6 For any graph G = (V , E), α(G) + β(G) = |V |.

Proof. If S is a maximum vertex independent set of G, then α(G) = |S|.


If K is a minimum vertex covering of G, then β(G) = |K |.
By definition and above theorem,

|K | ≤ |V − S| ⇒ β(G) ≤ |V | − α(G)
⇒ α(G) + β(G) ≤ |V | (19.1)

If V − K is a vertex independent set and S being maximum,

|S| ≥ |V − K | ⇒ α(G) ≥ |V | − β(G)


⇒ α(G) + β(G) ≥ |V | (19.2)

From (19.1) and (19.2), we get α(G) + β(G) = |V |. 

Definition 19.7 1. Let G = (V , E) be a graph. A subset M of E is called an edge inde-


pendent set if no two edges are adjacent in G. The number of edges in a maximum edge
independent set is called as edge independent number and is denoted by α  (G).
2. A subset L of E is said to form an edge cover if every vertex of G is incident to some
edge in L. The minimum number of edges in an edge cover set is called as edge covering
number and is denoted by β  (G).
19.1 Independent Sets 357

3. Also a matching is a set of independent edges. α  (G) is also called as maximum matching
number.

Theorem 19.8 For any graph G = (V , E), α  (G) + β  (G) = |V |.

Proof. Let M be the set of independent edges where M is maximum and |M| = α  (G).
Suppose L is the set edges, satisfying the property that it contains one edge incident for each
of the (|V | − 2α  ) vertices in of G that are not covered by any edge in M. So, M ∪ L will
be an edge covering of G. That is

|M ∪ L| ≥ β  (G) by definition of β 
⇒ α  + |V | − 2α  ≥ β 
⇒ |V | ≥ β  + α  (19.3)

Suppose M is a minimum edge cover of G and then |M| = β  (G). Since M is minimum,
it cannot have an edge ρ = uv such that u and v are also incident with an edge in M other
than ρ. This means G[M] is a edge spanning subgraph of G induced by M. So each edge of
M will be incident with atleast one end vertex of an edge in G[M]. Let Q be such vertices
where the incidency is exactly with one end vertex of M. This means |Q| = |M| = β  (G).
Each of the induced subgraph G[M] will have exactly one vertex that is not in Q. So we
can write,

|V | = |Q| + (number of induced subgraphs G[M]) (19.4)

Now one can form a set of independent edges of G by picking one edge from each of the
induced subgraphs G[M]. This means

α  (G) ≥ (number of induced subgraphs G[M])

Hence

|V | ≤ β  (G) + α  (G) (19.5)

From (19.3) and (19.5), we have

α  (G) + β  (G) = |V |.


358 19 Independent Sets, Coverings and Matchings

19.2 Matchings

We have seen that any set M of independent edges is also called as matching of that graph.
Definition 19.9 1. A matching M is said to be a maximum matching of a graph G if G
has no matching M  such that |M  | > |M|.
2. A matching M is said to be maximal matching of G if there is no matching M  of G
such that M ⊂ M  .
3. If e = uv ∈ M, a matching of a graph G, we can say that the vertices u and v are matched
under M. We say the vertices u, v are M-saturated.
4. A set S of vertices of a graph G is said to be M-saturated for a matching M of G if every
vertex in S is incident with some edges in M.
5. A vertex u of a graph G is said to be M-unsaturated for a matching M if it is not incident
with any edge in M.

Example 19.10 Consider the following graph (Fig. 19.2).


The matching M = {v1 v2 , v4 v5 } is a maximal matching.
The matching M  = {v1 v6 , v2 v7 , v3 v4 } is a maximum matching. The vertices v1 , v2 , v3 ,
v4 , v6 , v7 are M  -saturated where as v5 is M  -unsaturated.

Definition 19.11 1. Let M be a matching of a graph G. A path P in G = (V , E) called


an M-alternating path if the edges in P are alternating between M and E − M.
2. Let M1 , M2 be two matchings of a graph G = (V , E). Let M1 M2 denote the symmetric
difference of M1 and M2 . That is

/ M2 } ∪ {e |e ∈
M1 M2 = {e|e ∈ M1 , e ∈ / M1 , e ∈ M2 }.

The subgraph induced by M1 M2 of G will be a graph whose components are either
paths or cycles in G of even length whose edges alternate between M1 and M2 .

Fig. 19.2 Maximal Matching v1 v2

W7 :

v6 v3
v7

v5 v4
19.3 Matching in Bipartite Graphs 359

3. A path whose edges alternate between M and E − M, for a matching M, having start
and end vertices being M-unsaturated is called as M-augmenting path.

Example 19.12 In W7 , M  = {v1 v6 , v2 v7 , v3 v4 } P : v1 v6 v7 v2 v3 v4 is an alternating path,


but not an augmenting path.
For M  = {v1 v2 , v3 v4 }, P : v6 v1 v2 v3 v4 v5 is an augmenting path.

Following is a characterization by Berge for maximum matchings in graphs.

Theorem 19.13 Let G = (V , E) be a graph. A matching M of G is maximum if and only


if G has no M-augmenting path.

Proof. (i) Suppose for a matching M there is a M-augmenting path P. Then delete from
the matching M, the edges of M that are on P and adding to M those edges of P not
in M, we get a new matching M. Here M has one extra edge than M. So M cannot be
maximum.
(ii) Conversely, suppose M is a matching of G without M augmenting path in G. If M is
a maximum matching of G, then by (i), there is no M-augmenting path in G. Now for
the two matchings, M, M, consider MM. The components of G[MM] can be only
single vertices, alternating paths of even length, or even cycles that has alternate edges
between M and M. This means |M| = |M| which means M is maximum.


Definition 19.14 Let G = (V , E) be a graph. A spanning subgraph of G is a factor G. A


factor of a graph G that is k-regular will be called as k-factor of G. So a 1-factor of G is a
matching which saturates every vertex of G. A 1-factor of G is called a perfect matching
of G. A 2-factor of G is a 2-regular spanning subgraph and hence it is the disjoint union of
cycles.

Example 19.15 Consider the graph (Fig. 19.3)


G 1 does not have 1-factor. G 2 has 1-factor.

19.3 Matching in Bipartite Graphs

An institute has k1 , k2 , . . . , kn laboratries and there are t-courses 1 , 2 , . . . , t to be con-


ducted in a particular slot in the labs. Suppose the course m can be conducted in say ‘ f ’
labs. The problem is to assign the t-courses in the n labs so that no two labs are assigned to
the same course.
The above assignment activity can be seen as a graph theory problem. Consider the n labs
to be the vertices of one partition and t-courses as vertices in the other partition. If the lab ks
360 19 Independent Sets, Coverings and Matchings

G1 : G2 :

Fig. 19.3 Graphs (5)

is suitable for a course m , then make an edge between them. Once all the assignments are
complete, we can see whether there is a matching that saturates every vertex of the n-labs
set. A solution to this problem was given by Hall. We have the following theorem to this
effect.

Theorem 19.16 Let G = (V , E) be a bipartite graph with V = X ∪ Y , X ∩ Y = ∅. Then


G has a matching M saturating all the vertices of X if and only if

|N (S)| ≥ |S|

for every subset S of X . Here N (S) denotes all the vertices each of which is adjacent to
atleast one vertex in S.

Proof. (i) Suppose G has a matching saturating all vertices of X . Let S be any subset of
X . Every vertex of S is matched to different vertices in the neighbourhood of S which
lies in Y . So |S| ≤ |N (S)|.
(ii) Conversely suppose for every subset S of X , N (S)| ≥ |S|. Suppose G has no matching
saturating all the vertices in X . Let M be a maximum matching and that M saturate
maximum number of vertices in X . Let x be a M-unsaturated vertex in X . Let Z be the
set of vertices of G that are reachable from x by M-alternating paths. There will be no
M-augmenting path in these as M being maximum. Let S = Z ∩ X and T = Z ∩ Y .
Clearly every vertex in T is matched by M to a vertex in S − {x} and conversely.
This means N (S) = T and |T | = |S| − 1. Also |S| = |T | + 1 as S ⊆ X . This means
|S| > |T | = |N (S)| which is not true. Hence G has maximum matching.


We have already seen system of distinct representatives in chap ??. We just recall the
definition here once again.
19.4 The Perfect Matching Theorem 361

Definition 19.17 Let V = {a1 , a2 , . . . , an } be a given set. Let ζ = (A1 , A2 , . . . , Am ) be a


class of subsets of V . i.e., Ai ⊆ V for 1 ≤ i ≤ m. Then a subset R = {x1 , x2 , . . . , xm } of
V is a system of distinct representations (SDR) of the class ζ if xi ∈ Ai , 1 ≤ i ≤ m and
xi = x j for i = j.

We now have Hall’s SDR theorem as a corollary to the above theorem.

Corollary 19.18 A necessary and sufficient condition for the existence of a SDR  for a class
m 
 
ζ = (A1 , A2 , . . . , Am ), each Ai being subset of a set V is that |R| ≤  Ai  for every set
 
i=1
R = {x1 , x2 , . . . , xm }, xi ∈ Ai , 1 ≤ i ≤ m, xi = x j for i = j.

Proof. Let G = (V , E) be a bipartite graph of the given situation where


V = X ∪ Y and
X = {A1 , A2 , . . . , Am }
Y = V = {a1 , a2 , . . . , an }
Ai is incident with a j if a j ∈ Ai . Now for R = (x1 , x2 , . . . , xm ),

m
N (X ) = Ai ⊆ V and |X | = m. By Hall’s theorem the system has SDR if and only if
i=1
G has a matching that saturates evey vertex of X . 

Remark 19.19 Hall’s theorem is also known as the marriage theorem. This theorem has
several equivalent formulations by different authors.

19.4 The Perfect Matching Theorem

Now, let G be any graph. We will see under what condition G has a 1-factor. 1-factor of a
graph G is also known as perfect matching. We have the following result by Tutte.

Theorem 19.20 Let G = (V , E) be a graph. G has a 1-factor if and only if

ko (G − S) ≤ |S| ∀ S ⊆ V (19.6)

where ko (G − S) denotes the number of odd components of G − S.

Proof. Suppose G has perfect matching M. Let S ⊆ V be any subset. For each of the odd
components of G − S, a vertex in such a component must be incident with an edge in M
whose other end vertex being in S. All such vertices must be distinct. So ‘S’ is as large as
the number of odd components and may be larger.
362 19 Independent Sets, Coverings and Matchings

Conversely suppose ko (G − S) ≤ |S| for every S ⊆ V . Suppose S = φ, then G has no


odd components. This means |V | is even, say |V | = 2n. Here we take G to be a connected
graph.
The result is proved by induction on n. For n = 1, G = K 2 and the result is trivial. Let
the result be true for all the graphs with even number of vertices whose count is less than
2n. Consider a graph G = (V , E) with |V | = 2n. For any S, ko (G − S) ≡ |S| mod 2. That
is ko (G − S) and |S| are both either odd or even.
Now we have two cases.
Case i: Suppose ko (G − S) < |S| for every subset S of V and 2 ≤ |S| ≤ 2n. By the par-
ity matching of ko (G − S) and |S|, we have ko (G − S) ≤ |S| − 2 ∀ S ⊆ V . Consider
an edge e = uv ∈ E. Let V  = V − {u, v} and G  = G − {u, v}. By induction assumption
G  satisfies (19.6). If not, ko (G  − T ) > |T | for some T ⊆ V  . This means ko (G − S) =
k(G  − T ) > |T | and |T | = |S| − 2. This means ko (G − S) ≥ |S| − 1, which is a contra-
diction. So G  must have a 1-factor M  . M  + uv = M  is a 1-factor for G.
Case ii: Suppose ko (G − S) = |S| ≥ 2. Let S  = {v1 , v2 , . . . , vt } be a subset of V with
maximum number of vertices such that ko (G − S  ) = |S  |. Let H1 , H2 , . . . , Hs be the odd
components of G − S  .
By Hall’s theorem for bipartite graphs we can see that |S| odd components of G − S can
be attached with vertices in S. Tutte’s condition implies that any k such odd components must
be joined in G with minimum ‘k’ vertices in S. If this is not true, then we get that k  number of
vertices in S are joined to k odd components with k  < k. This means k( G − T ) ≥ k > |T |
for T ⊆ S, which is a contradiction.
Hence a vertex of an odd component can be matched to a vertex of S in a distinct
manner. Suppose G is an odd component with a vertex ‘x’ being matched with x of S.
Then G  = G − x has even number of vertices. Tutte’s condition must be true for G  . i.e.,
ko (G  − T ) ≤ |T |, for T , a subset of vertex set of G  . If this is not true, then ko (G  − T ) >
|T | ⇒ ko (G  − T ) > |T | + 2. Consider the set S = S ∪ T ∪ {x}. Then ko (G − S  ) =

ko (G  − T ) + ko (G − S) − 1 = ko (G  − T ) + |S| − 1
> |T | + |S| + 1
= |S|

This is a contradiction. Hence Tutte’s condition must be true for G. G  has a 1-factor.
For an even component E of G − S and x, a vertex of E, we have G − (S ∪ {x}).
ko (G − (S ∪ {x})) ≥ ko (G − S) + 1 violating Tutte’s condition. So G − S has no even
components.
Hence a vertex in the odd component of G − S is distinctly matched with a vertex of S
and the 1-factor of G − {x} of the odd components G together make a 1-factor for G. This
completes the proof. 
19.5 Domination 363

Corollary 19.21 Let G = (V , E) be a connected 3-regular graph and having no cut edges.
Then G has a 1-factor.

Proof. Let S ⊆ V and let the odd components of G − S be H1 , H2 , . . . , Ht . Let Hi =


(Vi , E i ), 1 ≤ i ≤ t. Let ki be the number of edges of G having end vertices u i , vi such that
u i ∈ Vi and vi ∈ S. Then we have

ki ≥ 2 as G is 3-regular.

Also

d(v) = 3.|Vi | = 2.|E i | + ki (19.7)
v∈Vi

 
t
d(v) = k|S| ≥ ki + 2 m (19.8)
v∈S i=1

where m is the number of edges in the induced subgraph G[S].


From (19.7) ki = 3|Vi | − 2|E i | ⇒ ki is odd and ki > 2 implies ki ≥ 3.
Now summing over all the t odd components, we get


t 
t
3t ≤ ki ≤ ki + 2 m ≤ 3 S|.
i=1 i=1

So ko (G − S) = t ≤ |S|. By the above theorem G has a perfect matching. 

Remark 19.22 A 3-regular graph with cut edges will not have a perfect matching.

Example 19.23 This graph G is 3-regular, with 16 number of vertices. But G does not have
a 1-factor. (Verify) (Fig. 19.4).

19.5 Domination

Domination in a graph studies about the nature of a subset of the vertex set in relevance to its
neighbours. A vertex v of a graph is said to dominate itself as well as its adjacent vertices.

Definition 19.24 (1) Let G = (V , E) be a graph. A subset S of V is called a dominating


set of G if every vertex in V − S has an adjacent vertex in S. A vertex ‘v’ dominates
itself. 
(2) Every vertex of G is either in S or in the neighbourhood N (S) = N (v) in G.
v∈S
364 19 Independent Sets, Coverings and Matchings

Fig. 19.4 Graphs (6)

G: x

(3) The minimum dominating set of G is said to be the γ -set of G. A γ -set has minimum
cardinality such that it is a dominating set of G.
(4) A minimal dominating set of S of G is one such that there exist no dominating set S 
with S  ⊂ S.
(5) The domination number of a graph G is denoted by γ (G).

Example 19.25 Consider the following Peterson graph (Fig. 19.5).


γ (G) = 3. S = {v1 , v8 , v9 } is a γ -set.
The set S1 = {v6 , v7 , v8 , v9 , v10 } is a minimal dominating set.

The ‘domination in graphs’ was introduced by Ore. The research on this topic has become
important because of its applications. In the following theorem we can see a necessary and
sufficient condition for a set S of a graph G to be a minimal dominating set.

Fig. 19.5 Graphs (7) v1

v6
v5 v2
v10 v7
G:

v9 v8
v4 v3
19.5 Domination 365

Theorem 19.26 Let G = (V , E) be a graph. Let S ⊆ V be a dominating set of G. S is


minimal dominating set if and only if one of the following holds for each vertex d ∈ S:

(i) d is not adjacent to any vertex in S.


(ii) There exists a vertex s ∈ V − S such that d is the only vertex of S adjacent to s.

Proof. If S is minimal, then S − {d} not a dominating set. Hence either d or a vertex s in
the set V − S is not dominated by S − {d}. This covers conditions (i) and (ii) above.
Converse is true and left as an exercise. 

Corollary 19.27 Let G = (V , E) be a graph without isolated vertices. Suppose S is a


minimal dominating set of G. Then V − S is a dominating set of G.

Proof. If V − S is not a dominating set, then a vertex d ∈ S is not adjacent to any vertex in
V − S. This means S − {d} is a dominating set which is a contradiction. 

Exercises

1. Determine the parameters α, β, α  , β  for the following graphs.

(i) K m,n

(ii) Petersen graph

2. Say whether the following are true or fasle with justifications.

(i) Every vertex covering of a graph contains a minimum covering.


(ii) For a bipartite graph G, αβ > |E| where G = (V , E) if and only if G is complete
bipartite.

3. Give an example of a graph that has 2-factor.


4. Find the number of 1-factors of K 2n .
5. Let G be a k-regular, (k − 1)-edge connected graph with even number of vertices. A
graph G  is obtained from G by removing (k − 1)-edges. Then show that G  has a
1-factor.
Graph Coloring
20

In this chapter we introduce the concepts of vertex coloring, edge coloring of graphs. We
can see some bounds on the number of colors used on the vertices or edges. One can see
that main research topic on graph theory was on graph coloring in the last two decades.

20.1 Vertex Coloring

Definition 20.1 (1) Let G = (V , E) be a graph. By k-vertex coloring, we mean that the
vertex set V is partitioned as V1 ∪ V2 ∪ · · · ∪ Vk such that the vertices in Vi are assigned
the same color. Each Vi is non empty independent set and Vi ’s are called the color
classes. That is a function f : V → {1, 2, . . . , k} such that f (v) = i, 1 ≤ i ≤ k will be
the defined color function on V . If the graph G has a k-coloring of its vertices, we say
G is k-vertex-colorable.
(2) The chromatic number of a graph G is the minimum number of independent sub-
sets V1 , V2 , . . . , Vk such that V = V1 ∪ V2 · · · ∪ Vk , Vi ∩ V j = ∅, i  = j, 1 ≤ i, j ≤ k.
Here k is called the chromatic number of G and is denoted by χ (G). Any such partition
will be called as chromatic partition of V .
(3) A k-coloring of a graph means that the graph G used almost k-colors for coloring its
vertices.
(4) If G = (V , E) is a k-chromatic graph i.e., χ(G) = k but χ (G − v) = (k − 1) for every
vertex v ∈ V , then G is said to be a k-critical graph.

Remark 20.2 (1) If every k-coloring of a graph G with no color class is empty, gives rise
to the same partition of the vertex set, then we can say G is uniquely k-colorable.
(2) In the computation of chromatic number, only adjacent vertices are taken into account.
So multiple edges and loops are discarded.

© Ane Books Pvt. Ltd. 2025 367


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_20
368 20 Graph Coloring

Example 20.3 1. χ(K n ) = n


2. χ(K m,n ) =
2
2 if n is even
3. χ(Cn ) = .
3 if n is odd

Theorem 20.4 Let G = (V , E) be a graph such that |V | = n and its independent number
be α(G). Then α(G)
n
≤ χ(G) ≤ n − α(G) + 1

Proof. Let V = V1 ∪ V2 · · · ∪ Vχ(G) be the chromatic partition of V . As Vi ’s are indepen-


dent, |Vi | ≤ α(G), 1 ≤ i ≤ χ(G). Hence
χ(G)

n= |Vi | ≤ α(G).χ(G) (20.1)
i=1

Let S be a maximum independent set of G, so |S| = α(G). Let V − S = V 1 ∪ V 2 · · · ∪ V 


be a partition of V − S with |V i | = 1 ∀ i, 1 ≤ i ≤ ,  = n − α(G). This partition together
with S form a partition of V and there are n − α(G) + 1 independent subsets of V . So we
have

χ(G) ≤ n − α(G) + 1 (20.2)

Combining (20.1) and (20.2) we get the result. 

A proper k-coloring of a graph G is also a proper k-coloring of any of its subgraph H .


So χ(H ) ≤ χ(G). A complete graph K n is also called as a clique of size n. So a clique in
a graph G is a complete subgraph of G. We know that an independent set of G is an empty
induced subgraph in G.
Notation: Let G be graph. A subgraph of G that is a clique of maximum order will be
denoted by ω(G).

Proposition 20.5 Let G = (V , E) be a graph. Then χ (G) ≥ ω(G).

Proof. If ω(G) = m, then G contains K m as a subgraph. So χ (K m ) = m and χ (G) ≥


χ(K m ) = m. 

Example 20.6 Consider W7 (Fig. 20.1).


ω(W7 ) = 3 χ(W7 ) = 3.
For W6 , ω(W6 ) = 3 χ(W6 ) = 4.

Theorem 20.7 Let G = (V , E) be a graph and let G be k-critical. Then δ(G) ≥ k − 1.


20.1 Vertex Coloring 369

Fig. 20.1 W7

W7 :

Proof. Since G = (V , E) is k-critical, we have χ(G − v) = k − 1 for any vertex v ∈ V .


Suppose there exists a vertex v ∈ V such that d(v) < k − 1. Then the (k − 1)-coloring
of G − v can be extended such that G is (k − 1)-colorable. As ‘v’ has less than (k − 1)-
neighbours, one can assign a color to v that is assigned to any of its neighbours of v. So G
is (k − 1) colorable which is not true. 

Remark 20.8 Suppose G is a graph with χ(G) = k and H being a subgraph of G with
minimum number of edges having no isolated vertices. H is a k-critical subgraph of G. So
every k-chromatic graph will contain a k-critical subgraph.

Corollary 20.9 1. Let G = (V , E) be a graph with χ (G) = k. Then G has atleast k ver-
tices of degree minimum (k − 1).
2. For any graph G, χ(G) ≤  + 1.

Theorem 20.10 Let G = (V , E) be a k-critical graph. Suppose S ⊆ V is a vertex cut of


G, then G[S] cannot be a clique.

Proof. Let G = (V , E) be a k-critical graph. Let S ⊆ V be any vertex cut of G. We want to


show G[S] is not a clique. Suppose G[S] is a clique. Let G 1 , G 2 , . . . , G t be the components
of G − S. Let Hi be the induced subgraph of G on V (G i ) ∪ S, 1 ≤ i ≤ t. This Hi will be
a proper subgraph of G and so every Hi is (k − 1) colorable. In particular the vertices of S
will be distinctly colored because S being vertices of K k . So fixing the colors for the vertices
of ‘S’ and coloring V (Hi ) gives a (k − 1)-coloring for Hi , 1 ≤ i ≤ t. This turns out to be
a (k − 1)-coloring of G. This is a contradiction. Hence G[S] cannot be a clique. 
370 20 Graph Coloring

20.2 Brooks’Theorem

It is not difficult to see for any graph G, χ(G) ≤  + 1. If G is an odd cycle, then χ (G) = 3
and if G is K n , χ(K n ) = k = (G) + 1. These two are the only graphs where the bound
(G) + 1 for its chromatic number is achieved. The following theorem by Brooks gives a
better upper bound for the chromatic number.
Theorem 20.11 If G is a connected graph where G  = C2n+1 , K m , then χ (G) ≤ (G).

Proof. Let G = (V , E) be a graph such that G  = C2n+1 , K m . Let the maximum degree in
G be k. Without loss of generality we can take k ≥ 3. [When k = 1, G is a clique, and when
k = 2, G is either an odd cycle or a bipartite graph].
If G is not a regular graph then there is a vertex v in G such that d(v) < k. As G
is connected, one can look for a spanning tree of G from the vertex ‘v’ in an order of
decreasing indices based on the distance from v. Let every such vertex be labelled as
v1 , v2 , . . . , vn−1 , vn , (vn = v).
Also each vi has atmost (k − 1) lower indexed neighbours. Therefore if we color vertices
vi , 1 ≤ i ≤ n − 1, in that order with colors from the set ζ = {1, 2, . . . , } using a least
integer from ζ that has not been used to color any of its adjacent vertices that are assigned
colors so far. Here there is definitely one color available to color vi . As d(vn ) = d(v) < ,
again one color is available for vn = v. So this gives a -coloring for G.

(i) Suppose G is k-regular, clearly k ≥ 3 as G is not an odd cycle.


(ii) Suppose G has a cut vertex ‘v’. Consider the component G in G − v. Let G be the
graph obtained by adding the vertex ‘v’ to G along with the edges connected to ‘v’.
Clearly dG (v) < k and so G can be properly colored with k-colors. By permuting
colors in such a subgraph, one can reach the k-coloring of G such that ‘v’ has the same
color in both G and G .
(iii) Suppose G has a vertex v with vu, vw ∈ E(G), uw ∈ / E(G). Also suppose G − {u, w}
is connected. Then G − {u, w} has a spanning tree and we can name the vertices of
this tree as v3 , v4 , . . . , vn in the non-decreasing order of their distances from v. As in
the above description, each vertex before v will have maximum (k − 1) lower indexed
vertices as their neighbors. Now the vertices u and w are non-adjacent and can be given
same color and vi , 3 ≤ i ≤ n − 1 with the least color from the set {1, 2, . . . , k} that has
not been assigned so far to any of its neighbours. This sequential assignment always
leaves a color for the vertex ‘v’. So G is δ-colorable. (iv) below shows the existence
of two such vertices u, w in G.
(iv) Let G be a 2-connected, k-regular graph. Let v ∈ V (G). If G − v is also 2-connected,
then let v1 = v and v2 be a vertex at a distance two from v1 . This is possible as G is
connected and not a complete graph. If G − v has a cut-vertex, then ‘v’ is adjacent
to a vertex in every subgraph G 1 , G 2 , . . . , G  each of them being a block. Also the
20.3 Planar Graphs Coloring 371

neighbours of v1 , v2 of v lie in two such blocks and they are not adjacent. Algo G −
{v1 , v2 , v} is a connected graph as each block has no cut vertices. So d(v) ≥ 3 implying
that G − {v1 , v2 } is connected.


Remark 20.12 The maximum degree bound on the chromatic number is really poor. For
example, for any bipartite graph it is 2.

20.3 Planar Graphs Coloring

In this section the concept of coloring vertices of a planar graph will be considered. We
know that any planar graph will have a plane embedding. For any plane graph the coloring
of faces can be defined.

Definition 20.13 Let G = (V , E) be a plane graph with F = { f 1 , f 2 , . . . , f t } its faces. Let


F = F1 ∪ F2 ∪ · · · ∪ F be the partition of F. Each set Fi of faces is such that no two faces
in Fi share a common edge on the boundary. Some Fi ’s may be empty. That is faces in Fi are
non adjacent with each other. Now each face ‘ f i ’ can be assigned same color and each Fi get
different coloring. That is a color function f : F → {1, 2, . . . , k} such that f ( f s ) = t for
every f s ∈ Ft , Fi ’s are called as color classes. If the plane graph has k-face coloring, then
it will be called as k-face colorable and the smallest such k will be called as face chromatic
number of G. It is denoted by χ (G).

Example 20.14 Consider the plane graph (Fig. 20.2)


Each face is adjacent to all other faces. So χ (K 4 ) = 4.

The proof of the following propositions are easy to prove and left as an exercise.

Proposition 20.15 1. Let G = (V , E) be a plane graph. G is k-vertex colorable or k-face


colorable if and only if all its components have this property.
2. G is k-vertex colorable or k-face colorable if and only if all its blocks have this property.

Fig. 20.2 Graph (3)


f4
K4 : f1 f3
f2
372 20 Graph Coloring

Proposition 20.16 Every planar graph is k-vertex colorable if and only if every plane graph
is k-face colorable.

Proof. Suppose G = (V , E) is a planar graph that is k-colorable. Let G be a connected


graph that has no cut vertices and cut edges. Suppose G ∗ is the dual of G and G is the
plane graph corresponding to G ∗ . Any two vertices in G are adjacent if and only if the
corresponding faces of G are adjacent. So χ(G) = χ (G).
Conversely let G = (V , E) be a plane graph that is k-face colorable. Let G be connected
and has no cut vertices or cut edges. Let G ∗ be the dual of G. G ∗ is loopless as G has no
cut edges/vertices. Suppose the vertices f 1 , f 2 in G ∗ have multiple edges, then subdivide
these edges except one edge. Replace all such multi edges of G ∗ using substitution. Let the
resultant graph be G . G is a plane graph. Clearly two vertices u, v are adjacent in G, then
the corresponding regions/faces of G are adjacent and conversely. So, χ (G ) = χ (G). G
is k-vertex colorable. 

Remark 20.17 Loops and multiple edges are irrelevant while vertex coloring a plane graph.
So, for face coloring of a plane graph, we can assume that any two faces share atmost one
edge in the common boundary.

Four Color Theorem (FCT)

Every planar graph is 4-colorable.


The proof of the above theorem was given by Appel and Haken (1977). There are some
equivalent coloring concepts like FCT. We have the following one result.

Theorem 20.18 A graph G = (V , E) is 4-colorable if and only if every triangulation of G


is 4-colorable.

Proof. A plane graph G = (V , E) with |V | ≥ 3 is maximally plane if and only if every


face of G is a boundary of a triangle. So every triangulation of a graph is a planar graph. As
every planar graph being a subgraph of a triangulated graph, the result follows. 

Theorem 20.19 The FCT is true if and only if every 3-regular plane graph without cut
edges is 4-face colorable.

Proof. A planar graph is 4-colorable if and only if every plane graph without cut edges is
4-colorable. Every plane graph G with a cut edge ‘e’ and let G be the graph obtained by
contracting e. So χ (G) = χ (G ) where χ (G) is the face chromatic number of G.
Let G be a plane graph without cut edges. Let G be the graph obtained from G as follows:
20.3 Planar Graphs Coloring 373

Fig. 20.3 A situation v

u1 u2

v1 u v2

Case i: If G has a vertex v of degree 2. Let v1 vv2 be the edges at v. Subdivide v1 v and
vv2 by introducing two new vertices u 1 , u 2 . Now let u and w be two new vertices to be
introduced such that edges uu 1 , uu 2 , wu 1 , wu 2 and uw are the new edges to be drawn and
delete the edges vu 1 , vu 2 . See the following part of the graph (Fig. 20.3)
So we can see that we replace ‘v’ by K 4 − e which is a 3-regular maximal planar subgraph.
Let G be the new graph thus modified.
Case ii: Suppose G has a vertex ‘v’ of degree more than 4 i.e., d(v) ≥ 4. Let v1 , v2 , . . . , vs
be the vertices incident at v. Let u 1 , u 2 , . . . , u s be new vertices added to G − v such that
v1 u 1 , v2 u 2 , . . . , vs u s are added as new edges (Fig. 20.4).
So the vertex ‘v’ is replaced by the above way leads to a 3-regular graph G . G will have
no cut edges. Hence G is 4-face colorable.
Now reversing or contracting K 4 − e or the graph part of G modified as in Case (ii) above
we get back G from G . So G is 4-face colorable with maximum 4-colors. 

We state the following theorem whose proof is popular and widely available in the
literature.

Theorem 20.20 Every planar graph is 5-colorable.

Fig. 20.4 A situation u

vs
v1 ...
v2 v3

... us
u1
u2 u3
374 20 Graph Coloring

20.4 Edge Coloring

Definition 20.21 Let G = (V , E) be a graph. A k-edge coloring of G is a partition of the


edge set E as E = E 1 ∪ E 2 ∪ · · · ∪ E k with E i ∩ E j = ∅, i  = j. For if the edges in E are
colored with k-colors {1, 2, . . . , k} (say) such that no two adjacent edges are given same
color. E i ’s are called edge-color classes. If the edges E can be colored with k-colors and k
being minimum, then G is said to be k-edge colorable. Here the number will be called as
edge chromatic number and is denoted by χ (G).

Example 20.22 For

(i) K 5 , χ (G) = 5
(ii) K 3,2 , χ (G) = 3
(iii) C6 , χ (G) = 2.

The following observations follow from definition.


Observations

 G, χ (G) ≥ (G).
1. For any graph
n if n is odd
2. χ (K n ) =
n − 1 if n is even

2 if n is even
3. χ (Cn ) =
3 if n is odd

Theorem 20.23 For a bipartite graph G, χ (G) = (G).

Proof. The proof is by induction on the number of edges of G. Let G = (V , E) be a graph.


For |E| = 1, the result is true. Assume the result to be true for all bipartite graphs with
maximum (s − 1)-edges.
Let G be a graph with s-edges. Let e = uv be an edge of G. Consider G − e has a proper
-coloring. Let this coloring be named as ζ .
Case i: In ζ , there is a color that is not represented at the vertices u and v, then this color
can be used for e and then G has -coloring.
Case ii: Suppose all the  colors are represented either at u or v in G − e. But the degree of
u and v are atmost  − 1 in G − e, there is a color, in ζ that is not represented at u in G − e.
There will be a color for v as well from ζ in G − e. If ‘i’ is one such color not represented
at u, then ‘i’ is represented at v and if ‘i’ is not represented at v then ‘i’ is represented at u
in G − e. Note that u and v lie in different part as G is bipartite graph. But there exist no
u-v path in G in which the colors alternate between i and j. Suppose P is a maximal path in
20.4 Edge Coloring 375

G − e starting from ‘u’ and edges on P being alternately colored with i and j. Swapping the
colors i and j in P, will retain the proper coloring of G − e using -colors. This swapping
makes a color ‘i’ not represented at both u and v. Now color e with i and this yields a proper
-coloring of G. 

For all simple graphs, χ (G) ≥ (G). For example χ (C5 ) = 3. So χ (C5 ) =  + 1.

Theorem 20.24 For any simple graph G = (V , E), (G) ≤ χ (G) ≤ 1 + (G).

Proof. The bound that χ (G) ≥ (G) is directly implied by definition and structure of
G = (V , E).
We now show that χ (G) for G having maximum degree (G) + 1.
Suppose G is not  + 1-edge colorable. But G definitely has a subgraph H = (V , E) that
is  + 1-colorable with maximum number of edges. Choose an edge uv1 ∈ / E and uv1 ∈ E.
Clearly d(u) ≤  and as H is  + 1-colorable, there exists a color ‘c’ not represented at u
in H . The same argument applies to vertex v1 ∈ V and a color c1 is not represented at v1 in
H as in the following part graph of H (Fig. 20.5).
As per the above diagram and argument the color c1 will be represented at u by an edge
uv2 (say). If not uv1 can be given color c1 and hence H + uv1 has one more edge than H
and will have proper  + 1-coloring. Suppose the color c2 is not represented at v2 , then an
edge uv3 can be assigned color c2 and so on. By this we get a set of edges incident at u as
{uv1 , uv2 , . . . , uvk } (say) such that a color ci for 1 ≤ i ≤ k is not represented at vi and so
edge uv j+1 can be assigned color c j , 1 ≤ j ≤ k as seen in the above diagram.
While checking the colors represented at the vertices v1 , v2 , . . . , vk that are adjacent
to u, we notice at some stage ‘s’ 1 ≤ s ≤ k, the color ‘c’ is not represented at vs , then
one can reassign colors c1 , c2 , . . . , cs−1 from uv2 , uv3 , . . . , uvs to uv1 , uv2 , . . . , uvs to
uv1 , uv2 , . . . , uvs−1 and assign color ‘c’ to u s as ‘c’ is not represented at both u and vs .
This systematic checking and shifting fields  + 1- edge coloring of H + uv1 which is a
contradiction to the edge coloring of H . So, we can assume that a color ‘c’ is represented
at each of the vertices v1 , v2 , . . . , vk that are adjacent to u. As d(u) is finite the sequential
checking will terminate. Also there may be an edge e not incident at u with color ck assigned
to ρ or the sequence reaches the assignment of same color c such that c1 = cs ,  < s − 1.

Fig. 20.5 A situation u(c)

v1 (c1 ) ck−1
c1
c2
... (ck )
v2 (c2 )
v3 (c3 )
376 20 Graph Coloring

As the color ck is not represented at u in H , one can reassign the colors as before to get
a  + 1 coloring of H + e which is a contradiction.
If cs = c for  < s − 1, assign colors c1 , c2 , . . . , c to uv1 , uv2 , . . . uv and let uv+1
be not colored. So the subgraph H = (H + uv1 ) − uv+1 and H have the same number of
edges. Consider the subgraph T of H which is either a cycle or a path in which the colors
‘c’ and ‘c ’ alternate. Now the color ‘c’ is represented at every vertex v1 , v2 , . . . , vs and in
particular at v+1 and vs , where as c is not represented at v+1 and vs because we shifted
color c to uv and c = cs is not represented at vs . In this case d(v+1 ) = d(vs ) = 1. Also
the color c is represented at ‘u’ but ‘c’ is not represented. It means d(u) = 1 in the subgraph
T of H which is a path or an even cycle. So the vertices u, v+1 and vs cannot be in the
same component in the cycle or path subgraph T of H that is considered above.
If u, vs+1 are in different component of the subgraph T of H , interchanging the colors c
and c+1 in the components containing v+1 , we get the color ‘c’ not represented at u and
v+1 . So the edge uv+1 can be given color ‘c’. This leads to  + 1-coloring of H + uv+1 .
Identically if u, v+1 are in the same component of T but vs is not, interchanging c and c
in the component containing vs we get  + 1 coloring of H + uvk . So in all possible ways
of coloring leads to  + 1 coloring of H + e, e an edge not in H , which is a contradiction.
So, χ (G) ≤ 1 + (G). 

The above theorem was given by Vizing and Gupta. Vizing also classifies graphs in terms
of edge chromatic number.

Definition 20.25 (i) Let G = (V , E) be a graph. G is called class-I graph if χ (G) = 


and G is called class-II graph if χ (G) =  + 1.
(ii) A graph G = (V , E) is said to be edge-chromatic minimal if χ (G − e) < χ (G) for
every edge e ∈ E.
(iii) A graph G in class-II is said to be class-critical if G − e is in class-I for every edge
e ∈ E(G). It is not easy to determine the class of a given graph as determining edge-
chromatic number of a given graph is an NP-complete problem. It can be seen that
χ (K m,n ) = (K m,n ) and hence any complete bipartite graph belongs to class-I. A
cycles of odd length belong to class-II.

Theorem 20.26 Any regular graph G = (V , E) will be in class-I if and only if G has
1-factor.

Proof. For a k-regular graph G, χ (G) = k or k + 1. If χ (G) = k, then there will be k-


colorings of the vertices of G such that E 1 ∪ E 2 · · · ∪ E k , E i ∩ E j = ∅, is a color partition of
the edges. Hence every vertex v ∈ V is incident with exactly one edge in a set E i , 1 ≤ i ≤ k.
This means each color class E i forms a 1-factor, it is not difficult to show that χ (G) = k.

20.4 Edge Coloring 377

Corollary 20.27 If G = (V , E) is a k-regular graph with |V | being odd, then G belongs


to class-II.

Exercises

1. Determine the vertex-chromatic number, edge-chromatic number and face-chromatic


number of the following graphs.

(i) Peterson graph.


(ii) Cubic graph.
(iii) Tripartite graph.

2. Show that if G is a non empty bipartite graph then G belongs to class-I.


3. Is it true that any complete graph is uniquely colorable? Justify your answer.
4. Let G be a uniquely k-colorable graph. Is it true that G is complete? Justify your answer.
5. Give 2 examples of graph G with

(i) χ (G) = (G)


(ii) χ (G) > (G).

6. Is it true that every planar graph is 5-colorable? Justify your answer.


7. Let G = (V , E) be a graph and let S ⊆ V be an independent set of vertices of G. If G
is k-critical then show that χ(G − S) = χ(G) = 1.
8. A vertex coloring of a graph G = (V , E) is said to be complete if for any two coloring
c1 and c2 in the set of colorings there is a pair of vertices u, v ∈ V such that uv ∈ E and
u is colored with c1 and v is colored with c2 . Give 2 examples of graphs G such that G
has complete colorings.
9. The chromatic index ψ(G) of a graph G is the maximum number k for which G has a
complete k-coloring. Is it true that χ(G) < k < ψ(G)? Justify your answer with some
examples.
Ramsey Numbers and Ramsey Graphs
21

Theodore S. Motzlan, an Israeli-American mathematician commented that complete disorder


is impossible. This also means that any irregular structure if large enough, will definitely
contain some ‘regular’ substructure. Ramsey in 1929, proved some important results in set
theory which gained attention due to their wide applicability. We will see how Ramsey
theorems have graph theory formulations and generalizations. Ramsey theory is also called
as mathematics of coloring.

21.1 Some Basic Theorems on Subsets and Coloring

In the following theorems on a set X , we use the notation Pn (X ) to denote the subsets of X
whose cardinality is always n. The elements of Pn (X ) are said to be colored using a color
set C, we mean that each of the n-element set in P (X ) are assigned a color from C.

Definition 211 Let X be a set and C be a coloring of Pn (X ). For a subset Y of X , if every


element of Pn (X ) get the same color, then the set Y is said to be monochromatic in C
(Fig. 21.1).

Theorem 211 Let n, k be positive integers. Let X be an infinite set and f be a coloring
function that assigns colors from the set C, with |C| = k, to the elements of Pn (X ). Then X
contains an infinite monochromatic subset.

In the case of X being finite, the above theorem can be stated as there definitely exists a
subset of finite cardinality having assigned the same color as seen below.

© Ane Books Pvt. Ltd. 2025 379


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_21
380 21 Ramsey Numbers and Ramsey Graphs

Fig. 21.1 Subset mapping

f R G
Pn (X)
B Y

A Set of colors

Subsets of cardinality n

Theorem 212 Let m, k, s ∈ N+ . If there exists positive integer ‘n’ such that Pm (X ) being
subsets of X with |X | = n, then for any k-coloring of Pm (X ), there exists a monochromatic
subset Y of X with |Y | = s.
The least integer ‘n’ for which Theorem 212 is valid is called the Ramsey number. It is
denoted by R(m, k, s) where m, k, s are the parameters.

The following theorem is a generalization of Theorem 212.

Theorem 213 Let m, k, s1 , s2 , . . . , sk be positive integers. If there exists a least number

n = R(m, k, s1 , s2 , . . . , sk ),

called the Ramsey number with parameters m, k, s1 , s2 , . . . , sk and if C = {c1 , c2 , . . . , ck },


the coloring set for Pm (X ) with |X | = n, then X has a subset Y with |Y | = si , which is
monochromatic with assigned color being ci .

21.2 Ramsey Numbers of Graphs

We first start with a puzzle on friends and strangers in a group.


A group has a set of n people. In this set there will always be either a subset of 3 people
who are mutual friends or a subset of three people who are mutually strangers. Find minimum
such ‘n’. The value of ‘n’ in this puzzle is the Ramsey number.

Definition 212 1. The Ramsey number R(s, t) is the least number n such that any graph
on n vertices contains either an independent of size s or a clique of size t.
2. The Ramsey number Rk (s1 , s2 , . . . , sk ) is the least number ‘n’ such that any coloring of
the complete graph K n with colors {1, 2, . . . , k} contains a clique of size si , in color i
for some i.
21.2 Ramsey Numbers of Graphs 381

Fig. 21.2 A situation v

v1 v2 v3

Example 211 For any graph G = (V , E) with |V | = 6. Show that G must contain either
a K 3 or K 3 .

Solution: This solution gives the solution to the puzzle stated above on friends and strangers.
Hence R(3, 3) = 6.
Let v ∈ V . This vertex ‘v’ must be adjacent to three vertices in G or G by stated conditions
in the puzzle.
Suppose ‘v’ is adjacent to three vertices in G say v1 , v2 , v3 (Fig. 21.2).
If two of these v1 , v2 , v3 are adjacent in G, then G has K 3 . If none of v1 , v2 , v3 are
adjacent in G, then G has K 3 on v1 , v2 , v3 .

Remark 211 For any graph G and its complement G, K n = G ∪ G. By coloring edges of
G with a color ‘red’ and edges of G with color ‘blue’ say, we get a 2-coloring of edges of
K n . The converse is also true.

From the above remark we have the following lemma which can be proved by induction
on number of vertices.

Lemma 211 Let G = (V , E) be a graph with |V | = (s + t)Cs . Then G contains either a


clique of size (s + 1) or an independent size of (t + 1).

We have the following simple observations on Ramsey numbers.

(i) R(s, t) = R(t, s) as the two colors on the edges can be swapped.
(ii) R(s, 1) = 1, as K 1 has no edges. Any one color on K 1 contains a clique in that color.
(iii) R(s, 2) = s. If G contains a complete graph K s with ‘red’ colored edges, then the
result is true. If one of its edges is colored with ‘blue’ then G contains a K 2 with ‘blue’
color.

It is not easy to compute the values of Ramsey numbers. For some small numbers,
3 ≤ s ≤ 6, 3 ≤ t ≤ 7, Ramsey numbers R(s, t) are given in Table 21.1. In the table ? implies
only upper and lower bounds are known.
382 21 Ramsey Numbers and Ramsey Graphs

Table 21.1 Upper and lower bounds


s 3 4 5 6
t
3 6 9 14 18
4 9 18 25 ?
5 14 25 ? ?
6 18 ? ? ?
7 23 ? ? ?

Fig. 21.3 R(3, 4) = 9


b
b b
b
b
b b b
b
b b
b

Example 212 R(3, 4) = 9.

Solution: We can first show that R(3, 4) ≥ 9. The argument is based on coloring the edges
of K 8 with ‘red’ and ‘blue’ colors (Fig. 21.3).
G is the graph of K 8 in which all the edges are given ‘blue’ color. G is the complement
subgraph of G in K 8 whose edges are colored with ‘red’. So K 8 has colored edges and does
not contain a clique of size 4 or an independent set of size 3.
Now we have to show R(3, 4) ≤ 9. For this consider K 9 and color its edges with ‘red’
and ‘blue’.
There cannot be a 5-regular subgraph of K 9 whose edges are completely red. This is due
to the fact that in any graph, number of odd degree vertices must be even. Then there cannot
be a 3-regular subgraph of K 9 all whose edges are ‘blue’, as seen below for any vertex v of
K 9 (Fig. 21.4).
So K 9 , whose edges are 2-colored, must have a vertex ‘v’, with 6-edges incident with v
are given ‘red’ color or 4-edges are given ‘blue’ color (Fig. 21.5).
These six red edges that are incident to six other vertices other than v must induce a
monochromatic K 3 as R(3, 3) = 6. If such an induced K 3 is ‘red’ in color then we have the
required clique. If this K 3 is ‘blue’ then its connecting edges with ‘v’ must induce a K 4 in
color ‘blue’. So we have the result.
21.3 Ramsey Theorem 383

Fig. 21.4 A situation


r
v r
b r
r
b b r

Fig. 21.5 A situation


r
b v r
b
r
r r r

The case with the edges incident at ‘v’, four of them being colored ‘blue’ and four of
them colored ‘red’ can be argued identically. Hence R(3, 4) = 9.

21.3 Ramsey Theorem

We now have Ramsey theorem for 2-colored graphs.

Theorem 214 Let s, t ∈ N. There exists a natural number n such that any 2-colored com-
plete graph on n vertices must contain a monochromatic K s or K t . Here ‘n’ is the least
number and R(s, t) = n.

Proof We know that R(s, 2) = R(2, s) = s and R(1, t) = R(t, 1) = 1. The existence of
R(s, t) comes from the fact that R(s, t) being bounded. We now show R(s, t) is bounded.
The proof is given by using method of induction on the number of vertices of the graph
K s+t .
Since the bounds is true for some base values, let us assume the result to be true for
R(s − 1, t) and R(s, t − 1) that they exist.
We now claim that R(s, t) ≤ R(s − 1, t) + R(s, t − 1).
Let n = R(s − 1, t) + R(s, t − 1) and consider edges of K n being colored with colors
red and blue. Let v be a vertex in K n . Let Rv and Bv be two sets such that
384 21 Ramsey Numbers and Ramsey Graphs

Rv = {u | uv ∈ E(K n ) and uv is colored red}


Bv = {u  | u  v ∈ E(K n ) and u  v is colored blue}

Clearly |Rv | + |Bv | = n − 1. Also if |Rv | < R(s − 1, t) and |Bv | < R(s, t − 1), then

|Rv | + |Bv | < R(s − 1, t) + R(s, t − 1)


<n
⇒ |Rv | + |Bv | ≤ n − 2

which is not true. So either |Rv | ≥ R(s − 1, t) or |Bv | ≥ R(s, t − 1).

Case (i): If |Bv | ≥ R(s, t − 1) and Bv inducing a complete ‘red’ colored subgraph K s , then
we are done. If Bv induces a complete ‘blue’ colored subgraph K t−1 , then Bv ∪ {v} must
induce a blue colored K t . Actually each vu  is blue for all u  ∈ Bv . So Bv ∪ {v} induces a
‘blue’ colored K t if Bv has ‘blue’ colored K t−1 being induced by it.

Case (ii): The argument for Rv is identical to case (i).


So we have seen that a 2-colored complete graph on ‘n’ must contain a ‘red’ K s or blue
K t and hence R(s, t) (< n) is bounded.

Remark 212 When K n is a complete graph whose vertex set n is countably infinite, every
two colored K n must contain K s , a countably infinite monochromatic complete subgraph.
This is known as the infinite case of Ramsey theorem for two colors.

21.4 Bounds on Ramsey Numbers

The bounds of Ramsey number are not easy to determine. However in many cases, the
lower bound for some Ramsey number R(s, t) is found using 2-coloring of K n containing
a monochromatic subgraph K s or K t in all possible coloring so R(s, t) > n. Some bounds
are determined using some combinatorial method. The following theorem is already proved
in Sect. 21.3.

Theorem 215 R(s, t) ≤ R(s − 1, t) + R(s, t − 1) for s, t ≥ 2. Also we have a direct upper
bound on R(s, t).

Theorem 216 R(s, t) ≤ (s + t − 2)Cs−1 for s, t ≥ 2.

Proof The proof is given using double induction on s, t as the inequality involves both the
integers s, t.
Base case will be for r = 2, s = 2.
21.4 Bounds on Ramsey Numbers 385

So R(2, 2) ≤ 2 is true.
Let the bound be true for R(s − 1, t) and R(s, t − 1).
We know from the previous theorem that

R(s, t) ≤ R(s − 1, t) + R(s, t − 1)


≤ ((s − 1) + t − 2)C(s−1)−1 + (s + (t − 1) − 2)Cs−1
= (s + t − 3)Cs−2 + (s + t − 3)Cs−1
= (s + t − 2)Cs−1 [using Pascal’s rule:
nCk + nCk+1 = (n + 1)C(k+1) ]

Hence the theorem.

Remark 213 When s = t, we have

R(s, s) ≤ (2 s − 2)Cs−1
= 2(s − 1)Cs−1 .

Regarding the lower bound, we have the following special case theorem where s = t.

Theorem 217 For an integer n with nCs < 2sC2 −1 , we have R(s, s) > 2(s/2) .

Proof To find R(s, s) with R(s, s) > n, we consider a 2-coloring of K n such that edges
of K n are colored randomly with red or blue. We need to show that in all possibility, the
2-colored K n neither contains a blue colored K s or red colored K s .
Let S be the set of s vertices of K n such that the corresponding K s being its induced
subgraph. Also if χ S is the set of 2-colorings of K n where the induced subgraph K s is
either completely blue or red. This means there are 2nC2 −sC2 ways to color the remaining
(nC2 − sC2 ) edges of K n by χ S . Hence

|χ S | = 2.2(nC2 −sC2 ) (21.1)

For every possible subset ‘S’ of vertices of K n . Consider


 
  
 
 χ S  .

 S:|S|=s 

This union is the set all possible s-subset vertices of K n satisfying the monochromatic
condition. So,
386 21 Ramsey Numbers and Ramsey Graphs

 
   
 
 χ 
S ≤ |χ S |

 S:|S|=s  S:|S|=s

= 2.2(nC2 −sC2 ) (using (21.1))
S:|S|=s

= nCs .2.2(nC2 −sC2 ) (21.2)

Actually the number of all possible 2-coloring of K n is 2(nC2 ) .


But by the condition given in the theorem,

nCs < 2sC2 −1


⇒ nCs .2.2(nC2 −sC2 ) < 2sC2 .2(nC2 −sC2 )
= 2nC2

This means for the choice of ‘n’ there exists a 2-coloring of K n containing neither a
‘blue’ colored K s or red colored K s . Hence R(s, s) > n.

We have seen in Table 21.1 some known Ramsey numbers. The table also contains some
‘?’ marks. For some of these entries we know from the literature the lower and upper bounds
of Ramsey numbers. We list some Ramsey number ranges in the Table 21.2.
Exercises

1. Let r1 , r2 , r3 , . . . be a sequence of distinct real numbers. Prove that it contains a mono-


tonic subsequence.
2. Show that in a group of n students, n > 2, there exists atleast a set of 2 people who have
the same number of friends.

Table 21.2 Ramsey number ranges


s t R(s, t)
3 10 [40, 42]
3 11 [46, 51]
4 6 [35, 41]
4 7 [49, 61]
5 5 [43, 48]
5 6 [58, 87]
6 6 [102, 165]
6 7 [113, 298]
7 7 [205, 540]
21.4 Bounds on Ramsey Numbers 387

3. Consider all points (x, y) on a x-y plane such that both x, y are integers. By assigning
colors red or blue to these points, show that there exists a rectangle all of whose corners
have the same color.
4. Show that for any r ≥ 2, there exists an integer n ≥ 3 such that for any r -coloring of
the set {1, 2, . . . , n}, there always exists three numbers n 1 , n 2 , n 3 having the same color
such that n 1 + n 2 = n 3 .
5. Find (i) R(4, 4) and (ii) R(5, 5).
6. Show that R(s, t) = R(t, s).
7. Find a tight upper bound for R(3, s).
Spectral Properties of Graphs
22

Linear algebra is widely applied to several practical problems. Matrices, vector spaces,
play vital role in the understanding of structural properties of graphs. Even today algebraic
method to solve graph theory problem is a highly interesting topic. This area of graph theory
is fitted under the title ‘special graph theory’. We will see some concepts and techniques of
relating matrices to graphs. The reader is expected to have only very basic knowledge of
linear algebra to understand the approach.

22.1 Basics of Spectral Graph Theory

Let G = (V , E) be a graph such that V = {v1 , v2 , . . . , vn } and E = {vi v j /1 ≤ i, j ≤ n}.


The definitions of adjacency matrix A G and incidence matrix IG of G have been defined
in Chap. 2.
The matrix A G is always symmetric and trace of A G is zero. The matrix A G is formed
for an arbitrary labelling/arrangement of vertices in V . So the primary interest will be to see
for those properties of A G that are invariant under any permutation of vertices.
The entries of A G are 0 and 1. In case we apply the linear algebra theory, the field of
reference will be {0, 1}.
Suppose G = (V , E) is a graph and the vertices in V are ordered. Let A G be the cor-
responding adjacency matrix. Let D be a {0, 1} matrix that represents the reordering of
vertices or permutation of vertices in G. Then the new adjacency matrix A G (say) can be
obtained from this reordering and it will be D A G D −1 . Because of this relation, we can
ignore the mention on ordering of vertices and simply consider the adjacency matrix for
discussions.

© Ane Books Pvt. Ltd. 2025 389


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_22
390 22 Spectral Properties of Graphs

Fig. 22.1 Graph (1)


v1 e1 v2

G: e3 e2

v4 e4 v3

Example 22.1 Consider the graph (Fig. 22.1).

v1 v2 v3 v4 v1 v2 v3 v4
⎡ ⎤ ⎡ ⎤
v1 0 1 1 1 e1 1 1 0 0
⎢ 0⎥ ⎢ 0⎥
A G = v2 ⎢ 1 0 0 ⎥ I G = e2 ⎢ 1 0 1 ⎥
v3 ⎣ 1 0 0 1⎦ e3 ⎣ 1 0 0 1⎦
v4 1 0 1 0 e4 0 0 1 1

Clearly A G is a symmetric matrix. All the entries on the diagonal are ‘0’.

Proposition 22.2 Let G = (V , E) be a graph. Let A G be its adjacency matrix. Then (AkG )i j
gives the number of k-length paths between vertices vi v j . 

Proof When k = 0, 1, the result is true. We use induction technique to complete the proof.
Assume the result to be true for (AkG )i j .
Consider

(Ak+1
G )i j = A G · A G
k


n
= (AkG )it et j (22.1)
t=1

Here et j = 1 if there is an edge between vt and v j , otherwise et j = 0. (AkG )it gives the
number of k-length paths beween vi and vt . Hence (22.1) enumerates all paths of length
(k + 1). 

Corollary 22.3 G is a connected graph if and only if (A + I )m−1 has no zero entry on all
its non-diagonal positions. Here m denotes the number of vertices of G.
22.1 Basics of Spectral Graph Theory 391

Suppose λ is an eigen value of the adjacency matrix A G , λ will be real because A G is


symmetric. Also the multiplicity of λ will be the dimension of the space of eigen vectors
of λ.
The eigen values are determined from the equation |A − λI | = 0 or det(A − λI ) = 0
where |A − λI | or det(A − λI ) denotes the determinant of A − λI .

Definition 22.4 The spectrum of a graph G is the set of eigenvalues of A G including their
multiplicities. That is if the distinct eigen values of A G are λ1 > λ2 > · · · > λt and m i (λi )
denote the multiplicity of λ , 1 ≤ i ≤ t. Then spectrum of G is denoted as Spec(A G ) and
is
λ1 λ2 λ3 · · · λt
Spec(A G ) =
m 1 (λ1 ) m 2 (λ2 ) m 3 (λ3 ) · · · m t (λt )

Example 22.5 Let




0111
⎜1 0 1 0 ⎟
AG = ⎜ ⎟
⎝ 1 1 0 1⎠
1010
 √ √ 
− 17+1 −1 0 17+1
Spec(A G ) = 2 2
1 1 1 1
See Fig. 22.2.

Definition 22.6 The characteristic polynomial of a graph G = (V , E) is nothing but the


characteristic polynomial of its adjacency matrix A G with some labeling of its vertices in
V . This polynomial is denoted by χ(G : λ).
So,

χ(G : λ) = |A − λI | or det(A − λI )

n
= (−1)i ci λn−i
i=0

Fig. 22.2 Graphs (2) 1 2

G:

4 3
392 22 Spectral Properties of Graphs

(i) The roots of the characteristic polynomial are the eigen values of the graph G.
(ii)

χ(G : λ) = |A − λI | = |P(A − λI )P −1 |
= |P A P −1 − λI |

for some permutation matrix P.

So, the characteristic polynomial χ(G : λ) is independent of the labelling of vertices.


If we expand χ(G : λ),

χ(G : λ) = c0 λn − c1 λn−1 + c2 λn−2 + · · · + (−1)n cn

Here c1 is the coefficient representing sum of zeros of the polynomial, which is sum
of its eigen values. This is also the trace of the matrix A G . So c1 = 0. From the theory of
matrices, we know that all the coefficients can be expressed in terms of principle minors of
the adjacency matrix A G . Hence we have the following theorem.

Theorem 22.7 For a graph G = (V , E), the coefficients of χ (G : λ) satisfy the following.

(i) c1 = 0.
(ii) −c2 is the number of edges in G.
(iii) −c3 is twice the number of three cycles in G.

Let G = (V , E) be a graph and A G be its adjacency matrix. Polynomial that are formed
using A0G , A1G , A2G , . . . , AnG with coefficients either from R or C.

Definition 22.8 The adjacency algebra AG of a graph G comprises of polynomial in powers


of A G with coefficients either from R or C.
Clearly every element of AG is a linear combination of A0G , A1G , . . . , AnG . Earlier we had
a theorem for the count of walks from a vertex vi to a vertex v j in a graph G. We have the
next proposition, which mentions about the dimension of adjacency algebra of a connected
graph G.

Proposition 22.9 Let G = (V , E) be a connected graph and let AG be its adjacency alge-
bra and ‘d’ be its diameter. Then dimension of AG is atleast d + 1.

Proof Let u and v be two vertices such that d(u, v) = d and suppose

u = u 1 , u 2 , . . . , u d+1 = v
22.1 Basics of Spectral Graph Theory 393

is a walk of length d. Consider the vertex u i and the walk u = u 1 , u 2 , . . . , u i is of length


i − 1 and there is no shorter walk from u = u 1 to u i . This means AiG will have a non
zero entry at this position and Ai−1 i−2
G , A G , . . . , A G , I will have zero at this position. This
means AiG is not linearly dependent on Ai−1 i−2
G , A G , . . . , A G , I . This argument is true for
each i, 1 ≤ i ≤ d. This means {I , A G , A2G , . . . , AdG } are linearly independent in AG . So the
dimension of AG is d + 1. 

Corollary 22.10 Let G be a connected graph with diameter ‘d’. Then A G will have atleast
(d + 1) distinct eigen values.

Let us see the spectrum of some special graphs.

Theorem 22.11 Let G = (V , E) be a k-regular graph with |V | = n. Then every eigen value
λ of A G is such that |λ| ≤ k.

Proof Let λ be an eigen value of A G and x be the corresponding eigen vector. Then A G x =
λx, x  = 0. Let x = (x1 , x2 , . . . , xn )T and let xi be the largest positive entry in the eigen
vector x. Let u 1 , u 2 , . . . , u k be the vertices adjacent to the vertex vi in G. Consider the inner
product of ith row of A G with the vector x. We get

x j1 + x j2 + · · · + x jk = λxi
⇒ |λ||xi | = |λxi |
= |x j1 + x j2 + · · · + x jk |
≤ k|xi |
⇒ |λ| ≤ k.

Corollary 22.12 Let G = (V , E) be any graph. Then |λ| ≤ (G) where λ is an eigen value
of A G .

Definition 22.13 A linear subgraph of a graph G is a subgraph of G whose components


are single edges (K 2 ) or cycles (Cn , n ≥ 3).

We state the following theorem without proof. This theorem evaluates the value of the
determinant of the adjacency matrix using linear subgraphs.

Theorem 22.14 Let G = (V , E) be a graph. For the adjacency matrix A G ,



det(A G ) = (−1)e(H ) 2c(H )
394 22 Spectral Properties of Graphs

2 3

G1 : G2 : 1
4

Fig. 22.3 Graphs (3)

where the summation is taken over all linear subgraphs H of G. Here e(H ) is the number
of even components and c(H ) the number of cycles of H .

Example 22.15 Consider the following two graphs (Fig. 22.3).


⎡ ⎤
01010
⎢1 0 1 0 0 ⎥
⎢ ⎥
⎢ ⎥
A G 1 = ⎢0 1 0 1 0 ⎥
⎢ ⎥
⎣1 0 1 0 0 ⎦
00000

⎡ ⎤
0 1 1 1 1
⎢1 0⎥
⎢ 0 0 0 ⎥
⎢ ⎥
AG 2 = ⎢1 0 0 0 0⎥
⎢ ⎥
⎣1 0 0 0 0⎦
1 0 0 0 0

Characteristic polynomial of A G 1 and A G 2 will be the same and it is λ5 − 4λ3 . Hence


G 1 and G 2 have same eigen values.

From the above example one can see that the spectrum does not characterize the structure
of a graph. We can use the concept only for understanding other invariant parameters of a
graph.

Definition 22.16 Two graphs that have the same characteristic polynomial are said to be
cospectral graphs.

Finding a family of graphs having the same characteristic polynomial is in general a very
hard problem.
22.2 Laplacian Matrix of Graphs 395

22.2 Laplacian Matrix of Graphs

We will define another type of matrix associated with a graph G known as Laplacian matrix
L(G). This matrix is directly related to the already defined adjacency matrix A G and the
degrees of the vertices of the graph G.

Definition 22.17 Let G = (V , E) be a simple graph. Consider the matrix L for G and it
will be a matrix such that ⎧

⎨d(vi ) if vi = v j

L i j = −1 if vi v j ∈ E


⎩0 otherwise
for 1 ≤ i, j ≤ n, V = {v1 , v2 , . . . , vn }.
Consider the diagonal matrix D

d(vi ) if vi = v j
Di j =
0 if vi  = v j

for 1 ≤ i, j ≤ n.
The Laplacian matrix L defined above can be seen as

L = D − AG .

Example 22.18 1. Consider the graph G (Fig. 22.4).


Its Laplacian is given below:

1 2 3 4 5
⎡ ⎤
1 2 −1 0 0 −1
2⎢
⎢−1 4 −1 −1 −1⎥

L = 3⎢ 0 −1 2 −1 0⎥
⎢ ⎥
4⎣ 0 −1 −1 3 −1⎦
5 −1 −1 0 −1 3

Fig. 22.4 Graphs (4-1) 1 2

G: 3

5 4
396 22 Spectral Properties of Graphs

Fig. 22.5 P5
v1 v2 v3 v4 v5
P5 :

2. Consider the path graph (Fig. 22.5).

v1 v2 v3 v4 v5
⎡ ⎤
v1 1 −1 0 0 0
v2 ⎢
⎢−1 2 −1 0 0⎥ ⎥
L(P5 ) = v3 ⎢ 0 −1 2 −1 0⎥
⎢ ⎥
v4 ⎣ 0 0 −1 2 −1⎦
v5 0 0 0 −1 1

3. Consider the complete graph K 4 (Fig. 22.6).


⎡ ⎤
3 −1 −1 −1
⎢−1 3 −1 −1⎥
L(K 4 ) = ⎢
⎣−1

−1 3 −1⎦
−1 −1 −1 3

4. Consider the cycle C5 (Fig. 22.7).:


⎡ ⎤
2 −1 0 0 −1
⎢−1 −1 0⎥
⎢ 2 0 ⎥
⎢ ⎥
L(C5 ) = ⎢ 0 −1 2 −1 0⎥
⎢ ⎥
⎣0 0 −1 2 −1⎦
−1 0 0 −1 2

In all the above examples one can see that all the Laplacian matrices are real symmetric.
We will now see some basic properties. Since the eigen values of real symmetric matrix are
real, any Laplacian matrix will have all its eigen values real.

Fig. 22.6 K 4
v1 v2

K4 :

v4 v3
22.2 Laplacian Matrix of Graphs 397

Fig. 22.7 C5
v1

v5 v2

v4 v3

Definition 22.19 Let M be a n × n real matrix. M is called positive semi definite if

x T M x ≥ 0 for all x ∈ Rn .

Now for a Laplacian matrix L(G) of a graph, x T L(G)x ≥ 0. For any edge e = uv ∈ E
of G = (V , E), we have,

x T L e x = (x u − x v )2 , ∀ x ∈ Rn

where ⎧

⎪ if i = j, i = u, v
⎨1
Le = −1 if i = u, j = v


⎩0 otherwise
Since 
x T L(G)x = x T L e x ≥ 0, we have.
e=uv∈E

Theorem 22.20 Let G = (V , E) be any graph. Then the Laplacian L(G) is symmetric
positive semi definite.

Lemma 22.21 The Laplacian of the complete graph K n has the eigen value ‘0’ and eigen
value ‘n’ occurring (n − 1)-times.

Proof For any graph G, λ = 0 is an eigen value of L(G). Consider x = (1, 1, . . . , 1) ∈ Rn


and L(G)x. L(G) is a matrix with row sum zero and column sum zero. Hence L(G)x will
be a zero matrix. So ‘0’ is an eigen value of L(K n ).
The Laplacian matrix L(K n ) has entries

−1 if i  = j
ai j =
n − 1 if i = j.

L(K n ) has no entries with ‘0’.


398 22 Spectral Properties of Graphs

Consider the matrix


L(K n ) − n I = M.
This M matrix has all its entries as ‘−1’, M is not invertible and has rank 1. So ‘n’ must
be an eigen value of L(K n ) and nullity of M must be (n − 1). So the eigen value ‘n’ has
multiplicity (n − 1). 

Lemma 22.22 Let G = (V , E) be a graph and let λ1 , λ2 , . . . , λn be the eigen values of the
Laplacian matrix L(G) such that

0 = λ1 ≤ λ2 ≤ · · · ≤ λn .

Then G is connected if and only if λ2  = 0.

Proof Suppose G is disconnected. Then there are atleast two components in G and G is the
union of such components. Let G 1 , G 2 be the components of G. Then the Laplacian of G
can be put in the following term.
 
L(G 1 ) 0
L(G) =
0 L(G 2 )

So, the orthogonal eigen vectors of λ1 = 0 are (1, 0)T and (0, 1)T which are linearly inde-
pendent. Hence the multiplicity of λ = 0 > 1.
Conversely let x be an eigen vector of λ1 = 0 of the matrix L(G) and, let G be connected.
Then, L(G)x = 0. 
⇒ x T L(G)x = (x u − x v )2 = 0.
e=uv∈E

This means x u = x v for e = uv ∈ E. As G is connected, every pair of vertices u, v are


connected by a path, x u = x v is true for any two vertices u, v. This means x is a constant
vector. So the eigen space of the eigen value λ1 = 0 is 1. 

The eigen values of star graphs and path graphs are as below.

(i) The star graph Sn on n-vertices has eigen value 0 with multiplicity 1, eigen value 1 with
multiplicity (n − 2) and eigen value n with multiplicity 1.
(ii) The Laplacian matrix of Cn has eigen values

2π k
2 − 2 cos
n

The eigen values of L(Pn ) are same as the eigen values of L(C2n ).
22.2 Laplacian Matrix of Graphs 399

We know what a spanning tree of a graph is. We also saw the definition of a Laplacian
matrix of a graph. We now state matrix-tree theorem which gives a nice connection between
graph theory and matrix theory. The matrix-tree theorem is an important theorem in many
ways. The theorem simply modifies the given Laplacian matrix L of a graph G by eliminating
a row i and column i from L to form a new matrix L̂ i (say). The number of spanning trees of
G is simply the value of det( L̂ i ). Here the vertices of G are assumed to be distinguishable
and hence det( L̂ i ) counts some isomorphic spanning trees also.

Example 22.23 Consider the graph (Fig. 22.8).


⎡ ⎤
2 −1 −1 0
⎢−1 3 −1 −1⎥
L=⎢
⎣−1

−1 2 0⎦
0 −1 0 1

The spanning trees of G are Fig. 22.9.

Fig. 22.8 Graph (5)


v u

G:

w x
Fig. 22.9 Spanning trees
v u v u

w x w x

w x

v u
400 22 Spectral Properties of Graphs

Now let
⎡ ⎤
3 −1 −1
L̂ 1 = ⎣−1 2 0 ⎦
−1 0 1

Hence the count on the number of spanning trees of G is 3.

Remark 22.24 The calculation of det( L̂ j ) that gives the number of spanning trees is inde-
pendent of the choice of ‘ j’. i.e., any vertex of G occurring in L can be choosen.

Example 22.25 Consider K 4 and


⎡ ⎤
3 −1 −1 −1
⎢−1 3 −1 −1⎥
L(K 4 ) = ⎢
⎣−1

−1 3 −1⎦
−1 −1 −1 3

Number of spanning trees of K 4 are 16.


⎡ ⎤
3 −1 −1
det( L̂ 3 ) = ⎣−1 3 −1⎦
−1 −1 3
= 16.

We state the Matrix-Tree Theorem without proving it. The proof can be seen in D.B.
West.

Theorem 22.26 Let G = (V , E) be a graph and let L be its Laplacian. The number of
spanning trees n T contained in G is given by the following method.
Choose a vertex vi and eliminate the ith row, ith column from L and the determinant
value of the resultant matrix will be n T .

22.3 Eigen Values and Eigen Vectors of Graphs

We have seen two types of matrices associated with any simple undirected graphs. They
are adjacency matrix and Laplacian matrix. We had a brief and basic ideas discussed in the
previous two sections. In this section we can see more concepts on eigen values and eigen
vectors of these two matrices.
Note that both adjacency matrix and Laplacian matrix are real and symmetric. In these
matrices, there will be an orthoganal basis comprising of the eigen vectors. Note that the
22.3 Eigen Values and Eigen Vectors of Graphs 401

Fig. 22.10 Graph (7) v1 v2

G: v3

v5 v4

eigen values are counted along with their multiplicities. Both A and L of G are n × n matrices
where n is the number of vertices of the graph G. For further discussion and understanding
let us use the following notation.
Let λ1 ≤ λ2 ≤ · · · ≤ λn be the arrangement of eigen values of the adjacency matrix
and let λn 1 ≤ λn−1 ≤ · · · ≤ λ1 be the arrangement of eigen values of L(G). Also note that
A + L = d I where 
d d = deg(vi ) if i = j
D=
0 otherwise.
Hence we see that λk λk = d for regular graphs.

Example 22.27 Consider the graph (Fig. 22.10).


⎡ ⎤
010 0 1
⎢1 0 1 0⎥
⎢ 1 ⎥
⎢ ⎥
A G = ⎢0 1 0 1 0⎥
⎢ ⎥
⎣0 1 1 0 1⎦
100 1 0

⎡ ⎤
2 −1 0 0 −1
⎢−1 −1 −1 0⎥
⎢ 3 ⎥
⎢ ⎥
L(G) = ⎢ 0 −1 2 −1 0⎥
⎢ ⎥
⎣0 −1 −1 3 −1⎦
−1 0 0 −1 2

⎡ ⎤
2 0 0 0 0
⎢0 0⎥
⎢ 3 0 0 ⎥
⎢ ⎥
A G + L(G) = ⎢0 0 2 0 0⎥
⎢ ⎥
⎣0 0 0 3 0⎦
0 0 0 0 2
402 22 Spectral Properties of Graphs

Fig. 22.11 Graphs (8)

G1 :

G2 :

Eigen values are of A G are

−2, −1.170, 0, 0.689, 2.481

Eigen values of L(G) are

4.618, 3.618, 2.382, 1.382, 0.

Example 22.28 Consider the following graphs (Fig. 22.11).


Clearly G 1 and G 2 are not isomorphic. The characteric polynomial of G 1 is

χ(G 1 : λ) = λ6 − 7λ4 − 4λ3 + 7λ2 + 4t − 1

One can check that the characteric polynomial of G 2 is also same as that of G 1 . Hence G 1
and G 2 are cospectral graphs.

Exercises

1. Does there exist two trees that are cospectral? Justify your answer.
2. Find two cospectral regular connected graphs.
3. If G is a connected graph that has 4 distinct eigen values, then show that diam(G) ≤ 3.
4. Find the spectrum of the following graphs (Fig. 22.12).
5. Consider the graph (Fig. 22.13).
Find the characteristic polynomial of G. Is it same as the product of characteristic
polynomials of the two components of G? Justify your answer.
22.3 Eigen Values and Eigen Vectors of Graphs 403

Fig. 22.12 Graphs (4)

(i)

(iii)

(ii) (iv)

Fig. 22.13 Graphs (5)

G:

6. Let G = (V , E) be a graph and let



v∈V deg(v)
ave(G) =
n
where |V | = n. Then show that

ave(G) ≤ λ(G) ≤ (G)

where λ(G) is the largest eigen value.


7. Find the largest eigen values of K n and K m,n .
8. Let G = K m,n , a complete bipartite graph. Show that it has exactly one positive eigen
value.
404 22 Spectral Properties of Graphs

Fig. 22.14 Graphs (10)

(i)

(ii)

(iii)

Fig. 22.15 Graphs (11) u

y v

x w
(i)

b u

a v

z w

y x

9. Is the statement in question 8 true for any complete t-partite graph? Justify your answer.
10. Find the value of determinant of A G of the following graphs (Fig. 22.14).
11. Find the number of spanning trees of the following graphs (Fig. 22.15).
Directed Graphs and Graph Algorithms
23

23.1 Directed Graphs

Definition 23.1 A directed graph or digraph D is a pair (V , E)  where V is a finite non empty
set of vertices and E = {e = (u, v)|u, v ∈ V , u  = v}. Here (u, v)  = (v, u) ∀ u, v ∈ V . The
elements of E are called as directed edges or arcs. For (u, v) ∈ E,  u will be called as the
initial vertex or tail vertex and v will be called as terminal vertex or head vertex. The edge
e = (u, v) is understood as an arc from u to v.

Remark 23.2 A digraph can be drawn as a diagram with the vertices being represented as
‘dots’ and edges being represented as ‘arrows’ to indicate the head and tail vertices.

Example 23.3 Consider

D = ({u, v, w, x}, {(u, v), (v, w), (w, x), (x, u), (u, x)})

The digraph diagram will be as in Fig. 23.1.

Fig. 23.1 Digraph

Note that we often refer the diagram of a digraph as the digraph itself. We have the
following definitions of a digraph which are similar to those of graphs.

© Ane Books Pvt. Ltd. 2025 405


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1_23
406 23 Directed Graphs and Graph Algorithms

 be a digraph.
Definition 23.4 Let D = (V , E)

(1) The indegree of a vertex v ∈ V in D is the number of arcs that have vertex ‘v’ as their
head or terminal vertex. It is denoted by d − (v). Outdegree of a vertex v ∈ V denoted
as d + (v) will be the number of arcs that have the vertex ‘v’ as their tail.
(2) A directed walk in a digraph D will be a sequence of alternating vertices and arcs
w  1 ≤ j ≤ t. Note that
 : v0 , e1 , v1 , e2 , . . . , et , vt such that vi ∈ V , 0 ≤ i ≤ t, e j ∈ E,
the arc e j will be an arc with v j−1 as its tail and v j as its head, for 1 ≤ j ≤ t. We can
simply write w  as a directed walk from v0 to vt . w  will be a closed walk when v0 = vt .
(3) A directed path P is a directed walk with all its vertices are distinct. A directed cycle
is a non trivial closed directed walk having head and tail being the same.
(4) A digraph in which (u, v) ∈ E for every u, v ∈ V is said to be strongly connected.
That is there is a directed walk between every pair of vertices. It is said to be weakly
connected if the underlying graph is connected. If the underlying graph is disconnected,
then the digraph is disconnected.
(5) A component of a digraph is said to be a strong component if it is a maximal strongly
connected component (or subgraph) of D.
(6) A digraph D is said to be acyclic if it has no directed cycle.

Example 23.5 w : v1 e1 v2 e5 v4 is a walk.


There is no walk from v3 to v1 .
There is no closed walk in D.
The graph D is weakly connected.
D has no strong component (Fig. 23.2).

Fig. 23.2 Graphs (2)

We state a few basic results which are not difficult to prove.


Theorem 23.6 1. For any digraph D = (V , E)
 
d + (v) = d − (v)
v∈V v∈V
23.2 Minimal Connector Problem 407

2. If the digraph D has a directed walk from a vertex v to a vertex u then D has a directed
path from v to u.
3. Let H1 and H2 be two subgraphs of D that are strongly connected and V (H1 ) ∩ V (H2 )  =
φ. Then H1 ∪ H2 is strongly connected.
4. If in a digraph D every vertex v is such that d + (v) ≥ 1, then D contains a directed cycle.
5. The necessary and sufficient condition for a digraph D to be acyclic is that its vertex set
can be ordered as v1 , v2 , . . . , vn such that (vi , v j ) ∈ E with i  j.

23.2 Minimal Connector Problem

Suppose there are ‘n’ buildings to be connected for internet facility. The designer is also given
the cost for every pair of buildings. The problem is to establish a network at a minimum cost
irrespective of the other influencing parameters. For this we first define a weighted graph.

Definition 23.7 A graph G = (V , E) is called a weighted graph if there is a real function


φ : E → R. The function φ is called the weight function or cost function.

So the connector problem can be seen to be a graph G where vertices represent buildings,
and the edges represent the possible connections that can be made. The ‘φ’ function assigns
the cost against each edge indicating the cost of construction. The problem is to construct a
network of minimal cost. One can see that the selection will be a spanning tree of G whose
cost is minimal.

Theorem 23.8 Let (G, φ) be a network representation. The minimal cost network Tφ will
be a minimal spanning tree of G whose total weight will be the least.

The following is an algorithm which computes the minimal weight spanning tree.
Kruskal’s Algorithm
Input: G and φ.

1. Select an edge e1 ∈ E such that φ(e1 ) being the smallest.


(If there two edges with least cost select any one).
2. Continue to select in sequence edges e2 , e3 , . . . , ei all having costs with

φ(e1 ) ≤ φ(e2 ) ≤ · · · ≤ φ(ei ).

Then choose φ(ei+1 ) such that it is the least weight edge among leftover edges, such
that e1 , e2 , . . . , ei+1 do not form a cycle.
408 23 Directed Graphs and Graph Algorithms

3. Stop when step 2 cannot be done any more.

Remark 23.9 The correctness of the algorithm follows from the above theorem and the
steps of the algorithm being direct computation.

Example 23.10 Consider the graph (Fig. 23.3)

Fig. 23.3 Graphs (3)

First draw all the vertices without edges.

Fig. 23.4 Step 1


23.2 Minimal Connector Problem 409

Fig. 23.5 Step 2

Fig. 23.6 Step 3

Fig. 23.7 Step 4

Fig. 23.8 Step 5


410 23 Directed Graphs and Graph Algorithms

Fig. 23.9 Step 6

Fig. 23.10 Step 7

Total cost = 77

The minimal connector problem is actually finding a minimal spanning tree in a given
weighted graph. The following algorithm by Prim finds a minimum spanning tree of a given
weighted graph. This is also a greedy algorithm. To form a spanning tree having minimum
weight, actually a tree T is constructed in steps by adding edges of least weight. Initial
choice of an edge to T will be the edges or edge with the least weight. Initially T will be
disconnected and have edges less than the number of vertices of the underlying weighted
graph (G, φ). The algorithm is as below.
Prim’s Algorithm
Input: (G, φ) with n vertices, m edges n > 1.
Output: T , a minimum weight spanning tree.
Step 1: T ← {u}. u, any vertex in G.
Step 2: Add to T those edges uv such that φ(uv) is minimum such that u ∈ T , v ∈ / T . If
there are more than one edge with minimum weight, choose one arbitrarily.
Step 3: If T has (n − 1) edges, then stop else repeat Step 2 until adding edges to T , with
minimum weight edges become impossible. If T has less than (n − 1) edges and adding
edges become impossible means G is not a connected graph.
23.2 Minimal Connector Problem 411

Example 23.11 Consider the following weighted graph (G, φ)

Fig. 23.11 Weighted graph

Initially T is a tree with {v1 } say. Now edge v1 v5 will be added to T as it is the edge with
least weight which is incident with v1 . In the next iteration consider vertices in G other than
v1 , v5 which are incident either with v1 or v5 having the least weight edge. This iteration
adds v5 v3 to T . Now the vertices of T are {v1 , v3 , v5 }. In the next iteration all edges incident
with v1 , v3 , v5 that are not examined so far are considered. Now T is updated with vertices
{v1 , v3 , v4 , v5 } and the edge v4 v5 is added.
At this stage the tree T looks as below

Fig. 23.12 Weighted tree

Finally the spanning tree with minimum weight will be

Fig. 23.13 Weighted spanning


tree
412 23 Directed Graphs and Graph Algorithms

Remark 23.12 If n is the number of vertices and m is the number of edges in (G, φ), then
the time complexity of Prim’s algorithm will be O(m + n log2 n) steps.

23.3 Shortest Path Problem

Given a weighted digraph, the shortest path problem is the problem of finding a path between
two vertices in the graph such that the sum of the weights on the edges of the path is minimum.
This problem can be defined for both directed and undirected graphs. This is a model for
describing layout of road map between n cities (say) and one wishes to find the shortest
route between any two given cities. Here the distance between any two cities are described
by weighted edges, if they have a direct connection. We give a simple algorithm called.
Dijkstra’s Algorithm
Problem: Let G be the weighted digraph and let u 0 , v0 be any two vertices of G.
 = (V , E, φ), u 0 , v0 ∈ V .
Input: G
Let S0 = {u 0 }. Let u 1 ∈ V \S0 such that the path P0 from u 0 to u 1 is the shortest one. In
the next step identity u 2 ∈ V − {u 0 , u 1 } such that the path P1 from u 0 to u 2 which includes
P1 as a concatenated path from u 0 to u 1 and an edge u 1 u 2 such that the path P2 from u 0
to u 2 being the shortest. Continue the above process to find a path from u 0 to v0 which is
shortest.
Note that the process computes the distance from u 0 in steps exploiting the minimum
distance paths in sequence. We illustrate the algorithm with an example and then give the
actual algorithm.

 φ) be the given weighted graph as in the following diagram.


Example 23.13 Let (G,

Fig. 23.14 Weighted graph (5)

Let us find the shortest path between v1 and v4 .


In the first iteration, we get the source vertex v1 ∈ S, where S is the set updated iteratively
for identifying vertices on the path from v1 to v4 which is the shortest. So v1 ∈ S initially.
23.3 Shortest Path Problem 413

In the next iteration we see vertices v2 , v7 , v6 reachable by an edge from v1 directly. The
weights of φ(v1 v2 ) = 3, φ(v1 v7 ) = 7, φ(v1 v6 ) = 4. Since v1 v2 has the least weight. We
add v2 ∈ S. So S = {v1 , v2 } now.
In the third iteration we compute the paths from v1 to vertices v3 , v6 and v7 with their
weights respectively. Hence

W (v2 v3 ) = W (v1 , v2 ) + φ(v2 v3 ) = 3 = 3 = 6

where W (u, v) means the sum of weights of the edges of paths from u to v which is the
shortest. Similarly
W (v1 , v6 ) = 4 and W (v1 , v7 ) = 7
and so v6 ∈ S.
Fourth iteration checks for

W (v1 , v7 ), W (v2 , v3 ), W (v6 v5 )

and adds v5 ∈ S.
In the fifth iteration the weights

W (v1 , v7 ), W (v2 v5 ), W (v5 v4 )

are computed and their values are

W (v1 , v7 ) = 0 + 7 = 7
W (v2 v3 ) = 3 + 3 = 6
W (v5 , v4 ) = 5 + 7 = 12

Hence add v3 ∈ S.
Sixth iteration finds v7 to be put in S because

W (v1 , v7 ) = 0 + 7 = 7
W (v5 v4 ) = 5 + 7 = 12
W (v3 v4 ) = 6 + 4 = 10

Finally we compute
W (v5 v4 ) and W (v3 v4 ).
They are 12 and 10 respectively. Hence we have v4 ∈ S. Now

S = {v1 , v2 , v6 , v5 , v3 , v7 , v4 }.
414 23 Directed Graphs and Graph Algorithms

The shortest path P1 : v1 v2 v3 v4 which can be identified by backtracking the path from v4 to
v3 , v3 to v2 and v2 to v1 . This is done by collecting the respective arcs leading to minimum
distance from v1 .

Dijkstra’s Algorithm
Input (Ḡ, φ) with source vertex v0 and end vertex vt . Ḡ(V , Ē), |V | = n.

1. For i = 0 W (vi , vi ) ← 0, W (u, v) ← ∞ if uv ∈


/ E, Si ← {vi }.
2. For i  = 0, for each

x ∈ V − Si W (u i , x) ← min{W (v0 , u i ) + φ(u i x)}.

Let u i+1 be the vertex of minimality not in Si .


3. If i = n − 1 stop. If i < n − 1,
4. Output W (v0 vi ) then i ← i + 1 and go to step 2.

When the algorithm ends the value of shortest distance will be the output.
n(n−1)
The complexity of the algorithm will be O(n 2 ). As we see step 2 will be using 2
additions which is the major step in this algorithm.
Exercises
1. Find the minimum weight spanning tree in the following graphs (Figs. 23.15 and 23.16).

(i)

Fig. 23.15 Weighted graph (1)

(ii)
2. Find the shortest path in the following digraphs.

(i) Source vertex v1 and end vertex v6 (Fig. 23.17).


23.3 Shortest Path Problem 415

Fig. 23.16 Weighted graph (2)

Fig. 23.17 Weighted graph


(2-1)

Fig. 23.18 Weighted graph


(2-2)

(ii) Source vertex : v2 and end vertex : v6 (Fig. 23.18).

3. For each of the weighted graphs given below find the minimum spanning tree using Prim’s
algorithm (Figs. 23.19 and 23.20).

(i)

Fig. 23.19 Weighted graph


(3-1)
416 23 Directed Graphs and Graph Algorithms

(ii)

Fig. 23.20 Weighted graph


(3-2)

 = (V , E)
4. If G  is a strongly connected digraph, then show that there is a subset V̄ of V ,
with V̄  = φ such that outdegree of every vertex v ∈ V̄ is atleast 1.
5. A Directed Acyclic Graph (DAG) is a digraph with no directed cycles.
Check whether the following graph is a DAG. Justify your answer (Fig. 23.21).

Fig. 23.21 DAG

6. Let G = (V , E) be an undirected graph and let E = E 1 ∪ E 2 with a condition that every


vertex v ∈ V is incident with atmost one edge from E 1 and E 2 . Show that G is 2-colorable.
 = (V , E)
7. A directed walk in a digraph G  is a sequence v0 e1 v2 e2 . . . en vn such that vi ∈ V ,
0 ≤ i ≤ n and ei is an arc from vi−1 to vi , 1 ≤ i ≤ n. If v0 = vn , then the directed walk is
said to be a closed one and if v0 , v1 , . . . , vn are distinct, then the walk is called a directed
path.
Find two distinct directed walks, two distinct directed paths and two distinct closed walks
in the following digraph, if they exists (Fig. 23.22).

Fig. 23.22 Graph (7)


23.3 Shortest Path Problem 417

 = (V , E)
8. Let G  be a digraph and let H̄1 , H̄2 be two subgraphs of G  which are strongly
connected. If vertices of H̄1 and H̄2 are disjoint, then show that H̄1 ∪ H̄2 is strongly con-
nected.

Problems and Solutions—Graph Theory

1. Definition: A graph whose vertices are named distinctly is called a labelled graph.
Question: A graph G has 4 vertices and 5 edges. Its vertices are labelled as {a, b, c, d}.
Draw all such possible graphs.
Solution: The graphs are in Fig. 23.23.

Fig. 23.23 Graphs (1)

2. Are the following graphs bipartite? (Fig. 23.24).

Fig. 23.24 Graphs (2)

Solution: (i) G 1 contains no odd cycles. Its 4-cylces are in Fig. 23.25.
418 23 Directed Graphs and Graph Algorithms

Fig. 23.25 Graphs (2-1)

The 6-cycles are in Figs. 23.26 and 23.27.

Fig. 23.26 Graphs (2-2)

Fig. 23.27 Graphs (2-3)


23.3 Shortest Path Problem 419

(ii) G 2 contains an odd cycle 6 5 Hence G 2 is not bipartite.


(Try yourself) Are the following graphs bipartite? Justify your answer (Fig. 23.28).

Fig. 23.28 Graphs (2-4)

3. Definition: Let G be a graph on ‘n’ vertices. Let d1 , d2 , . . . , dn be the degrees of the


vertices of G. Degree vector D(G) = (d1 , d2 , . . . , dn ) such that d1 ≤ d2 ≤ · · · ≤ dn and
di ≥ 0 ∀ i, 1 ≤ i  = n.
Find the degree vector of the following graphs (Fig. 23.29).

Fig. 23.29 Graphs (3)


420 23 Directed Graphs and Graph Algorithms

Solution:
(i) D(G 1 ) = (3, 3, 3, 4, 4, 5)
(ii) D(G 2 ) = (2, 2, 3, 3, 3, 3, 4).

(Try yourself) Draw a graph ‘G’ for the degree vector (i) D(G) = (1, 3, 3, 3) (ii) D(G) =
(3, 3, 3, 3, 3, 3)
4. Draw the complement graph of the following graphs and write down their degree vectors
(Figs. 23.30 and 23.31).

Fig. 23.30 Graphs (4)

Solution:
(i) D(G 1 ) = (1, 1, 1, 2, 2, 3)
(ii) D(G 2 ) = (1, 1, 2, 2, 2)
(Try yourself) Is it true that a complement of a bipartite graph is bipartite? Justify your
answer.
5. Let G be a graph with ‘n’ vertices and m edges. If every vertex of G is degree either t or
t + 1, then find the number of vertices of degree‘t’ in G.
Solution: Let ‘s’ be the number of vertices of degree ‘t’ in G. Then we can write the equation

s.t + (n − s)(t + 1) = 2 m
⇒ s = n(t + 1) − 2 m.

6. Let G be a simple graph with 9 vertices and let the sum of the degrees of the vertices of
G be atleast 27. Show that G has a vertex of degree at least 4.
23.3 Shortest Path Problem 421

Fig. 23.31 Graphs (4-1)

Solution: We know that the sum of the degrees cannot be 27. The first even number after 27
will be 28. If every vertex of G is of degree 3, then the sum of the degrees will be 27. But
this is not possible for two reasons.
Reason 1: Sum of the degrees must be even.
Reason 2: Number of odd degree vertices in G must be even.
Hence the sum of the degrees will be atleast 28. By pigeon hole principle there is a vertex
of degree atleast 4 in G.
(Try yourself) Does there exist a simple graph G with degree vector D(G) = (1, 1, 2, 4, 4)?
Justify your answer.
7. Definition: Let G be a graph. A subgraph G − {v} is a subgraph of G obtained from G
by deleting the vertex ‘v’ and all the edges incident at ‘v’. For the following graph G find
G − {v1 }, G − {v1 , v2 }, G − {v1 , v2 , v3 } (Figs. 23.32, 23.33, 23.34 and 23.35).

Fig. 23.32 Graphs (7)


422 23 Directed Graphs and Graph Algorithms

Solution:

Fig. 23.33 Graphs (7-1)

8. In the following graph G find all the cut-vertices and cut-edges (Fig. 23.36).
Find the cut-vertices and cut-edges of G.
Solution: Cut-vertices are {v7 , v9 , v11 } cut-edges are {v9 v11 , v11 v12 , v7 v13 }.
9. Does there exist a graph with the following conditions?
Conditions: G is a simple graph on 7 vertices and has exactly two cycles.

Fig. 23.34 Graphs (7-2)


23.3 Shortest Path Problem 423

Fig. 23.35 Graphs (7-3)

Fig. 23.36 Graphs (8)

Solution: The answer is ‘Yes’.

(i) If G is connected, then G will be the graph


(ii) If G is not connected, then G will be the graph (Figs. 23.37 and 23.38).

10. Show that there always exists a connected graph on n-vertices and (n + 1)-edges con-
taining exactly two cycles, for n ≥ 4.
Solution: Let us see how to draw such a graph. A connected graph on n-vertices and (n − 1)-
edges will be a tree. In particular we can consider a path Pn on n vertices and (n − 1) edges.
By adding an edge between the two leaf nodes will make (Pn + e) as a cycle Cn on n vertices
and n-edges. Now an edge drawn inside Cn by connecting two non adjacent vertices on Cn
will give the desired graph.

Fig. 23.37 Graphs (9-1)


424 23 Directed Graphs and Graph Algorithms

Fig. 23.38 Graphs (9-2)

11. A graph G has 24 edges 10 vertices. Each vertex has either degree 3 or degree 5. Find
the number of vertices of G that are of degree 3.
Solution: Suppose G = (V , E), then |V | = 10, |E| = 24. By handshaking lemma we have
the sum of the degrees of the vertices being equal to 48. i.e.,

d(v) = 48. (23.1)
v∈V

Suppose the number of vertices of degree 3 is x, then (10 − x) vertices will be of degree
4. Hence
3x + 5(10 − x) = 48 ⇒ x = 1.
Hence there is only one vertex of degrees and a vertices of degree 5.
12. Definition: Let S be a set with |S| = n. Consider a subset I of P (S), the power set of S.
Consider the subsets in I to represent vertices and for any A, B ∈ I there will be an edge
between A and B if their intersection is non-empty. A simple graph thus constructed will be
called as the ‘intersection graph’.
Question: Draw the intersection graph for the subsets. A = {1, 2, 3}, B = {2, 3, 4}, C =
{4, 5, 6}, D = {2, 3, 4, 5}, E = {1, 3, 5, 6} (Fig. 23.39).
Solution: Here I = {A, B, C, D, E}.
13. Show that given a simple graph G, there always exists an intersection graph I (G) of a
set of subsets of a finite set such that G is isomorphic to I (G).

Fig. 23.39 Graphs (12) B

A C

E D
23.3 Shortest Path Problem 425

Solution: Let G = (V , E) and let V = {1, 2, . . . , n}. Now we construct the intersection
graph I (G) from G such that G ∼ = I (G). For I (G), the vertices are subsets of V . Let
X 1 , X 2 , . . . , X n be the subsets such that X i = { j/i j ∈ E} ∪ {i}. Clearly for I (G), the edges
will be supplied based on whether X i ∩ X j being empty or not. This is same as saying X i , X j
are adjacent in I (G) iff i j ∈ E. Clearly I (G) is unique and isomorphic to G.
14. Definition: In the intersection graph, instead of considering subsets as vertices, we
consider open interals on real line as vertices what we obtain is known as ‘Interval graph’.
That is the edges are between two open interals, if they overlap.
Question: Find the value of n, such that C3 is isomorphic to an interval graph I C3 (say)
and C4  I C4 .
Solution: (i) Consider C3 . Let I1 , I2 , I3 be three intervals with

I1 = (a1 , a2 ) (23.2)
I2 = (b1 , b2 ) (23.3)
I3 = (c1 , c2 ). (23.4)

One can construct an interval graph I C3 with the following conditions on I1 , I2 and I3
(Fig. 23.40).

Fig. 23.40 Graphs (14)

Clearly I C3 ∼
= C3 .
(ii) Such an assignment of intervals to the vertices of C4 is not possible. Let the vertices of
I C4 be I1 , I2 , I3 and I4 say. Clearly each I j is adjacent to I , Im and I , Im are nonoverlapping
intervals. Suppose two edges are drawn satisfying this condition with I j I , I j Im ∈ E(I C4 ),
I ∩ Im = ∅. One can argue that the further supply of edges becomes impossible to make
I C4 ∼= C3 .
15. Definition: A graph G is said to be a chordal graph if in every cycle subgraph C of
length ≥ 4, there is an edge of G joining two nonadjacent vertices in C.
Question: Are the following graphs chordal? (Figs. 23.41, 23.42, 23.43 and 23.44).

Fig. 23.41 Graphs (15-1)


426 23 Directed Graphs and Graph Algorithms

Fig. 23.42 Graphs (15-2)

Fig. 23.43 Graphs (15-3)

Fig. 23.44 Graphs (15-4)

Solution: Graphs in (i), (ii) are chordal graphs (iii) and (iv) are non chordal graphs.
In graph (i), there are no cycles.
In graph (ii) the cycle C4 contains a chord.
In graph (iii) all the cycles are of length 3. There are no cycles of length ≥ 4.
In graph (iv), C3 , C5 are present. But C5 does not contain a chord.
16. Let G = (V , E) be a simple connected graph. Show that G has two vertices of the same
degree.
Solution: The graph is given to be a simple graph and let |V | = n.
If a vertex v ∈ V is of degree (n − 1), then ‘v’ is incident with all the remaining (n − 1)
vertices. In this case there will be no vertex v ∈ V whose degree 0. All the remaining (n − 1)
vertices must be with degree ti , ti ∈ {1, 2, . . . , n − 1}. Hence by Pigeon-hole principal as the
‘n’ vertices can have (n − 1) different degrees, there must be two vertices of same degree.
17. Draw all graphs on 6 vertices in which each vertex is of degree less than or equal to 2.
Also find the number of connected graphs in this drawing (Fig. 23.45).
23.3 Shortest Path Problem 427

Solution:

There are only two graphs that are connected.


18. Definition: A rooted tree is a tree in which a vertex is identified as a root. With respect
to this root, we define depth of a vertex to be the number of edges in the path from root to
this vertex.
Question: Find the depth of the vertices

{u 2 , u 3 , u 4 , u 5 , u 6 , u 7 , u 8 , u 9 , u 10 , u 11 }

in the following rooted tree whose root is ‘u 1 ’ (Fig. 23.46).


Solution:

Depth of {u 2 , u 3 , u 4 } is 1.
Depth of {u 5 , u 6 , u 7 } is 2.
Depth of {u 8 , u 9 , u 10 , u 11 } is 3.
428 23 Directed Graphs and Graph Algorithms

Fig. 23.45 Graphs (17)

Fig. 23.46 Graphs (18)

19. Definition: A rooted binary tree is one in which evey vertex that is not a leaf has degree
3. That is each non-leaf vertex has two children. To be full if every vertex has degree 3 or
degree 1 except the root vertex which of degree 2.
Question: Let T be a rooted binary tree that is full having 49 vertices. What is the maximum
height of T and what is the minimum height of T . Justify your answer.
Solution: Note that maximum depth of T is called as height of the tree. As T is a full binary
tree, one can actually draw a binary tree T with maximum height is as Fig. 23.47.
23.3 Shortest Path Problem 429

Fig. 23.47 Graphs (19-1)

Number of nodes of T is

49 = 1 + 2 + 2 + ·
· · + 2 + 2
s times
= 2s +1
⇒ s = 24.

Hence maximum height of such a tree will be 24.


One can observe from the above construction that there has to be maximum number of
vertices at each level satistying the given conditions. We draw such a tree as Fig, 23.48.
Hence 1 + 2 + 22 + 2+ · · · + 2k = 49.
⇒ 25 < 49 < 26
Hence the minimum height of the tree will be 6.
20. Does there exist a rooted binary tree with

(i) depth 3 and 9 leaf nodes?


(ii) a full binary tree with 8 internal vertices or non-leaf vertices and 7 leaf vertices?
Justify your claim.

Solution:

(i) Let T be the binary tree with n vertices. Let T be of height 3 and let the leaf vertices of
T be 9. Then
9 ≤ 23 = 8.
430 23 Directed Graphs and Graph Algorithms

Depth 0

Depth 1

Depth 2

Fig. 23.48 Graphs (19-2)

Hence such a tree is not possible.


(ii) A full binary tree with ‘t’ internal vertices has a total of 2t + 1 vertices. Such a tree will
have (t + 1) leaf vertices. Hence t + 1 = 8 + 1 = 9. So such a tree is not possible.

21. Let G = (V , E) be a graph on even number of vertices.

(i) Does there exist a graph G that is not a tree such that G has exactly two vertices with
degree ‘t’ for t ∈ {1, 2, . . . , n}, |V | = 2n?
(ii) Show that number of trees on n vertices with the property that such trees have exactly
two vertices of degree t ∈ {1, 2, . . . , n} is n(n + 1), with |V | = 2n.

Solution:

(i) The following graph is a graph G on 8 vertices.

Fig. 23.49 Graphs (21-1)

(ii) Let T = (V , E) be a tree on 2n-vertices satisfying the given property that there are
exactly 2 vertices of degree t ∈ {1, 2, . . . , n}. Hence sum of the degrees will be 2(1 +
2 + · · · + n) = n(n + 1). So, |E| = n(n+1)n . Since T is a tree, T must have (2n − 1)-
edges. Hence
23.3 Shortest Path Problem 431

n(n + 1)
= 2n − 1
n
⇒ n 2 − 3n + 1 = 0
⇒ n = 1 or 2.

This means T must be a tree on either 2 vertices or 4 vertices. Such trees are drawn in
Fig. 23.50.

Fig. 23.50 Graphs (21-2)

22. Let G be a graph with maximum matching of size 2m. Show that the size of a maximal
matching in G is atleast m.
Solution: One can understand such a graph by looking at G having m components, with
each component has a path P3 of length 3. Then the maximum matching will use two of
these edges in P3 . This gives a maximum matching of size 2m. Clearly in a matching M of
size 2m, one can identity a maximal matching M of size atleast m. Each of the edges in M
will cover one end vertex of an edge in M. i.e. Fig. 23.51,

Fig. 23.51 Graphs (22)

If this is not true then one can add an edge to M contradicting the fact that M being
maximal. The number of vertices covered by M will be 2m and M is of size atleast m.
23. Let G be a graph having 2m vertices and let degree of every vertex of G be atleast
(m + 1). Then show that G has a perfect matching.
Solution: The graph G described in the question will contain a Hamilton cycle. Taking
alternate edges on this cycle will produce a perfect matching.
24. Let S be a finite set. Let S1 , S2 , . . . , Sn be subsets of S. Prove the following using the
“matching” concepts of graph theory.
432 23 Directed Graphs and Graph Algorithms

(i) There exists a subset F of {1, 2, 3, 4, . . . , n} such that |S1 ∪ S2 ∪ . . . Sn | < |F|.
(ii) There exists elements x1 , x2 , . . . , xn ∈ S with xi  = x j , i  = j such that xi ∈ Si for each
1 ≤ i ≤ n.

Solution: Let us define a graph G = (V , E) such that the set of vertices will be {1, 2, . . . , n} ∪
S. E = {e = iv/i ∈ {1, 2, . . . , n}, v ∈ S and v ∈ Si }
Clearly G is a bipartite graph.
G being bipartite, if it has a matching every element of {1, 2, . . . , n}, then there will be
an element vi ∈ S such that ivi ∈ E and ivi ∈ M. Clearly such vi , 1 ≤ i ≤ n are distinct as
ivi ∈ M
If there is no such matching M, then by Hall’s theorem there will be a subset F of
{1, 2, . . . , n} covered by edges in E. This means

|S1 ∪ S2 · · · ∪ Sn | < |F|.

But we have
|I | < |S1 ∪ S2 · · · ∪ Sn |.
25. For what values of m, does the complete graph K m contain

(i) a Euler trail?


(ii) a Hamilton path?
(iii) a Hamilton cycle?

Solution:

(i) K 1 , K 2 contain Euler trail, K 2n+1 , n ≥ 3 contain Euler trial.


(ii) K m for m ≥ 1 contain Hamilton path.
(iii) K m , m ≥ 3 contain Hamilton cycle.

26. Let G be a simple connected graph having an Euler tour—Are the following statements
true? Justify your answer.

(i) If the number of vertices in G is even, then G must have even number of edges.
(ii) If G is bipartite, then the number of edges of G must be odd.

Solution:

(i) This statement is false. Consider the following graph as an example.


Number of vertices is 6, but the number of edges is 7. The graph definitely contains an
Euler tour.
23.3 Shortest Path Problem 433

Fig. 23.52 Graphs (26)

(ii) The statement will be false for the following reason.


Total number of edges in any bipartite graph will be sum of the degrees of the vertices
in any one of the parts. Also the graph is given to contain an Euler tour. So every vertex
of G is of even degree. So the graph must contain even number of edges (Fig. 23.52).

27. Let G be a connected graph having even number of edges. Also assume that the degree
of every vertex of G is even. Every edge of G being colored using two colors say red or
green. Is it possible to color the edges in such a way that every vertex of G has the same
number of red and green edges incident with it? Justiy your answer.
Solution: Since G is connected and every vertex of G is even, G has an Euler tour say C.
Now color edges of C alternately using the colors red and green. One can understand that
every pair of edges occurring as adjacent ones in C get different colors. Since every vertex
has even degree, coloring the edges satisfying the conditions of the question is possible.
28. Let G be a graph on atleast ‘n’ vertices such that δ(G) = t, n ≥ 2. Show that for every
such ‘t’, there exists a graph G containing no cycle of length t + 1.
Solution: Let k =  nt . Consider k different copies of K t+1 . Here the total number of vertices
will be k(t + 1) and k(t + 1) > n. i.e., for t = 3, n = 4. We have the following graph that
has no cycle of length greater than 4 (Fig. 23.53).

Fig. 23.53 Graphs (28)

This procedure produces a graph satisfying the given conditions.


29. Does there exist a non-Hamiltonian graph G on n vertices n ≥ 1 such that

(i) the number of edges is (n − 1)C2 + 1.


(ii) δ(G) =  n2 +1.
Justify your answer.
434 23 Directed Graphs and Graph Algorithms

Solution:

(i) One can construct a non-Hamilton graph as below.


Consider two copies of the complete graph K  n2  . Let it be disjoint copies. So we can
call them as G 1 and G 2 . Let v ∈ V (G 1 ), a specific one. Supply edges from v to all
vertices of G 2 . Let the resultant graph be denoted as G (say). Clearly minimum degree
of G is  n2 −1. G is non-Hamilton because every such cycle passing through all the
vertices of G will meet the specified vertex ‘v’ atleast twice.
(ii) Consider K n−1 . Now add a new vertex ‘u’ such that u is adjacent to one of the vertices
of K n−1 . Clearly the number of edges in the resulting graph will be (n − 1)C2 + 1.
Also the constructed graph is non-Hamiltonian.

30. Definition: A tournament is a directed graph tkn obtained by assigning direction or


orientation to every edge of a complete graph K n .
Question: Show that every tournament t K n has a Hamilton path.
Solution: We prove the result using mathematical induction on the number of vertices of
t Kn .
For n = 2, t K 2 :
Hence there is an Hamilton path in t K 2 .
Assume the result to be true for all tournaments t K n on n vertices that they have a
Hamilton path.
Consider t K n+1 . Let v be a vertex of t K n+1 and consider t K n+1 − {v}, the graph obtained
by removing ‘v’ from t K n+1 . Note that the resultant graph is a tournament t K n . By assump-
tion t K n has a Hamilton path say v1 → v2 → · · · → vn , say.
Case i: If v → v1 in t K n+1 , then v → v1 → v2 · · · → vn is a Hamilton path in t K n+1 .
Case ii: If v j → v is in t K n+1 and ‘ j’ be the maximum indexed vertex of t K n such that
v j → v. Here for j = n,
v1 → v2 → · · · → vn → v
is a Hamilton path in t K n+1 .

v1 → v2 → · · · → v j → v → v j+1 → · · · → vn
is a Hamilton path in t K n+1 .
31. Consider the complete graph K n , n ≥ 4. Show that K 2n can be partitioned into n Hamilton
paths. Note that no two Hamilton paths in this collection share an edge.
Solution: K 2n for n ≥ 4 has a Hamilton path and a Hamilton cycle as well. For example the
graph K 4 has two paths (Figs. 23.54 and 23.55).
which are edge-disjoint Hamilton paths.
23.3 Shortest Path Problem 435

Let the vertices of the graph K 2n be denoted by {0, 1, 2, . . . , 2n − 1} and let them be
arranged in a circular fashion. One can write the Hamilton paths as Fig. 23.56.

Fig. 23.54 Graphs (31-1)

Fig. 23.55 Graphs (31-2)

kth Hamilton path:

Fig. 23.56 Graphs (31-3)

Here use the indices as (mod 2n) where t = 0, 1, . . . , 2n − 1. This gives all the n distinct
Hamilton paths. One has to the paths do not share any edge.
32. Show that if a plane graph has different faces having the same set of edges as boundary,
then the graph must be a cycle.
Solution: Let G be the plane graph and let f 1 , f 2 be two different faces of G. Let G be the
subgraph of G and also bounding edges of the faces f 1 , f 2 . Then G must contain a cycle
say C. This means that f 1 and f 2 are in different faces of C. This is possible only when G
itself is C. Also the vertices and edges of G will be in one of the faces of C. This imply
that f 1 , f 2 are different faces of C. C clearly has only two faces. So f 1 ∪ f 2 ∪ C will be the
whole plane R2 . Hence G ∼ = C.
436 23 Directed Graphs and Graph Algorithms

33. Prove the following.

(i) Let G be a triangulated plane graph. Show that G has even number of faces.
(ii) Does there exist a planar graph having the property that each vertex of degree atleast 5
and atleast one vertex of degree 8?

Solution:

(i) Every face of G = (V , E) is now a triangle except the exterior face. Sum of the edges
bounding the faces will be 2|E|. This means 3|F| = 2|E|, F is the set of all faces.
Hence |F| must be even.
(ii) We know

|E| ≤ 3 V | − 6 (23.5)

for G = (V , E), G being planar.

Every vertex being of degree atleast 5 and the vertex being of degree atleast 8 means,

6 + 8 ≥ 14, where w is a vertex of degree 8.
v∈V ,
v =w

which is true as (23.5) imply that



6V| − deg(v) ≥ 12
v∈V

⇒ (6 − deg(v)) + (6 − deg(w)) ≥ 12
v∈V
v =w

⇒ (6 − deg(v)) ≥ 14.
v∈V
v =w

This is possible for a graph G with 15 vertices.


34. Prove or disprove the following statements.

(i) If G = (V , E) is a planar graph having no subgraph isomorphic to K 3 , then χ (G) ≤ 4.


(ii) If G = (V , E) is a planar graph having no subgraph isomorphic to K 4 , then χ (G) ≤ 3.

Solution:

(i) This statement is a direct consequence of Four Color theorem.


It can be shown directly as below as well.
23.3 Shortest Path Problem 437

Since G has no subgraph isomorphic to K 3 , G must contain a vertex of degree atmost


three. We can proceed by induction on the number of vertices. For |V | = 1, 2, the
result is true that χ(G) ≤ 4. Assume the result to be true for graphs with |V | < n.
Let G be a graph on n vertices as with the property of the statement that it has no
subgraph isomorphic to K 3 . Let v be a vertex of degree ≤3. Clearly G − {v} is such
that χ(G − {v}) ≤ 4 by assumption, ‘v’ can be colored with one of the colors not used
for its neighbours in G − {v}. This shows χ(G) ≤ 4.
(ii) This statement is not true. Consider the following graph.

Fig. 23.57 Graphs (34)

χ(G)  = 3 and G has no subgraph isomorphic to K 4 (Fig. 23.57).


35. Show that a plane graph G = (V , E) is 2-connected if and only if every face of G is
bounded by a cycle.
Solution: If every face of G is bounded by a cycle, then obviously G is 2-connected.
Assume G is 2-connected. To show that every face of G is a cycle. We adopt the method
of contraction. That is let there be a face ‘ f ’ of G that is not bounded by a cycle. As G is
given to be 2-connected, G must have atleast one of its faces bounded by a cycle. Let G be
a maximal subgraph of G made up of faces bounded by cycles. None of the faces in G will
have two non adjacent vertices that are being adjacent in G. This is becuse G is a maximal
subgraph of G containing all the cycle faces of G. In fact G = (V , E) is 2-connected. For
any two vertices u, v ∈ V . x ∈ V \V there is a path between u and v passing through x
(Harary’s characterization). So there are two paths between any pair of vertices u, v ∈ V ,
one being a path present in G and the other being as seen in the previous statement. Hence
the boundary of every face of G is a cycle.
36. If G = (V , E) is a 3-connected graph, |V | ≥ 5, then show that there is an edge uv(=
e) ∈ E such that G.e is 3-connected. Here G.e is the graph obtained from G by contracting
the edge e(= uv).
Solution: Suppose G.e is not 3-connected for each edge e ∈ E. Consider, e = uv. Let w
be the vertex in G.e representing the contraction of e. Clearly G.e is 2 connected as G is
3-connected. Also the subgraph G = {u, v} must be connected, for any u, v ∈ V .
Let u 1 , u 2 ∈ V such that G.e − {u 1 , u 2 } is not connected and u 1 , u 2 , w be distinct. The
graph G.e − {u 1 , u 2 } can be obtained from G − {u 1 , u 2 } by contracting the edge uv = e
438 23 Directed Graphs and Graph Algorithms

as u  = u 1 , v  = v1 . This means G.e − {u 1 , u 2 } is connected. This is a contradiction as


G.e − {u 1 , u 2 } is disconnected. Hence our assumption that u 1 , u 2 , w being distinct is not
a valid one. Hence the contracted vertex w must be in any separting set of G.e as either
u 1 = w or v1 = w. So G − {u 1 , v1 , w} is not connected.
Now let G be component of G − {u 1 , v1 , x} with least number of vertices. The vertices
u 1 , v1 and x must be adjacent with three distinct vertices of G. Let p, q, r be vertices in
G such that ρ1 = pu 2 , ρ2 = qv1 , ρ3 = r x. {u 1 , u 2 , x} has to be a minimum disconnecing
set of G. If one considers G − { p, q, x} having G  as the minimum vertex component G 
must be a proper subgraph of G. Continuing like this one can reach a component with a
single vertex and an edge joining to one of the three vertices whose removal disconnected
the graph. Let one of the edges be say e and G.e is 3 connected, which is not possible.
37. Definition: A maximal outerplanar graph is one that loses its outer-planarity property if
any two non-adjacent vertices are joined by an edge.
Question: Let G = (V , E) be an outerplanar graph with |V | = n, |E| = m and with ‘ f ’
number of faces. Prove the following.

(i) m = 2n − 3, f = n − 1
(ii) there is atleast 3 vertices whose degrees are <4
(iii) there is atleast 2 vertices of degree 2
(iv) κ(G) = 2.

Solution:

(i) Degree of outer face will be ‘n’ and degree of each interior face is 3. Hence

3( f − 1) + n = 2 m (23.6)
n−m+ f =2 (23.7)
⇒ f = n − 1, m = 2n − 3

(ii) Let di be the number of vertices of degree i.

d1 = 0
2d2 + 3d3 + · · · = 2d2 + 2d3 + d3 + 4d4 + 4d5 + d5 + · · · = 2 m
= 4n − 6
⇒ 2d2 + 2d3 + 4(d4 + d5 + · · · ≤ 4n − 6
But d1 + d2 + d3 + · · · + dn = n
d4 + d5 + · · · = n − d2 − d3

So
23.3 Shortest Path Problem 439

2d2 + 2d3 + 4(d4 + d5 + · · · ) ≤ 4n − 6


⇒ 2d2 + 2d3 + 4(n − d2 − d3 ) ≤ 4n − 6
⇒ d 2 + d3 ≥ 3

(iii) If d2 = 0, then

3d3 + 4d4 + · · · = 4n − 6
⇒ 3d3 + 4(n − d3 ) ≤ 4n − 6
⇒ d3 ≥ 6, which is a contraction.
Hence d2  = 0
can d2 = 1

(iv) Clearly all the vertices are lying in the outer face. So every vertex is adjacent to two
of its neighbouring vertices. This means κ(G) > 1. But there is atleast one vertex of
degree 2. So κ(G) < 3. This means κ(G) = 2.

38. Show that, if G = (V , E) is outer planar, then G contains atleast 2 vertices of degree
<3.
Solution: Let |V | ≥ 5 as the statement is true for all outer planar graphs with |V | ≤ 4. If
G is not maximal outer planar, add edges to G such that G becomes maximal outer planar
graph say G  = (V , E  ). This makes the outer face of G being bounded by a Hamilton cycle
C of G. Let u, v ∈ V such that uv ∈ E  . Let this chord uv of C along with edges on the path
between u and v lying on C will be a face bounded by a cycle and this cycle will include
minimum number of interior faces of G  . This number must be 1. Every vertex on this cycle
will be of degree 2. Let x ∈ V , x  = u, v such that degree of x is 2. The other path between
u, v on C will identify a vertex x  of degree 2 in a similar manner.
39. Definition: The crossing number of a non planar graph G = (V , E) is the minimum
number of crossover of its edges for all possible drawings of G in a plane. It is denoted by
cr (G).
Question: Let G = (V , E) be a graph with |V | ≥ 3. Then

cr (G) ≥ |E| − 3 V | + 6.

Solution: Let the drawing of G on the plane have t crossings such that ‘t’ being minimum.
Suppose we take each crossing point be a vertex then the drawing now becomes a plane
graph H (say) such that H has |V | + t vertices and |E| + 2t edges. This is because each
new vertex divides the edge into two new edges. We know, for a planar graph H ,
440 23 Directed Graphs and Graph Algorithms

|E| + 2t ≤ 3(|V | + t) − 6
⇒ t ≥ |E| − 3 V | + 6.

40. Let G = (V , E) be a graph. Show that

|V |2
χ(G) ≥ .
|V |2 − 2|E|

Solution: Let χ(G) = k (say). Coloring the vertices of G will produce a partition of the
vertices V of G such that V = V1 ∪ V2 ∪ V3 ∪ · · · ∪ Vk such that the vertices in Vi are
colored with same color i (say). Clearly one can see G as a k-partite graph where there
are edges between the partitions preserving its chromatic number. The edges of G will be
maximum when G is a complete k-partite graph with each Vi being equal to |Vk | , 1 ≤ i ≤ |V |.
 2
Hence the edges between the partitions Vi and V j will be |Vk | for i  = j. This means

|V |2
|E| ≤ kC2 · and
k2
(k − 1)|V |2
2|E| ≤
k
Also
k−1
|V |2 − 2|E| ≥ |V |2 1 −
k
|V |2
⇒ χ(G) ≥ .
|V |2 − 2|E|
41. Prove that a graph G = (V , E) is t-colorable if and only if every block of G is t-colorable.
Solution: Suppose G is t-colorable. Then it is true that every block of G is t-colorable.
Suppose every block of G is t-colorable. We prove that G is also t-colorable using the
induction on the number of blocks. For one block, the result is true. Let G be with n blocks
and let the result that G being t-colorable be true. Now consider G to have (n + 1) blocks
and that each block being t-colorable. Let the graph be with one pendant block ‘B’ (say) and
let the remaining part H of G be with n blocks. So for H , the result that H being t-colorable
is true. Also as a block, B is also t-colorable. Clearly B shares a unique vertex ‘v’ with H .
If ‘v’ is assigned the same color in H and B, the result is true. Otherwise a recoloring of the
vertices of B can be done to assign ‘v’ the same color as that in H . Hence G is t-colorable.
42. Show that the subgraph induced by any two color classes in a k-coloring of a graph G
that is uniquely k-colorable must be connected.
Solution: A graph G is said to be uniquely k colorable if there is exactly one partition of its
vertices into k-color classes.
23.3 Shortest Path Problem 441

Let K 1 , K 2 be two color classes in the k-coloring of G that are colored with colors 1, 2.
Consider the induced subgraph G 12 induced by the vertices in K 1 and K 2 . Suppose G 12 is
not connected. Then every component of G 12 must contain vertices that use both color 1 and
2. Suppose there is a component F in G 12 , then interchange the colors 1, 2 in the vertices
of F, we get a different coloring of G. This is not possible. Hence G 12 is connected.
43. Let G be an undirected simple graph. Let A G be the adjacency matrix of G = (V , E).
Then show that


n
(i) λi = 0
i=1

n
(ii) λi2 = 2|E|
i=1

n
(iii) λi3 = 6.t
i=1
where t is the number of cycles of length 3 in G.

Solution:

(i) By the definition of trace of a matrix. We know that it will be zero as A G has all its
diagonal entries zero. This is always true for any simple graph. Also A G is a symmetric
matrix and hence it is diagonalizable. Then ‘P −1 A G P = D’ with the diagonal matrix
D has all the eigen values of A G . Hence


n
λi = 0
i=1

as the property ‘trace’ being invariant under similarity transformation.


n Also in the
characteristic polynomial of A G , the coefficient of t n−1 will be λi where the
n i=1
graph G has ‘n’ vertices. Hence λi = 0.
i=1
(ii) In the matrix A2G , any coefficient ai2j represents the number of paths of length 2 between
the vertex vi and v j for V = {v1 , v2 , . . . , vn }. This result can be proved by direct
argument on constructing A2G from A G . So if one considers the trace of A2G , it will be
sum of the vertex degrees of G. Hence


n
λi2 = 2|E|.
i=1
442 23 Directed Graphs and Graph Algorithms

H , then it
(iii) This result can be proved using the result that if a i j is the ijth entry of A G
represents number of paths between vi and v j of length n. One has to enumerate all
a ii in A3G that occur on the diagonal.

44. Find the spectrum of Figs. 23.58 and 23.59.


Solution:

Fig. 23.58 Graphs (44-1)

Fig. 23.59 Graphs (44-2)

⎡ ⎤
0 1 0 0 0 0
⎢1 0⎥
⎢ 0 1 1 0 ⎥
⎢ ⎥
⎢0 1 0 1 1 0⎥
(i) A G = ⎢ ⎥
⎢0 1 1 0 1 0⎥
⎢ ⎥
⎣0 0 1 1 0 1⎦
0 0 0 0 1 0

The characteristic polynomial will be

(λ2 − 1)(λ4 − 6λ2 + 4λ + 1)

The spectrum will be


1.90 1 −0.19 −1 −2.70
1 2 1 1 1
(ii) The characteristic poly of the tree will be
23.3 Shortest Path Problem 443

λ8 − 7λ6 + 9λ4 .

The spectrum will be


2.30 1.30 0 −1.30 −2.30
1 1 4 1 1

45. Definition: A graph G is said to be orientable if each edge of G can be given direction
such that the resultant graph is strongly connected.

Fig. 23.60 Graphs (45-1)

Fig. 23.61 Graphs (45-2)

Fig. 23.62 Graphs (45-3)

Check whether the following graphs are orientable or not. If so provide a orientation
(Fig. 23.60, 23.61 and 23.62).
444 23 Directed Graphs and Graph Algorithms

Fig. 23.63 Graphs (45-4)

Fig. 23.64 Graphs (45-5)

Solution:

(iii) It is not possible to orient this graph. The necessary condition for a graph to be orientable
is that every edge of it must be contained in a cycle (Fig. 23.63 and 23.64).

46. Show that a graph G is 2-connected if and only if it is strongly connected.


Solution: Let G be strongly connected. Suppose G has a cut edge and the edge be e = uv
i.e., Figure. It means there is only one way to move from u to v. That is G is not strongly
connected. Hence every edge of G must lie on a cycle. So G is 2-connected.
Conversely let G be 2-connected. So every edge of G must lie on a cycle C. Direct all
edges of C cyclically. If every every edge of G is lying on C then G is strongly connected.
Suppose there is an edge e of G that does not lie on C, but e being adjacent to an edge lying
on C. Since G is 2-connected e must lie on a cycle C  (say). Now provide orientation to the
edges of C  cycliclly except those edges that already received orientation. Now it is clear
to see that the edges of C and C  have orientation that makes the graph strongly connected.
Continue the procedure until every edge of G is oriented.
Bibliography

M. H. Albert, M. D. Atkinson and V. Vatter, Counting 1324, 4231-avoiding permutations. Electronic


J. Combin 16 (2009), # R136.
M. H. Albert, M. Elder, A. Rechnitzer, P. Westcott and M. Zabrocki, On the Stanley-Wilf limit of
4231-avoiding permutations and a conjecture of Arratia. Adv. in Appl. Math. 36 (2006), no. 2,
96–105.
R. Alter, Some remarks and results on Catalan numbers, in Proc. Second Louisiana Conference
on Combinatorics, Graph Theory and Computing (1971) (R. C. Mullin et al., eds.) Congressum
Numeratium III, Utilitas Mathematica Publishing Co., Winnipeg, 1971, 109–132.
N. Alon and E. Friedgut, On the number of permutations avoiding a given pattern. J. Combin. Theory
Ser. A. 89 (2000), no. 1, 133–140.
I. Anderson, Perfect matchings of a graph. J. Combin. Theory Ser. B 10 (1971) 183–186.
K. Appel and W. Haken, Every planar map is four colorable. Bull. Amer. Math. Soc. 82 (1976)
711-712.
R. Arratia, On the Stanley-Wilf conjecture for the number of permutations avoiding a given pattern.
Electronic J. Combin., 6 (1999), no. 1, N1.
V. Bafna and P. Pevzner, Sorting by transpositions. SIAM J. Discrete Math. 11 (1998), no. 2, 224–240
(electronic).
R. B. Bapat, Graphs and Matrices, Springer, University Text (2010).
C. Berge, Two theorems in graph theory. Proc. Nat. Acad. Sci. U.S.A. 43 (1957) 842–844.
C. Berge, Some classes of perfect graphs. Six Papers on Graph Theory. Indian Statistical Institute,
Calcutta (1963) 1–21.
N. Biggs, Algebraic Graph Theory, Second edition, Cambridge University Press, Cambridge (1993).
N. L. Biggs, E. K. Lloyd and R. J. Wilson, Graph Theory, 1736-1936. Oxford University Press,
London (1976).
M. Bóna, Introduction to Enumerative Combinatorics. McGraw-Hill, Boston, MA, 2007.
M. Bóna, A Walk Through Combinatorics, 3rd Edition. World Scientific, River Edge, NJ, 2011.
J. A. Bondy and V. Chvátal, A method in graph theory. Discrete Math. 15 (1976) 111–136.
J. A. Bondy and U. S. R. Murty, Graph Theory. Springer, New York (2008).
W. G. Brown and J. W. Tutte, On the enumeration of rooted non-separable planar maps, Canad. J.
Math., 16 (1964) 572–577.

© Ane Books Pvt. Ltd. 2025 445


R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1
446 Bibliography

A. Burstein, A short proof for the number of permutations containing the pattern 321 exactly once.
Elec. J. Combin. 18 (2001), no. 2, p21.
R. Chapman, An involution on derangements. 17th British combinatorial Conference (Canterbury,
1999). Discrete Math. 231 (2001), no. 1–3, 121–122.
C. Charalambides, Enumerative Combinatorics. Chapman & Hall / CRC, Boca Raton, FL, 2002.
G. Chartrand and F. Harary, Graphs with prescribed connectivities, Theory of Graphs. Academic
Press, New York (1968) 61–63.
G. Chartrand and J. Mitchem, Graphical theorems of the Nordhaus Gaddum class. Recent Trends in
Graph Theory. Springer, Berlin (1971) 55–61.
G. Chartrand and P. Zhang, Chromatic Graph Theory. Chapman & Hall/CRC Press, Boca Raton
(2009).
V. Chvátal, Tree-complete graph Ramsey numbers. J. Graph Theory 1 (1977) 93.
V. Chvátal and P. Erdös, A note on Hamiltonian circuits. Discrete Math. 2 (1972) 111–113.
Claude Berge, Graphs and Hypergraphs. New York: Elsevier, 1973.
J. Cofman, Catalan numbers for the classroom? Elemente der Mathematik, 52 (1997), 108–117.
C. W. Curtis, Frobenius, Burnside, Schur and Brauer: Pioneers of Representation Theory, American
Mathematical Society, Providence, to appear.
D. M. Cvetković and M. Doob, Recent results in the theory of graph spectra, Annals of Discrete
Math., Elsevier, Amsterdam/New York (1988).
N. G. de Bruijn, Pólya’s theory of counting. in Applied Combinatorial Mathematics (E. F. Beckenbach,
ed.), Wiley, New York (1964); reprinted by Krieger, Malabar, Florida (1981).
J. Désarmenien and M. Wachs, Descent classes on permutations. J. Combin. Theory A, 64 (1993),
no. 2, 311–328.
B. Descartes, A three colour problem. Eureka 9 (1947) 21.
R. Diestel, Graph Theory, Third Edition. Springer-Verlag, Berlin (2005).
G. A. Dirac, Some theorems on abstract graphs. Proc. London Math. Soc. 2 (1952) 69–81.
G. A. Dirac, A property of 4-chromatic graphs and some remarks on critical graphs. J. London Math.
Soc. 27 (1952) 85-92.
S. Doty and G. Walker, Modular symmetric functions and irreducible modular representations of
general linear groups, J. Pure Appl. Algebra 82 (1992) 1–26.
S. Dulueq. S. Gire and J. West, Permutations with forbidden subsequences and nonseparable planar
maps. Discrete Math., 153 (1996), no. 1–3, 85–103.
P. H. Edelman, Inversions and cycles in permutations. Europ. J. Combinatorics, 8 (1987), 269–279.
E. Egerv́ary, On combinatorial properties of matrices (Hungarian). Mat. Lapok 38 (1931) 16–28.
S. Elizalde, Asymptotic enumeration of permutations avoiding generalized patterns. Adv. Appl. Math.
26 (2006), 138–155.
P. Erdös, Some remarks on the theory of graphs. Bull. Amer. Math. Soc. 53 (1947) 292–294.
P. Erdös, Extremal problems in graph theory. A Seminar on Graph Theory. Holt, Rinehart and Winston,
New York (1967) 54–59.
P. Erdös and T. Gallai, Graphs with prescribed degrees of vertices (Hungarian). Mat. Lapok 11 (1960)
264–274.
Fede S. Roberts and Barry Tesman, Applied Combinatorics (second edition), CRC Press (2009).
H. J. Finck, On the chromatic numbers of a graph and its complement. Theory of Graphs. Academic
Press, New York (1968) 99–113.
Frank Harary, Graph Theory. Reading, MA: Addison-Wesley, 1969.
P. Franklin, The four color problem. Amer. J. Math. 44 (1922) 225–236.
Gary Chartand, Linda Lesniak and Ping Zhang, Graphs and Digraphs (6th edition), CRC Press (2016).
George E. Andrews and Kimmo Eriksson, Integer Partitions, Cambridge, England: Cambridge Uni-
versity Press, 2004.
Bibliography 447

S. W. Golomb, How to number a graph. Graph Theory and Computing. Academic Press, New York
(1972) 23–37.
J. Gross and J. Yellen (editors), Handbook of Graph Theory. CRC Press, Boca Raton, FL (2004).
R. P. Gupta, The chromatic index and the degree of a graph. Notices Amer. Math. Soc. 13 (1966)
719.
R. K Guy, Crossing numbers of graphs. Graph Theory and Applications. Springer-Verlag, New York
(1972) 111–124.
F. Harary, The maximum connectivity of a graph. Proc. Nat. Acad. Sci. U.S.A. 48 (1962) 1142–1146.
F. Harary and C. St. J. A. Nash-Williams, On Eulerian and Hamiltonian graphs and line graphs.
Canad. Math. Bull. 8 (1965) 701–709.
P. J. Heawood, On the four-colour map theorem. Quart. J. Pure Appl. Math. 29 (1898) 270–285.
P.J. Hilton and J. Pedersen, Catalan numbers, their generalization, and their uses, Math. Intelligencer,
13 (Spring 1991), 64–75.
B. Jackson, Hamilton cycles in regular 2-connected graphs. J. Combin. Theory Ser. B 29 (1980)
27–46.
J. B. Kelly and L. M. Kelly, Paths and circuits in critical graphs. Amer. J. Math. 76 (1954) 786–792.
T. P. Kirkman, On a problem in combinatorics. Cambridge and Dublin Math. J. 2 (1847) 191–204.
D. Kremer, Permutations with forbidden subsequences and a generalized Schröder number. Discrete
Mathematics, 218 (2000), no. 1–3, 121–130.
L. Lesniak, Results on the edge-connectivity of graphs. Discrete Math. 8 (1974) 351–354.
C. L. Liu, Topics jn Combinatorial Mathematics. Washington, DC: Mathematical Association of
America, 1972.
Louis Comtet, Advanced Combinattorics. Boston: Reidel, 1974.
L. Lovász, A characterization of perfect graphs. J. Combin. Theory Ser. B 13 (1972) 95–98.
Luo Jian-Jin, Catalan numbers in the history of mathematics in China, in Combinatorics and Graph
Theory, Proc. Spring School and International Conference on Combinatorics, Hefei, 6–27 April
1992 (H. P. Yap et al., eds.), World Scientific, (1992) 68–70.
M. M. Matthews and D. P. Sumner, Hamiltonian results in K 1,3 -free graphs. J. Graph Theory 8 (1984)
139–146.
Miklós Bona, Combinatorics of Permutations. Boca Raton, FL: Chapman & Hall/CRC 2004.
M. Molloy and B. Reed, A bound on the total chromatic number. Combinatorica 18 (1998) 241–280.
J. Noonan and D. Zeilberger, The enumeration of permutations with a prescribed number of forbidden
patterns. Adv. in Appl. Math., 17 (1996), no. 4, 381–407.
O. Ore, Note on Hamilton circuits. Amer. Math. Monthly 67 (1960) 55.
O. Ore, Theory of Graphs. Amer. Math. Soc. Colloq. Pub., Providence, RI (1962).
O. Ore, Hamilton connected graphs. J. Math. Pures Appl. 42 (1963) 21–27.
S. Pan and R. B. Richter, The crossing number of K 11 is 100. J. Graph Theory 56 (2007) 128–134.
K. R. Parthasarathy, Basic Graph Theory. Tata McGraw Hill Pub. (1994).
F. P. Ramsey, The Foundations of Mathematics, and Other Logical Essays. Harcourt, Brace and
Company, New York (1931).
R. C. Read, An introduction to chromatic polynomials. J. Combin. Theory 4 (1968) 52–71.
B. Reed, ω, , and χ. J. Graph Theory 27 (1998) 177–212.
A. Reifegerste, On the diagram of Schröder permutations. Electronic J. Combin., 9 (2003), no. 2, R8.
A. Reifegerste, On the diagram of 132-avoiding permutations. European J. Combin., 24 (2003), no.
6, 759–776.
J. Remmel, A note on a recursion for the number of derangements. European J. Combin., 4 (1984),
no. 4, 371–374.
Richard A. Brualdi and Herbert J. Ryser, Combinatorial Matrix Theory. New York: Cambridge
University Press, 1991.
448 Bibliography

R. D. Ringeisen and L. W Beineke, The crossing number of C3 × Cn . J. Combin. Theory Ser. B 24


(1978) 134–136.
G. Ringel, Problem 25. Theory of Graphs and its Applications. Nakl. CSAV, Prague (1964) 162.
D. G. Rogers, A Schröder triangle: Three combinatorial problems, in Combinatorial Mathematics
V: Proceedings of the Fifth Australian Conference, Lecture Notes in Math. 622, Springer-Verlag,
Berlin/Heidelberg/New York (1977) 175–196.
D. P. Sanders and Y. Zhao, Planar graphs of maximum degree seven are class I. J. Combin. Theory
Ser. B 83 (2001) 201–212.
M. Sekanina, On an ordering of the set of vertices of a connected graph. Spisy Přír Fak. Univ. Brno
(1960) 137–141.
R. Stanley, Binomial posets, Möbius inversion, and permutation enumeration, J. Combinatorial The-
ory Ser. A, 20 (1976), 336–356.
R. Stanley, Enumerative Combinatorics, Volume 1, Third Edition, Cambridge University Press, Cam-
bridge UK, 2011.
R. Stanley, Enumerative Combinatorics, Volume 2, Cambridge University Press, Cambridge UK,
1999.
G. Szekeres and H. S. Wilf, An inequality for the chromatic number of a graph. J. Combin. Theory
4 (1968) 1–3.
P. G. Tait, Remarks on the colouring of maps. Proc. Royal Soc. Edinburgh 10 (1880) 729.
C. Thomassen, Some remarks on Hajós’ conjecture. J. Combin. Theory Ser. B 93 (2005) 95–105.
S. Toida, Properties of an Euler graph. J. Franklin Inst. 295 (1973) 343–345.
P. Turán, Eine Extremalaufgabe aus der Graphentheorie. Mat. Fiz. Lapok 48 (1941) 436–452.
P. Turán, A note of welcome. J. Graph Theory 1 (1977) 7–9.
W. T. Tutte, On Hamiltonian circuits. J. London Math. Soc. 21 (1946) 98–101.
W. T. Tutte, A theorem of planar graphs. Trans. Amer. Math. Soc. 82 (1956) 99–116.
V. G. Vizing, On an estimate of the chromatic class of a p-graph. (Russian) Diskret. Analiz. 3 (1964)
25–30.
V. G. Vizing, Critical graphs with given chromatic class. Metody Diskret. Analiz. 5 (1965) 9–17.
I. Vun and P. Belcher, Catalan numbers, Math. Spectrum, 30 (1997/98), 3–5.
D. B. West, Introduction to Graph Theory, Second Edition. Prentice-Hall, Upper Saddle River, NJ
(2001).
A. T. White, Graphs of Groups on Surfaces, Interactions and Models. North-Holland, Amsterdam
(2001).
H. Whitney, The coloring of graphs. Ann. of Math. 33 (1932) 688–718.
J. E. Williamson, Panconnected graphs. II. Period. Math. Hungar. 8 (1977) 105–116.
R. M. Wilson, Decompositions of complete graphs into subgraphs isomorphic to a given graph. Congr.
Numer. 15 (1976) 647–659.
R. Wilson, Four Colors Suffice: How the Map Problem Was Solved. Princeton University Press,
Princeton, NJ (2002).
Index

A 195, 196, 198–201, 203, 207–210, 218,


Abelian, 152, 169 221, 228–233, 240, 249, 250, 254, 272,
Absorption, 7, 137 274, 275
Activity, 24–26, 35, 38, 39, 52, 53, 56, 62, 66, Bell, 53, 60, 109
189–193, 195, 198, 199, 202, 204, 206, Big-O, 21
208, 213, 214, 217, 220, 227, 231–233, Bijective, 11, 28, 152, 157
273, 359 Binary, 8, 44, 45, 49, 71, 72, 87, 131, 132,
Acyclic, 301, 303, 406, 407, 416 134–136, 145, 149, 151, 176, 187, 292,
Adjacent, 69, 104, 229, 280, 282–284, 296, 302, 428–430
305–307, 311, 317, 319–321, 324, 326, Binomial, 37–39, 42, 46–49, 67, 68, 81, 83, 113,
328, 336, 349–351, 353, 355, 356, 360, 173, 175, 178, 202, 212–214, 216, 224,
363, 365, 367, 370–372, 374, 375, 381, 245–247, 253, 263
393, 425, 433, 434, 437–439, 444 Bipartite, 283–285, 295, 296, 300, 310, 312,
Algebra, 3, 227, 389, 392 315, 327, 338, 345, 359–362, 365, 370,
Algorithm, 19, 20, 23, 71, 72, 103–105, 107, 371, 374, 376, 377, 403, 417, 419, 420,
116–120, 326, 407, 408, 410, 412, 414, 432, 433
415 Bound, 22, 23, 31, 128, 133–137, 139, 144, 145,
Alternating, 113, 358–360, 406 149, 225, 226, 261, 296, 343, 344, 367,
Antisymmetric, 9, 131, 145, 263 370, 371, 375, 381–387
Arrangements, 42, 56, 61–67, 75, 124, 125, Boundary, 341, 342, 345, 347, 354, 371, 372,
158–160, 179, 198, 229, 251, 254, 258, 435, 437
259, 272, 273, 389, 401 Bridge, 190, 211, 279, 297, 298, 300, 302, 323,
Ascent, 177, 178, 270 326
Associative, 6, 145, 151
Asymptotic, 22, 23, 237 C
Augmenting, 359, 360 Cardinality, 3, 13–16, 33, 104, 111, 113, 154,
Automorphism, 293 156, 158, 199, 315, 320, 355, 364, 379
Cartesian product, 8, 25, 234
Caterpillar, 302, 312
B Chain, 9, 31, 32, 132–137, 149
Balls, 24, 36, 42–45, 48, 51–53, 63, 64, 69, 70, Characteristic, 12, 98, 99, 391, 392, 394, 402,
75, 85–88, 114, 129, 149, 152, 190, 191, 441, 442
© Ane Books Pvt. Ltd. 2025 449
R. Rama, Topics in Combinatorics and Graph Theory,
https://doi.org/10.1007/978-3-031-74252-1
450 Index

Chord, 109, 304, 305, 426, 439 Cycles, 154, 156, 157, 163–167, 169, 170, 177,
Chromatic, 367–372, 374, 376, 377, 440 264, 266, 284, 291, 292, 295–302, 304,
Circuit, 288 305, 308–310, 312, 319, 320, 324–329,
Circular, 64–66, 74, 158, 160, 169, 229, 435 331, 332, 334–338, 343, 353, 354, 358,
Clique, 368–370, 380–382 359, 370, 376, 392–394, 396, 406, 407,
Closure, 151, 329, 330, 336 416–419, 422, 423, 425, 426, 431–435,
Color, 36, 96, 107, 129, 158, 160, 161, 163, 437, 439, 441, 444
165–169, 199–201, 203, 210, 230, 232,
249, 263–265, 367, 369–372, 374–376,
379–382, 384, 385, 387, 433, 436, 437, D
440, 441 Decompose, 291
Combinations, 48, 66, 67, 69, 70, 72, 117–119, Decomposition, 120, 157, 163, 290–292,
125, 211, 244, 275, 276, 321, 392 308–312, 319, 320
Commutative, 6, 137, 145, 152, 153, 227 Degree, 281, 282, 284–286, 292, 293, 296,
Complement, 4, 6, 7, 284, 293, 304, 310, 381, 300, 302, 312, 313, 317–319, 323–326,
382, 420 329–331, 341–344, 350, 354, 369–371,
Complete, 19, 24–26, 38, 62, 72, 73, 101, 122, 373–375, 382, 395, 419–421, 423, 424,
141, 144–146, 149, 170, 282–284, 291, 426, 428, 430, 431, 433, 434, 436–439,
293, 296, 303, 309–312, 315, 317, 324, 441
326–328, 330, 331, 333, 336, 338, 360, Demorgan’s Laws, 7
362, 365, 368, 370, 376, 377, 379–381, Derangement, 123–125, 127, 129
383, 384, 390, 396, 397, 403, 404, 432, Descent, 177–179
434, 440 Deviation, 222–225
Complexity, 20, 22, 23, 72, 104–106, 412, 414 Diagonal, 60, 169, 174, 184, 186, 187, 246, 268,
Component, 8, 57, 199, 294–297, 300, 303, 390, 395, 441, 442
305, 317, 319–322, 324, 326, 331–334, Diagrams, 5, 56–60, 111, 112, 133, 134, 137,
340, 343, 348, 351, 358, 359, 361–363, 139, 142, 143, 145, 147, 149, 176, 261,
369–371, 376, 393, 394, 398, 402, 406, 262, 350, 375, 405, 412
431, 438, 441 Diameter, 97, 258, 259, 288, 312, 392, 393
Composition, 11, 12, 56, 153, 156, 157, 254, Difference, 4, 5, 17, 35, 36, 102, 240, 358
265 Digraph, 405–407, 412, 414, 416, 417
Congruent, 121 Directed, 133, 405–407, 412, 416, 434
Conjugate, 57, 58, 60, 271 Disjoint, 4, 5, 14, 24, 25, 128, 156, 163, 205,
Connected, 44, 288, 294–306, 311–313, 207, 227, 299, 308, 320–322, 325, 342,
315–325, 327, 331–338, 340, 343, 345, 359, 417, 434
350–354, 362, 363, 365, 370–372, 390, Distinct, 9, 23, 34, 35, 42–45, 52, 53, 59, 60, 69,
392, 393, 398, 402, 406, 407, 410, 416, 70, 74, 83, 100, 117, 123, 149, 152, 162,
417, 423, 426, 427, 432, 433, 437, 438, 164, 169, 184, 190, 191, 195, 196, 198,
440, 441, 443, 444 208–210, 218, 230, 241, 242, 249, 264,
Connectivity, 315–320, 338 271, 279, 287, 303, 306, 307, 311, 320,
Contracted, 305, 353, 438 326, 337, 339, 360–362, 386, 391, 393,
Contraction, 306, 349, 350, 437, 439 402, 406, 416, 432, 435, 437, 438
Convergence, 78, 80 Distinguishable, 42, 51, 52, 69, 85, 86, 190,
Convolution, 38, 81 195, 399
Cotree, 305 Distribution, 23, 24, 43–45, 51–53, 56, 75, 82,
Countable, 3, 14, 15, 28, 211, 234, 235 85, 86, 149, 190, 195, 208, 214, 217–219,
Cover, 355–357, 365, 431 223, 224, 226, 227, 231, 232, 274
Critical, 367–369, 376, 377 Distributive Laws, 6
Curves, 234, 280, 339–341 Division, 78, 79, 116–119, 349
Index 451

Domain, 8, 10, 224, 236 379–384, 389–408, 410–412, 414–417,


Domination, 7, 363, 364 419–426, 430–441, 443, 444
Group, 33, 35, 38, 39, 48, 69, 74, 75, 121, 136,
151–154, 156, 157, 159–165, 167, 169,
E 203, 209, 228, 229, 246, 254, 264, 265,
Edge, 133, 180, 191, 263, 264, 279–288, 290, 380, 386
293–300, 302–306, 308–312, 315–330,
336, 338–345, 348–363, 365, 367,
369–377, 381–383, 385, 390, 392, 393, H
397, 405, 407, 408, 410–413, 416, 417, Hamilton, 327–329, 331, 332, 334–336, 431,
420–425, 427, 430–440, 443, 444 432, 434, 435, 439
Eigen, 391–394, 396–398, 400–403, 441 Hamiltonian, 323, 327, 328, 330–333, 335–338
Embedding, 339, 340, 342, 345, 347, 351, 353, Hasse, 133, 134, 137, 139, 142, 143, 145, 147,
354, 371 149, 261, 262
Empty set, 4, 9, 70, 84, 172, 191 Head, 189–192, 196, 202, 204, 210–215, 217,
Enumerate, 24, 82, 148, 149, 208, 390, 442 220, 225–229, 273, 274, 276
Enumeration, 23, 24, 26, 64, 166, 167, 265, 303 Homeomorphic, 347
Equivalence, 9, 10, 28, 158, 160, 162, 163, 166, Homogeneous, 91–93, 99, 100, 102
167, 266, 294, 339 Hypercube, 312
Euler, 115, 123, 165, 279, 323–325, 340, 343,
432, 433
Events, 24, 25, 111, 112, 126, 190–207, 209, I
210, 216, 227–230, 272, 274 Idempotent, 7, 136
Exclusion, 111, 123, 126, 127, 148, 260 Identical, 26, 43–45, 48, 51, 53, 64, 70, 87, 158,
Expectation, 219, 220 196, 203, 216, 226, 230, 243, 250, 265,
Exponential, 82, 84, 85, 87, 95, 96, 109 319, 384
Exterior, 341, 342, 345, 347, 351, 436 Identity, 7, 38, 39, 47, 147, 151–153, 159, 169,
178, 264–267, 310, 343, 412, 431
Inclusion, 111, 123, 126, 127, 132, 148, 260
F Independent, 19, 194, 200–204, 214, 217, 220,
Face, 340–345, 350, 351, 353, 354, 371–373, 222, 223, 226, 228, 272, 274, 282, 283,
377, 435–439 295, 310, 320–322, 355–358, 367, 368,
Factor, 82, 115, 116, 149, 188, 237, 260, 359, 377, 380–382, 392, 393, 398, 400
361–363, 365, 376 Induction, 16, 31, 32, 39, 40, 49, 55, 94, 97,
Factorial, 16, 54, 62 120, 148, 220, 228, 233, 234, 238, 243,
Forbidden, 127, 128, 148 248, 269, 271, 272, 295, 298, 303, 320,
Forest, 301 321, 325, 326, 353, 362, 374, 381, 383,
Formula, 17, 26, 39–41, 53, 89, 90, 109, 136, 384, 390, 434, 437, 440
145, 148, 171, 183, 200, 257, 306, 307, Inequality, 197, 224–226, 228, 234, 238, 239,
340, 343 317, 334, 345, 384
Infinite, 12, 14, 17, 28, 29, 69, 80, 116, 154,
194, 228, 235, 282, 379, 384
G Initial, 16, 17, 90, 93, 97, 99, 100, 102, 107,
Generating, 4, 71, 72, 77–85, 87–92, 94–97, 155, 287, 405, 410
107, 109, 172, 180, 181, 186, 251–257, Injective, 11–14
274, 275 Intersection, 4, 6, 7, 424, 425
Graceful, 311, 312 Inverse, 7, 10–12, 28, 79, 93, 94, 147, 151–153,
Graph, 10, 27, 133, 170, 174, 180, 263, 264, 169, 265
279–306, 308–313, 315–365, 367–377, Inversion, 146, 148, 165, 350
452 Index

Isomorphism, 292, 293 Modular, 3, 139–141


Modulo, 121–123, 159, 264, 353
Monoid, 151, 152
J Multinomial, 42, 43
Join, 136, 137, 340, 346, 351 Multiple, 21, 48, 94, 116, 122, 123, 231, 232,
Jordan, 339, 341 367, 372
Multiset, 42–45, 61, 66, 70, 72, 73
Multisubsets, 70, 72, 73
L Mutual, 380
Label, 307
Laplacian, 395–400
Lattices, 3, 134, 136–142, 144–146, 149, 150, N
175–177, 184, 185, 187, 188, 262, 267, Negation, 7, 145
268 Neighbour, 303, 363, 369–371, 437
Leaf, 35, 302, 307, 310, 312, 370, 423, 428–430 Non-Isomorphic, 149, 170, 263, 264
Numbers, 3, 4, 8, 10, 12–28, 33–36, 38, 39,
Lemma, 14, 31, 118, 136, 139–141, 157, 158, 42–45, 47–49, 51–54, 56–75, 77, 80–90,
162, 168, 170, 264, 350–353, 381, 423 94–97, 99, 103–109, 112–118, 120–126,
Linear, 42, 56, 63–65, 91, 93, 97, 99, 106, 128, 129, 147, 148, 152, 154–156,
117–119, 178, 181, 389, 392–394 158–162, 164–185, 187–193, 195–200,
List, 31, 52, 70–73, 104–106, 116, 150, 165, 205, 208–211, 213–216, 218–221,
171, 190, 195, 227, 228, 239, 303, 320, 223–233, 235, 237, 239–244, 246–252,
386 254, 258–260, 263, 264, 267, 272–274,
Little-o, 22 281, 282, 285, 288, 293–296, 300,
Loop, 106, 281, 350, 367, 372 303, 305–308, 310, 311, 313, 315–317,
320–322, 324–328, 331, 332, 334, 335,
338, 340, 341, 343, 345, 350, 353–357,
M 360–365, 367–372, 374–377, 379–384,
Mass, 211, 212, 216–221, 223–225, 231 386, 387, 390, 392, 394, 399–401, 404,
Match, 228, 239, 271 406, 410, 412, 420, 421, 423, 424, 426,
Matching, 174, 355, 357–363, 431, 432 427, 429–434, 436–442
Matrix, 152, 289, 290, 300, 389, 391–393,
395–401, 441
Maximal, 31, 32, 135, 136, 149, 294, 299, 303, O
310, 328, 345, 358, 373, 374, 406, 431, One-to-one, 234, 235
437–439 Orbit, 157–159, 168, 170, 266
Maximum, 34, 117, 191, 262, 263, 282, 283, Ordered pair, 8, 34, 279
285, 288, 320, 322, 324, 334, 354–360, Ordering, 23, 32, 71–73, 103, 117, 132,
362, 368, 370, 371, 373–375, 377, 428, 134–136, 149, 150, 165, 194, 389
429, 431, 434, 440 Outer, 345–347, 351, 438, 439
Mean, 222–226, 232 Overlapping, 111
Minimal, 33, 135, 149, 262, 351, 364, 365, 376,
407, 410
Minimally, 303, 305 P
Minimum, 34, 35, 150, 235, 262, 263, 279, 282, Panconnected, 337
288, 300, 315, 317–322, 324, 334, 353, Pancyclic, 337, 338
355–357, 362, 364, 365, 367, 369, 374, Parameter, 210, 212, 214, 216, 224, 232, 315,
380, 407, 410–412, 414, 415, 428, 429, 317, 319, 343, 355, 365, 380, 394, 407
434, 438, 439 Parentheses, 95, 171, 172, 174
Index 453

Partition, 51, 53, 56–60, 94, 95, 163, 164, 166, Reflexive, 9, 131, 132, 263
196, 208, 248, 283, 294, 295, 297, 306, Regions, 109, 339–341, 347, 351, 353, 372
315, 316, 326, 359, 367, 368, 371, 374, Regular, 169, 206, 264, 284–286, 296, 300, 310,
376, 440 333, 334, 359, 363, 365, 370, 372, 373,
Paths, 75, 133, 174–177, 184–188, 267–269, 376, 377, 379, 382, 393, 401, 402
287, 288, 290, 293, 294, 296–303, Relation, 3, 8–10, 16, 27, 28, 31, 52, 58,
305, 308, 309, 311, 319–322, 326–328, 77, 89–95, 97–102, 104, 106–109, 121,
335–337, 348, 351, 353, 358–360, 374, 122, 131, 132, 134–136, 145, 149, 150,
376, 390, 396, 398, 406, 407, 412–414, 154, 155, 157, 158, 162, 163, 172, 173,
416, 423, 427, 431, 432, 434, 435, 437, 179–181, 183, 187, 256, 257, 259, 263,
439, 441, 442 266, 280, 292, 294, 334, 339, 389
Pattern, 77, 97, 182, 184, 187, 267–270 Repetition, 26, 63, 69, 74, 96, 154, 192, 197,
Pentagon, 169, 264, 265, 354 287
Permutations, 36, 42, 45, 61–67, 72, 86, 96, Replacement, 74, 195, 198, 199, 203, 207, 208,
123–129, 151–154, 156, 157, 161–170, 228, 232, 233, 275, 276
177–179, 182–184, 187, 249, 264–270, Residue, 122, 123
389, 392 Rook, 126–129
Peterson, 334, 348, 349, 354, 364, 377 Rooted, 187, 427–429
Pigeon Hole Principle, 31, 33–35, 156, 421 Rotation, 158, 160–164, 169
Planar, 339–348, 350, 351, 353, 354, 371–373,
377, 436, 439
Polygon, 169, 174, 184, 187 S
Polynomial, 48, 54, 120, 126, 127, 129, 155, Saturated, 358
164–166, 170, 180, 274, 391, 392, 394, Separable, 316
402, 441, 442 Sequence, 16–20, 24–26, 34, 47–49, 62, 77, 78,
Poset, 132–138, 142, 144–147, 149, 150, 165 80–82, 84, 87–91, 97, 99, 104, 109, 116,
Positive, 14, 22, 23, 29, 35, 36, 38, 47, 49, 58, 117, 129, 171, 172, 175, 185, 225, 229,
59, 74, 99, 108, 109, 117, 119–123, 129, 240, 246, 253, 255, 256, 271, 272, 282,
146, 149, 154, 156, 210, 237, 238, 240, 284, 293, 300, 302, 307, 312, 313, 319,
246, 251, 271, 313, 379, 380, 393, 397, 331, 342, 349, 350, 375, 386, 406, 407,
403 412, 416
Power, 4, 7, 15, 33, 37, 43, 48, 77–82, 84, 87, Set, 3–17, 19, 21, 22, 24, 28, 29, 31–34, 36, 42,
120, 125, 132, 134, 137, 144, 146, 166, 45, 48, 51–53, 59, 61–64, 66–74, 83–86,
232, 246, 392, 424 99, 104, 112, 114–117, 121–125, 127, 129,
Power set, 4, 7, 15, 33, 132, 134, 137, 144, 146, 131, 132, 134–137, 144, 146, 148–154,
424 156–158, 160–163, 165, 167, 168, 171,
Prime, 3, 4, 114–118, 120, 121, 123, 129, 158, 172, 175, 177, 178, 183, 184, 187,
159, 237, 260, 271 189–191, 193, 194, 199, 202, 205, 206,
Probability, 191–209, 211–221, 223–233, 208, 210, 211, 226, 227, 232, 234, 235,
272–276 245–247, 250, 254, 259–261, 263, 266,
272, 279, 282, 283, 290–295, 297, 301,
304, 306–308, 310, 315–317, 319–322,
R 324, 325, 330, 331, 334, 335, 351, 353,
Ramsey, 379–381, 383, 384, 386 355–358, 360–365, 367, 368, 370, 371,
Random, 189, 191, 192, 202, 210–228, 230–233, 374–377, 379, 380, 382, 384–387, 391,
272, 274 405, 407, 412, 424, 431, 432, 435, 436,
Range, 8, 10, 11, 18, 27, 112, 211, 214, 231, 438
386 Singleton, 11, 194, 202
Recursion, 16, 55, 59, 105–107, 155 Sort, 104–107
454 Index

Sorting, 70, 103, 107 Time, 8, 19, 20, 23, 25, 26, 34, 37, 42, 43, 56, 66,
Space, 24, 66, 99, 169, 189–203, 206–211, 214, 69, 70, 72, 74, 75, 95, 96, 104–107, 112,
216, 217, 220, 227, 228, 230, 231, 233, 113, 120, 177, 188–192, 198, 202, 204,
389, 391, 398 208–211, 213, 219, 225, 226, 228–231,
Spanning, 290, 303–307, 312, 313, 326, 327, 233, 239, 250, 251, 259, 272–274, 295,
345, 357, 359, 370, 399, 400, 404, 407, 303, 412
410, 411, 414, 415 Tough, 205, 333–335
Spectrum, 391, 393, 394, 402, 442, 443 Tour, 323–326, 432, 433
Stabilizer, 157, 168, 170, 266 Transitive, 9
Star, 301, 310, 311, 398 Traversable, 326
Stirling, 51, 52, 54, 154–156, 196, 232, 272 Tree, 174, 187, 293, 301–313, 322, 370, 399,
String, 44, 45, 69, 71, 72, 77, 85, 87, 88, 103, 400, 402, 404, 407, 410, 411, 414, 415,
109, 135, 171, 172, 175, 176, 184, 187, 423, 427–431, 442
189, 190, 273 Trials, 202–204, 210–212, 214, 215, 221, 225,
Subdivision, 348, 351–353 232, 272, 287, 324, 327, 432
Subgraph, 290, 294, 299, 300, 303, 304, Triangle, 39, 40, 47, 49, 243, 293, 309, 342,
306, 308, 309, 315, 319, 321, 326, 327, 345, 354, 372, 436
336, 345, 347, 348, 350, 351, 353, 354,
357–359, 363, 368–370, 372, 373, 375,
376, 382, 384, 385, 393, 406, 421, 425, U
435–438, 440, 441 Uncountable, 3, 14–16, 234
Subset, 4–6, 8, 10–12, 17, 24, 26, 32, 39, 48, Union, 4, 6, 7, 10, 15, 24, 25, 112, 156, 196,
51, 66–73, 83–85, 112, 113, 115, 116, 206, 270, 304, 359, 385, 398
122, 125–129, 132, 134, 135, 141, 144, Universal set, 5–7
146–149, 189–191, 195, 217, 244–247,
254, 263, 272, 282, 283, 317, 332, 333,
V
335, 355, 356, 360–363, 367, 368, 379,
Variable, 145, 210–227, 231, 232, 274
380, 385, 416, 424, 425, 431, 432
Variance, 222–224, 226, 232
Success, 202, 214, 215, 221, 225, 227, 229, 272
Vectors, 99, 389, 391, 393, 398, 400, 419–421
Surface, 339, 340
Venn diagrams, 5, 111, 112, 227
Surjective, 11–14, 52, 53, 247 Vertex, 133, 170, 187, 263–265, 279–288, 290,
Symmetric, 5, 9, 131, 152, 153, 166, 290, 358, 292–300, 302, 303, 305–313, 315–340,
389–391, 396, 397, 400, 441 343–345, 347–363, 365, 367, 369–377,
Symmetric difference, 5, 358 380–385, 389–393, 395, 398–401,
405–408, 410–417, 419–441

T
Tail, 189, 202, 204, 206, 212, 213, 217, 228, W
229, 231, 273, 274, 276, 405, 406 Walk, 279, 287, 294, 295, 323, 392, 393, 406,
Terminal, 405, 406 407, 416

You might also like