Enumerative Combinatorics (Discrete Mathematics and Its Applications)

  • 99 649 3
  • Like this paper and download? You can publish your own PDF file online for free in a few minutes! Sign Up

Enumerative Combinatorics (Discrete Mathematics and Its Applications)

DISCRETE MATHEMATICS AND ITS APPLICATIONS Series Editor Kenneth H. Rosen, Ph.D. AT&T Bell Laboratories Abstract Algebra

2,263 607 14MB

Pages 628 Page size 309 x 476.25 pts Year 2011

Report DMCA / Copyright

DOWNLOAD FILE

Recommend Papers

File loading please wait...
Citation preview

DISCRETE MATHEMATICS AND ITS APPLICATIONS Series Editor

Kenneth H. Rosen, Ph.D. AT&T Bell Laboratories Abstract Algebra Applications with Maple, Richard E. Klima, Ernest Stitzinger, and Neil P. Sigmon Algebraic Number Theory, Richard A. Mol/in An Atlas of The Smaller Maps in Orientable and Nonorientable Surfaces, David M. Jackson and Terry I. Visentin An Introduction to Crytography, Richard A. Mol/in Combinatorial Algorithms: Generation Enumeration and Search, Donald L. Kreher and Doug/as R. Stinson Cryptography: Theory and Practice, Second Edition, Douglas R. Stinson Design Theory, Charles C. Lindner and Christopher A. Rodgers Frames and Resolvable Designs: Uses, Constructions, and Existence, Steven Furino, Ying Miao, and Jianxing Yin Fundamental Number Theory with Applications, Richard A. Mol/in Graph Theory and Its Applications, Jonathan Gross and Jay Yellen Handbook of Applied Cryptography, Alfred J. Menezes, Paul C. van Oorschot, and Scott A. Vanstone Handbook of Discrete and Computational Geometry, Jacob E. Goodman and Joseph O'Rourke Handbook of Discrete and Combinatorial Mathematics, Kenneth H. Rosen Introduction to Information Theory and Data Compression, Darrel R. Hankerson, Greg A. Harris, and Peter D. Johnson Network Reliability: Experiments with a Symbolic Algebra Environment, Daryl D. Harms, Mirostav Kraetzl, Charles J. Co/bourn, and John S. Devitt Quadratics, Richard A. Mol/in The CRC Handbook of Combinatorial Designs, Charles J. Co/bourn and Jeffrey H. Dinitz Handbook of Constrained Optimization, Herbert B. Shulman and Venkat Venkateswaran

ENUMERATIVE COMBINATORICS CHARALAMBOS A. CHARALAMBIDES

CHAPMAN & HALLICRC A CRC Press Company Boca Raton London New York Washington, D.C.

Library of Congress Cataloging-in-Publication Data Charalambides, Ch. A. Enumerative combinatorics I Charalambos A. Charalambides. p. em. - (The CRC Press series on discrete mathematics and its applications) Includes bibliographical references and index. ISBN 1-58488-290-5 I. Combinatorial enumeration problems. I. Title. II. Series. QAI64.8 .C48 2002 5ll'.62--dc21

2002019775

This book contains information obtained from authentic and highly regarded sources. Reprinted material is quoted with permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to publish reliable data and information, but the author and the publisher cannot assume responsibility for the validity of all materials or for the consequences of their use. Neither this book nor any part may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, microfilming, and recording, or by any information storage or retrieval system, without prior permission in writing from the publisher. The consent of CRC Press LLC does not extend to copying for general distribution, for promotion, for creating new works, or for resale. Specific permission must be obtained in writing from CRC Press LLC for such copying. Direct all inquiries to CRC Press LLC, 2000 N.W. Corporate Blvd., Boca Raton, Florida 33431.

Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation, without intent to infringe.

VJSit the CRC Press Web site at www.crcpress.com © 2002 by Chapman & Haii/CRC

No claim to original U.S. Government works International Standard Book Number 1-58488-290-5 Library of Congress Card Number 2002019775 Printed in the United States of America I 2 3 4 5 6 7 8 9 0 Printed on acid-free paper

Preface

Combinatorics, at the early stages of its emergence, treated the enumeration and properties of permutations, combinations and partitions of a finite set under various conditions. Its advent coincides with that of discrete probabilities in the 17th century. The advance of probability theory and statistics, with an ever-increasing demand for more general configurations, as well as the appearance and growth of computer science, have undoubtedly contributed to the rapid development of combinatorics during the last decades. This subject was then expanded to cover enumeration and examination of properties as well as investigation of existence and construction of configurations with specified properties. This book provides a systematic coverage of the subject of enumeration of configurations with specified properties. It is designed to serve as a textbook for introductory or intermediate level enumerative combinatorics courses usually given to undergraduate or first year graduate students in mathematics, computer science, combinatorics, or mathematical statistics. The broad field of applications of combinatorial methods renders this book useful to anyone interested in operational research, physical and social sciences. In Chapter 1, the two basic counting principles of addition and multiplication are introduced after a brief presentation of the necessary elements of set theory. Along with these principles, the notion of a recurrence (recursive) relation is introduced and its connection with a difference equation is pointed out. Also, discrete probability is briefly introduced for use in the subsequent chapters. In the last section, the symbols of summation and product are also presented and some of their properties are discussed. Chapter 2 is devoted to the enumeration and properties of permutations, combinations, divisions and partitions of a finite set and also the enumeration of integer solutions of a linear equation. Further, some basic elements of enumeration of lattice paths are presented. This chapter concludes with several classical applications in discrete probability theory and statistics. Vandermonde's factorial formula, Newton's binomial formula and the

vi

PREFACE

multinomial formula are presented in Chapter 3, after a suitable extension of factorials and binomials. Stirling's approximation formula is also given. In Chapter 4, in continuation to the counting principles of addition and multiplication, the principle of inclusion and exclusion is extensively treated. In addition, the Bonferroni inequalities are derived. The famous problem of coincidences (probleme des recontres), which perhaps constitute the first application of the inclusion and exclusion principle, is examined in Chapter 5 in the general framework of enumeration of permutations with fixed points. The related problem of enumeration of permutations with successions is examined in the same chapter. Chapter 6 is devoted to a thorough presentation of generating functions, which constitute an important means of unifying the treatment of enumerative combinatorial problems. In several enumeration problems, the number of configurations satisfying specified conditions can only be expressed recursively. In Chapter 7 we present the basic methods of solving linear recurrence relations. Chapter 8 is devoted to an extensive treatment of the Stirling numbers of the first and second kind, which are the coefficients of the expansion of factorials into powers and of powers into factorials, respectively. In addition, the coefficients of the expansion of generalized factorials into usual factorials are examined. The enumeration of distributions (of balls into urns) and occupancy (of urns by balls) is closely related to the enumeration of permutations and combinations. A formulation of this problem in a general framework and its treatment from a different point of view warrants a separate chapter. This treatment is the subject of Chapter 9. A few elementary aspects of the combinatorial theory of partitions of integers are discussed in Chapter 10. Specifically, after the introduction of the basic concepts, recurrence relations and generating functions of the numbers of partitions with summands of specified values are obtained. Also, relations between the numbers of various partitions are concluded. The last section of this chapter includes some interesting classical q-identities. Chapter 11 deals with the partition polynomials in n variables. The coefficient of the general term of these polynomials is the number of partitions of a finite set of n elements in specified numbers of subsets of the same cardinality and the summation is extended over all partitions of the number n. As particular cases, the partition polynomials include the exponential, logarithmic and potential polynomials, which owe their particular names to the form of their generating functions. The inversion of a power series by using the potential polynomials is presented in the last section of this chapter. Enumeration problems emerging from the representation of a permutation as a product of cycles are treated in Chapter 12.

PREFACE

vii

The problem of counting the number of equivalence classes of a finite set under a group of its permutations is the subject of Chapter 13. Finally, Chapter 14 considers the Eulerian and the Carlitz numbers. In the last two sections of this chapter, these numbers are used to express the number of permutations with a given number of ascending runs (or rises) and the number of permutations with repetitions with a given number of non-descending runs (or rises). A distinctive feature of the presentation of the material covered in this book is the comments (remarks) following most of the definitions and theorems. In these remarks the particular concept or result presented is discussed and extensions or generalizations of it are pointed out. In concluding each chapter, brief bibliographic notes, mainly of historical interest, are included. At the end of each chapter, a rich collection of exercises is provided. Most of these exercises, which are of varying difficulty, aim to the consolidation of the concepts and results presented, while others complement, extend or generalize some of the results. So, working these exercises must be considered an integral part of this text. A few of the exercises are marked with an asterisk, indicating that they are more challenging. Hints and answers to the exercises are included at the end of the book. Before trying to solve an exercise, the less experienced reader may first look up the hint to its solution. The material of this book has been presented several times to cla.'lses at the department of mathematics of the University of Athens, Greece, since 1972. Its first Greek edition, containing only Chapters 1 to 7, was published in 1984. Since then, the comments and suggestions communicated to me by students and colleagues who used it as a textbook for an introductory course in combinatorics contributed to improvements of certain points. The need for a textbook for a second, more advanced course in combinatorics led to its substantial expansion. The revised second Greek edition, expanded by the addition of Chapters 8 to 14 was published in 1990. Thanks are due to my colleagues Dr. M. Koutras and Dr. A. Kyriakoussis for their comments and suggestions while I prepared this revision. The preparation of this English edition was an opportunity for me to clarify and improve several points. The comments of the reviewers and the series editor were of great help and are gratefully acknowledged. Special thanks are also due to Mrs. Rosa Garderi for the excellent typesetting of the book. Charalambos A. Charalambides Athens, September 2001

The Author

Charalambos A. Charalambides, is professor of mathematics at the University of Athens, Greece. Dr. Charalambides received a diploma in mathematics (1969) and a Ph.D. in mathematical statistics (1972) from the University of Athens. He was a visiting assistant professor at McGill University, Canada (1972-73), a visiting associate professor at Temple University, Philadelphia (1985-86) and a visiting professor at the University of Cyprus (1995-96). Since 1979 he has been an elected member of the International Statistical Institute (lSI). Professor Charalambides' research interests include enumerative combinatorics, discrete probability and parametric statistical estimation. He is an associate editor of Communications in Statistics and co-edited Probability and Statistical Models with Applications, Chapman Hall/CRC Press.

To Angelos and Cassandra

Contents

Preface 1

2

BASIC COUNTING PRINCIPLES 1.1 Introduction 0 1.2 Sets, relations and maps 1.201 Basic notions 1.202 Cartesian product 1.203 Relations 1.2.4 Maps 1.205 Countable and uncountable sets 1.206 Set operations 1.207 Divisions and partitions of a set 1.3 The principles of addition and multiplication 1.4 Discrete probability 1.5 Sums and products 1.6 Bibliographic notes 1.7 Exercises PERMUTATIONS AND COMBINATIONS 201 Introduction 0 202 Permutations 203 Combinations 0 2.4 Divisions and partitions of a finite set 205 Integer solutions of a linear equation 206 Lattice paths 207 Probabilistic applications 20701 Classical problems in discrete probability 20702 Ordered and unordered samples 0 20703 Probability models in statistical mechanics 208 Bibliographic notes 209 Exercises

v 1

1 3 3 5 7 7 9 9 13 14 24 27 35 36 39

39 40 51 62 68 75 82 82 86 89 90 91 xnz

xiv

CONTENTS

3 FACTORIALS, BINOMIAL AND MULTINOMIAL COEFFICIENTS 103 3.1 Introduction . . . . . 103 3.2 Factorials . . . . . . 104 3.3 Binomial coefficients 110 3.4 Multinomial coefficients 123 3.5 Bibliographic notes . 124 3.6 Exercises . . . . . . . . 124 4 THE PRINCIPLE OF INCLUSION AND EXCLUSION 131 4.1 Introduction . . . . . . . . . . . . . . . . . . . 131 4.2 Number of elements in a union of sets . . . . 132 4.3 Number of elements in a given number of sets 144 4.4 Bonferroni inequalities . . . . . . . . 152 4.5 Number of elements of a given rank 155 4.6 Bibliographic notes 158 4. 7 Exercises . . . . . . . . . . . . . . . 159 5 PERMUTATIONS WITH FIXED POINTS AND SUCCESSIONS 169 5.1 Introduction . . . . . . . . . . . 169 5.2 Permutations with fixed points 169 5.3 Ranks of permutations . . . . . 174 5.4 Permutations with successions . 176 5.5 Circular permutations with successions . 180 5.6 Bibliographic notes . 184 5. 7 Exercises . . . . . . . . . . . . . . . . . 184 6 GENERATING FUNCTIONS 6.1 Introduction . . . . . . . . . . 6.2 Univariate generating functions . . . . . 6.2.1 Definitions and basic properties . 6.2.2 Power, factorial and Lagrange series 6.3 Combinations and permutations 6.4 Moment generating functions .. 6.5 Multivariate generating functions 6.6 Bibliographic notes 6. 7 Exercises . . . . . . . . . . .

191 191 192 192 202 208 215 219 223 223

7 RECURRENCE RELATIONS 7.1 Introduction . . . . . . . . . . . . . . . 7.2 Basic notions . . . . . . . . . . . . . . 7.3 Recurrence relations of the first order 7.4 The method of characteristic roots ..

233 233 233 235 239

CONTENTS

7.5 7.6 7. 7 8

The method of generating functions Bibliographic notes . Exercises . . . . . . .

STIRLING NUMBERS 8.1 Introduction . . . . . . . . . . . . . . . . . . . 8.2 Stirling numbers of the first and second kind 8.3 Explicit expressions and recurrence relations . 8.4 Generalized factorial coefficients . . . . . 8.5 Non-central Stirling and related numbers 8.6 Bibliographic notes . 8. 7 Exercises . . . . . . . . . . . . . . . . . .

XV

250 264 264 277 277 278 289 301 314 319 321

9 DISTRIBUTIONS AND OCCUPANCY 9.1 Introduction . . . . . . . . . . . . . . . 9.2 Classical occupancy and modifications . . 9.3 Ordered distributions and occupancy . . . 9.4 Balls of general specification and distinguishable urns 9.5 Generating functions 9.6 Bibliographic notes . 9. 7 Exercises . . . . . .

339 339 340 348 350 353 358 359

10 PARTITIONS OF INTEGERS 10.1 Introduction . . . . . . . . . . . 10.2 Recurrence relations and generating functions 10.3 A universal generating function . . . . . 10.4 Interrelations among partition numbers 10.5 Combinatorial identities 10.6 Bibliographic notes . 10.7 Exercises . . . . . . . .

369 369 370 376 383 391 396 396

11 PARTITION POLYNOMIALS 11.1 Introduction . . . . . . . . . . . . . . . . 11.2 Exponential Bell partition polynomials . 11.3 General partition polynomials . . . 11.4 Logarithmic partition polynomials 11.5 Potential partition polynomials 11.6 Inversion of power series 11.7 Touchard polynomials 11.8 Bibliographic notes . 11.9 Exercises . . . . . . .

411 411 412 419 424 428 433 442 447 448

xvi

CONTENTS

12 CYCLES OF PERMUTATIONS 12.1 Introduction . . . . . . . . . . . . 12.2 Permutations with a given number of cycles 12.3 Even and odd permutations . . . . . . . . . 12.4 Permutations with partially ordered cycles . 12.5 Bibliographic notes . 12.6 Exercises . . . . . . . . . . . . . . . . . . .

461 461 462 468 471 478 478

13 EQUIVALENCE CLASSES 13.1 Introduction . . . . . . . . . 13.2 Cycle indicator of a permutation group . 13.3 Orbits of elements of a finite set 13.4 Models of colorings of a finite set 13.5 Bibliographic notes . 13.6 Exercises . . . . . . . . . . . . .

487 487 488 493 499 507 507

14 RUNS OF PERMUTATIONS AND EULERIAN NUMBERS 513 14.1 Introduction . . . . 513 14.2 Eulerian numbers . 513 14.3 Carlitz numbers . . 522 14.4 Permutations with a given number of runs . 530 14.5 Permutations with repetition and a given number of runs 533 14.6 Bibliographic notes . 537 14.7 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 538 HINTS AND ANSWERS TO EXERCISES

545

BIBLIOGRAPHY

591

INDEX

601

Chapter 1 BASIC COUNTING PRINCIPLES

1.1

INTRODUCTION

Combinatorics, at the early stages of its emergence, was basically concerned with the enumeration of permutations, combinations and partitions of a finite set under various conditions. The demand for construction and study of more general configurations expanded its subject. Combinatorics, nowadays established as a branch of discrete mathematics, deals with the existence, construction, enumeration and examination of properties of configurations satisfying specified conditions. The appearance of combinatorial problems may be traced back far into time. In a letter considered to have been addressed by Archimedes to Eratosthenes, it is proposed, subject to certain conditions, to "compute the number of cattle of the Sun." This problem is one of the rare allusions in antiquity to combinatorics and its confrontation depends on consideration of the polygonal numbers of Pythagoras, Nicomachos and Diophantos. Investigation of the existence or nonexistence of a configuration with certain specified properties constitutes the famous problem of "magic squares." This is the problem of placing positive integers in a square of n rows and n columns in such a way that the sum of the numbers in any row, column or diagonal is the same. Two simple examples of magic squares for n = 3 and n = 5 are given in Figure 1.1. The magic squares were known to Chinese in antiquity. The "Grant Plan," which is described in one of the oldest divinatory books in China, constitutes one such configuration, and legend claims it was decorated upon the back of a divine tortoise that emerged from the river Lo. Substituting the various sets of marks by positive integers, we obtain the left magic square of Figure 1.1. The magic squares were also known to ancient Greeks, according to a reference to them by Theona Smyrneou. The Indians and later the Arabs worked on these squares. The Greek monk Emmanuel Moschopoulos gave the first method of constructing magic squares in the 14th century. Euler and other great mathematicians

2

BASIC COUNTING PRINCIPLES

FIGURE 1.1 Magic squares

4

3 8

g 5 1

2 7 6

11 4 17 10 23

24 12 5 18 6

7 25 13 1 19

20 8 21 14 2

3 16 g 22 15

also showed interest in the same problem, in a more abstract setting, in the construction of finite geometries. For certain configurations that can be easily obtained, such as the combinations of n objects taken k at a time, it is natural to ask for their multitude. In this way a new development in the evolution of combinatorics began with deriving formulas for the number of configurations satisfying specified properties. Of course, combinatorics has been greatly developed in this direction as a result of the powerful influence of probability (with the classical definition of Laplace) and statistics. For a long time combinatorics was considered as the art of counting. From this point of view, elements of combinatorics may be traced almost everywhere. The majority of the classical formulas has been discovered and rediscovered several times. Perhaps the oldest example is the binomial coefficients which, in the 12th century, were known to the students of the Indian mathematician Bhakra; according to a recent discovery, the recursive computation of these coefficients was taught in 1265 by the Persian philosopher Nasir-Ad-Din. Pascal and Fermat rediscovered the binomial coefficients as a by-product of their study of games of chance. It is also known that Cardan, in 1560, proved that the number of subsets of a set of n elements is 2n. In 1666, Leibniz published the first treatise in combinatorics "Dissertatio de Arte Combinatoria." As the configurations became more complex, great effort was put in counting techniques. In this direction, the most celebrated discovery was Laplace's generating function technique. In the 20th century several new applications of combinatorics appeared in statistics (design of experiments), in coding theory (the problem of capacity of a set of signals), in operational research (the traveling salesman problem), etc. Polya proved his famous theorem on counting. When the configurations under consideration become too complex and the derivation of their exact number very difficult, the effort is focused on asymptotic values, bounds, inequalities, etc. A particularly curious case in this direction are the Ramsey numbers, which are very close to the binomial coefficients; it is not even known how to calculate them when their parameter values are greater than 7.

1.2. SETS, RELATIONS AND MAPS

3

In certain quite difficult problems the only method of dealing with them remains that of listing all possible configurations. This method of reasoning by exhaustion has been used in proving important results and in other branches of mathematics. This book concentrates on counting configurations satisfying specified conditions. In this chapter, some necessary basic elements of set theory are presented, in the next section, to pave the way for the presentation of the basic counting principles of addition and multiplication. Combinatorics is tightly connected with discrete probability theory; this connection greatly influenced its rapid development. It is thus reasonable that a brief introduction of the notion of probability and its connection to counting configurations follows the presentation of the basic counting principles. In order to make the book self-contained, the symbols of summation and product are presented and their basic properties are discussed.

1.2 SETS, RELATIONS AND MAPS 1.2.1

Basic notions

The concept of a set is a primitive notion in set theory like the concepts of a point and a straight line in Euclidean geometry. For the presentation of the basic concepts of combinatorics, only a few elements of set theory are needed and not its axiomatic foundation. In this respect, it is sufficient to consider a set as a (well-defined) collection of distinct objects. Sets are usually designated by capital letters of the alphabet with or without subscripts and their elements by lower case letters. The fact that the element a belongs to (or is a member of> the set A is expressed by writing a E A. The negation of this statement is expressed by writing a ~ A. In describing which objects are contained in a set A we use the notation

which requires that the list of elements of the set A is known, or the notation

A= {a: a has property P}, where P is a characteristic property of the elements of the set A. Two special sets are often of interest: the universal set, designated by fl, which is the set of all objects under consideration, and the empty or null set, designated by 0, which does not contain any of the objects under consideration. It must be noted that these two sets may vary from case to case. For example, in studying the real roots of polynomials, 'the set of real

BASIC COUNTING PRINCIPLES

4

numbers R is taken as the universal set. In this framework the set {x E R : x

2

-

2x + 2

= 0}

is an empty set as it is known that the quadratic equation x 2 - 2x + 2 = 0 has only complex roots and, more specifically, the roots x 1 = 1 - i and x 2 = 1 + i, where i = A is the imaginary unit. Further, if the study is extended to the complex roots of polynomials, the set of complex numbers Cis taken as the universal set. In this case the set of roots of the polynomial x 2 - 2x + 2,

{x E C: x 2

-

2x + 2 = 0} = {1- i, 1 + i},

is not empty. A set B is called a subset of a set A if and only if for every b E B, we have bE A (every element of B is also an element of A). This is indicated by writing B ~ A (and is read as B is a subset of A or B is included in A) or equivalently by writing A 2 B (and is read as A is a superset of A or A includes B). If B ~ A and there exists a E A such that a fJ. B, then B is said to be a proper subset of A and this is indicated by B C A or equivalently by A ::::> B. The fact that B ~ A does not exclude A ~ B; when both relations hold, the sets A and B, consisting of the same elements, are called equal and this is indicated by A= B. The set of all subsets of a set A is called the power set of A, and is denoted by P(A). In the sequel, all sets under consideration are considered as subsets of a universal set fl, that is, all are elements of P(fl). Schematic figures are frequently used for illustrating pictorially various sets. The Venn diagrams are such figures in which the universal set fl is defined by a closed area of the plane containing its elements; the elements of fl are defined by geometrical points of this plane. The subsets of fl are defined by subareas. Figure 1.2 represents the fact that B C A. FIGURE 1.2 Subset of a set

.(J)

1.2. SETS, RELATIONS AND MAPS

5

Note that these schematic figures are useful in verifying the validity of theorems of the theory of sets and also in indicating their proofs. Naturally, the proofs must exclusively be based only on the definitions of the notions.

1.2.2

Cartesian product

The concept of an ordered pair and, generally, of an ordered n-tuple is needed for the definition of the Cartesian product of two and generally of n sets. According to the definition of the equality of sets, the pair (twoelement set) {a, b} is equal to the pair {b, a}. Further, there are cases where it matters which element is first and which is second; for example in analytic geometry the pair of coordinates (a, b) of a point on the plane designates its abscissa and ordinate, respectively. The necessity of this distinction of the elements of a pair leads to the introduction of the concept of an ordered pair. A pair of elements a and b (not necessarily different) in which a is considered as the first and b as the second element is called an ordered pair and is denoted by (a, b). According to this definition, two pairs (a, b) and (c, d) are equal if and only if a= c and b = d. The concept of an ordered n-tuple (a 1 , a 2 , ... , an) can be inductively defined as follows. Thus, for n = 3, an ordered triple (a 1 , a 2 , a 3 ) is defined as (a1,az,a3) = ((a1,az),a3), an ordered pair with first element the ordered pair (a1, a 2) and second the element a 3 . Generally, an ordered n-tuple (a 1 , az, ... , an) is defined as

an ordered pair with first element the ordered (n-1)-tuple (a 1 , az, ... , an-d and second the element an. In several cases it is convenient to adopt the vector terminology where the first element a 1 is called first coordinate, the second element az is called second coordinate, etc. After the introduction of the concept of an ordered pair and, generally, of an ordered n-tuple, the Cartesian product can by defined as follows: The Cartesian product of the sets A and B, denoted by A x B, is defined as the set of ordered pairs in which the first coordinate is an element of the set A and the second coordinate is an element of the set B, that is

Ax B ={(a, b): a E A, bE B}. This definition can be extended to n sets A1 , A2 , •.. , An as follows: A1

X

Az X···

X

An= {(al,az, ... ,an): a1 E A1,a2 E Az, ... ,an E An}·

Particularly, if A 1 = Az = · · · = An = A, the Cartesian product is denoted by An.

6

BASIC COUNTING PRINCIPLES

The Cartesian product A x B is geometrically represented by the points (a, b) of the plane, with abscissa x = a taking values from the set A (xaxis) and ordinate y = b taking values from the set B (y- axis). Generally, the Cartesian product A 1 x A2 x · · · x An is represented by the points (a 1 , a2, ... , an) of the n-dimensional space with the k-coordinate taking values from the set Ak (xk -axis), k = 1, 2, ... , n. Example 1.1 Routes

Suppose that there are three different roads a 1 , a 2 and a 3 from town 0 to town A, and four different roads b1 , b2, b3 and b4 from town A to town B. Find the different routes from town 0 to town B. A route from town 0 to town B may be represented by an ordered pair (a, b), where a is a road from the set A = {a1 , a2, a3} of roads from town 0 to town A, and b is a road from the set B = {b1 , ~, b3 , b4 } of roads from town A to town B. l'_hus, the set of routes from town 0 to town B is the Cartesian product:

Ax B =

{(ai,bi),(ai,~),(ai,~),(ai,b4),(a2,bi),(a2,b2),

(a2, b3), (a2, b4), (a3, bi), (a3, b2), (a3, b3), (a3, b4) }.

0

This is geometrically represented in Figure 1.3.

FIGURE 1.3 Set of routes

b b4







b3







b2







bl







a

1.2. SETS, RELATIONS AND MAPS

1.2.3

7

Relations

A binary relation from the set A to the set B is a subset R of the Cartesian product A X B. The ordered pair (a, b) satisfies the relation if and only if (a, b) E R. This is usually denoted by aRb. If B = A, then R is called a relation on A. Such relations are for example the equality relation and the inclusion relation, which have already been introduced in Section 1.2.1. These relations are defined on the set P(D) of the subsets of n. Note that the equality relation on a set A is the diagonal D A of the Cartesian product

n

A2. The above definition is very general. The most interesting relations are those satisfying certain desirable properties. Such properties are the following: A binary relation R on a set A is called: (a) Reflexive, if and only if for every a E A, it holds aRa (b) Symmetric, if and only if aRb implies bRa (c) Antisymmetric, if and only if aRb and bRa imply a= b (d) Transitive, if and only if aRb and bRc imply aRc The inverse (or reciprocal) of a binary relation Ron A denoted by n- 1 is defined as follows: an - 1 b, if and only if bRa. An equivalence relation is a binary relation that is reflexive, symmetric and transitive. Such relation is, for example, the equality relation. An order relation is a binary relation that is reflexive, antisymmetric and transitive. Such relation is, for example, the inclusion relation ~. The inverse of this relation is the relation 2.

1.2.4 Maps A subset F of the Cartesian product A x B is called a map (or function or correspondence) of the set A into the set B if and only if, for every a E A, there exists only one b such that (a, b) E F. Thus, if (a, b1 ) E F and (a, b2) E F, then b1 = ~- In the ordered pair (a, b) E F, the element a E A is called archetype and the element b E B is called the image of a by F and is usually denoted by b = F(a). Consequently, a map F of the set A into the set B associates to each element a E A only one element b E B, the image of a by F. If, in addition, for every element bE B, there exists at least one element a E A such that (a, b) E F, then F is called surjective (onto) . A map F of the set A into the set B is called injective (one-to-one) if and only if there exist at most one element a E A such that (a, b) E F. Thus, if (all b) E F and (a2, b) E F, then a 1 = a 2. Finally, a map F is called bijective (one-to-one and onto) ifF is both surjective and injective.

8

BASIC COUNTING PRINCIPLES

The diagonal T A of the Cartesian product A 2 , TA = { (a, b) E A 2 : a = b}, is called identity map of the set A. Thus, T A associated to each element a E A the same element TA(a) =a. If F ~ A x B is a bijective map of the set A into the set B, then its inverse map, denoted by F- 1 ~ B x A, is defined as follows: (b, a) E F- 1 if and only if (a, b) E For, equivalently, a= p-l (b) if and only if b = F(a) for every a E A and b E B. Consider the set N = {1, 2, ... , n, ... } of natural numbers. A map of the set N into a set A, {(n,an): n E N,an E A}, which corresponds an element an E A to each natural number n E N, is particularly called a sequence of elements of A. This sequence is usually denoted as an E A, n = 1, 2, .... The element an is called the n-th term of the sequence. Consider, in general, an index set I. A map of the set I into a set A,

{(i,ai): i E I,ai E A}, which corresponds an element ai E A to each i E I, is called a family of elements of A. This family is usually denoted as ai E A, i E I. The term family is used instead of the term map when the interest is focused on the elements ai E A and not on the map itself. Note that a sequence is a particular case, I N, of a family.

=

Example 1.2 Maps Consider the sets A= {0, 1, ... , 9}, B = {0, 1, 2} and their Cartesian product Ax B = {(a,b): a E {0, 1, ... ,9}, bE {0,1,2}}.

(a) The subset

{(0,0),(2,0),(4,0), (6,0),(8,0),(1, 1),(3i1), (5,1),(7,1),(9,1)}, of A x B, is a map F from the set A into the set B such that

F(O)

= 0,

F(2)

= 0,

F(4)

= 0,

F(6)

= 0,

F(8)

=0

F(1)

= 1,

F(3)

= 1,

F(5)

= 1,

F(7)

= 1,

F(9)

= 1.

and

Note that the image b = F(a) of an element a E A is the remainder of the division of a by 2. Further, this map F is not surjective since there is no element a E A such that F(a) = 2.

1.2. SETS, RELATIONS AND MAPS

9

(b) The subset

{(0,0), (3,0),(6,0), (9,0), (1, 1),(4, 1), (7,1), (2,2),(5,2), (8,2)},

of A x B, is a surjective map G from the set A into the set B such that G(O) = 0, G(3) = 0, G(6) = 0, G(9) = 0, G(1) = 1, G(4) = 1, G(7) = 1, G(2) = 2, G(5) = 2, G(8) = 2.

This map corresponds to each element a E A the remainder b division of a by 3. 0

1.2.5

= G(a)

of the

Countable and uncountable sets

Two sets A and B are called equivalent, and this is denoted by A ,...., B, if and only if there exists a bijective map of the set A into the set B. For example, the set A = {2, 4, ... , 2n} is equivalent to the set B = {1, 2, ... , n} since the map F(a) = a/2 for every a E A is bijective. More generally, the set A= {a 1,a2, ... ,an} is equivalent to the set B = {1,2, ... ,n}, with F(ak) = k for every k = 1, 2, ... , n, is a bijective map from A into B. A set A is called finite, with n elements, if and only if it is equivalent to the subset { 1, 2, ... , n} of natural numbers. The empty set 0 is considered finite with 0 elements. A set that is not finite is called infinite. A set A is called infinitely countable if and only if it is equivalent to the set N = {1, 2, ... , n, ... } of natural numbers. Denoting by ak the element of A that corresponds to the natural number k, fork= 1, 2, ... , the set A can be represented as if it is finite with n elements, or as

if it is infinitely countable. A set A is called countable if it is finite or infinitely countable. A set that is not countable is called uncountable.

1.2.6

Set operations

The union of two sets A and B is defined as the set that includes the elements of{} belonging to A orB (the conjunction or being not exclusive) and is denoted by A U B, that is

A U B = {w E {} : w E A or w E B}. This definition is extended to n sets A 1 , A2 , •.. , An: A 1 U A2 U · · · U An

= {w

E {} : w E Ak for at least one k E { 1, 2, ... , n}}

BASIC COUNTING PRINCIPLES

10

and more generally to a family of sets {Ai, i E J}:

U Ai = {wE fl: wE Ai for at least one subscript i E J}. iE/

The intersection of two sets A and B is defined as the set that includes the common elements of the two sets and is denoted by A n B, that is

An B ={wE

fl: wE

A and wEB}.

For reasons of economy the notation AB instead of A n B is frequently used. This definition is extended ton sets A1 , A2 , •.. , An: Ar n A2 n ···nAn= {wE fl: wEAk for all subscripts k E {1, 2, ... , n}}

and more generally to a family of sets {Ai, i E J}:

n

Ai = {wE fl: w E Ai for all subscripts i E 1}.

iE/

The union and intersection are pictorially illustrated by Venn diagrams in Figure 1.4; the shaded area represents the set under consideration. FIGURE 1.4 Union and intersection

The complement (with respect to the universal set fl) of a set A is defined as the set that includes the elements of fl not belonging in A and is denoted by A' or Ac orCA, that is A'= {wE fl: w

t/. A}.

The (set theoretic) difference of a set B from a set A is defined as the set that includes the elements of A not belonging in B and is denoted by A- B, that is A- B ={wE fl: wE A, w t/. B}. Note that

A'

=n-

A, A - B

= An B'.

1.2. SETS, RELATIONS AND MAPS

11

FIGURE 1.5 Complement and difference

The Venn diagrams of the difference of two sets and the complement of a set are given in Figure 1.5. The operations of union and intersection of sets share many similarities and differences, with the operations of summation and multiplication of real numbers, as follows from the next theorem.

THEOREM 1.1 For any sets A. B and C the following properties of the union, intersection and complementation hold: (a) Associativity of the union and intersection: (Au B) u C =Au (B u C), (An B) n C =An (B n C). (b) Distributivity of the intersection with respect to the union and of the union with respect to the intersection:

An (B U C)= (An B) u (An C), Au (B n C)= (Au B) n (Au C). (c) Commutativity of the union and intersection:

AU B = B u A, An B = B n A. (d) The null set 0 is the neutral element for the union:

Au0 = 0UA= A, while the universal set

n is the neutral element for the intersection Ann= nnA= A.

(e) The complementation assigns to each set A, the set A' such that AnA'= 0, AUA' = n.

BASIC COUNTING PRINCIPLES

12

(f) !2' = 0, 0' = !2, (A')' = A (g)

AUA=A, Auf2=f2, AnA=A, An0=0.

PROOF

It can be easily verified that these properties are almost direct consequences of the definitions of the union, intersection and complementation. The proof of (b), which requires a somewhat longer series of steps than the others, may be carried out as follows. Consider an element w E An (B U C). Then w belongs to both A and B U C and thus it belongs to A and to at least one of B and C. This implies that w belongs to both A and B or to both A and C and hence it belongs to An B or to An C. Therefore w E (An B) u (An C) and A n (B u C) ~ (A n B) u (A n C). Similarly, it can be shown that (AnB)U(AnC) ~ An(BUC),whenceAn(BUC) = (AnB)U(AnC). The proof of Au (B n C) = (Au B) n (Au C) is quite similar. I

REMARK 1.1 The set P( !2) of all subsets of !2, furnished with the operations of union U, intersection nand the map C: P(f2) --+ P(f2), which to every element A E P(f2) assigns its complement CA =A' E P(f2), is made a Boolean algebra since, according to Theorem 1.1, properties (a) to (e), constituting the definition of such an algebra, are satisfied. I Two important interrelations between the operations of union, intersection and complementation are given in the next theorem. THEOREM 1.2 De Morgan's formulae Let A and B be subsets of a universal set f2. Then

(AUB)'=A'nB', (AnB)'=A'uB'.

PROOF Consider an element w E (Au B)'. Then w ~ AU Band hence A and w ~ B. This implies w E A' and w E B'. Thus w E A' n B' and (AU B)' ~ A' n B'. Similarly it can be shown that A' n B' ~ (Au B)', whence (A U B)' = A' n B'. The proof of the second formula can be similarly carried

w ~

out.

I

REMARK 1.2 ... ,An of !2:

De Morgan's formulae can be extended to n subsets AI, A2 , (AI U A2 U .. · U An)' = A; n A; n .. · n A~, (AI n A2 n ···nAn)' = A; U A~ U · · · U A~,

13

1.2. SETS, RELATIONS AND MAPS

and to a family of subsets { Ai, i E I} of [):

The derivation of these formulae follows verbatim the lines of the proof of Theorem 1.2. I The distinction of two sets according to whether they have elements in common or not will be useful in the sequel. In this respect, the next definition is introduced. Two sets A and B are said to be disjoint if they do not have elements in common, that is, if An B = 0. More generally, the sets A 1 , A2, ... , An are said to be pairwise or mutually disjoint if Ai n AJ = 0 for all pairs of subscripts { i, j} with i -1- j, from the set of indices { 1, 2, ... , n}. In such a case, the operation of the union is designated by + or L instead of U. Some useful properties of the Cartesian product are shown in the next theorem.

THEOREM 1.3 For any sets A. B, C and D the following relations hold:

(Au B)

X

c =(A

X

C) u (B

X

C),

(An B) x (C n D)= (Ax C) n (B x D). PROOF Consider an element u E (A U B) x C. Then u = (a, c) with a E AU B, c E C and hence a E A or a E B and c E C, which implies (a, c) E AxCor(a,c) E BxC. Thereforeu =(a, c) E (AxC)u(BxC)and (AUB) xC ~ (A xC)u(Bx C). It can be shown, following the inverse procedure, that (Ax C)u(B x C) ~ (AUB) x C and thus (Au B) x C = (Ax C)u(B x C). The proof of the second formula is quite similar. I

1.2.7 Divisions and partitions of a set An n-division of a set W (or a division of a set W in n subsets) is an ordered n-tuple of sets (A 1 , A 2, ... , An) that are pairwise disjoint subsets of W and their union is W, that is: Ai ~ W, i = 1, 2, ... , n, Ai n AJ = Ar

0,

i, j = 1, 2, ... , n, i -1- j,

+ A2 + · · · + An = W.

14

BASIC COUNTING PRINCIPLES

Note that, in a division of a set, the inclusion of one or more empty sets is not excluded. For example, the ordered sequence (AI, A 2 , A3, A 4 ), with AI = {w!}, A2 = {w2,w3,w4}, A3 = {w5} and A 4 = 0, is a 4-division of the set W = {wi,w2,w3,w4,w5}· An n-partition of a set W (or a partition of a set W in n subsets) is a set of n sets {AI, A2, ... , An} that are pairwise disjoint and not null subsets of W and their union is W, that is:

Ai ~ W, Ai

= 0, i = 1, 2, ... , n,

Ai n Ai

= 0,

i,j

= 1, 2, ...

, n, i-::/= j,

Note that, in a partition, as opposed to a division of a set, no empty sets are included and the sets constituting it are not ordered.

1.3

THE PRINCIPLES OF ADDITION AND MULTIPLICATION

As has been noted in the introduction, counting configurations constitutes a major part of combinatorics. The set of configurations is in any case finite and so the problem of counting them is a problem of counting the elements of a finite set. The number of elements of a finite set A is denoted by N(A) or IAI and is called the cardinal of it. In the case of a finite universal set n, its cardinality is taken as N(n) N. At this point, though clear from the relevant definitions of the preceding section, it is worth noting explicitly the following lemma.

=

LEMMAI.J If A and B are finite and equivalent sets, then

N(A) = N(B). Thus, the cardinal of a finite set A may be deduced by determining a finite set B, equivalent to A, with known cardinality. Some basic properties of cardinality are proved in the next theorem. THEOREM 1.4 (a) If A and B are finite and disjoint sets, then

N(A +B) = N(A) + N(B).

1.3.

THE PRINCIPLES OF ADDITION AND MULTIPLICATION

15

(b) If A is a subset of a finite universal set fl and A' its complement, then N(A')

= N- N(A).

(c) If A and Bare finite sets, then

N(A- B)= N(A)- N(A n B) and particularly for B

~

A,

N(A- B)= N(A)- N(B). PROOF (a) Since An B = or to B only and thus

0, any element of A+ B

belongs either to A only

N(A +B)= N(A) + N(B). (b) Note that the sets A and A' are disjoint and according to part (a), N(A +A')= N(A) + N(A'). Further, A+ A' = fl, whence N := N(D) = N(A)

+ N(A')

and N(A') = N- N(A). (c) Since (An B') n (An B) = (An A) n (B' n B) = An 0 = 0, the sets A n B' = A - B and A n B are disjoint and further (An B') +(An B)= An (B' +B)= An fl =A. Hence N(A) = N((A n B') +(An B))= N(A n B') + N(A n B) and N(A- B)= N(A n B') = N(A)- N(A n B). In particular, forB~ A, whence An B = B, it follows that N(A- B)= N(A)- N(B) and the proof of the theorem is completed.

I

16

BASIC COUNTING PRINCIPLES

REMARK 1.3 The set function N (·),which corresponds to every set A E P( D) its cardinal N(A), is (a) nonnegative: N(A) ~ 0 for every set A E P(D) and (b) finitely additive: N(A + B) = N(A) + N(B) for any disjoint sets A, BE P(D), according to part (a) of Theorem 1.4. These properties made N(·) a finitely additive measure (or simply measure) on P( D). The most known measures are also the length, area and volume in geometry, the mass in physics and the probability (measure) in the theory of probability. This last measure is introduced in the next section for the needs of the probabilistic applications of combinatorics. I As regards the cardinal of the union of more than two finite and pairwise disjoint sets, the next corollary of the first part of Theorem 1.4 is shown. COROLLARY 1.1 If A 1 , A2, . .. , An are finite and pairwise disjoint sets, then N(A1 + A2 +···+An)= N(AI) + N(A2) + · · · + N(An)·

(1.1)

PROOF Note first that, according to part (a) of Theorem 1.4, relation (1.1) holds for n = 2. Suppose that ( 1.1) holds for n - 1, that is N(A1 + A2 +···+An-d

= N(AI) + N(A2) + · · · + N(An-d·

It will be shown that (l.l) holds also for n. For this reason, set A= A 1

+ A2 +

···+An-I and B =An, whence

= (A1+A2+· · ·+An_i)nAn = A1nAn+A2nAn+· · ·+An-lnAn = 0, A+ B = (A1 + A2 +···+An-d+ An= A1 + A2 +···+An-I+ An·

AnB

Thus, the sets A and Bare finite and disjoint and according to part (a) of Theorem 1.4, N(A +B) = N (A) + N(B), and the hypothesis that (1.1) holds for n- 1, it follows that N(A1

+ A2 +···+An) = N(A1 + A2 +···+An-d+ N(An)

= N(A1) + N(A2)

+ · · · + N(An-d + N(An)·

Hence, according to the principle of mathematical induction, ( 1.1) holds for every integer n ~ 2. I REMARK 1.4 Relation ( 1.1) is often referred to as the addition principle and can also be stated as follows: if an element (object) wi can be selected in ki different ways, for i = 1, 2, ... , n, and the selection of wi excludes the simultaneous selection of w1 , i, j = 1, 2, ... , n, i I j, then any of the elements (objects) w 1 or w2 or · · · or Wn can be selected in k1 + k 2 + · · · + kn ways. I

THE PRINCIPLES OF ADDITION AND MULTIPLICATION 17

1.3.

REMARK 1.5 For each division (A 1 , A 2 , ... , An), as well as for each partition {A 1 , A2 , ... , An}. of a finite set W, the sets A 1 , A2 , ... , An are finite and pairwise disjoint. Thus, by Corollary 1.1, the following relation holds:

N(W)

= N(A1 + A2 +···+An)= N(A1) + N(A2) + · · · + N(An),

I

for both a division and a partition of a finite set.

The next theorem is concerned with the cardinality of the Cartesian product of finite sets.

THEOREM 1.5 If A and B are finite sets, then

N(A x B)= N(A)N(B). PROOF Let A= {a 1, a 2 , ... , ak} and B may be written in the form

A= A1

(1.2)

= {b1, b2 , •..

+ A2 + · · · + Ak, A;= {a;},

i

,

br }. Then the set A

= 1, 2, ... , k

and the Cartesian product A x B, according to Theorem 1.3, in the form

where the sets (Cartesian products) A 1 x B, A2 x B, ... , Ak x Bare pairwise disjoint. Hence

N(A

X

B)= N(Al

X

B)+ N(A2

X

B)+ ... + N(Ak

X

B).

Noting that, for any i E { 1, 2, ... , k}, the Cartesian product A; x B is the set of the ordered pairs (a;, bj) with first element the only element ai of the set A; = {a;} and second element any of the elements bj. j = 1, 2, ... , r, of the set B, it follows that N(A; X B)= N(B), i = 1,2, ... ,k. Thus

N(A x B)= kN(B) = N(A)N(B) and the proof of the theorem is completed.

I

Example 1.3 Routes revisited Suppose that there are three different roads a 1 , a 2 and a 3 from town 0 to town A, four different roads b1, b2 , b3 and b4 from town A to town B, and two different roads c 1 and c 2 from town 0 directly to town B. Calculate the number of different routes from town 0 to town B.

BASIC COUNTING PRINCIPLES

18

A route from town 0 to town B through town A may be represented by an ordered pair (a, b), where a is a road from the set A = {a 1 , a 2 , a 3 } and b is a road from the set B = {b1 , b2 , b3 , b4 }. Thus the set of routes from town 0 to town B through town A is the Cartesian product Ax B = {(a, b) :a E A, bE B}. Also, the set of routes from town 0 to town B directly is C = { c 1 , c2 }. Therefore, by the addition principle and expression (1.2), the number of different routes from town 0 to town B equals N(A)N(B)

+ N(C)

= 14.

D

A subset S 2 of the Cartesian product !! 2 , of a finite universal set fl with itself, cannot always be written as a Cartesian product A x B, with A ~ fl and B ~ fl. Nevertheless, an expression similar to (1.2) may be obtained for the number of elements of s2 when the number of selections for the first coordinate and, for each of these selections, the number of selections for the second coordinate, are known. Specifically, the next corollary, which is readily deduced from Corollary 1.1 and Theorem 1.5, is concerned with the number of elements of s2. COROLLARY 1.2 lfS2 = (A 1 x B 1 ) + (A 2 x B2) + · · · + (Ak x Bk), where A 1 ,A2 , . .. ,Ak are finite and pairwise disjoint sets and B 1 , B 2 , ... , Bk are finite sets, then

In particular; if Ai = {ai} and Bi = {bi,l, bi,2, ... , bi,r }, i = 1, 2, ... , k, whence s2 = {(ai,bi,j). i = 1,2, ... ,k, j = 1,2, ... ,r}, and introducing A= {a 1,a2, ... ,ak}, then N(S2)

= N(A)N(Bi) = kr.

( 1.4)

The cardinality of the Cartesian product of more than two finite sets is inductively deduced from Theorem 1.5. COROLLARY 1.3 If A,, A2, ... , An are finite sets, then

N(A 1 PROOF

X

A2

X · ·· X

An)= N(AI)N(A2) · · · N(An)·

(1.5)

Note first that, according to Theorem 1.5, relation (1.5) holds for

n = 2. Suppose that (1.5) holds for n - 1, that is,

THE PRINCIPLES OF ADDITION AND MULTIPLICATION 19

1.3.

It will be shown that (1.5) holds also for n. For this reason put A= At x A 2 x · · · x An-t and B =An, whence

A

X

B =(At

X

A2

X··· X

An-t)

X

An= At

Thus, according to Theorem 1.5, N(A x B) that ( 1.5) holds for n - 1, it follows that

N(A1

X

A2

X··· X

An)= N(At

X

X

A2

X··· X

An-t

X

An.

= N(A)N(B), and the hypothesis A2

X··· X

An-t)N(An)

= N(At)N(A2) · · · N(An_t)N(An)

and according to the principle of mathematical induction, (1.5) holds for every integer n 2: 2. I

Example 1.4 Binary number system In the binary number system each number is represented by a binary sequence of Os and Is. For example, the numbers 5 and II, which are expressed in terms of powers of 2 as 5 = 1· 22 + 0 · 21 + 1· 2° and 11 = 1· 23 + 0 · 22 + 1· 21 + 1· 2°, are represented by the binary sequences (1,0, 1) and (1,0, 1, 1), respectively. Note that, with the exception of the number 0, which is represented by the one digit sequence (0), all the other binary sequences start with digit 1. Calculate the number of four-digit binary sequences. The first digit of a four-digit binary sequence is necessarily l. Further, a fourdigit binary sequence (1, at, a 2 , a 3 ) uniquely corresponds to an ordered triple (a 1 ,a2,a3), with ai E Ai = {0, 1}, i = 1, 2,3. Thus, the set B 4 of four-digit sequences is equivalent to the set At x A2 x A3, of ordered triples (at, a 2, a3), with ai E Ai = {0, 1}, i = 1, 2, 3 and by Lemma 1.1 and Corollary 1.3, N(B4) = N(At

X

A2

X

A3) = N(At)N(A2)N(A3) = 23.

Clearly, the 8 four-digit binary sequences are the following

(1, 0, 0, 0), (1, 0, 0, 1), (1, 0, 1, 0), (1, 0, 1, 1), (1, 1, 0, 0), (1, 1, 0, 1), (1, 1, 1, 0), (1, 1, 1, 1) and represent the integers 8, 9, 10, 12, 13, 14 and 15.

0

Example 1.5 Factors of a positive integer Evaluate the number of positive integers that are factors of the number 300. Note first that the number 300 is expressed as a product of prime numbers as

Each factor of this number is of the form

BASIC COUNTING PRINCIPLES

20

wherei 1 E A 1 = {0, 1, 2}, i 2 E A 2 = {0, 1} and i 3 E A3 = {0, 1, 2}. Therefore, by ( 1.5), the number of different factors of the number 300 equals

The set of these 18 factors is

{1,2,3,4,5,6,1o,12,15,2o,25,3o,5o,6o,75,1oo,15o,3oo}.

D

An extension of expression (1.4) to a subset Sn of the n-fold Cartesian product is given in the following corollary.

nn

COROLLARY 1.4 Let Sn be a subset of elements (w1,w2, ... ,wn) of then-fold Cartesian product fl'l, of a finite universal set Sl with itself Specifically, assume that the first coordinate w1 can be selected from a set A = {a 1, a2, ... , ak,} of k 1 elements and, for each selection w 1 = ai 1, the second coordinate w 2 can be selected from a set Ai 1 = {ai,,1, ai,,2, ... ,ai 1,k2 } of k2 elements, i1 = 1, 2, ... , k1, and so on. Finally, assume that for each selection w1 = ai 1 , w2 = ai 1,i2 , ... , Wn-1 = a; 1 ,i2 , ... ,in-1' the last coordinate Wn can be selected from a set Ai,,i2 , ... ,in-I = { ai, ,i2,··· ,in-1 ,1' a;, ,i2,··· ,in-! ,2, ... , ai, ,i2, .. ,in-1 ,kn} of kn elements, ir = 1, 2, ... , kr. r = 1, 2, ... , n - 1. Then

REMARK 1.6

Relation ( 1.6) is often referred to as the multiplication principle and can be restated as follows: if an element (object) w1 can be selected in k 1 ways and for each of these ways an element w2 can be selected in k 2 ways and so on and for each of these ways an element Wn can be selected in kn ways, then all the elements (objects) w1 and w2 and··· and Wn can be selected (sequentially) in k1 k2 · · · kn ways. In many applications the set of different selections of wi cannot be identified in advance, but only after the selections of w1, w2, ... , wi_ 1. This does not cause any difficulty in the application of the multiplication principle since the only requirement is the cardinality of the set of selections of wi. This point is further clarified I in the next example.

Example 1.6 Booking tickets Suppose that there are n stations on a railway line. How many different kinds of tickets have to be provided so that booking is possible from any station to any other station? Let us represent the route from station si to station si by the pair (si, si), i =/= j. The set of different kinds of tickets to be provided is equal to the set 5 2 of ordered

1.3.

THE PRINCIPLES OF ADDITION AND MULTIPLICATION

21

=

pairs (a, b) of different stations. Note that the set of different selections of a is A { s 1 , s 2 , ... , sn}, while the set of different selections of b is not known in advance, since b has to be different from a. After the selection a si from the set A, the set of different selections of b is Bi = A - {si} = { s 1, s 2 , ... , si-I, si+ 1, ... , sn }. Irrespective of the possibility of identifying the set Bi, its cardinality is in any case equal to N(Bi) n- 1 and hence formula (1.4) can be applied. Therefore

=

=

N(Sz) = N(A)N(Bi) = n(n- 1),

0

which is the required number of different kinds of tickets.

Example 1.7 The number of subsets of a finite set

=

=

Consider a finite set Wn {WI, W2, ... , Wn} and let An P(Wn) be the set of subsets of Wn. The number sn = N(An) may be determined as follows. Note first that, to any subset U of Wn there corresponds an ordered n-tuple (ai,a 2 , •.. ,an) such that aj 0 if WJ ¢ U, and aj 1 if Wj E U for j = 1, 2, ... , n. In this way, the null set 0 ~ Wn corresponds to the ordered n-tuple (0, 0, ... , 0), with all components zero; the one-element set {WI} ~ Wn corresponds to the ordered n-tuple (1, 0, ... , 0), with the first component equal to one and the rest components zero; and the set Wn ~ Wn corresponds to the ordered n-tuple (1, 1, ... , 1), with all components equal to one. This correspondence is one to one and, according to Lemma 1.1, the number sn of subsets ofWn is equal to the number of ordered n-tuples (a I, a 2 , ... , an), with aj E Aj 0, 1}, which, in tum, is equal to the number of elements of the Cartesian product AI x A2 x · · · x An, with A.J {0, 1 }, j 1, 2, ... , n. Then, according to formula (1.5), this number is equal to Sn = 2n. 0

=

=

={

=

=

Example 1.8 Sum of terms of a geometric progression The sum of the first n terms of a geometric progression with the first term equal to 1 and proportion equal to 2 may be derived combinatorially as follows: Let En be the set of nonempty subsets of a finite set Wn w1 , w2 , •.. , Wn} and Ck the Set of SUbsets of the finite set Wk = {WJ, W2, ... , Wk }, each of which contains Wk, k = 1,2, ... ,n. Then cl,C2,··· ,Cn are pairwise disjoint and C1 + C2 + · · · + Cn = En. Note that, to each subset of Wk containing the element wk, corresponds a subset of Wk-I (without any restriction), from which it is obtained by adding wk, k = 2, 3, ... , n. This correspondence is one to one and hence the number N(Ck) is equal to the number of subsets of Wk-l, which, in tum, according to Example 1.7, is equal to N(Ck) = 2k-l, k = 2, 3, ... , n. Especially, the number of subsets of W 1 = {WI} containing the element w 1 is equal to N(CI) = 1. Further, the number of nonempty subsets of Wn is equal to N(En) 2n - 1. Therefore, on using (1.1 ), it follows that

={

=

1 + 2 + 22

+ · · · + 2n-I

= 2n - 1,

BASIC COUNTING PRINCIPLES

22

0

which is the required expression.

Before concluding this section on the basic counting principles, it is worth noting that, in several enumeration problems, the number of configurations satisfying specified conditions can only be expressed recursively. In addition, even when the direct expression of this number in a closed form is possible, a recurrence relation is useful at least for tabulation purposes. The notion of a recurrence relation, which is extensively used in the sequel, is briefly introduced here. (The basic methods of solving recurrence relations are presented in Chapter 7.) Consider a sequence of numbers an, n = 0, 1, .... In combinatorics an may represent the number of subsets of a finite set Wn = {WI, w2, ... , wn} that satisfy a set of specified conditions. In general, we may assume that an+r = F(n, an, an+l, ... , an+r-1), n = 0, 1, ....

This equation, in which the term an+r is expressed as a function of the preceding r terms, an, an+ I, ... , an+r-l, of the sequence, is called recurrence relation of order r. The notion of a recurrence relation is also introduced in the case of a double-index sequence an,k, n = 0, 1, ... , k = 0, 1, .... So, the equation

is called recurrence relation of order (r, s). Notice that r is the order of this recurrence relation with respect to the first index (variable) and s is its order with respect to the second index (variable). In this case the term an+r,k+s is expressed as a function of the (n + 1)(k + 1)- 1 = nk + n + k terms an,k, an,k+l, an+l,k, ... , an+r-l ,k+s> an+r,k+s-l of the double-index sequence. From the computation point of view, the tabulation of the number an, for n = 0, 1, ... , or the number an,k, for n = 0, 1, ... , k = 0, 1, ... , can be done more easily step-by-step by using the corresponding recurrence relation. For this purpose, the knowledge of the r initial conditions (values) a0 , a 1 , ..• , ar-l, in the first case, and of the r + s initial conditions (sequences) aok,alk,··· ,ar-lk and ano,anl,··· ,ans-I, in the second case, are required. The initial conditions guarantee the uniqueness of the solution of the recurrence relation. In this section only a very simple example of a recurrence relation is discussed. Closely connected with a recurrence relation is the (finite) difference equation, which is defined as follows. The first order finite difference, with increment h, of a function y = f(x) denoted by .tJ.hf(x), is defined by .tJ.hf(x) = f(x +h)- f(x). Recursively, the r-th order finite difference of f(x) is defined by .:1/J(x) = .tJ.h[.tJ.~-I f(x)], r = 2, 3, .... Introducing the displacement (shift) of f(x), which is defined by Ehf(x) = f(x +h) and recursively by Ehf(x) = Eh[E~-l /(x)] = f(x + rh), r = 2, 3, ... , it follows 1

I

I

1

I

I

1.3.

THE PRINCIPLES OF ADDITION AND MULTIPLICATION 23

that !lhf(x) form

= Ehf(x)- If(x),

Ef.f(x)

where If(x)

= F(x, f(x), Ehf(x), ...

=

f(x). An equation of the

, E~-I f(x)),

xER

or equivalently of the form

ll'f.f(x) = G(x, f(x), !lhf(x), ... , .:1~-I f(x)) = 0, x E R is called difference equation of order r. In the particular case where the function y = f(x) is defined only on a countable set of points {x 0 , XI, •.. , Xn, ... } which, in the applications of the calculus of finite differences, are usually equidistant, Xn = x 0 + nh, n = 0, 1, ... , the transformation Zn = (xn- x 0 )/h, n = 0, 1, ... is used. So, the function f is transformed to the function g, with g(n) = f(x 0 + nh), which is defined on the set {0, 1, ... } of nonnegative integers. In this particular case, using the sequence

Yn=g(n)=f(xo+nh), n=0,1, ... , and since E~(xn) = f(xn difference equation, with x

Yn+r

+ jh)

= Xn,

= g(n + j) = Yn+j, j = 1, 2, ... , the may be written as

= F(n,yn,Yn+I•···

,Yn+r-I), n

= 0,1, ...

,

which is a recurrence relation of order r. Note that the method of solving a finite difference equation is the same as that of solving the recurrence relation even when the function y = f(x) is defined for every x E R. In the last case an investigation of the solution is required.

Example 1.9 A recurrence relation for the number of subsets of a finite set As in Example 1. 7, consider a finite set W n = { w 1 , w 2 , . . . , Wn} and let An = P(Wn) be the set of subsets of Wn. The number sn = N(An) may be deduced recursively as follows. The set An+ I = P(Wn+I) of subsets of Wn+l = {w1, w2, ... , Wn, Wn+l} can be divided into the following two disjoint subsets: the set A of subsets of Wn+ 1, each of which does not include the element Wn+ I and the set B of subsets of Wn+I, each of which includes the element Wn+l· Hence An+ I =A+ Band, by the addition principle, N(An+d = N(A) + N(B). Clearly, A = An and so N(A) = N(An). Further, to each subset B that belongs to B there uniquely corresponds the subset A = B - {Wn+l} that belongs to An and so, by Lemma l.I, N(B) = N(An)· Consequently N(An+I) = 2N(An) and Bn+I = 2sn, n = 0, 1, ... ,

with so = 1, which is the number of subsets of the null set. This is a homogenous recurrence relation of the first order with constant coefficients. Iterating (applying

BASIC COUNTING PRINCIPLES

24

repeatedly) it, we find

and, since so

1.4

= 1, we conclude that Sn = 2n.

0

DISCRETE PROBABILITY

The theory of probability is concerned with the study of mathematical models, known as stochastic models, which are used in explaining random or stochastic phenomena or experiments. The basic characteristic of these experiments is that the conditions under which they are performed and the values of various quantities appearing in them do not predetermine the outcome, but do predetermine the set of possible outcomes. The element of randomness lies in the inability of predetermining the outcome of random phenomena or experiments. The set n of the possible outcomes of a random phenomenon or experiment is called sample space and the elements w of n are called sample points. It should be noted that it is possible to define more than one set of possible outcomes for each random phenomenon or experiment and, according to the requirements of the specific problem, the more appropriate of these is chosen as the sample space. The inappropriate choice of the sample space leads to many paradoxes. The sample space may be finite or countably infinite or uncountable. For the cases of finite or more generally countable sample spaces, on which this presentation concentrates, every subset A of n is called an event. An event A = { w} containing only one element of n is called an elementary or simple event. The classical definition of probability was first expressed by De Moivre ( 1711) as follows: the probability of the occurrence of an event is the fraction whose numerator is the number of possibilities favorable for the occurrence of the event and the denominator is the number of all possibilities, provided that all possibilities are equally probable. This condition is essential because, otherwise, by considering the two possibilities of the occurrence and the non-occurrence of an event, it can be concluded that its probability is one half. This is not true in general since these two cases are not always equally probable. The concept of equally probable cases should be defined independently of the notion of (the measure) of probability; otherwise, in the classical definition of probability, there would be a vicious circle. This is achieved by the adoption of the principle of the want of sufficient reason. So if, according to all available data, no reason is known for regarding any of

1.4. DISCRETE PROBABILITY

25

the possibilities more or less probable than any other, then all possibilities are regarded as equally probable. It should be noted that the classical definition of probability applies only on finite sample spaces. The foundation of the theory of probability based on the classical definition of probability is attributed to Laplace (1812). Consider a finite sample space fl = {w1 ,w2 .•. ,wN }, whose elements (sample points, possibilities) are, according to the principle of the want of sufficient reason, equally probable and an event A E P(fl). The probability of A, denoted by P(A), is given by the expression P(A) =

N~A)'

=

where N(A) is the number of elements of A and N N(fl) is the number of elements of the sample space fl. Note that the condition of equally probable sample points (possibilities) is then expressed by

P({wi})

= P({w2 }) =

···

1

= P({wN}) = N"

According to the definition of the classical (uniform) probability, the calculation of the probability P(A) of an event A in a finite sample space fl whose elements are equally probable is a purely combinatorial problem of counting the numbers N(A) and N of certain configurations. REMARK 1.7 It is worth presenting the most important properties of the classical probability that subsequently inspired the suitable choice of axioms in the axiomatic foundation of the theory of probability. The set function P(·), which, in the case of a finite sample space fl whose elements are equally probable, assigns the number P(A) = N(A)/N to each event A E P(fl) is (a) nonnegative: P(A) 2: 0 for every event A E P(fl), (b) normalized: P(fl) = 1 and (c) finitely additive: P(A +B) = P(A) + P(B) for any disjoint (mutually exclusive) events A, BE P(fl). Properties (a) and (c), which follow directly from the definition of classical probability and the corresponding properties of the set function N ( ·), made P( ·) a finitely additive measure on P( fl) (see Remark 1.3). Property (b), which is a direct consequence of the definition of classical probability, distinguishes the probability from other measures. Note that, from (c) and the principle of mathematical induction, the next expression is deduced: P(A1

+ A2 + · · · +An)

= P(AI)

+ P(A2) +. ·. + P(An),

for any pairwise disjoint events A 1 ,A 2 , ... ,An E P(fl). Also, if Wi, i 1, 2, ... , n are finite sample spaces, each with equally probable elements, and Ai E P(Wi). i = 1, 2, ... , n, then from (1.5) it follows that P(A 1 X A2

X ·· · X

An)

= P(AI)P(A 2 ) · · · P(An),

26

BASIC COUNTING PRINCIPLES

provided the elements of the sample space fl = WI equally probable. I

X

w2

X ••• X

Wn are also

An extension of the classical definition of probability, in the case of a finite sample space fl whose elements are not necessarily equally probable, constitutes the next definition of probability: A set function P(·) defined on the set of events P(fl), assuming real values and satisfying properties (a), (b) and (c) is called probability (or measure of probability). These properties are quite general and, for the calculation of the probability of any event A E P(fl), the knowledge of the probabilities Pi = P( { wi}) of the elementary events {wi}, i = 1, 2, ... , N is required. Indeed, if A= {willWi 2 , • •• ,w;k}, then, with Air = {w;r}, r = 1, 2, ... , k, it follows that A= A;,

+ Ai2 + · · · + Aik,

Air n Ai, =

0, r

-::f. s,

and so k

P(A) = LP({wir}). r=O

In the special case in which P({w!}) it reduces to

= P({w2 }) = ··· = P({wN}) = 1/N,

k P(A) = N'

with k = N(A), which is the classical definition of probability. Three useful properties of the probability that follow directly from the classical definition of probability and Theorem 1.4 are quoted here for easy reference in the following chapters. The probability of the complementary event A' of A may be expressed as P(A') = 1 - P(A).

For any events A and B, the next relation holds P(A- B)

and particularly for B

~

= P(A) -

P(A n B)

A,

P(A- B)= P(A)- P(B).

Examples with applications of the classical definition of probability are given in the following chapters after the introduction of the combinatorial concepts necessary for their presentation.

1.5. SUMS AND PRODUCTS

1.5

27

SUMS AND PRODUCTS

A finite sum of n terms, a 1 , a 2 , ... , an, is denoted by

or briefly by

n

Sn = Laj. j=l The number 1 is called the lower limit and the number n the upper limit of the sum. Note that the lower limit can be any integer r < n. Clearly, the value of the sum n

Sr,n = Lai j=r is completely determined by the general term aj (j = r, r + 1, ... , n) and the limits r and n and does not depend on the (bound) variable j even though it occurs in its expression. Thus, the variable j can be replaced by another variable i without any effect on the value of the sum: n

n

Sr,n = Laj =La;= ar +ar+l +···+an· j=r i=r More generally, the transformation i = j + m, with inverse j i - m, where m is a given integer, may be used. In this case, the general term aj (j = r, r + 1, ... , n) becomes b; =ai-m (i = r + m, r + m + 1, ... , n + m) and the sum sr,n is transformed to

n Sr,n

n+m

= z=aj = j=r

and particularly for m

L

n+m a;-m

=

i=r+m

2::

b;

i=r+m

= -r n

n-r

n-r

Sr,n = Laj = Lai+r j=r i=O

= Lb;. i=O

This brief notation of simple (with respect to one variable) sums is also used to represent double (with respect to two variables) sums and generally multiplesums. So,thesumofthetermsa;,j,j = 1,2, ... ,k,j = 1,2, ... ,n, is denoted by n

Sk,n =

k

L L a;,j

j=l i=l

28

BASIC COUNTING PRINCIPLES

and, more generally, the sum of the terms k = 1, 2, ... , r, is denoted by nr

Jr=l

, ...

,J,,

jk

1, 2, ... ,nk,

nt

:2: ···:2: :2:

=

Sn,,n2 ... ,n,

n2

aJd 2

aJ,,j2,···,Jr·

}2=1 }J=l

REMARK 1.8 If the set J of the values of the variable j and, more generally, if the sets J 1 , Jz, ... , Jr of the values of the variables j 1 , jz, ... , ir, respectively, are not sets of consecutive integers, the following notation of the sums is adopted:

s

= :2: aj' s = jEJ

:2: ... :2: :2: irEJr

ajloi2o··· ,j,.

}2Eh j, EJ1

When the sets J and J 1 , J2 , ... , Jr are defined by the conditions C and C 1 , C 2 , ... , Cr. respectively, the following notation of the sums may be used:

According to the last notation, the sums n

= :2: aj'

Sn

n

Sk,n

k

= :2: :2: ai,j

j=l

j=l i=l

may, equivalently, be written as: Sn

:2:

=

l~j~n

aj,

Sk,n

=

:2: :2:

aj·

l~j~n l~i~k

If the expression of the conditions C and C 1 , C 2 , ... , Cr is not very simple, then it is preferable to avoid writing it underneath the summation sign. In this case the conditions are written after the sum in the form of phrases like "where the summation is extended over all j or j 1 , jz, . .. , ir such that the conditions C or cl' c2, ... 'Cr are satisfied." I REMARK 1.9

If in the sum

the general term is constant (independent of the subscript j): ai 1,2, ... ,n,then n

sn =

:2: a = a + a + · · · + a = na. j=l

a, j

29

1.5. SUMS AND PRODUCTS

The special case a

= 1 is particularly noted: n

L1=n. j=l

In general,

L1 = N(J) jEJ

and

L ... L L irEJr

1 = N(J1 )N(J2 )

.•.

N(Jr),

j,EJ, j,EJt

I

for any finite sets J, J1, )z, ... , Jr.

Some basic properties of finite sums, which constitute simple extensions of the corresponding properties of the sum and product of two real numbers, are presented in the next theorem.

THEOREM 1.6 n

n

LbaJ = bLaJ, j=l

j=l

n

n

n

j=l

i=l

j=l

n

k

n

j=l

i=l

Lai + Lb; = L(aJ + bJ), k

k

n

l:aJ Lb; = LLaJbi = LLaJb;, n

j=l i=l

k

i=l j=l

k

n

LLai,J = LLai,J· j=l i=l

i=l j=l

REMARK 1.10 As regards the possibility of changing the order of summation in double (or multiple) sums, special care should be given when the set of values of one variable depends on the set of values of the other variable. A characteristic example of this nature constitutes the sum n

j

LLai,J, j=l i=l

where, for a given value of the variable j E J 1 = {j : 1 ~ j ~ n }, the set /1 = { i : 1 ~ i ~ j} of values of the variable i depends on the value j E J 1 . This

BASIC COUNTING PRINCIPLES

30

dependence can be reversed without altering the set K = { (i, j) : 1 ~ i ~ j ~ n}, of values of the pair (i, j) of variables in the double sum. Indeed, for a given value of the variable i E I 2 = {i : 1 ~ i ~ n}, the set of values of the variable j is h = {j : i ~ j ~ n}. Hence n

n

j

LLai,j

n

= LLai,j = LLai,j·

j=l i=l

i=l j=i

(i,j)EK

As a second example, the relation n

n-j+l

n

n-i+l

j=l

i=l

i=l

j=l

'L 'L a;,j='L 'L

a·. t,J

I

can be similarly established.

A finite product of n terms, a 1 , a 2 , ... , an, is denoted by

or briefly by n

Pn

=II aj. j=l

Clearly, all notational and other remarks previously made on finite sums are applied, with the necessary changes, to finite products as well. The brief notation of simple products is also used for the presentation of double and more generally multiple products. So, the product of the terms i = 1,2, ... ,k, j = 1,2, ... ,n, is denoted by

ai,j,

n

Pk,n

=

k

II II a;,j j=l i=l

and more generally, the product of the terms aj,J 2 , ... ,J,, k = 1, 2, ... , r, is denoted by n1'

Pn, ,n2,··· ,n,

n2

n1

II ... II II

=

j,=l

a)! ,j,, ... ,j,.

)2=1)1=1

It can be easily shown that n

k

k

n

II II ai.j =II II ai,j, J=l i=l

ik = 1,2, ... ,nk,

i=l j=l

1.5. SUMS AND PRODUCTS

n

31

j

n n

II II ai,j = II II ai,j, i=l j=i

j=l i=l

n n-j+l

II II j=l

n n-i+l

ai,j

= II

II

i=l

j=l

i=l

ai,j.

The union of n sets, A 1 , A 2 , ... , An, is briefly denoted by n

UAi := A1 U A2 U · · · U An i=l

and the intersection of these sets by

n n

Ai := A1

n A2 n · · · n An

i=l

and both share properties analogous to those of finite sums and products. Example 1.10 Sum of terms of an arithmetic progression The general term of an arithmetic progression is a1 = a+ jb, j = 1, 2, ... , n. The sum n

sn(a,b)

= L:aj,

aj =a+jb, j

= 1,2, ... ,n,

j=l

may be evaluated as follows. Using the transformation i = n- j + 1, with inverse j = n- i + 1, the general term aj = a+ jb (j = 1, 2, ... , n) takes the form bi an-i+l ={a+ (n + 1)b}- ib (i = 1, 2, ... , n). Therefore

=

n

sn(a,b) = Lbi, bi ={a+ (n + 1)b}- ib, i

= 1,2, ...

i=l

and

n 2sn(a, b)= L aj j=l

n

+L i=l

n bi

= L(aj + bJ)· j=l

Since a1 + b1 = 2a + (n + 1)b, j = 1, 2, ... , n, it follows that

2sn(a,b) =n{2a+(n+1)b} and Sn

'b)_ n{2a + (n (a, b) _~( - L a +J j=l

2

+ 1)b} .

,n

BASIC COUNTING PRINCIPLES

32

In particular, for a = 0 and b = 1, the last expression reduces to Sn

D

+ 1).

= t j = n(n

2

j=l

Example 1.11 Evaluate the sum

n

Cn,2

= "'"' L....,]·2 · j=l

Using the identity

we get

3cn,z

n

n

j=l

j=l

= 3 Li 2 = Z:U + 1) 3 -

n

n

n

j=l

j=l

j=l

Z:i- 3 Li- L 1.

Putting in the first sum of the right-hand side i 1.10 and Remark 1.9)

= j + 1 and, since (see Example

t j = n(n2+1), t1=n, j=l

j=l

we find n

n+l

3cn,2

=L

i3-

i=2

Li3- 3n(n2+ 1) -

n

= (n +

1)3- 1- 3n(n2 + 1) - n

j=l

n(2n 2 + 3n 2 + 1)

n(n + 1)(2n + 1)

2

2

Hence

Cn,z

= t j 2 = n(n + 1~(2n + j=l

Example 1.12 Evaluate the sum

n

Cn=

n

2:2)j. j=l i=l

i+j=n

1).

D

1.5. SUMS AND PRODUCTS

33

Introducing in the inner sum the transformation k = n- i, with inverse i = n- k, and taking into account the restriction i + j = n, it follows that, for a given j E {1, 2, ... , n }, k = j. Then the sum Cn reduces to n

n

n

j=l

j=l

j=l

Since (see Examples l.l 0 and l.ll)

~ . _ n(n + 1) ~ .2 _ n(n L... 1 2 ' L... 1 j=l

+ 1)(2n + 1) 6

'

j=l

it follows that

C _ n 2 (n

+ 1) _

n (n

+ 1) (2n + 1)

2

n-

6

n(n 2 - 1) 6

D

Example 1.13 Sum of terms of a geometric progression The general term of a geometric progression is aj = abi- 1 , j = 1, 2, ... , n. The sum n

n

gn(a,b) = Laj =a Lbi- 1 j=l

j=l

may be evaluated as follows: multiplying both sides of this expression by (1- b), we get

(1- b)gn(a, b)

n = a(1- b)~ bi- 1 =a

( n

~ bi- 1

and so ~

·_ 1

= L... ali'

=

a(1 - bn) _ b .

j=l

1

Note that the sum 00

g(a, b)=

L abij=l

1

,

n

~ bi

+ 1, whence j

Putting in the second sum of the last equality i = j

gn (a, b)

-

)

.

= i - 1, we find

34

BASIC COUNTING PRINCIPLES

of an infinite numberoftermsof a geometric progression aj = af>J-I ,j = 1, 2, ... , with lbl < 1, may be calculated by using the last result. Indeed, from co

~ ahl- 1 L... j=1 and since limn-; co bn

(1 _ bn)

n

= n-->co lim ~ abl- 1 = lim _a-'-----'L... n-->co 1 - b j=1

= 0 for lbl

< 1, it follows that co

~

·-I

g(a,b) = L...afY j=1

a

=

1

0

_ b.

Example 1.14 Evaluate the double sum Sn(a,b) = LLai-lb1-1. t:::;i:::;j:::;n The set of values of the pair (i, j) of (bound) variables of this sum, K = { (i, j) : 1 ::; i ::; j ::; n},

may be expressed as follows: for a given value of the variable j E J = {j 1 ::; j ::; n }, the set of values of the variable i is I = { i : 1 ::; i ::; j} and hence n

Sn(a,b)

j

=LLai-1b1-1 =LLai-1b1-I =LLai-Ib1-I. jEJ iEl

(i,j)EK

j=l i=l

Upon using the formula for the sum of a finite number of terms of a geometric progression (see Example 1.13), we get

and so 1- bn Sn(a, b)= (1- a)(1- b)

a(1 - anbn) (1- a)(1- ab).

Example 1.15 Evaluate the products n

Pn

=IT a1, j=O

n

Pn

j

=IT IT aib1-i. j=O i=O

0

35

1.6. BIBLIOGRAPHIC NOTES

The first product, on using the formula for the sum of a finite number of terms of an arithmetic progression

t)=n(n +l), 2 j=l

is evaluated as n

Pn

=II

= a1+2+···+n = an(n+l)/2.

aj

j=O

In a similar way the second product is expressed as n

Pn

n

j

=II II ai!J-i = II j=Oi=O

n

ai(Hl)/2/}(j+l)/2

=

II (ab)J(j+l)/2 j=O

j=O

and, since

~ j(j + 1) - ~ ~ L...t

2

~ ~.

·2

+ 2 L...tJ

- 2 L...t 1

j=l

j=l

=

j=l

n(n + 1)(2n + 1) 12

+

n(n + 1) 4

=

n(n + l)(n + 2) 6

'

is deduced as n

Pn

j

=II II ai!J-1 = (abt(n+l)(n+2)/6.

D

j=Oi=O

1.6

BffiLIOGRAPHIC NOTES

The basic counting principles of addition and multiplication have been presented, along with the necessary elements of set theory. Also, discrete probability was introduced and properties of sums and products have been discussed. Much of this classical material may be found in calculus and probability books. The first two chapters of the book by T. Apostol (1962) are devoted to this subject. The classical book of W. Feller (1968) may also be used for further reading. The book by F. N. David (1962) contains a lot of information on counting and its connection with the probability of games of chance.

BASIC COUNTING PRINCIPLES

36

1.7

EXERCISES

1. Suppose that three distinguishable (different) coins are tossed. Write down the elements s = (a, b, c) of the set S 3 of possible outcomes and verify that N(S3 ) = 8. A map F from the set S 3 to the set N3 = {0, 1, 2, 3}, which, to each element (outcome) of S 3 corresponds the number of heads registered in it, is useful in probability theory. For each elements = (a, b, c) from the set S 3 , write down its image F(s) = n from the set N 3 .

2. Suppose that two distinguishable dice (one white and one black) are rolled and let s2 = {(w,b): w = 1,2, ... ,6, b = 1,2, ... ,6} be the set of possible results. (a) Find the number N(S2 ) of possible results. Let Ak be the subset of possible results ( w, b) with sum w + b = k, for k = 2, 3, ... , 12. (b) Write down the elements of each of the sets A 2 , A 3 , ... , A 12 . 3. Suppose that three distinguishable dice (one white, one black and one red) are rolled and let s3 = {(w,b,r): w = 1,2, ... ,6, b = 1,2, ... ,6, r = 1, 2, ... , 6} be the set of possible results. (a) Find the number N(S3 ) of possible results. Further, let A be the subset of possible results (w, b, r) with sum w + b + r > 10 and A' its complement (with respect to S 3 ). Show that the sets A and A' are equivalent, and conclude that N(A) = 108. 4. Suppose that the 5 left-hand gloves £ 5 = {h, h, ... , l5} of 5 pairs of gloves G5 = {(l 1,rt),(h,r2), ... ,(l5,r5)} are kept in drawer D1, while the corresponding 5 right-hand gloves R 5 = {r 1, r2, ... , r 5} are kept in a second drawer D 2 . Calculate the total number of ways of choosing one left-hand glove and one right-hand glove. Also, find the number of ways of choosing one left-hand glove and one right-hand glove that do not form a pair. 5. Find the number N(Bn) of n-digit binary sequences and the (total) number N(Tn) of binary sequences of at most n digits. 6. The Morse code. A letter of the alphabet is represented by a sequence of telegraphic "dot" and "dash" signals with repetitions allowed. Find the number ofletters that can be represented by sequences of at most n symbols. 7. Calculate the number of positive integers with exactly one digit equal to 3 that are (a) greater than or equal to 10 and less than 100 and (b) greater than or equal to 100 and less than 1000. Combining these results, conclude (c) the total number of positive integers with exactly one digit equal to 3 that are less than 1000. 8. Calculate the number of odd positive integers that are (a) greater than 10 and less than or equal to 100, (b) greater than 100 and less than

1. 7. EXERCISES

37

or equal to 1000 and conclude (c) the total number of odd positive integers that are less than or equal to 1000. 9. An alphabet is, in general, a set L = {h, h, ... , ln}, of n different letters. An ordered k-tuple of letters from the alphabet L (repetitions allowed) is a k-letter word. Calculate (a) the total number of three-letter words from the alphabet L, (b) the number of three- letter words that do not have repeated letters and (c) the number of three-letter words that contain the letter ln. 10. Evaluate the number of positive integers that are factors of the following numbers: (a) 23 · 32 ·5 1 , (b) 900 and (c) 9800. 11. (Continuation) Let N = p~ 1 p~ 2 • • • p~", where Pi, i = 1, 2, ... , n, are prime numbers and ki, i = 1, 2, ... , n, are positive integers. Show that the number of positive integers that are factors of N is equal to A(k1, k2, ... , kn) = (kl + 1)(k2 + 1) · · · (kn + 1). 12. An examination sheet contains n multiple-choice questions. A list of four alternative answers, among which only one is correct, is provided to each question. A student taking such an exam answers each question by marking one of the given answers. Find the number of different ways of answering the examination. 13. Soccer's results foresight. Each card of soccer's results foresight contains 13 matches. The ordered pairs of teams are written on the card in horizontal rows with one pair in each row. The foresights are marked with the symbols 1, X and 2 for win, tie and defeat of the home (first) team. A complete series of foresights consists of 13 symbols put in a column, one for each match. (a) Find the number of different columns that can be written. (b) If one specific symbol is used to mark each of 6 suitably chosen matches, two specific symbols are used to mark each of 5 given matches and all three symbols are used to mark each of the remaining 2 matches, how many different columns can be written? 14. In Greece, for the registration of automobiles, three letters and a four-digit number are used. The 14 letters A, B, E, Z, H, I, K, M, N, 0, P, T, Y, X, common in the Greek and Latin alphabets, are used. Find the number of automobiles that can be registered with this system. 15. In a telegraphic station n different telegraphs are to be distributed to k operators for expedition. Find the number of different distributions. 16. Find the number of divisions of a finite set of n elements in (a) two subsets, (b) k subsets.

17. Show that the number of maps f of the set X into the set Y = {y 1 , y 2 , .•. , Yk} is equal to kn.

= {x 1 , x2, ... , Xn}

38

BASIC COUNTING PRINCIPLES

18*. The pigeonhole principle. Show that if n + 1 objects are distributed into n cells, then at least one cell contains at least two objects. Using this principle, prove that, if K = {k1 , k2, ... , kn+d ~ {1, 2, ... , 2n}, then two integers ki and ki, belonging to K, exist, such that each of these divides the other. 19*. (Continuation). Let k1 ,k2 , ... ,kn be positive integers. Prove that two subscripts i and j, with 1 ~ i < j ~ n, exist, such that the sum ki+I + ki+2 + · · · + kj is divisible by n. 20*. (Continuation). Show that among any six numbers chosen from the set {1, 2, ... , 10} there are at least two such that one of them is divisible by the other.

Chapter 2 PERMUTATIONS AND COMBINATIONS

2.1

INTRODUCTION

The notions of permutations, combinations and partitions of finite sets are very basic in the development of enumerative combinatorics; in fact, for a long time the aim of combinatorial analysis was to enumerate such permutations, combinations and partitions. Thus, an introduction to combinatorics naturally begins with a thorough study of these notions. After introducing the notions of permutations and combinations of a finite set in the first two sections of this chapter, a host of emerging enumerative problems is explored. The permutations and combinations of a finite set without and with repetition are enumerated. Also, the number of permutations with a specified number of repetitions, for each element of the finite set, is derived. In addition, recurrence relations for these numbers are deduced. The divisions of a finite set into subsets, which constitute an extension of combinations, are then enumerated. Further, the enumeration of partitions of a finite set, which is related to that of divisions, is treated in the same section. In a separate section, the problem of counting the number of integer solutions of a linear equation with unit coefficients is reduced to a problem of enumerating combinations. Some basic elements of enumeration of lattice paths, related to the enumeration of certain combinations, are presented. The reflection principle, which facilitates the enumeration of lattice paths, is demonstrated. Moreover, the famous ballot problem that led to the development of lattice paths is treated. The last section of this chapter is devoted to discussion of several applications in discrete probability and statistics. Specifically, the classical probabilistic problems of the most beneficial bet and the distribution of shares, with which a systematic study of enumeration of permutations and combinations began, are discussed. In addition, the Maxwell-Boltzman, Bose-Einstein and Fermi-Dirac stochastic models in statistical mechanics are briefly examined.

PERMUTATIONS AND COMBINATIONS

40

2.2

PERMUTATIONS

The concept of an ordered pair and generally of an ordered n-tuple, necessary for the definition of the Cartesian product of sets, has already been introduced in Section 1.2.2. The next definition of a permutation is based on this concept.

DEFINITION 2.1 Let Wn = {w 1 ,w2, ... ,wn}, a finite set ofn elements. An ordered k-tuple (a 1, a2, ... , ak), with ar E Wn. r = 1, 2, ... , k, is called k-pennutation of the set Wn or simply k-pennutation of n. Note that the elements (components) of a k-permutation of n may or may not be different elements of Wn. For the first case, the term k-permutation of n is preserved, while for the second and when unrestricted repetitions are allowed, the term k-permutation of n with repetition is used. When any restrictions on the number of repetitions exist they are explicitly specified. The unqualified term, permutation, is used for the particular case of an n-permutation of n. It is clear from the definition of a k-permutation of n, without or with repetition, that two k-permutations of n are different if at least one element in one of these permutations does not belong to the other. Further, two k-permutations of n containing the same k elements are different if at least one element occupies different positions in these permutations. Also, a kpermutation of n (without repetition) is meaningful when 1 ::; k ::; n, while a k-permutation of n with (unrestricted) repetition is always meaningful for k ~ 1 and n ~ 1. The following examples serve as to illustrate the different kinds of permutations and indicate the method of counting them. The latter will be helpful in understanding the general methods of enumeration of the different kinds of permutations.

Example2.1 (a) The 2-permutations of the set w4 = { Wl, w2, W3, W4 }, of 4 elements, are the following:

(w3,wl), (w3,w2), (w3,w4), (w4,w1), (w4,w2), (w4,w3). Note that, in any 2-permutation (al, a2) of the set w4 = {Wl, W2, W3, .W4 }, the first element a 1 can be selected from the set A 1 = W4, of 4 elements, while, after the selection of the first element, the second element a 2 , which must be

2.2. PERMUTATIONS

41

different from a I, can be selected from the set Az = W 4 - {a I}, of 3 elements. Thus, according to the multiplication principle, the number of 2-permutations of 4 equals 4 · 3 = 12. A simple counting of these permutations verifies this result. (b) The permutations of the set w3 = {Wt' Wz' W3}, of 3 elements, are the following: (w1,

wz, w3),

(w1, w3,

wz),

(w2, WI, w3),

(Wz, W3, WI), (W3, WI, Wz), (W3, Wz, WI), the number of which, according to the multiplication principle, is equal to 3 · 2 ·1 =

6.

0

Example 2.2 The 2-permutations of the set following:

(w 3,wi),

w4 = {WI, W2, WJ' W4}' with repetition, are the

(w3,w2), (w3,w3), (w3,w 4 ),

(w 4,wi), (w4,wz),

(w4,w3),

(w4,w4).

Note that, in any 2-permutation (a I' az) of the set w4 = {WI, Wz' W3, w4} with repetition, the first element a I as well as the second element az can be chosen from the set W 4 of 4 elements. Hence, according to the multiplication principle, the number of 2-permutations of 4, with repetition, equals 4 · 4 = 16. 0

Example 2.3 The permutations ofthe set w3 = {WI' Wz}' of two kinds of elements with ki = 2 elements wi and kz = 1 element w2 are the following:

Let us pretend that we do not know the total number of these permutations. The problem of enumerating them may be transformed to an equivalent counting problem, which can be solved by applying basic counting principles. In this particular case, a suitable transformation is carried out in two consecutive actions. Firstly, the two like elements WI are transformed to distinct, by assigning to each a second index, Wt,I, WI,2· Secondly, in each permutation the distinct elements WI,I and w 1 , 2 are permuted in all possible ways. Since 2 elements are permuted in only 2 ways, from each permutation 2 new permutations are constructed. The permutations thus constructed are all the permutations of the set Wz, 3 = { WI,I, WI,2, wz }, of 3 (distinct) elements, which according to part (b) of Example 2.1 are the following 6: ( Wt,I, WI,2, Wz),

(WI,2, WI,I, W2),

(WI,2, Wz, WI,i),

(wz, WI,I, W1,2), (wz,

( WI,l, W2, WI,2), WI,2, W1,t).

PERMUTATIONS AND COMBINATIONS

42

Thus, if x is the required number of permutations, then 2x

= 6 and so x = 3. 0

Example2.4 The 3-permutations of the set W3 = {w1, w2, W3}, with restricted repetition and, specifically, with the element w 1 allowed to appear at most k 1 = 2 times, the element w 2 at most k 2 = 1 time and the element W3 at most k3 = 3 times, are the following 19:

(w1, w2, w3), (w1, w3, w2), (w2, w1, w3), (w2, w3, w!), (w3, w1, w2), (w3, W2, w!), (wl 1 W1, W2), (WJ, W2, WJ ), (w2, W! 1 W! ), (w1, WI, W3), (w1, w3, w1 ), (w3, w1, WI), (wi, w3, w3), (w3, w1, w3), (w3, w3, w!), (w2, w3, w3), (w3, w2, w3), (w3, w3, w2), (w3, W3, w3).

0

The following two theorems are concerned with the number of permutations (without repetition). THEOREM2.1 The number of k-permutations ofn, denoted by P(n, k) or (n)k, is given by

P(n, k)

= (n)k = n(n- 1) · · · (n- k + 1).

(2.1)

PROOF Let Pk(Wn) be the set of k-permutations of the set Wn = {w1, w2, ... , wn}· In any k-permutation (a 1 , a 2 , ... , ak) of the set Wn, the first element a 1 can be selected from the set A 1 = Wn of n elements, while after the selection of the first element, the second element a 2 , which must be different from a 1 , can be selected from the set A 2 = Wn - { a 1 } of n - 1 elements. Finally, after the selection of the elements a 1 , a 2 , ... , ak_ 1 , the last element ak> which must be different from the k- 1 preceding elements, can be chosen from the set Ak = Wn - { a1, a2, ... , ak-1} of n - ( k - 1) elements. Thus, according to the multiplication principle,

= N(Pk(Wn)) = N(A!)N(A2) · · · N(Ak) = n(n -1) · · · (n- k + 1) and the required expression is established. I P(n, k)

For the particular case, k = n, of the permutations of n the next corollary follows. COROLLARY 2.1 The number of permutations ofn, denoted by P(n), is given by

P(n)

= P(n, n) = 1 · 2 · 3 · · · (n- 1) · n.

(2.2)

2.2. PERMUTATIONS

43

=

REMARK 2.1 The number P(n, k) (n)k, k = 1, 2, ... , n, n = 1, 2, ... , is a special case of the factorial of a real number x of order k (see Chapter 3 for details) and is called falling factorial of n of order· k. In particular, the falling factorial of n of order k = n, which is the product of all integers from 1 to n, is called n factorial and is denoted by n!. Thus, the number P( n) of permutations of n, according to (2.2), is P(n)

= n!,

n

= 1,2, ....

Further, multiplying expression (2.1) by (n- k) · (n- k- 1) · · ·3 · 2 · 1 and then dividing it by (n - k)! = 1 · 2 · 3 · · · (n - k - 1) · (n - k), the number P(n, k) (n)k may be rewritten as

=

=(n)k = (n n!_ k)!' k = 1,2, ... ,n, n = 1,2, .... The numbers P(n, 0) =(n) n = 0, 1, ... and P(O) = 0!, which have no P(n,k)

0,

combinatorial meaning, are taken by convention as unity: P(n,O)

If k > n, then P (n, k)

= (n)o = 1, n = 0, 1, ... , P(O) = 0! = 1.

=(n)

k

= 0 and (2.1) is still valid. It is worth noting that

P(n, n- 1)

= P(n, n) = P(n) = n!,

which is a consequence of the fact that, specifying the positions of the n - 1 elements, the position of the n-th element is uniquely determined. The n! increases rapidly, with increasing n: 2! = 2, 3! = 6, 4! = 24, 5! = 120, 6! = 720, 7! = 5040,.. . . A useful approximation of it is presented in Chapter 3. I Example2.5 Consider a man who has five different keys, only one of which fits the door of his house. He does not recognize the proper key and tries the keys one after the other, until he opens the door. Let us find the number of ways he may try to open the door so that he succeeds (a) at the third trial, (b) until the third trial and (c) at the last trial. (a) Let us number the five different keys from 0 to 4 assigning the number 0 to the key that fits the door. Note that, to a sequence of three trials, where in the third trial the door opens, there corresponds an ordered triple ( a 1 , a 2 , 0), where ai E {1, 2, 3, 4}, j = 1, 2, a 1 f. a 2 . Thus the required number of sequences of three trials equals the number of 2-permutations, (a 1 , a 2 ), of the set { 1, 2, 3, 4}, of four keys, that is P(4, 2) = 4 · 3 = 12.

44

PERMUTATIONS AND COMBINATIONS

These 12 sequences are the following:

(1,2,0), (1,3,0), (1,4,0), (2,1,0), (2,3,0), (2,4,0), (3,1,0), (3,2,0), (3,4,0), (4,1,0), (4,2,0), (4,3,0). (b) The number of ways he may try to open the door so that he succeeds until the third trial, according to the addition principle, equals the sum of the numbers of ways he may try to open the door so that he succeeds at the first or second or third trial. Since the number of ways he may try to open the door so that he succeeds at the k-th trial equals the number P(4, k -1) = (4)k-l of the (k -I)-permutations of the set of { 1, 2, 3, 4}, of four keys, for k = 1, 2, 3, the required number is given by the sum 3

s4,3

= L:c4)k-1 = 1 + 4 + 12 = 11. k=l

(c) The number of ways he may try to open the door so that he succeeds at the fifth (last) trial, according to the analysis of (a), equals the number of permutations (a 1 , a 2 , a 3 , a 4 ), of the set {1, 2, 3, 4}, of four keys, that is

4!

= 4. 3. 2. 1 = 24.

D

Example 2.6 Let us consider an urn containing n balls numbered from 1 to n. Assume that k balls are successively drawn from the urn without replacement (without returning the ball drawn to the urn after each drawing). The first number drawn wins a great value gift, while the subsequent numbers win gifts of smaller value. Find the number of possible outcomes of the drawings. Note that each possible outcome consists of knumbers from the set {1, 2, ... , n }. The order in which the numbers are drawn counts, since it determines the distribution of the gifts. Therefore, to each possible outcome there corresponds one and only one k-permutation of nand, according to Theorem 2.1, the required number is given by

(n)k=n(n-l)···(n-k+l).

0

Example2.7 Suppose that three workers are to be selected among the ten workers, { w 1 , w 2 , . . . , w 10}, of a small factory. A different job is to be assigned to the first, second and third workers. Find the number of different selections, which (a) do not include w 10 (who has not finished a delicate job) and (b) include w 10 (the most skilled worker). Note first that the order of selection of the three workers counts, since it determines the assignment of the three different jobs. Thus, to each possible selection there corresponds one and only one 3-permutation (a 1 , a 2 , a 3 ) of the set

2.2. PERMUTATIONS

45

ww }. Further, (a) since w 10 is not to be included in the selection, is a 3-pennutation of the set { w 1 , wz, ... , w 9 } of the other nine workers and so the required number of selections equals { w 1 , w2 ,

... ,

( a 1 , a 2 , a3)

P(9, 3) = 9 · 8 · 7 = 504.

(b) Since w 10 is to be included in the selection, he may be selected first or second or third. To each of the selections (w 10, a1 , az), (a 1 , Ww, az), (a1 , az, ww) there corresponds one and only one 2-pennutation (a 1 , a 2 ) of the set {w 1 , w 2 , ... , w 9 } of nine workers. Hence the required number of selections equals

3P(9, 2)

= 3 · 9 · 8 = 216.

It is worth noting that the sum of the number of selections that do not include w 10 and the number of selections that include w 10 equals

P(9, 3)

+ 3P(9, 2)

= 504

+ 216 =

720,

which is the total number of selections (without any condition), P(lO, 3) = 10 · 9 · 8 = 720.

0

This relation is generalized in the following theorem. THEOREM2.2

The number P(n, k) relations

(n)k. of k-permutations of n, satisfies the recurrence

P(n, k) = P(n- 1, k)

+ kP(n- 1, k- 1),

(2.3)

fork= 1, 2, ... , n, n = 1, 2, ... , and P(n, k)

= nP(n- 1, k- 1) = (n- k + l)P(n, k- 1),

(2.4)

fork= 1, 2, ... , n, n = 1, 2, ... , with initial conditions: P(n,O) = 1, n

= 0, 1,2, ... , P(n,k)

= 0, k

> n.

Let Pk(Wn) be the set of k-pennutations of the set Wn = {w 1 , w2 , · .. , Wn}. If Q is the set of the k-pennutations of Wn that do not include the element Wn and S the set of the k-permutations of Wn that include the element Wn, then Q n S = 0 and Pk (Wn) = Q + S. Hence, according to the addition

PROOF

principle,

N(Pk(Wn)) = N(Q)

+ N(S).

Apparently Q = Pk(Wn-d andN(Q) = N(Pk(Wn-d) = P(n-1, k). Further, from each (k- !)-permutation ofWn-l• by attaching the element Wn in any of the

46

PERMUTATIONS AND COMBINATIONS

k possible positions (one before the first element, k - 2 between the k - 1 elements and one after the last element), k different k-permutations of Wn that include Wn are constructed. Therefore, N(S) = kN(Pk-1 (Wn-1)) = kP(n- 1, k- 1) and P(n,k) = P(n -1,k)

+ kP(n -1,k -1),

k = 1,2, ... ,n, n = 1,2, ....

For the proof of (2.4) note that the first r (ordered) elements, (a 1 , a 2 , ... , ar ), of a k-permutation, (a 1 , a 2 , . . . , ar, ar+ 1, ... , ak), of W n, can be chosen from the set A1 = Wn in P(n, r) ways. After every such selection, the last k- r (ordered) elements, (ar+l, ... , ak), can be chosen from the set A2 = Wn- {a1, a 2 , ... , ar} in P(n- r, k- r) ways. Hence, according to the multiplication principle, P(n, k) = P(n, r)P(n- r, k- r), r

= 1, 2, ...

, k, k = 1, 2, ... , n.

In particular, for r = 1 and r = k- 1, since P(n, 1) =nand P(n- k + 1, 1) = n- k + 1, the first and second recurrence relations of (2.4) are deduced. The initial conditions, which often have no combinatorial meaning, are chosen in such a way that their introduction into the recurrence relation gives the correct values to the subsequent terms that have a combinatorial meaning and known values. Thus, from the known valuesP(n, 1) = n, n = 1, 2, ... and the recurrence relation (2.3), it follows that P(n, 0) = P(n

+ 1, 1)- P(n, 1)

= n

+ 1- n

= 1, n = 0, 1, ....

The initial condition P(n, k) = 0 fork > n is obvious. These are also the initial I conditions for the recurrence relation (2.4). REMARK 2.2 As regards the initial conditions of the recurrence relations (2.3) and (2.4), note that, instead of the relations P(n, 0) = 1, n = 0, 1, ... , which are indirectly deduced, the relations P(n, 1) = n, n = 1, 2, ... , following directly from the definition of a permutation, may be used. The preference to the first relations is due to some technical advantages that they provide in the study of recurrence relations, especially through generating functions. I COROLLARY 2.2 The number P(n)

=n!,

ofpennutations ofn, satisfies the recurrence relation

P(n) = nP(n -1), n = 1,2, ... , with initial condition P(O) = 1. In the next theorem the number of permutations with (unrestricted) repetition is derived.

47

2.2. PERMUTATIONS

THEOREM2.3 The number of k-permutations of n with (unrestricted) repetition, denoted by U(n, k), is given by

U(n,k)=nk. Note that, in any k-pennutation (a 1 , a 2 , ... , ak) of the set Wn Wn} with repetition, the element ai can be chosen from the set Ai = Wn. of n elements, i = 1, 2, ... , k. Hence, Uk(Wn) A1 x A2 x · · · x Ak is the set of k-permutations of the set Wn with repetition and according to the multiplication principle, PROOF

{ w 1 , w2 ,

... ,

=

U(n, k)

= N(Uk(Wn)) = N(Al

X

A2

X · ·· X

Ak)

= N(A1)N(A2) · · · N(Ak) = nk. The proof of the theorem is thus completed.

I

Example 2.8 Ternary number system In the ternary number system each number is represented by a ternary sequence of Os, l s and 2s. For example, the numbers 5 and II, which are expressed in tenns of powers of 3 as 5 = 1 · 3 1 + 2 · 3° and 11 = 1 · 3 2 + 0 · 3 1 + 2 · 3°, are represented by the ternary sequences (1, 2) and (1, 0, 2), respectively. Note that, with the exception of the number 0, which is represented by the one-digit sequence (0), in all the other ternary sequences the first digit is different from 0. Calculate the number of four-digit ternary sequences. The first digit of a four-digit ternary sequence is either I or 2. A four-digit ternary sequence (1, a 1, a 2 , a 3) corresponds to a 3-pennutation (a 1, a 2, a 3) of the set {0, 1, 2} with repetition. Thus, the number of four-digit ternary sequences (1, a1, a2, a3), according to Theorem 2.3, equals U(3, 3)

= 33 = 27.

Similarly, the numberoffour-digitternary sequences (2, a 1, a 2, a 3) equals U (3, 3) = 27 and so the total number of four-digit ternary sequences is given by 2U(3, 3) = 54.

D

Example2.9 (a) Find the number of different outcomes in a series of k tosses of a coin. An outcome of a series of k tosses of a coin may be represented by an ordered ktuple (a1, a2, ... , ak) of letters from the set {h, t}, where ai denotes the outcome of the i-th toss, i = 1, 2, ... , k, and hand t stand for heads and tails, respectively. Hence, the number of different outcomes in a series of k tosses of a coin equals

48

PERMUTATIONS AND COMBINATIONS

the number of k-permutations of the set { h, t}. For k = 3, the different outcomes are the following: (h, h, h), (h, h, t), (h, t, h), (t, h, h), (h, t, t), (t, h, t), (t, t, h), (t, t, t),

in agreement with U(2, 3) = 23 = 8. (b) Consider a series of k throws of a die or equivalently a throw of k distinguishable dice. Find the number of different outcomes. An outcome of a series of k throws of a die may by represented by an ordered ktuple (a 1 , a 2 , ... , ak) of numbers from the set {1, 2, 3,4, 5, 6}, where ai denotes the outcome of the i-th throw, i = 1, 2, ... , k. Therefore, the number of different outcomes in a series of k throws of a die equals

the number of k-permutations of the set {1, 2, 3, 4, 5, 6}, of 6 numbers (faces of a die), with repetition. Fork = 2, the different outcomes are the following: (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6), (5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (5, 6), (6, 1),(6,2),(6,3), (6,4), (6,5),(6,6), in agreement with U(6, 2) = 6 2 = 36.

0

Example 2.10 Distributions of distinguishable balls into distinguishable urns Let k distinguishable balls { b1 , b2, ... , bk} be successively distributed into n distinguishable urns (cells) { w1 , w 2 , ... , Wn} of unlimited capacity. Find the number of different distributions . Clearly, ball br can be placed in any of the n urns, r = 1, 2, ... , k and so, according to the multiplication principle, the k balls can be distributed into the n urns in nk different ways. It is worth noting the one-to-one correspondence between the set of distributions of k distinguishable balls into n distinguishable urns of unlimited capacity and the set of k-permutations of n with (unrestricted) repetition. Indeed, the distribution of the k balls {b1, b2, . .. , bk} into then urns Wn = { w1 , w 2, ... , wn}. according to which the ball br is placed into the urn Wi~· r = 1, 2, ... , k, corresponds to the k-permutation (wi1 , Wi2 , ••• , Wik) of the set Wn, of n urns, with (unrestricted)

49

2.2. PERMUTATIONS

repetitiOn. Thus, the number of distributions of k distinguishable balls into n distinguishable urns of unlimited capacity equals

U(n, k) = nk, the number of k-permutations of n with repetition. The general problem of distributions of balls of different kinds into urns of different kinds and capacity is examined at length in Chapter 9. 0 In concluding, let us turn the discussion to the enumeration of k-permutations of Wn = {wi,Wz, ... ,wn} with repetition, in which the element Wi may appear ki times, i = 1, 2, ... , n, where k1 + kz + · · · + kn = r 2 k. The calculation of their multitude, using the two basic counting principles, is quite difficult. This problem is treated more effectively by the use of generating functions. Constituting a powerful tool for the treatment of many combinatorial problems, these functions are examined in Chapter 6, in which we return to this problem. The next theorem is concerned with the particular case of k = r.

THEOREM2.4 The number of pennutations of n kinds of elements with k 1 , k 2 , . •. , kn elements, respectively, denoted by M(k 1 , kz, ... , kn). is given by

PROOF Consider a permutation (a 1, a2, ... , ar), of the n kinds of elements Wn = {w 1 , w 2 , •.. , wn}. where ki of the a's are Wi, i = 1, 2, ... , n, with k1 + kz + · · · + kn = r. If the k 1 like elements w 1 are transformed to distinct, by

assigningtoeachasecondindex from I tok 1 , w 1 , 1 , w 1 , 2 , ••• , w 2 ,k 1 , and permuted in all possible ways, preserving the positions the element w 1 occupies in this permutation, k 1 ! permutations are constructed. If, in any of these permutations, the k 2 like elements w 2 are transformed to distinct, w 2 , 1 , w 2 , 2 , •.. , w 2 ,k 2 , and permuted in all possible ways preserving the positions the element w 2 occupies in this permutation, k2 ! permutations are constructed. Repeating this procedure until all the n kinds of elements are exhausted and then applying the multiplication principle, it follows that, from the permutation (a 1 , a 2 , ••• , ar ), k 1!k2 ! · · · kn! permutations, (bi,bz, ... ,br),ofthesetWn,r = {wi,j :j = 1,2, ... ,ki,i = 1,2, ... ,n},ofr (distinct) elements, are constructed. Moreover, each permutation (b 1 , b2 , . •• , br) of the set Wn,r. of r elements, by deleting the second index from its elements wi,J, j = 1, 2, ... , ki, i = 1, 2, ... , n, is reduced to a unique permutation ( a1, az, ... , ar) of the n kinds of elements W n = { w 1, w 2 , •. • , Wn }, where ki of the a's are Wi, i = 1, 2, ... , n, with k 1 + k 2 + · · · + kn = r. Therefore, k 1!k2 ! · · · kn!M(k 1 , k 2 , •• • , kn) equals the number of permutations of the

PERMUTATIONS AND COMBINATIONS

50

set Wn,r. of r elements. Further, the number of these permutations, according to Corollary 2.1, is equal to r! and hence we find the relation

from which (2.5) follows.

I

Example 2.11 Consider r recruits, among which k; come from the i-th district of the country, i = 1, 2, ... , n, so that k 1 + k2 + · · · + kn = r. Distinguishing them according to district of their origin, the number of ways they can be arranged on a line equals

the number of permutations of n kinds of elements (districts), with k 1 ,k2 , ... , kn elements (recruits), respectively. Distinguishing them according to the number of the recruitment invitation, the number of ways they can be arranged on a line equals P(r) = r!, the number of permutations of r elements (numbers). In particular, for n = 2 and k 1 = 2, k2 = 2, the M(2, 2) = 6 arrangements of the recruits, according to the district of their origin, are the following:

(dt, dt, d2, d2), (dt, d2, d2, dl), (dt, d2, dt, d2), (d2,dt,d2,dl), (d2,dt,dt,d2), (d2,d2,dt,dl), and the corresponding arrangements of the recruits, according to their recruitment invitation (double-index) number are the following:

(du, d12, d21, d22), (d12, du, d21, d22), (du, d12, d22, d21), (d12, dn, d22, d2t),

(du, d21, d22, d12), (dt2,d2l,d22,dll), (du, d22, d21, d12), (d12, d22, d21, du), (du, d21, d12, d22), (d12, d21, du, d22), (du, d22, d12, d21), (d12, d22, du, d2t), (d21, du, d22, d12), (d21, d12, d22, du), (d22, du, d21, d12), (d22, d12, d21, du), (d21, du, d12, d22), (d21, d12, du, d22), (d22, du, d12, d2t), (d22, d12, du, d2t), (d21, d22, du, d12), (d21, d22, d12, du ), (d22, d21, du, d12), (d22, d21, d12, du). The total number of these arrangements is P( 4)

= 24.

0

51

2.3. COMBINATIONS

2.3

COMBINATIONS

DEFINITION 2.2 Let Wn = { Wt, w2, ... , Wn}. a finite set of n elements. A (non-ordered) collection ofk elements {a1,a2, ... ,ak}, with arE Wn, r = 1, 2, ... , k, is called k-combination of the set Wn or simply k-combination ofn. Note that the elements of a k-combination of n may or may not be different elements of Wn. For the first case, the term k-combination of n is preserved, while for the second and when unrestricted repetitions are allowed, the term k-combination of n with repetition is used. When any restrictions on the number of repetitions exist, they are explicitly specified. Note also that, according to the definitions of a set and a subset, a kcombination of the set Wn, without repetition, is a subset of Wn. Further, a k-combination of n is meaningful when 1 ::::; k ::::; n, while a k-combination of n with (unrestricted) repetition is always meaningful for k ~ 1, n ~ 1. The examples that follow illustrate the different kinds of combinations and provide an indication of their enumeration.

Example 2.12 The 2-combinations of the set W 4 following:

Note that, from each 2-combination {a 1, a 2 } of the set W4, by permuting its elements, the 2-permutations (a 1 , a 2 ) and (a 2 , at) of the set W 4 are deduced. Thus, the number of 2-combinations of 4 equals the number of 2-permutations of 4 divided by the number of permutations of 2, that is 12/2 = 6 (see Example 2.1). D

Example 2.13 The 2-combinations of the Set W4 following:

= {Wt

1

W2, W3, W4}

with repetition are the

{w2,w3}, {w2,w4}, {w3,w3}, {w3,w4}, {w4,w4}. Consider also the 2-combinations of the set W5 = { w 1 , w2, w3, W4, w5} (without repetition):

52

PERMUTATIONS AND COMBINATIONS

{w2,w4}, {w2,ws}, {wa,w4}, {wa,ws}, {w4,w5}. Note that a one-to-one correspondence exists between these two sets of2-combinations. Specifically, the 2-combination {W; 1 , wh }, 1 ::; ii ::; i 2 ::; 4, of the set W 4 = {WI, w 2, w 3 , w4} with repetition, uniquely corresponds to the 2perrnutation {W)J, w32}, 1 ::; JI < J2 ::; 4, of the set W5 = {WI, w2, wa, W4, Ws} (without repetition), where )I = ii and j 2 = i 2 + 1. Since the number of 2combinations of the set W5 = {WI, w2, w3, W4, Ws} equals ( 5 · 4) /2 = 10, it follows, by Lemma 1.1, that the number of 2-combinations of the set W 4 = {WI, w2, W3, w4} with repetition is also equal to I 0. 0

Example 2.14 The )-combinations of the set w4 = {WI' W2' W3' W4} with repetition and the restriction that each element is allowed to appear at most two times are the following 16:

{WI, WI, W2}, {WI, WI, W3}, {WI, WI, W4}, {WI, W2, W2}, {WI , W2, W3}, {W1, W2, W4}, {WI , W3, W3}, {WI , W3, W4}, {wi, W4, w4}, {w2, w2, wa}, {w2, w2, w4}, {w2, wa, wa}, {W2, W3, W4}, {W2, W4, W4}, {Wa, W3, W4}, {W3, W4, W4}.

0

The following two theorems are concerned with the number of combinations (without repetition).

THEOREM2.5 The numberofk-combinations ofn, denoted by C(n, k) or(~), is given by

(n) = n(n-

n = C( 'k) - k

1) · · · (n- k + 1)

k!

=

n!

k!(n- k)! ·

(2.6)

PROOF Let Ck(Wn) be the set of k-combinations and Pk(Wn) the set of k-perrnutations of Wn = {WI, w2 , •.• , Wn}. Note that, to each k-combination {a I, a2, ... , ak} of Wn, there correspond k! k-permutations (a; 1, a; 2, . .. , a;k) of Wn, which are formed by permuting its k elements in all k! possible ways. Further, to each k-permutation, (a I, a 2 , ... , ak), of Wn, there corresponds one and only one k-combination, {a 1 , a 2 , ... , ak}, of Wn. Therefore,

P(n, k) := N(Pk(Wn)) = k! N(Ck(Wn)) := k!C(n, k) and, using (2.1 ), expression (2.6) is deduced.

I

REMARK 2.3 Note that every time a k-combination of the set W n = {WI, w 2, ... , wn} is formed by selecting k elements, n- k elements are left, forming an

2.3. COMBINATIONS

53

(n- k)-combination of Wn. Hence to each k-combination, {a I, a2 , ... , ak}. of Wn. there uniquely corresponds an (n- k)-combination, {bi, b2, ... , bn-k} = {w 1 , w2 , ... , wn} - {ai, a 2 , ... , ak}, of Wn. and conversely. Consequently, N(Ck(Wn)) = N(Cn-dWn)) and

This relation can also be shown algebraically, by using expression (2.6), as follows:

n) n! n! ( n ) ( k - k!(n- k)! - (n- k)!(n- (n- k))! - n- k · Note that the pair of sets A = {ai, a 2, ... , ak} and B = {bi, b2, ... , bn-d is a division of the set Wn = {WI, w2 , ... , Wn} (see Section 1.2.7). This point is examined in a more general set up in the next section. It is worth noting that there exists a one-to-one correspondence (bijective mapping) of the set Mk,n-dU2 ), of permutations of two kinds of elements U2 = {ui,u 2 }, with k and n- k elements, respectively, onto the set Ck(Wn), of kcombinations of the set Wn = {WI, w2 , ... , Wn }, of n elements. Specifically, to the permutation (vi, v2 , ... , vn) in which the element ·u 1 occupies the k positions { i 1 , i 2 , ... , ik} ~ { 1, 2, ... , n}. the k-combination {Wi 1 , Wi, ... , Wik} of the set Wn. of n elements, is associated and conversely. Hence M(k, n- k) = C(n, k),

I

in agreement with expressions (2.5) and (2.6).

Example 2.15 Consider an organization with seven vacant positions, among which two require mathematics degrees, three require computer science degrees and the remaining two positions are open to candidates with either a mathematics or a computer science degree. After a screening, the selection committee prepares a shortlist of candidates of whom seven hold mathematics degrees and six computer science degrees. In how many ways can the vacant positions be filled? From the seven candidates with mathematics degrees two can be selected (without regard to any order) in

G)=

~

7 6

=

21

ways and from the six candidates with computer science degrees three can be selected in 6·5·4 = --=20 2·3

(~)

54

PERMUTATIONS AND COMBINATIONS

ways. Finally, from the remaining eight candidates, two can be selected in

C)=

~ = 28

8 7

ways. Thus, according to the multiplication principle, the vacant positions can be filled in 21 ° 20 ° 28 = 11,760 ways.

D

Example 2.16 Binary number system revisited In the binary number system, calculate the number of five-digit binary sequences that contain exactly two zeros (see Example 1.4 ). The first digit of a five-digit binary sequence is necessarily I. A five-digit binary sequence ( 1, a 1 , a 2 , a 3 , a 4 ) that contains exactly two zeros uniquely corresponds to the set {i 1 , i 2 } of the two positions, out of the four positions { 1, 2, 3, 4} that the two zeros occupy in the binary sequence. Thus the number of five-digit binary sequences ( 1, a 1 , a 2 , a 3 , a4 ) that contain exactly two zeros equals

the number of 2-combinations of 4.

D

Example 2.17 Distributions of indistinguishable balls into distinguishable urns of limited capacity Suppose that k indistinguishable balls are successively distributed into n distinguishable urns {w 1 ,w2 , ..• ,wm}. each with capacity limited to one ball. Find the number of different distributions. Any distribution of k indistinguishable balls into n distinguishable urns may be represented by the subset {Wi 1 , Wi 2 , ••• , Wik} of urns in each of which a ball is placed. Thus, each distribution of k indistinguishable balls into n distinguishable urns corresponds to a selection of k urns from the set of then urns without regard to order and conversely. Therefore, the number of ways of placing k indistinguishable balls into n distinguishable urns, each with capacity limited to one ball, equals

the number of k-combinations of the set {w 1 , w2, ... , Wn} of n urns.

D

2.3. COMBINATIONS

55

THEOREM 2.6 Pascal's triangle The number C(n, k) (~). of k-combinations of n, satisfies the "triangular" recurrence relation 1 (2.7) ( = (n k = 1, 2, ... , n, n = 1, 2, ... , ) + (

=

~)

~

~ =~),

with initial conditions

(~)

= 1, n = 0, 1, ... ,

(~)

= 0, k

> n.

Let Ck(Wn) be the set of k-combinations of the set Wn = {w1, w2, ... , wn}. If A is the set of the k-combinations of Wn that do not include the element Wn, and B the set of the k-combinations of Wn that include the element Wn, then An B = 0 and Ck(Wn) = A+ B. Hence, according to the addition PROOF

principle,

N(Ck(Wn)) = N(A)

+ N(B).

Apparently A = Ck(Wn-d and N(A) = N(Ck(Wn-d). Further, one of the k elements of a k-combination {a 1 ,a2 , ... ,ak-1,ak}, belonging to B, is the element Wn and, since the order in which the elements are written does matter, it may be assumed that ak = Wn and ar E Wn-1· r = 1, 2, ... , k- 1. Thus, each k-combination {a 1 , a 2 , ... , ak- 1 , Wn} belonging to B corresponds to one and only one k-combination {a 1 , a 2 , ... , ak- 1 } belonging to Ck-1 (Wn-1 ), and conversely. Therefore N(B) = N(Ck-dWn-d) and

N(Ck(Wn)) = N(Ck(Wn-d)

+ N(Ck-dWn_l)).

The last relation implies (2.7). The initial conditions(~) = 1, n = 0, 1, ... , which are preferred to the conditions (7) = n, n = 1, 2, ... , are compatible with (2.7) since

The recurrence relation (2.7) may also be shown algebraically, by using expression (2.6). I The numbers C(n, k) = G), known as binomial coefficients, can be tabulated by using Pascal's triangle and its initial conditions. Table 2.1 gives the binomial coefficients fork= 0, 1, ... , n, n = 0, 1, ... , 12.

COROLLARY 2.3 The number C (n, k) rence relation

= G), of k-combinations of n, satisfies the "vertical" recur-

(~) = ~

G=D,

k = 1, 2, ... , n, n = 1, 2,...

(2.8)

PERMUTATIONS AND COMBINATIONS

56

Binomial Coefficients C(n, k)

Table 2.1

k

n 0 1 2 3 4 5 6 7 8 9 10

0

2

4

5

1 1 3 6 4 I 10 10 5 15 20 15 21 35 35 28 56 70 36 84 126 45 120 210 55 165 330 66 220 495

6 21 56 126 252 462 792

I

3

6

7

=

(~)

10

11

1 1 8 36 9 1 120 45 10 I 55 11 330 165 792 495 220 66

12

8

9

12

I

1 1 I

1 1 1 1 1 1 I

11

1

12

I

I

2 3 4 5 6 7 8 9 10 11 12

I I

7 28 84 210 462 924

I 1

and the "horizontal" recurrence relation

(~) = ~( _ 1l-r (n; 1) ~ k-j -_ L..)-1) j=k

(n + 1) _ .

J+1

_

, k -1,2, ... ,n, n -1,2, ....

PROOF

Summing both sides of the "triangular" recurrence relation

for r = k, k

+ 1, ...

, n,

and since (k~l) = 0, it follows that

(2.9)

2.3. COMBINATIONS

57

Multiplying the "triangular" recurrence relation

by ( -l)k-r and summing both sides for r = 1, 2, ... , k, we get

and since

(n;il)

= (~) = 1, it follows that

The second part of (2.9) can be shown in a similar way.

I

REMARK 2.4 The "vertical" recurrence relation (2.8) may also be derived independently of the "triangular" recurrence relation (2.7). The following combinatorial derivation is of interest. Let Ck(Wn) be the set of k-combinations of the set Wn = {w1, w2, ... , Wn} and Ar the subset of Ck (Wn) containing the combinations that include Wr as the element with the largest subscript, r = k, k + 1, ... , n. Then Ai n Aj = 0, i, j = k, k + 1, ... , n, i-::/:- j, Ck(Wn) = Ak + Ak+I +···+An and, according to the addition principle,

Note that, to each k-combination {a 1 ,a2 , ... ,ak-I,wr}, with aj E Wr-1 = {w1, w2, ... , Wr-I }, j = 1, 2, ... , k- 1, that belongs to An there corresponds one and only one (k- I)-combination {a 1 ,a2 , ... ,ak-d that belongs to Ck-I (Wr-J), r = k, k + 1, ... , n. Therefore, N(Ar) = N(Ck-1 (Wr_I)), r = k, k + 1, ... , n, and

The last relation implies (2.8).

I

Example 2.18 Consider a series of five tosses of a coin. Calculate the number of different outcomes of the first r tosses that include exactly two heads, for r = 2, 3, 4. Compare the sum of these numbers to the number of different outcomes of the five tosses that include exactly three heads.

PERMUTATIONS AND COMBINATIONS

58

An outcome of a series of r tosses of a coin (a 1 , a 2 , ... , ar) that includes two heads corresponds to the set {i 1 , i 2 } of the two positions, out of the r positions {1, 2, ... , r} that the two letters h occupy. Thus the number different outcomes of the first r tosses that include exactly two heads equals

(;), r

= 2,3,4,

the number of 2-combinations of the set {1, 2, ... , r }. Summing these numbers we get 4

?; (;) =

1+3 +6

= 10.

These ten outcomes are the following (h, h), (h, h, t), (h, t, h), (t, h, h), (h, h, t, t), (h, t, h, t), (h, t, t, h), (t, h, h, t), (t, h, t, h), (t, t, h, h).

The number of different outcomes of the five tosses that include exactly three heads is given by

G) = G) =

~ = 10

5 4

2..:::=

and equals the sum 2 (;), in agreement with the vertical recurrence relation (2.8). These ten outcomes are the following (h, h, h, t, t), (h, h, t, h, t), (h, t, h, h, t), (t, h, h, h, t), (h, h, t, t, h), (h, t, h, t, h)' (h, t, t, h, h)' (t, h, h, t, h)' (t, h, t, h, h)' (t, t, h, h, h).

Note that, a one-to-one correspondence exists between the two different sets of outcomes. Remark 2.4 will be helpful in establishing it. 0 In the next theorem the number of combinations with repetition is derived. THEOREM2.7 The number of k-combinations of n with repetition, denoted by E( n, k ), is given by (2.10)

PROOF Let [k (Wn) be the set of k-combinations with repetition of the set Wn = {w1,w2, ... ,wn} of n elements and Ck(Wn+k-d be the set of kcombinations without repetition of the set Wn+k-l = { w1, w 2 , ... , Wn+k-d of

2.3. COMBINATIONS

59

+ k - 1 elements. Consider a k-combination {Wi 1 , Wi 2 , ••• , Wik } that belongs to t'k (Wn) and suppose that the k subscripts, it, i2, ... , ik, are numbered in rising order. Then 1 ::; it ::; i2 ::; · · · ::; ik ::; n and, putting ir ir + (r - 1), r 1, 2, ... , k, it follows that 1 ::; ii < h < · · · < jk ::; n + k -1 and the corresponding k-combination {wj,, wh, ... , Wjk} belongs to Ck(Wn+k- 1 ). Further, the relation ir = ir + (r -1), r = 1, 2, ... , k, corresponds to each k-combination from t'k(Wn) one and only one k-combination from Ck(Wn+k-d and vice versa. Thus, N(t'k(Wn)) = N(Ck(Wn+k-d) and, by virtue of Theorem 2.5, (2.10) is deduced. I n

=

=

REMARK2.5 ThedoublesequenceofthenumbersE(n,k) = (n+;-t), k = 1, 2, ... , n = 1, 2, ... , of k-combinations of n with repetition, satisfies recurrence relations analogous to that of the double sequence of the numbers C (n, k) = (~), k = 1, 2, ... , n, n = 1, 2, ... , of k-combinations of n. Specifically, there hold: (a) The "triangular" recurrence relation

E(n, k) = E(n- 1, k)

+ E(n, k-

1), k

= 1, 2, ...

,n

= 1, 2, ....

(b) The "vertical" recurrence relation n

E(n,k)

= LE(r,k -1), k = 1,2, ... , n = 1,2, .... r=t

(c) The "horizontal'' recurrence relation k

E(n, k) = L E(n - 1, r), k = 1, 2, ... , n = 1, 2, .... r=O

These recurrence relations may be shown by employing the corresponding technique of deriving (2.7), (2.8) and (2.9). The following brief hints of a combinatorial derivation of the first two recurrences are quoted here. (a) The set t'k(Wn) of the k-combinations of n with repetition, by considering the element Wn E Wn, can be divided into the disjoint subsets A, of the kcombinations of n with repetition that include Wn, and /3, of the k-combinations of n with repetition that do not include Wn. Then N(A) = N(t'k(Wn-d), N(/3) = N(t'k-t(Wn)) and

N(t'k(Wn)) = N(t'k(Wn-d)

+ N(t'k-1 (Wn)),

yielding the triangular recurrence relation. (b) The set t'k(Wn) can be divided into n pairwise disjoint subsets A 1 , A 2 , ... , An, where Ar is the subset of t'k(Wn) containing the combinations that include wr as the element with the largest subscript, r = 1, 2, ... , n. Then N(Ar) = N(t'k-t(Wr)),r= 1,2, ... ,nand

N(t'k(Wn)) = N(t'k-I (Wt)) + N(t'k-I (W2)) + · · · + N(t'k-I (Wn)),

60

PERMUTATIONS AND COMBINATIONS

which implies the vertical recurrence relation.

I

Example 2.19 The number of distinguishable outcomes of a throw of k like (indistinguishable) dice equals E(6, k) = (k! 5), the number of k-combinations of the set {1, 2, 3, 4, 5, 6}, of the six faces of a die, with repetition (see Example 2.9b). For k 2 the possible outcomes are the following 21:

=

{1,1},{1,2},{1,3},{1,4},{1,5},{1,6},{2,2},{2,3},{2,4}, {2,5},{2,6}, {3,3},{3,4},{3,5},{3,6},{4,4},{4,5},{4,6},{5,5},{5,6},{6,6}. To these 2-combinations with repetition of the set { 1, 2, 3, 4, 5, 6} of six numbers, there correspond the following, in order, 2-combinations (without repetition) of the set { 1, 2, 3, 4, 5, 6, 7} of seven numbers:

{1,2},{1,3},{1,4},{1,5},{1,6},{1,7},{2,3},{2,4},{2,5},{2,6},{2,7}, {3,4},{3,5},{3,6},{3, 7},{4,5},{4,6},{4, 7}, {5,6},{5, 7},{6, 7}.

0

Example 2.20 Distributions of indistinguishable balls into distinguishable urns of unlimited capacity Suppose that k indistinguishable balls are successively distributed (allocated) into n distinguishable urns {w 1 , w 2 , ... , Wn} of unlimited capacity. Find the number of different distributions. Any distribution of k indistinguishable balls into n distinguishable urns of unlimited capacity corresponds to a collection of k urns {w; 1 , W; 2 , ... , w;k} from the set of then urns, with repetition, where the selection of an urn r times corresponds to the placement of r balls into it, r = 0, 1, ... , k. Thus, the number of ways of placing k indistinguishable balls into n distinguishable urns equals

the number of k-combinations of the set { w 1 , w 2 , ... , wn}, of then urns, with repetition.

0

Example 2.21 Display of flags on poles Consider the following "primitive" way of signaling. A display of flags of the same or different colors on poles in a row forms a signal. The absolute position of flags on a pole does not count and each pole has space for all the available flags. Assume that k flags and n poles are available. The number of different signals that can be transmitted is of interest.

2.3. COMBINATIONS

61

Consider first the case of flags of the same color and let sn,k be the number of different signals. If an,r is the number of different signals when r flags are used, then, by the addition principle, k

Sn,k

=L

an,r·

r=O

Note that, to each signal with r flags of the same color displayed on n distinguishable poles, there corresponds a collection of r poles {Pi 1 , Pi 2 , ••• , Pir} with repetition from the set {p 1 , P2, ... , Pn}, of the n poles, where the selection of a pole j times corresponds to the display of j flags on it, j = 0, 1, ... , r. Thus the number an,r equals

_(n +rr -1)

an,r-

'

the number of r-combinations of n with repetition. Therefore,

_~ (n+rr -1)

Sn,k- ~ r=O

and, by the vertical recurrence of r-combinations of n with repetition, this sum is given by (see Remark 2.5):

Further note that, to each signal with r flags of the same color displayed on n poles, there correspond r! signals with r flags of different colors displayed on n poles, which are obtained by permuting the r distinguishable flags in all positive ways (without altering the number of flags on each pole). Thus the number bn,r of signals with r flags of different colors displayed on n distinguishable poles equals

, =

bn r

, = r!

r!an r

(n + rr-

1 ) .

Note also that r flags can be chosen from the k flags of different colors in

k) = (k)r (r r! ways. Thus, according to the addition principle, the number Cn,k of signals with at most k flags of different colors displayed on n distinguishable poles is given by the sum

0

62

2.4

PERMUTATIONS AND COMBINATIONS

DIVISIONS AND PARTITIONS OF A FINITE SET

As has been noted in Remark 2.3, to each k-combination { a 1, a 2, ... , ak} of the set W n = { w 1, w 2, ... , Wn} of n elements, there corresponds a division ofWn in two subsets A= { a 1, a 2, ... , ak} and B = {b1, b2, ... , bn-k} = W n - { a 1, a 2, ... , ak}, with k and n - k elements, respectively. Thus, the number of divisions (A, B) of a finite set Wn, with N(Wn) = n, in two (ordered) subsets with N(A) = k 2: 0 and N(B) = n- k 2: 0 equals

C(n, k)

_ (n) (n)k

n!

= k = k! = k!(n-

k)!'

the number of k-combinations of n. An extension of this result is presented in the following theorem.

THEOREM2.8 The number of divisions ( A1, A2, ... , Ar) of a finite set W n• with N (Wn) = n, in r (ordered) subsets, with N(Aj) = kj 2: 0, j = 1,2, ... ,r, denoted by C(n, k1, k2, ... , kr-d or (k 1 ,k2 ,.n. ,kr_J, is given by

where kr

= n- k1

- k2 - · · · - kr-1·

PROOF In a division (A1, A2, ... , Ar) of a finite set Wn, with N(Wn) = n, the k1 elements of the first set A 1 can be chosen from the set W n, of n elements, in

ways. After the selection of the k1 elements of the first set A 1, the k2 elements of the second set A 2 can be chosen from the set W n - A 1, of n - k 1 elements, in

ways. Continuing in this manner, after the selection of the k1, k2, ... , kr- 2 elements of the sets A 1,A 2, ... ,Ar_ 2, respectively, the kr-1 elements of the set Ar- 1 can be chosen from the set Wn - A1 - A2 - · · · - Ar-2• of n - k1 - k2 - · · · - kr- 2 elements, in

63

2.4. DIVISIONS AND PARTITIONS OF A FINITE SET

ways. Finally, the selection of the ki, k 2 , ... , kr-I elements of the sets AI, A2 , ... , Ar-I. respectively, determines the kr elements of the last set Ar, since Wn - AI - A2 Ar-I is a set of n - ki - k2 kr-I = kr elements. Thus, by the multiplication principle, the number C(n, ki, k2 , ..• , kr-I) is given by 0

0

0

0

0

-

0

-

_ (n) (nki) ... (n- ki - k2- · · ·- kr_ 2) k k k

C(n,ki,k2, ... ,kr-I)-

I

n! (n- ki)! k1!(n- ki)! k2!(n- k1- k2)! n!

and so (2.11) is established. REMARK 2.6

2

r-I (n- ki - k2- · · ·- kr-2)! kr-I!(n- ki- k2- · · ·- kr_I)!

I

A comparison of (2.11) with (2.5) reveals that

where kr = n- ki - k2 - · · · - kr-I· This relation is not a simple coincidence. There exists a one-to-one correspondence of the set of divisions (AI, A 2 , ... , Ar) of a finite set Wn = {WI, w 2 , ... , wn}, of n elements, in r (ordered) subsets, with N(Aj) = kj 2: O,j = 1,2, ... ,r, k1 + k2 + ··· + kr =nand the set of permutations (a 1 , a 2 , ... , an) of r kinds of elements Ur = {ui, u 2 , •.• , Ur }, with kj elements equal to Uj, j = 1, 2, ... , r, ki + k2 + · · · + kr = n. Specifically, to the division (AI,A 2 , ... ,Ar). in which Wi belongs to the subset Ai, there corresponds the permutation (ai, a 2 , ... , an), in which the element a; = Uj, where i = 1, 2, ... , nand j = 1, 2, ... , rand vice versa. For example, for n = 7 and r = 3, to the division (AI' A2, A3) of the set w7 = {WI' W2, 'W7 }, with A1 = {wi,w4,w6,w7}, A 2 = {w3} and A3 = {w 2,w5}, there corresponds the permutation (UI, U3, U2, U!, U3, UI, UI) of the three kinds of elements U3 = {ui, u2, u3 }, while to the division (AI, A2, A3), with AI = W7, A2 = 0, A3 = 0, there corresponds the permutation (ui, ui, ui, ui, UI, UI, ui). I 0

0

0

REMARK 2. 7 The notation adopted for the expression of the number (2.11) constitutes an extension of the notation for the expression of the number (2.6), to which it reduces for r = 2. On the contrary, the notation of the number (2.11) by C(n,ki,k2, ... ,kr)

= (k1, k 2,n· · · , k r ),

also used by several authors, includes in addition to the numbers n, k1 , k 2, ... , kr-! and the number kr, which, when the previous numbers are known, is completely

64

PERMUTATIONS AND COMBINATIONS

determined by the relation kr = n- (k 1 + k2 + · · · + kr- 1 ). This notation for r = 2 leads to the notation

for the number (2.6) that is not coherent with the classical notation

C(n, k)

=(~)-

Further, note that from the relation k 1 + k2 + · · · + kr =nit follows that any ki, i = 1,2, ... ,r,canbeexpressedaski = n-(k 1 +···+ki-l +ki+t +···+kr), a difference of the sum of the rest kj, j = 1, 2, ... , i - 1, i + 1, ... , r from n. Thus, the numbers in (2.11) possess the following symmetric property:

(k1, k2,. •.

~kr-2, kr_J = (k1, k2, .. ~' kr-2, kJ = ... (k2, k3, ..

~' kr-1, kr)'

which extends the property

presented in the first part of Remark 2.3.

I

A recurrence relation for the number of divisions of a finite set is derived in the next theorem.

THEOREM2.9 The number C(n, k1, k2, ... , kr-d = (k,.k 2 ,.~. ,kr_,). of divisions (A 1, A2, ... , Ar) of a finite set Wn. with N(Wn) = n, in r (ordered) subsets, with N(Aj) = kj 2: 0, j = 1, 2, ... , r, satisfies the recurrence relation

for kj = 1, 2, ... , n, j with initial conditions

= 1, 2, ... , r -1, k1 + k2 + · · · + kr-l :S n, n = 1, 2, ... , ) (0 0 n ' ' ... ,0

= 1,

n

= 0, 1, ...

,

2.4. DIVISIONS AND PARTITIONS OF A FINITE SET

65

and

PROOF Let Ck 1 ,k 2 , ... ,k._, (Wn) be the set of divisions (A1, A2, ... , Ar) ofWn = {w 1 ,w2,···,wn}inr(ordered)subsetswithN(Aj) = kj 2:1, j = 1,2, ... ,r (whence kr = n- kt- k2- ···- kr)· If Aj is the set of divisions (A 1 , A 2, ... , Ar) of W n in r (ordered) subsets, with N (Aj) = kj 2: 1, j = 1, 2, ... , r, in which Wn E Aj, j = 1, 2, ... , r, then,

A; n Ai = 0, i, j = 1, 2, ... , r, i Ck,,k 2,... ,k._ 1 (Wn) = A1

-I- j,

+ A2 + · · · + Ar-l + Ar

and, by the addition principle,

Since

(Wn-d), N(A2)

N(At) =

N(Ck 1 -t,k 2 , ... ,k._,

N(Ar-d

= N(Ck 1,k2, ... ,k._ 1 -1 (Wn-d),

= N(Ck1,k2-1, ... ,k,_, (Wn-d),

N(Ar) = N(Ck1,k2, ... ,kr-1 (Wn-d),

it follows that

N(Ck1,k2, .. ,k.-1 (Wn)) = N(Ck1-t,k2,··· ,kr-1 (Wn-d) +N(Ck1 ,k2-1, ... ,kr-1 (Wn-t )) + · · · + N(Ck,,k 2,... ,k._ 1 -1 (Wn-t)) +N(Ck 1,k 2,... ,k._, (Wn-1)). This relation, by virtue of Theorem 2.8, implies (2.12). Note that recurrence relation (2.12) can also be shown algebraically by using expression (2.11 ). I REMARK 2.8 Consider a finite set Wn = {w 1 , w2, ... , wn}. with n = kr, and the particular case of the divisions (A 1 , A 2, ... , Ar) of W n in r (ordered) subsets, with N(Aj) = k, j = 1, 2, ... , r. The number Cn,k,r of these divisions of Wn, according to Theorem 2.8, equals I cn,k,r --~ ( k!Y ·

PERMUTATIONS AND COMBINATIONS

66

Further, consider the particular case of the partitions {AI, A2, ... , Ar} of Wn in r(unordered)subsets,withN(Aj) = k,j = 1,2, ... ,r. To each such partition there correspond r! from the preceding divisions and specifically those that are formed by permuting the r subsets in all possible ways. Thus, if Bn,k,r denotes the number of these partitions of Wn, then Cn,k,r = r!Bn,k,r• and so

B

I - _n_._

n,k,r - r!(kW.

In order to exemplify this connection, consider the divisions (A, B) and the partitions {A,B} of the set W4 = {w 1 ,w2 ,w3 ,w4 } in two subsets, with N(A) = N(B) = 2. The partitions are

and the corresponding divisions are ( {WI , W2}, { W3, W4}), ( {WI , W3}, { W2, W4}), ({WI, W4}, {W2, W3}), ({w3,w4}, {wi,w2}), ({w2,w4}, {wi,w3}), ({w2,w3}, {wi,w4}), in agreement with B4,2,2 = 3 and C 4,2,2 = 6.

I

The next theorem is concerned with the number of partitions of a finite set and constitutes a generalization of the conclusion of the preceding remark.

THEOREM 2.10

The number of partitions {AI, A2, ... , Ar} of a finite set W n• with N (Wn) = n, in r (unordered) subsets, among which rj 2: 0 include j elements, j = 1, 2, ... , n, denoted by B(n, r; ri, r 2, ... , rn). equals (2.13)

where ri

+ r2 + · · · + rn = rand ri + 2r2 + · · · + nrn = n.

PROOF Consider a partition {AI,A 2, ... ,Ar} of Wn, in rj 2: 0 subsets including j elements each, j = 1, 2, ... , n, with ri + r 2 + · · · + rn = r and r1 + 2r2 + · · · + nrn = n. To it there correspond n !r2! · · · rn! divisions of Wn in r subsets, with r 1 2: 0 subsets including j elements each, j = 1, 2, ... , n, and, specifically, those that are formed by internal permutation of then ;::: 0 subsets with one element, the r 2 2: 0 subsets with two elements, and, finally, the rn 2: 0 subsets with n elements in all possible ways. Thus,

2.4. DIVISIONS AND PARTITIONS OF A FINITE SET

67

and also by (2.11 ), n!

C(n, 1, ... , 1, 2, ... , 2, ... ) = ( 1.') Tl ( !)T2 2 From these two relations, (2.13) is deduced.

• • •

(n! )Tn

I

Example 2.22 Elevator passengers' discharge Consider an elevator of a building of five floors that starts from the basement with eight passengers. Find the number of ways of discharging k 1 = 0, k2 = 3, k3 = 1, k 4 = 2 and k5 = 2 passengers at the first, second, third, fourth and fifth floors, respectively. Note that to each way of discharging k 1 = 0, k2 = 3, k3 = 1, k 4 = 2 and k5 = 2 passengers at the first, second, third, fourth and fifth floors, respectively, there corresponds a division of the set W8 = { w 1 , w 2 , ... , ws}, of eight passengers, in five (ordered) subsets (A 1 , A2, ... , A5), with N(A!) = 0, N(A2) = 3, N(A3) = 1, N(A 4 ) = 2 and N(A5) = 2, where the discharge of the passenger wi at the j-th floor corresponds to wi E Aj, i = 1, 2, ... , 8, j = 1, 2, ... , 5. Thus, the required number, according to Theorem 2.8, equals 8 - 1680 ' 0!3!1!2!(8- 3- 1 - 2)! .

D

Example 2.23 Consider a series of 21 throws of a die. Find the number of different outcomes in which number i appears i times, i = 1, 2, ... , 6, so that 1 + 2 + · · · + 6 = 21. An outcome of a series of21 tosses of a die (a1, a 2 , ... , a 21 ) that includesi times the numberi, i = 1, 2, ... , 6, corresponds uniquely to a division (A 1 , A2 , ... , A 6 ) of the set {1, 2, ... , 21 }, of the 21 throws of the die, in six ordered subsets, where Ai is the set of throws in which numberi appears, with N(Ai) = i, i = 1, 2, ... , 6. Thus, by Theorem 2.8, the required number equals 21 ) 21! ( 1, 2, 3, 4, 5 - 1!2!3!4!5!6!"

D

Example 2.24 Distributions of students in sections Suppose that n = kr students of the School of Sciences have chosen to attend a specific course from the department of mathematics. In order to provide better attendance conditions, these students are distributed in r sections, each with k students. Determine the number of such distributions. (a) If the r sections are considered distinguishable (since the lectures take place either in different days of the week or in different hours of a day), then the required

68

PERMUTATIONS AND COMBINATIONS

number, according to Theorem 2.8, equals

n! = (k!}r,

Cn,k,r

the number of divisions (AI, A2 , ... , Ar) of the set Wn = {wi,w 2, ... , wn}. of then students, in r subsets (sections) with N(Aj) = k, j = 1, 2, ... , r. (b) If the r sections are considered as indistinguishable (since they cover the same amount of knowledge), then the required number, according to Theorem 2.10, equals

B

I - _n_._ r!(k!)r,

n,k,r -

the number of partitions {AI, A2, ... , Ar} of the set Wn = {WI, w2, ... , wn}. of then students, in r subsets (sections) with N(Aj) = k, j = 1, 2, ... , r. 0

Example 2.25 Distributions of distinguishable balls into indistinguishable urns Consider the distributions of n distinguishable balls into r indistinguishable urns, in which Tj 2: 0 urns include j balls, j = 0, 1, 2, ... , n, with r0 + ri +r 2 + · · · + rn = rand ri + 2r2 + · · · + nrn = n. Find the number of such distributions. Such a distribution corresponds to a partition of the set Bn = { bi, b2, ... , bn}, of then balls, in r-r0 (unordered) subsets, among which r1 2: 0 include j elements (balls), j = 1, 2, ... , n, with ri + r2 + · · · + rn = r- ro and ri + 2r2 + · · · + nrn = n. Thus, according to Theorem 2.10, the required number equals n! B(n,r-ro;ri,r2,····rn)= TI·'(I) '( 2.') rz 1. Tir2 . In particular, for n = 10, r of distributions equals

·rn.'( n.') Tn

= 5 and r 0 = 0, TI = 2, r 2 = 1, r3 = 2, the number

10! 12 600 2!(1!)21!(2!)12!(3!)2 = • '

2.5

..

0

INTEGER SOLUTIONS OF A LINEAR EQUATION

Consider the linear equation XI + X2 + · · · +

Xn

= k,

(2.14)

where k is an integer. The calculation of the number of integer solutions (ri, r 2 , .•• , rn) of (2.14) satisfying a given set of restrictions is reduced to

2.5. INTEGER SOLUTIONS OF A LINEAR EQUATION

69

the calculation of the number of combinations (with or without repetition) of the n indices { 1, 2, ... , n} satisfying analogous restrictions. In the following theorems and corollaries, the number of integer solutions of the linear equation (2.14) under several sets of restrictions is derived.

THEOREM 2.11 The number of solutions (r1, r 2, ... , rn) of the linear equation (2.14), with = 0 or 1, i = 1, 2, ... , n, and k a nonnegative integer; equals

:r:;

the number of k-combinations of n. PROOF Note that, to each solution (r 1 ,r2 , ... ,rn) of (2.14), with r; = 0 or 1, i = 1, 2, ... , n, there corresponds an assignment of the k units of the righthand side to the n distinguishable summands of the left-hand side of (2.14), assigning r; units to the i-th summand, i = 1, 2, ... , n. Since the possible values of ri are 0 and 1, such an assignment may be expressed as {a1, a 2 , ... , ak}, where aj E { 1, 2, ... , n} and a; =I aj, by listing only the indices of the summands to which a unit is assigned (where the order oflisting does not matter). This correspondence is obviously one to one and thus the number of solutions (r1 , r 2 , ... , rn) of (2.14), with r; = 0 or 1, i = 1, 2, ... , n, equals (~),the number of k-combinations ofn.

I

THEOREM 2.12 The number of nonnegative integer solutions (r 1 , r 2 , ... , rn) of the linear equation (2.14 ), with k a nonnegative integer; equals

the number of k-combinations of n with repetition. PROOF Note that, to each nonnegative integer solution (r 1 , r 2 , ..• , rn) of (2.14 ), there corresponds an assignment of the k units of the right-hand side to the n distinguishable summands of the left-hand side of (2.14), which assigns r; ~ 0 units to the i-th summand, i = 1, 2, ... , n. Such an assignment may be expressed as {a 1 , a 2 , ... , ak}, where r 1 elements are equal to 1, r 2 elements are equal to 2, ... , rn elements are equal ton, by listing r; ~ 0 times the index i, for i = 1, 2, ... , n (with the order of listing not counting). Thus, to each nonnegative int~ger solution (r 1 , r 2 , •.. , rn) of (2.14) there corresponds a k-combination

PERMUTATIONS AND COMBINATIONS

70

{a1 , a 2 , ... , ak} of the n indices { 1, 2, ... , n} with repetition, in which the element (index) i is included r; 2: 0 times, fori = 1, 2, ... , n. This correspondence is obviously one to one and so the number of nonnegative integer solutions of (2.14) equals (n+~-l), the number of k-combinations of n with repetition. I COROLLARY 2.4 (a) The number of integer solutions (r 1,r2, ... ,rn) of the linear equation (2.14), with the restrictions X;

for given integers

8;,

2:

8;,

i

= 1,2, ...

i = 1, 2, ... , n, with

8

=

81

,n

(2.15)

+ 82 + · · · + 8n

~

k, equals

(n+ k-8 1) (n + n-1 1) . k -

k -

8 -

8 -

(b) The number of integer solutions (r 1 , r 2 , ••. , rn) of the linear equation (2.14), with the restrictions (2.16) = 1, 2, ... , n = 1, 2, ... , n, with m = m 1 + m 2 + · · · + mn > k, x; ~ mi, i

for given integers mi, i equals

m 1) = (n + mn-1- 1). (n+ m-k k -

k -

PROOF (a) On using the transformation y; = x; - 8;, i = 1, 2, ... , n, the linear equation (2.14) and the restrictions (2.15) reduce to the linear equation

Y1

+ Y2 + · · · + Yn = k

-

8,

(2.17)

withy; 2: O,i = 1,2, ... ,nandk-8anonnegativeinteger. Since this transformation is one-to-one, to each integer solution (r 1 , r 2 , ... , rn) of the linear equation (2.14 ), with the restrictions (2.15), there corresponds one and only one nonnegative integer solution (r 1 - 8 1 , r 2 - 8 2 , .. . , r n - 8n) of the linear equation (2.17) and vice versa. Thus, the required number equals the number of nonnegative integer solutions of (2.17), which, by Theorem 2.12, is given by

(n+ k-8 1) (n + n-1 1) . k -

8 -

=

k -

8 -

(b) Similarly, upon using the tran·sformation z; = m; - x;, i = 1, 2, ... , n, the linear equation (2.14) and the restrictions (2.16) reduce to the linear equation ZI

+ Zl + ... + Zn

= m- k,

(2.18)

2.5. INTEGER SOLUTIONS OF A LINEAR EQUATION

71

with Zi 2 0, i = 1, 2, ... , nand m- k a nonnegative integer. Since this transformation (4.8) is also one-to-one, arguing as before, it follows that the required number equals the number of nonnegative integer solutions of (2.18), which, by Theorem 2.12, is given by

m - k - 1) = (n + m - k - 1) . (n+ m-k n-1

I

The proof of the corollary is thus completed.

The particular case with si = 1, i = 1, 2, ... , n in the restrictions (2 .15), which corresponds to the calculation of the number of positive integer (integral) solutions of the linear equation (2.14), is worth a separate presentation. COROLLARY 2.5 The number of positive integer solutions (r 1 , r 2 , ... , rn) of the linear equation (2.14), with k 2 n, equals

k- 1) = (k- 1). (k-n n-1

REMARK 2.9 The number of integer solutions (r 1 , r 2 , ... , rn) of the linear equation (2.14), with the restrictions

for given integers si, mi. i = 1, 2, ... , n, with s ~ k ~ m, s

= St + s2 + · · · + Bn,

m

= m1 + m2 + · · · + mn,

is calculated in Chapter 4 (Theorem 4.3) by applying the inclusion and exclusion I principle. REMARK 2.10 Integer solutions of a linear equation and distributions of indistinguishable balls into distinguishable urns. The existence of a one-toone correspondence between the integer solutions of the linear equation (2.14) and the distributions of k indistinguishable balls into n distinguishable urns {w 1 , w 2 , · .. , wn} is already indicated in the proofs of Theorems 2.11 and 2.12. Specifically, to an integer solution (r 1 , r 2 , ... , rn) of the linear equation (2.14) that satisfies a given set of restrictions, there uniquely corresponds the distribution of k indistinguishable balls into n distinguishable urns, {w 1 , w 2 , ... , wn}, that assigns I (allocates) ri balls into urn Wi for all i = 1, 2, ... , n, and vice versa.

72

PERMUTATIONS AND COMBINATIONS

Example 2.26 Consider a collection of 32 cards of four different colors (blue, green, red and yellow), with eight cards from each color. Find the number of different subcollections of (a) five cards and (b) at most five cards. (a) Let xi be the number of cards of the i-th color, i = 1, 2, 3, 4. Then a sub-collection of five cards is a nonnegative integer solution of the linear equation

Consequently, by Theorem 2.12, the number of different sub-collections of five cards equals

(8)5 (8)3 82.. 3 =

=

7 . 6 = 56.

(b) A sub-collection of k cards is a nonnegative integer solution of the linear equation X1 + X2 + X3 + X4 = k and, according to Theorem 2.12, the number of different sub-collections of k cards equals

( 4 +~- 1 ),

k=0,1, ... ,5.

Clearly, the number of sub-collections with at most five cards equals the sum of these numbers, 5

{;

(4 + k 1) k-

= 1 + 4 + 10 + 20 + 35 +56 = 126.

Note that, by the vertical recurrence relation of the number of k-combinations of 4 with repetition, this sum is given by (see Remark 2.5) (

4 + 5) =

5

(9) (9) 9. =

5

8. 7. 6 = 126.

4

2-3·4

The number of sub-collections with at most five cards may also be derived by noting that a sub-collection of at most five cards is a nonnegative integer solution of the linear inequality Xt + X2 + X3 + X4 :::; 5. The number of nonnegative integer solutions (r 1 , r 2 , r 3 , r 4 ) of this linear inequality, upon introducing the surplus variable x 5 = 5 - (x 1 + x 2 + x3 + x4), equals the number of nonnegative integer solutions (r 1 , r 2 , r3, r 4 , r 5 ) of the linear equation X1

+

X2

+

X3

+

X4

+

X5

= 5,

which, according to Theorem 2.12, is given by G)= 126.

D

2.5. INTEGER SOLUTIONS OF A LINEAR EQUATION

73

Example 2.27 Transportation of products of different kinds Let us consider a storehouse that has n kinds of a merchandized product, packed in boxes of equal size, with a proper identity label on each, in stocks of at least s boxes from each kind at any moment. Calculate the number of loads of different composition that a truck with capacity of k boxes may carry for the execution of orders requiring at least s boxes from each kind of the product . Let Xi 2: s be the number of boxes of the i-th kind that the truck may carry, i = 1, 2, ... , n. Then x 1 + x 2 + · · · + Xn is the total load of the truck, which, of course, does not exceed its capacity. Therefore, the required number equals the number of integer solutions (r 1 , r 2 , ... , rn) of the linear inequality

with the restrictions

xi 2: s, i

= 1, 2, ... , n,

ns :::; k,

which, upon introducing the surplus variable Xn+l = k- (x 1 + x 2 + · · · + xn). equals the number of integer solutions (r1, r 2 , ... , rn, rn+d• with rn+l = k- (r 1 + r 2 + · · · + rn), of the linear equation XI

+ Xz + · · · + Xn + Xn+l = k,

with the restrictions Xi

2: s, i = 1,2, ... ,n, :rn+l 2:0, ns :S k.

Consequently, according to Corollary 2.4, this number is

Example 2.28 Fibonacci numbers Find the number C 1 ( n, k) of k-combinations of the set { 1, 2, ... , n} that include no pair of consecutive integers and conclude the (total) number Cn of combinations of { 1, 2, ... , n} that include no pair of consecutive integers. Let {i 1 , i 2 , ... , ik} be any k-combination of the set {1, 2, ... , n}. Since the order of the elements included in any combination does not count, it may be assumed that 1 :S it < iz < · · · < ik :S n. Consider the distance between the successive elements of this k-combination:

and also

74

PERMUTATIONS AND COMBINATIONS

Adding these equations by parts, the following linear equation

J1 + iz + · · · + Jk + Jk+1

=n

is deduced. Thus, each k-combination { i 1 , i 2 , .•. , ik} of the set {1, 2, ... , n} that includes no pair of consecutive integers corresponds to an integer solution of this linear equation that satisfies the restrictions

Jl

~ 1,

Jz

h

~ 2,

~ 2, ... ' ik ~ 2, ik+1 ~ 0,

with s = s 1 + s 2 + · · · + Sk + Sk+ 1 = 1 + 2(k- 1) = 2k- 1 ::; n, and vice versa. Consequently, according to Corollary 2.4, the numberC1 (n, k) of k-combinations of the set {1, 2, ... , n} that include no pair of consecutive integers is given by

Ct(n, k) = (

n- k

k

+

1)

, k = 0, 1, ... , [(n

+ 1)/2],

where [x] denotes the integer part of x. Then, the (total) number C n of combinations of { 1, 2, ... , n} that include no pair of consecutive integers is given by the sum [(n+1)/2]

Cn

=

L

k

(n- k + ) , n = 1

0, 1, ....

k=O

The numbers / 0 = 1, f n = Cn- 1 , n = 1, 2, ... , are called Fibonacci numbers. The number f n first appeared as the number of pairs of rabbits born from one pair at the end of the (n - 1) -st month. This problem was posed in 1202 by Leonardo Fibonacci in his book on abacus (Liber Abacz). 0

Example 2.29 Lucas numbers Assume that then numbers of the set {1, 2, ... , n} are displayed on a circle, whence (n, 1) is a pair of consecutive points. Find the number B 1 (n, k) of kcombinations of the set {1, 2, ... , n} displayed on a circle that include no pair of consecutive points and conclude the (total) number K n of combinations of the set {1, 2, ... , n} displayed on a circle that include no pair of consecutive points. The set of k-combinations of the set {1, 2, ... , n} displayed on a circle that include no pair of consecutive points can be divided into two disjoint subsets: the subset of these combinations that include n and the subset of these combinations that do not include n. Further, (a) the number of these combinations that do not include n equals

c1 (n-

1, k)

= ( n-k k) '

the number of k combinations of then- 1 consecutive integers { 1, 2, ... , n- 1} displayed on a straight line, including no pair of consecutive integers. (b) The

75

2.6. LATTICE PATHS

number of these combinations that include n, and thus do not include neither 1 nor n- 1, equals n- k C 1 (n-3,k-1)= ( k-l ,

-l)

the number of (k- I)-combinations of then - 3 consecutive positive integers {2, 3, ... , n- 2} displayed on a straight line, including no pair of consecutive integers. Hence, by the addition principle, the required number is given by the sum BI(n, k) =

(n-k k) + (n -k-k- 1) 1

and since

it follows that

B1 (n, k) = n n_ k (n -k

k) = kn (n -k _k- 1) , k = 0, 1, ... , [n/2]. 1

The (total) number Kn of combinations of the set {1, 2, ... , n} displayed on a circle that include no pair of consecutive points is given by the sum [n/ 2 ]

Kn =

L

n n- k n _ k ( k ) , n = 1, 2, ....

k=O

The numbers g0 = 2, Yn = Kn, n = 1, 2, ... , which are connected with the Fibonacci numbers (see Example 2.28) by

= fn + fn-2, numbers. 0 Yn

are called Lucas

2.6

n

= 2, 3, ...

,

LATTICE PATHS

Consider an orthogonal system of axes on the plane xy and the lattice defined by the straight lines x = i, i = 0, ±1, ±2, ... , and y = j, j = 0, ±1, ±2, ... , that are orthogonal to the (horizontal) axis x and the (vertical) axis y, respectively. A directed polygonal line on the lattice that leads from the point (r, s) to the point (n, k), r ~ n, s ~ k, through horizontal and vertical straight sections, positively directed, is called lattice path (or, more precisely, minimal lattice path) from the point (r, s) to the point (n, k).

PERMUTATIONS AND COMBINATIONS

76

A horizontal section of a lattice path between two successive points (i, j) and (i + 1,j) (of the horizontal line y = j) is called horizontal (unit) step, while a vertical section of a lattice path between two successive points (i, j) and (i,j + 1) (of the vertical line x = i) is called vertical (unit) step. According to these definitions, a lattice path from the point (r, s) to the point (n, k), r ~ n, s ~ k, is completely determined in any of the following ways: (a) by the set {(xo,Yo), (x1,yt), ... , (xn+k-r-s,Yn+k-r-s)} of the n + k- r- s + 1 points through which it passes, with (x 0 ,y0 ) = (r,s) and (xn+k-r-s, Yn+k-r-s) = (n, k), (b) by the permutation (s 1 , s2, ... , Sn+k-r-s) of then- r symbols h and k- s symbols v, where Si = h if the i-th step is a horizontal one and si = v if the i-th step is a vertical one, i = 1, 2, ... , n + k- r- s, (c) either by the set {i 1, i2, ... , in-r} of the positions of the horizontal steps, a subset of the set {1, 2, ... , n + k - r - s }, or by the set {j1,h, ... ,ik-s} = {1,2, ... ,n + k- r- s}- {il,i2,··· ,in-r} of the positions of the vertical steps. The calculation of the lattice paths from the point (r, s) to the point (n, k) may be reduced, by a parallel transfer of the orthogonal system of axes, z = x- r, w = y- s, to the calculation of the lattice paths from the origin (0, 0) to the point (n- r, k- s). The following theorem and corollary are concerned with the enumeration of such paths. THEOREM 2.13

The number of lattice paths from the origin (0, 0) to the point (n, k), with n 2: 0, k 2: 0, is given by L(

n,

k)=(n+k)!=(n+k) k · n 'k' ..

(2.19)

PROOI - (m + 1 ), r = 1, 2, ... , n + k. In order to calculate this number, let us consider the set A of lattice paths from the origin (0, 0) to the point (n, k) and the set B of lattice paths from the origin (0, 0) to the point (n, k) that touch or intersect the straight line x = y - ( m + 1). Then cn,k,m

= N(A- B),

B ~A

and using part (c) of Theorem 1.4, it follows that cn,k,m

= N(A- B)= N(A)- N(B),

where, according to Theorem 2.13, N(A) = L(n, k)

= ( n +n k)·

As regards the calculation of the number N(B), note that (a) If k < m + 1, the points (0, 0) and (n, k) lie below the straight line x = y- (m + 1) and there is no

PERMUTATIONS AND COMBINATIONS

82

lattice path from (0, 0) to (n, k) touching or intersecting this line, whence B = and so N(B) = 0. (b) If m + 1 :::; k :::; n + m, then according to Lemma 2.1,

NB ( )

=(

n+k k-m+1

)=(

0

n+k) n+m-1 ·

Further, (c) if k > n + m, the point (n,k) lies either on the straight line x = y- (m + 1) or above it, while the origin (0, 0) lies below it; thus all the lattice paths from the origin (0, 0) to the point (n, k) touch or intersect this line, whence B =A, and so N(A) = N(B). Therefore,

and

Cn,k,m

2.7

= 0, fork > n + m.

D

PROBABILISTIC APPLICATIONS

Some interesting probabilistic applications of permutations and combinations are presented in this section. Specifically, four classical problems in discrete probability, problems of ordered and unordered samples in statistics and three classical probabilistic models of statistical mechanics are examined.

2.7.1

Classical problems in discrete probability

(a) The most beneficial bet. Chevalier de Mere, a professional player of games of chance, in 1654 proposed the following problem to the famous French mathematician Blaise Pascal (1623 -1662) for solution: which is more beneficial for a player, to bet on the appearance of at least one 6 in four throws of a die or of at least one double 6 in 24 throws of a pair of distinguishable dice? Note that in a throw of a die there are six equiprobable possible results, { 1, 2, 3, 4, 5, 6}, and thus the probability of the appearance of 6, according to classical definition of probability (see Section 1.4), is 1/6. Also, in a throw of a pair of distinguishable dice, according to Example 2.8, there are 62 = 36 equiprobable possible results, {(i,j): i = 1,2, ... ,6, j = 1,2, ... ,6}, and thus the probability of the appearance of (6, 6) is 1/36. Since the probability of the appearance of 6 in a throw of a die is six times the probability of

2. 7. PROBABILISTIC APPLICATIONS

83

the appearance of (6, 6) in a throw of a pair of distinguishable dice and the total number of throws of the pair of distinguishable dice is six times the total number of throws of a die, Chevalier de Mere concluded that the two required probabilities are equal. But, in practice, he noted a difference between the two probabilities and complained to Pascal that mathematics Jed to wrong conclusions. Pascal corresponded this problem to the famous French mathematician Pierre Fermat (1608-1665). Both suggested different solutions to this problem. Pascal's solution, is the following. Let A be the event of the appearance of at least one 6 in four throws of a die and B the event of the appearance of at least one (6, 6) in 24 throws of a pair of distinguishable dice. Then P(A)

= 1- P(A'),

P(B)

= 1- P(B'),

where I 54 P(B') = 3524 P( A ) = 64 ' 3624 '

since N(A') = 54, which is the number of the 4-permutations with repetition of the five numbers (excluding the number 6), N(flt) = 64 and N(B') = 35 24 , which is the number of the 24-permutations with repetition of the 35 pairs (excluding the pair (6,6)), N(fl2) = 36 24 . Thus 24 4 5) ~ 0,518, P(B) = 1 - (35) ~ 0,491. P(A) = 1 - ( "6 36 (b) Distribution of shares. Consider two players K and R contending in a series of games in which the winner is the one who first wins n games. Assume that the probability for each player to win a game is 1/2. Further, suppose that for some reason the series of games is interrupted when K has won n - k games and R, n - r games, k < n, r < n. In this case, in what shares might the total stake of s dollars be divided? Note that this is the oldest known probabilistic problem. It was initially published in 1494 by Lucas de Burgo Pacioli; however, the solution given by Pacioli was wrong. Later, Nicolo Tartaglia in 1556 and Francesco Peverone in 1581 engaged in this problem, but the solutions they proposed were also wrong. This is not surprising since then the notion of probability was not yet known. Fermat and Pascal, each independent of the other, provided the first correct solution of this problem. One of the solutions proposed by Fermat is the following. Assume that the series of games is continued and let A be the event in which player K is finally the winner and Aj the event in which player K completes the series of the rest of k wins at the j-th game (after the resumption of the series of games), j = k, k + 1, ... , k + r - 1. Then Ai

n A3

= 0, i f:. j,

A

= Ak + Ak+I + · · · + Ak+r-I

84

PERMUTATIONS AND COMBINATIONS

and so

k+r-1

=

P(A)

L

P(Aj)-

j=k

Further, N ( [}j) = 2i, which is the number of ]-permutations with ( unrestricted) repetition of then= 2 symbols w (win forK) and d (defeat for K) and

N(Ai) =

(j-

1 ), k-1

which is the number of different selections of the k - 1 positions for the symbol w from a total of j - 1 positions (the j-th position being occupied by the k-th w). Thus, by the classical definition of probability, P(Ai)

j-

= ( k-

and so

1 2i

(j _1)

k+r-1

~

P(A)=

1) 1

k-1

1 2i.

This expression can be reduced as follows: the probability P(A') that player K does not finally win and thus player R is finally the winner, which can be similarly evaluated, equals P(A') =

r~1 ~ j=r

(j1) ~ r -1

2J

and also, according to P(A') = 1- P(A), is given by k+r-1

P(A')

= 1-

" ~

j=k

.

(J-



1 ) k-1 2J

Equating the two expressions of P(A') and setting r = k, we conclude that

}~ G=D ~1

Therefore

1 2i =

1 L (j - 1) 2i'kr 1 k-1

2. 7. PROBABILISTIC APPLICATIONS

85

and, from the total stake of s dollars, player K might get a share of sP(A) dollars and player R a share of s[1 - P(A)J dollars. (c) The ballot problem {continuation). In a ballot between two candidates

N and K, N receives n votes and K receives k votes, with n > k. Calculate the probability that the votes for N are more than the votes for K at any step of a random counting of the votes. This problem was formulated by Bertrand in 1887. An elegant solution given in the same year by the French mathematician Desire Andre (18401917) is based on the reflection principle (see Section 2.6). Let E be the event in which the votes for candidate N are constantly more than the votes for candidate K during the counting of the votes. Since the votes are randomly taken out of the urn, the elementary events (sample points) are equiprobable and Laplace's formula of classical probability, P(E) = N(E)/N, can be applied. Note that N(E) is the number of ways of counting the votes so that, at any step, the votes for N are more than the votes for K and N is the number of ways of counting the votes without any restriction. According to Example 2.30, N(E)

n- (n

= 1[/n,k = n + kk +k k) .

Further,

and so

n-k

P(E) = - k .

n+

(d) The Banach matchbox problem. This problem, which was inspired by the smoking habits of the great Polish mathematician Banach, was presented by H. Steinhaus during a ceremony in honor of Banach. A mathematician always carries one matchbox in his right pocket and another in his left pocket. Whenever he needs a match to light his cigarette, he randomly chooses one of the two matchboxes. Suppose that each box initially contains n matches and consider the moment when, for the first time, the mathematician discovers that a box is empty. Calculate the probability Pn,k that, at this moment, the other box contains k matches. Let us denote by A the event in which the box in the right pocket contains k matches at the moment the box in the left pocket is discovered to be empty. Also let us denote by WI the selection of the box in the left pocket and by w 2 the selection of the box in the right pocket. Then A= {(a1, a 2, ... , a2n-k> wi): n of a's are WI and n- k are w2}.

PERMUTATIONS AND COMBINATIONS

86

Note that the number of sample points that belong to A equals N(A) = (2n- k)! = (2nn!(n- k)! n

k),

the number of permutations of the total of 2n- k symbols among which n symbols are w 1 and n - k symbols are w 2 • Further, each elementary event (sample point) B

= {(a1, a2, ...

, a2n-k, wi) : n specific a 1 s are w 1 and the other n - k are w2}

can be written as

where B2n-k+I = {wi} and n specific Bj are equal to {wi} and the other n- k Bj are equal to {w2}. Thus Bj 1/2.

2.7.3 Probability models in statistical mechanics Consider a mechanical system consisting of k particles. To each particle of mass m there correspond its position (x, y, z) and its momentum (mu, mv, mw), where u, v and w are the coordinates of its velocity. In statistical mechanics the 6-dimensional space, in which the vectors (x, y, z, mu, mv, mw) belong, is subdivided into a large number of n small regions or cells so that each particle, in accordance with its coordinates, is assigned to one cell. According to the hypotheses imposed on the particles (distinguishable or indistinguishable) and on the cells (distinguishable or indistinguishable, of limited or unlimited capacity), several models may be introduced. (a) Maxwell-Boltzman model. Assume that the k particles as well as the n cells are distinguishable. Thus, there are nk distributions (allocations) of the particles into the cells. Further, assume that these distributions are equiprobable and so each has probability 1/nk. Note that this assumption may be achieved by an appropriate definition of the cells. The number of distributions resulting in Tj particles in j-th cell, j = 1, 2, ... , n, equals

k)(k-rl)···(k-rl-···-rn-2)= k! , ( TI r2 Tn-1 r1!r2!···rn! with r 1 + r 2 + · · · + rn = k. Therefore the probability that Tj particles are in the j-th cell, j = 1, 2, ... , n, with r 1 + r 2 + · · · + rn = k, is

It should be noted that in modern theory it was shown beyond doubt that this model does not describe the behavior of any known particles. (b) Bose-Einstein model. Assume that the k particles are indistinguishable and the n cells are distinguishable. Thus, there are (n+~- 1 ) distributions of the particles into the cells. Further, suppose that these distributions are equiprobable, each with probability 1/ (n+~ - 1 ). This assumption holds true for photons, nuclei and atoms containing an even number of elementary particles. Thus, the probability that a given cell contains r particles is . k) = + kk+ kk - ' p (r, n, r

(n

r- 2) I (n

1)

PERMUTATIONS AND COMBINATIONS

90

since the remaining k - r particles can be distributed into the remaining 2 n- 1 cells in ) ways. The probability that s cells remain empty is

(n+z=;-

q(s; n, k)

=

(n) ( 1 )I (n + 1) s

k -

n- s- 1

k -

k

'

since there are (~) ways of selecting the empty cells and, for each of these selections, (n~~~J ways of distributing the k indistinguish~ble particles into the remaining n - s cells so that no one of these remains empty. (c) Fermi-Dirac model. It is assumed that the k particles are indistinguishable and the n cells distinguishable, with capacity limited to one particle. The second assumption requires k :::;: n. Thus, there are (~) distributions of the particles into the cells. Further, it is assumed that these distributions are equiprobable, each with probability 1/ (~). Therefore, the probability that a group of s given cells contains r particles equals q(r, s; n, k)

= (;)

(~=;)I(~).

Note that in statistical mechanics it was shown that electrons, neutrons and protons satisfy the assumptions of this model.

2.8

BIBLIOGRAPHIC NOTES

The French mathematicians Blaise Pascal (1623- 1662) and Pierre Fermat (1608-1665), motivated by the probabilistic problems of the most beneficial bet and the distribution of shares, discussed in Section 2. 7, initiated in 1654 the unification of the long existing methods and results on the enumeration of permutations and combinations of a finite set. Pascal's Triangle Arithmetique, which is now referred to as Pascal's triangle, was published after his death in 1665. The first textbook, Ars Conjectandi, dealing with problems of combinatorial and probabilistic nature was written by James Bernoulli (1654-1705). It was published posthumously in 1713 by Nicolas and John Bernoulli. The first comprehensive textbook on counting permutations and combinations was written by W. A. Whitworth (1867) and is available in reprint form. Illustrating the theory on enumeration of integer solutions of a linear equation, presented in Section 2.5, we examined the enumeration of linear and circular combinations that include no pair of consecutive integers; the Fibonacci and Lucas numbers emerged. Generating functions and other properties of these numbers will be discussed in subsequent chapters. Even more can be learned from the book by V. E. Hoggatt (1969).

2.9. EXERCISES

91

As we have noted in Section 2. 7, the famous ballot problem was formulated by J. Bertrand (1887). An elegant solution by using the reflection principle was given by D. Andre (1887). In recent years a lot of papers dealing with extensions and generalizations of this problem were published and led to the development of lattice path combinatorics. We have only touched upon this subject. The interested reader is referred to the books by W. Feller (1968, Chapter 3), F. Spitzer (1964), L. Takacs (1967a), S. G. Mohanty (1979) and T. V. Narayana (1979).

2.9

EXERCISES

1. Calculate the number of different seatings in a row of four boys and three girls (a) so that no two girls are seated next to each other and (b) without any restriction. 2. Suppose that 16 teams take part in a soccer premier league. For the championship of a season, each team contests with every other team in two matches, one home and the other away. Calculate the total number of matches. 3. In how many ways can five mathematics books, three physics books and two books of two other different subjects be placed on a shelf so that the books of the same subject are not interrupted? 4. An elevator of a four-floor building starts from the basement with three passengers. Find the number of ways of discharging these passengers. In how many of these ways does one passenger get off at the fourth floor? 5. Find the number of different ways the president, vice-president, secretary and treasurer of a seven-member committee can be chosen. 6. Consider a series of three throws of a die. Find the number of possible outcomes that include three consecutive numbers.

7. Calculate the number of four-digit integers that (a) have no digits other than 0, 1 or 2, (b) are even (numbers) and (c) are odd (numbers). 8. Suppose that ten letters {h, h, ... , l 10 } from an alphabet are given. Find the number of four-letter words that can be formed (a) without repeated letters and (b) without any restriction. 9. Find the number of permutations of five kinds of elements {w 1 , w 2 , with two like elements of each kind, in which the two like elements of each of the two kinds {w 1 , w 2 } are consecutive.

W3,W4,w 5 },

92

PERMUTATIONS AND COMBINATIONS

10. Find the number of permutations of the ten digits {0, 1, ... , 9} in which 0 precedes 1 and 2 precedes 3. 11. A problem of Galilei. Suppose that three distinguishable dice (one white, one black and one red) are rolled and let S 3 = {(w,b,r) : w = 1, 2, ... , 6, b = 1, 2, ... , 6, r = 1, 2, ... , 6} be the set of possible results. Also, let A be the subset of possible results (w, b, r) with sum w + b + r = 9 and B the subset of possible results (w, b, r) with sum w + b + r = 10. Calculate the numbers N(A) and N(B), and conclude that P(A) < P(B). 12. Circular permutations. An arrangement (i 1 ,i 2 , ... ,in) of the elements of a set { 1, 2, ... , n} on a circle, so that i 1 succeeds in, is called circular permutation. Show that the number of circular permutations of the set { 1, 2, ... , n} equals (n - 1)! 13. Suppose that seven persons {w 1 ,w2 , ... ,w7 } are arranged (a) in a row and (b) on a circle. In each case, find the number of different arrangements in which three persons stand between w 1 and w 2 .

14. Calculate the number of different seating of seven married couples (a) around a straight table, and (b) around a circular table, so that the husband and wife of three specified couples are seated next to each other. 15. Suppose that two distinguishable dice are rolled. Find the number of outcomes (pairs) in which both numbers are less than or equal (a) to 4 and (b) to 3. Combine the two results to find (c) the number of outcomes (pairs) in which 4 is the maximum of the two numbers. 16. (Continuation). Find the number of outcomes (pairs) in which 4 is the minimum of the two numbers. 17. A domino piece is marked by an unordered pair of two sets of dots. Each set contains 0 to 6 dots. Find the number of different domino pieces. 18. In how many ways can a group of six boys and six girls be divided into two equals groups so that each group contains odd numbers of boys and girls? 19. Consider five points on the circumference of a circle. Find (a) the number of cords that can be constructed by connecting these points in all possible ways, (b) the number of triangles that can be constructed with these points as vertices. Note that there is a one-to-one correspondence between the set of cords and the set of triangles that can be constructed using these five points. 20. In how many ways can a five-member council of a club of n couples be formed (a) if two women should be included, (b) if both husband and wife can not be included and (c) if no restriction exists.

2.9. EXERCISES

93

21. Consider a batch of ten new books that are to be placed on five available shelves of a library and assume that each shelf has room for up to ten books. Calculate the number of different arrangements of the books on the shelves in the cases where the books are (a) distinguishable and (b) indistinguishable in their external appearance. 22. Find the number of eight-digit ternary sequences (of Os, 1s or 2s) which include two Os and three 1s. 23. Find the number of permutations (i 1 , i 2 , ... , i 10 ) of the ten digits {0, 1, ... , 9} in which (a) it < i2, (b) it < i 2 < i3 and (c) it < i 2 and h < i4· 24. Find the number of ways of distributing ten different cards into four distinguishable boxes so that j cards are placed into the j-th box, j = 1,2,3,4. 25. Find the number of ways of equally distributing six different cards (a) to three children and (b) into three indistinguishable boxes.

26. Suppose that ten cards numbered from 0 to 9 are equally distributed (a) to five children and (b) into five indistinguishable boxes. In each case, find the number of different distributions and the number of these distributions in which each child (box) receives one card with an even number and the other card with an odd number. 27. Assume that three qualified candidates contest for a position of assistant professor in the department of mathematics. The 11-member selection committee is about to decide by voting whom to hire for the position. Calculate the number of different election outcomes (a) without any restriction and (b) with the restriction that a candidate receives a majority.

28. Every morning a man walks eight blocks to his office, which is located five blocks east and three blocks north of his house. For simplicity, assume that all the blocks are rectangular and there are no blind streets. Find the number of different paths he may follow if he walks only to the east and to the north. 29*. Consider the following procedure of partitioning a finite set of n elements into n one-element subsets. Initially this set is partitioned into two subsets. If one of the two subsets is an one-element set and the other contains at least two elements, then the subset with at least two elements is partitioned into two subsets; if both the subsets contain at least two elements, then any of these is partitioned into two subsets. Generally, at the k-th stage any of the subsets obtained at the preceding stages and containing at least two elements is partitioned into two subsets, k = 1, 2, ... , n -1. So, after n- 1 stages the set of n elements is partitioned into n one-element

94

PERMUTATIONS AND COMBINATIONS

subsets. Show that the number of ways this procedure can be executed is given by

30*. Suppose that n generals place secret documents in a safe that can be opened only when the majority of them is present. For this reason, the safe is locked with a number of lockers and each general has keys for some of them. Calculate (a) the least number an of lockers needed and (b) the number bn of keys a general should have. 31. Let r, s and n be positive integers. Prove combinatorially the relations

and

32. Show, (a) algebraically and (b) combinatorially, that

and

33. Show that

and ( n)(n) S k

=f(~)(k+s-j)( n j=O J S k +S -

34. Show that

and

.), m=min{k,s}.

J

2.9. EXERCISES

95

35. Prove that

and

36. Using Pascal's triangle, show that

37. Show that the number of injective maps = {yt,Y2,··. ,yn} is (n)k.

f

of the set X= {x 1 , x 2 , ...

,

xk} into the set Y

38. Show that the number of maps f of the set {1, 2, ... , k} into the set { 1, 2, ... , n} that are (a) strictly increasing is (~) and (b) increasing is ( n+k-1) k •

39. Let B(n, k, s) be the number of k-combinations of the set Wn+J = {w0 , w 1 , ... , wn}, of n + 1 elements, with repetition and the restriction that the element w 0 is allowed to appear at most s times and each of the other n elements at most once. Show that B(n, k, s) =

f

j=O

(k

~

.) , m = min{k, s}. J

40. Let E 2 (n, k) be the number of k-combinations of n with repetition and the restriction that each element is allowed to appear at most twice. Show that

E2(n,k) =

~ (;) (n ~ j),

m = min{n, [k/2]}.

41. (Continuation). Let A(n, r, k) be the number of k-combinations of n + r with repetition and the restriction that each of n specified elements may appear at most twice, while each of the other r elements may appear at most once. Show that m A(n,r,k)=L

J=O

(n). (n + j) J

k-r - . 2J

.

, m=mm{n,[k/2]}.

96

PERMUTATIONS AND COMBINATIONS

Also derive the expression A(n,r,k)

G)E

=~

2 (n,k-

i), s

= min{r,k}.

42. Consider n elements belonging in r different kinds, with k 1, k2, ... , kr elements, respectively. Let C(k 1, k2, ... , kr; k) be the number of k-combinations of the k 1 + k2 + · · · + kr = n elements and C(k2, k3, ... , kr; k- j) be the number of (k- i)-combinations of the k2 + k3 + · · · + kr = n- k 1 elements. Show that k,

C(k1, k2, ... , kr; k)

= L C(k2, k3, ...

, kr; k- j).

j=O

43*. Let S(n, k) be the number of partitions of a set of n elements ink subsets. (a) Prove that S(n, k)

= "L.,; r1 !(1!}r

1

n! r2!(2!Y2

• • •

rn!( n!)rn

,

where the summation is extended over all rj ~ 0, j = 1, 2, ... , n, with r1 + r2 + · · · + rn = k and r1 + 2r2 + · · · + nrn = n. Further, derive (b) the triangular recurrence relation S(n, k) = S(n- 1, k- 1)

+ kS(n-

with initial conditions S(O, 0) recurrence relation S(n, k)

1, k), k = 1, 2, ... , n = 1, 2, ... ,

= 1, S(n, k) = 0, k > n, and

= n-1 ~

(

n

~

1)

(c) the vertical

S(r, k- 1).

44*. (Continuation). If T(n, r, k) is the number of maps f of X = X2, ... , xn} into Y = {Yl, Y2, ... , Yr}, with range space f( X) containing k elements, (a) show that { X1,

T(n, r, k) = S(n, k)(r)k

and (b) conclude that n

L S(n, k)(r)k = rn. k=l

(c) Multiplying both sides of the last relation by (-1)i-r{t), r::; j::; n and summing for r = 1, 2, ... ,j, deduce the expression S(n,j)

= ~ t(-l)j-r(j)rn, j = 1,2, ... J. r=l

r

,n, n

= 1,2, ....

97

2.9. EXERCISES

The numbers S(n,j), j = 1, 2, ... , n, n = 1, 2, ... , are called Stirling numbers of the second kind. 45*. (Continuation). Let W(n, k) be the number of divisions of a set of n elements in k nonempty subsets. Show that k

W(n,k)

= k!S(n,k) = ?;(-1)k-rG)rn.

46*. (Continuation). Let Bn be the (total) number of partitions of a set of n elements. (a) Prove that

where the summation is extended over all ri 2: 0, i = 1, 2, ... , n, with r 1 + 2r2 + · · · + nrn = n. Further, (b) derive the recurrence relation n-1 (

Bn = L

n

~ 1)

Bk, k = 1, 2, ... , Bo = 1.

k=O

The numbers Bn, n = 0, 1, 2, ... , are called Bell numbers. 4 7*. (Continuation). Prove that n

Bn = LS(n,k) k=l

and

oo

n

r Bn = e -1 """ L..,; 1· r=O

r.

48. Let k indistinguishable balls be distributed into n distinguishable urns of unlimited capacity. Find the number of distributions of the balls into the urns in which no urn remains empty. 49*. Runs of like elements in permutations. Let (a 1 , a2, ... , an) be a permutation of k zeros and n - k ones. If

ai

= 1, aj = 0, j = i + 1, i + 2, ...

,i

+ r,

ai+r+l

= 1,

then (ai+1, ai+2, ... , ai+r) is called run of zeros of length r of the permutation (a 1 , a 2 , ... , an). Show that the number of permutations of k zeros and n- k ones that include (a) s runs of zeros is

98

PERMUTATIONS AND COMBINATIONS

and (b) s runs of zeros, among which so that s1 + s2 + · · · + Sk = s, is

Sr

2: 0 are of length r, r = 1, 2, ... , k,

50*. (Continuation). Runs of consecutive elements in combinations. Let = { il' i2, ... 'ik} beak-combination of the set { 1, 2, ... 'n }. If,

ck

then the r-combination Sr of the set { 1, 2, ... , n} is called run of consecutive elements of length r of the k-combination Ck. Show that, to each k-combination ck of { 1' 2, ... ' n} there uniquely corresponds a permutation Uk,n-k of k zeros and n - k ones and, to each run of consecutive elements of length r of Ck there uniquely Gorresponds a run of zeros of length r of Uk,n-k· Thus, conclude that the number of k-combinations of {1, 2, ... , n} that include (a) s runs of consecutive elements is

and (b) s runs of consecutive elements, among which sr 2: 0 are of length r, r = 1, 2, ... , k, so that s 1 + s 2 + · · · + Sk = s, is

51*. (Continuation). Runs of consecutive elements in combinations of circularly ordered elements. Consider the first n integral numbers {1, 2, ... , n} displayed on a circle so that n and 1 are consecutive. Show that the number of (circular) k-combinations of these n elements that include (a) s runs of consecutive elements is

_n n-k

(n - k) (k - 1) s

s-1

and (b) s runs of consecutive elements, among which r, r = 1, 2, ... , k, so that s 1 + s 2 + · · · + Sk = s, is

Sr

2: 0 are of length

52. Find the number of integer solutions of the linear equation X1

+ x2 + · · · + Xn

= k,

k integer

99

2.9. EXERCISES

with the restrictions (a) Xi 2: s, i = 1, 2, ... , n, s integer such that sn and (b) x; ~ m, i = 1, 2, ... , n, m integer such that mn;::: k.

~

k

53. Partial derivatives of a function. Find the number of partial derivatives of order k of an analytic function of n variables f (XI , x 2 , ... , Xn). 54. Let an,k be the number of monomials in the most general polynomial inn variables XI, x 2 , ... , Xn of degree k. Show that an,k

= ( n+k

k) .

55. Let Cs(n, k) be the number of k-combinations of the n numbers { 1, 2, ... , n} possessing the property: between any two points belonging to such a combination there are at least s points that do not belong to it. Prove that

56. Let B 8 (n, k) be the number of k-combinations of the n numbers {1,2, ... ,n}, displayed on a circle, with the property: between any two points belonging to such a combination there are at least s points that do not belong to it. Prove that B ( k) s n,

= (n -k ks) + s (n -k ks - 1

1) =

_ n (n - ks) n - ks k ·

57*. Let C(n, k;

Sk-I) be the number of k-combinations {ii, i2, ... , ik }, of {1,2, ... ,n}, with differences dm = im+I- im >am, m = 1, 2, ... , k - 1, where am, m = 1, 2, ... , k - 1, are given positive integers and Sk-I = ai + a 2 + · · · + ak-I· Further, let B(n, k; Sk-I, r) be the number of the preceding k-combinations which, in addition, have span d = ik - ii < n- r, where r is a given positive integer. Prove that ii

< i2 < · · · < ik,

C(n, k;

Sk-d

=

n - Sk-I)

k

(

and B(

k· ) _ n, ,sk-I,r=

(n-

Sk-I -

n-n-

k

Sk-I

r) (n+r

Sk-·I -

k-

+ (k- 1)r (n- Sk-I

sk-I -

r

k

1 -

r- 1) r).

58. Fibonacci numbers. Let Qn be the number of n-permutations of the two elements 0 and 1, with repetition and the restriction that no two zeros

PERMUTATIONS AND COMBINATIONS

100

are consecutive. Showing that the number Qn,k, of n-permutations of the two elements 0 and 1, with repetition, which include k zeros, no two of which are consecutive, is Qn,k = ( n- kk

+

1),

k

= 0, 1, ... , [(n + 1)/2],

conclude that [(n+1)/2]

Qn

=

L

(n- kk + 1) '

n = 0,1, ...

k=O

and

= Qn-1 + Qn-2, n = 2, 3, ... ' Qo = 1, Q1 = 2. / 0 = 1, fn = Qn- 1, n = 1, 2, ... , are the Fibonacci numbers.

Qn

The numbers

59*. Prove that the number of permutations (a 1 , a 2 , ••. , a2n) of n zeros and n ones, among the first k elements of which there are at least as many zeros as ones, for every k = 1, 2, ... , 2n, equals

Cn+1

= n +1 1 (2n) n '

the Catalan number. 60*. Lattice paths with diagonal steps. Consider paths from one point of a lattice to another in which, besides a horizontal step from (i,j) to (i + 1,j) and a vertical step from (i,j) to (i,j + 1), a diagonal step from (i,j) to (i + 1,j + 1) is allowed. Prove that (a) the number of lattice paths from the origin (0,0) to the point (n,k), with r diagonal steps, equals

L(n k r) _ (n + k- r)! _ (n + k- r) ' ' - r!(n- r)!(k- r)! r, k- r and (b) the number of lattice paths from the origin (0, 0) to the point (n, k), with r diagonal steps, that do not touch (with the exception of the origin) or intersect the straight line x = y equals

!P(n, k, r) = n

n- k + k- r

(n +

k- r).

r, k- r

61 *. (Continuation). Consider a ballot district, where each voter is allowed to vote for up to two candidates of the same party. Assume that two candidates N and K, of the same party, receive n and k votes, with n > k, respectively. Calculate the probability that, at any stage of the

2.9. EXERCISES

101

counting procedure, the votes for N are more than the votes for K, given that r voters vote for both N and K. 62. From an urn containing n tickets numbered 1, 2, ... , n, tickets are successively drawn one after the other without replacement. Show that the probability Pn,k that the number r is drawn at the k-th drawing is independent of k and equals Pn,k = 1/n. 63. From an urn containing n distinguishable balls among which r are black and n - r are white, balls are successively drawn one after the other without replacement, until for the first time a white ball is drawn. Show that the probability Pn,r,k that k drawings are required is given by Pn,r,k =

and conclude that

(n- r)(r)k-1 (n)k

~ (r)j ~ (n - 1) · J

j=l

r

=

n - r·

64. Spread of rumors. In a town of n + 1 inhabitants, a person tells a rumor to a second person, who in turn repeats it to a third person, etc. At each step, the recipient of the rumor is chosen at random from the n people available. Calculate the probability that the rumor will be told k times without (a) returning to the originator and (b) being repeated to any person. 65. Consider a sequence of tosses of a fair coin and let Pn be the probability that n tosses are required before the appearance of a run of heads of length 2. Show that

Pn = fn/2n+ 2 , n = 0, 1, ... ,

where [n/2]

fn

=L

k=O

are the Fibonacci numbers.

(n- k) k

' n = 0, 1, ... ,

Chapter3 FACTORIALS, BINOMIALAND MULTINOMIAL COEFFICIENTS

3.1

INTRODUCTION

The number (n)k, of k-permutations of n, and the number (~), of kcombinations of n, constitute particular cases of the factorial and the binomial of a real number x of order k, respectively. The concept of a factorial is as important as the concept of a power. In the calculus of finite differences, a major subject of discrete mathematics, factorials occupy the same central position as the powers in the infinitesimal calculus. The finite differences of factorials possess many of the nice properties of the derivatives of powers. The binomial (coefficient), closely related to factorial, is of equal importance. In discrete probability theory and in theoretical computer science, which concern finite differences and sums of functions, the expansion into factorial series is more advantageous than the expansion into power series. The multinomial (coefficient) is a multivariate extension of the binomial (coefficient). In this chapter we only touch upon the broad subject of factorials, binomial and multinomial coefficients. Specifically, after introducing the notion of a factorial of a real number, Vandermonde's factorial convolution formula is presented. Also, an invaluable formula in the approximation of probability distributions, known as Stirling's approximation formula of n!, is obtained. Further, Newton's binomial and the negative binomial formulae are combinatorially derived. Then, the monotonicity of the binomial coefficients is examined. Cauchy's binomial convolution formula is presented as a corollary of Vandermonde's factorial convolution formula. Finally, applications of these formulae in the evaluation of sums involving binomial coefficients and in the derivation of combinatorial identities are exemplified. In the last section of this chapter, the multinomial formula is combinatorially deduced.

104

3.2

FACTORIALS, BINOMIALS AND MULTINOMIALS

FACTORIALS

The factorial of order k, as well as the power of order k, is initially defined for k a positive integer and successively extended to k = 0 and to k a negative integer. Thus, let x be a real number and k a positive integer. The factorial of x of order k, denoted by (x)k> is defined by

(x)k = x(x- 1) .. · (x- k

+ 1).

If r is also a positive integer, then

(X) k+r = X(X - 1) .. · (X - k - r + 1) = [x(x- 1) · · · (x- k + 1)][(x- k)(x- k- 1) · · · (x- k- r

+ 1)]

and since

(x- k)(x- k- 1) .. · (x- k- r- 1) = (x- k)r, we deduce the following fundamental property of the factorials: (3.1)

(x)k+r = (x)k(x- k)r·

Requiring the validity of this fundamental property to be preserved, the definition of the factorial may be extended to zero or negative order. Specifically, it is required that formula (3.1) is valid for any integer values of k and 7'. Then, putting into it k = 0, it follows that

(x)r

= (x)o(x)r,

for any integer r. This equation, if x -:j:. 0, 1, ... , r- 1, whence (x)r -:j:. 0, implies (x)o = 1, while, if x = 0, 1, ... , 1 ' - 1, reduces to an identity for any value (x) 0 is required to represent. Further, from (3.1) with r a positive integer and k = -r, it follows that (x)-r(X + r)r = 1 and for x -:j:. -1, -2, ... , -r,

(x)-r = (

1

x

+ r)r

1

..,-----------,-------,----, r (x + r)(x + r - 1) .. · (x + 1)

= 1, 2, ....

Summarizing, the next general definition of the factorial is adopted.

3.2. FACTORIALS

105

DEFINITION 3.1 The factorial ofx of orderk, denoted by (x)k, is defined for every real number x and every integer number k by

. (x)k

= x(x- 1) · · · (x- k + 1),

k

= 1, 2, ...

, (x) 0

=1

(3.2)

and 1

(x)-k for x

=/

1

= (x + k)k = (x + k)(x + k- 1) · · · (k + 1)'

k

= 1• 2 • · · · '

(3 -3)

-1, -2, ... , -k.

REMARK 3.1 In addition to the notation (x )k of the factorial of x of order k, which is almost established in combinatorics, the notation x(k), which indicates the relation of the factorials to the powers, is also used. The factorial of x of order k, which is defined by (3.2) and (3.3), is called falling in distinction to the rising factorial of x of order k, which, for k = 1, 2, ... is defined by the product

x(x+1)···(x+k-1). This distinction is needless since both factorials can be expressed by the same notation, only the argument being different. Specifically, this product, with the notation we have adopted, equals ( x + k - 1) k. Also,

(x

+ k -1)k = (-1)k(-x)(-x -1) · · · (-x- k + 1) = (-1)k(-x)k.

Finally, it is worth noting that (3.3), for x

= 0, yields

(0)-r = 1/r!, r = 1, 2, ... , an interesting particular case.

I

A factorial convolution formula, due to Vandermonde, is derived in the following theorem. THEOREM 3.1 Vandermonde's formula Let x andy be real numbers and n a positive integer. Then

(x

+ Y)n =

t (~)

(x)k(Y)n-k·

(3.4)

k=O

PROOF

Note first that (3.4) holds true for n = 1. Assume that (3.4) holds for

n- 1, that is,

(x

+ Y)n-! =

E(n ~ k=O

1 ) (x)k (Y)n-k-!·

FACTORIALS, BINOMIALS AND MULTINOMIALS

106

It will be shown that (3.4) holds also for n. From (3.2), with x

+ y instead of x

and the induction hypothesis, we have

(x + Y)n = (x + y- n + 1)(x + Y)n-1 = (x

+ y- + 1) ~

(n ~ k=O

n

1 ) (x)k(y)n-k-1·

Since

(x + y- n + 1)(x)k(y)n-k-1 = (x)k(y)n-k + (x)k+1 (Y)n-k-1, we successively get

(x

+ Y)n = ~

(n ~ = ~ (n ~ k=O

1 ) (x)k(y)n-k

+~

1 ) (x)k(y)n-k

+

= (y)n + ~ { k=1

(n ~

1 ) (x)k+1 (Y)n-k-1

t (~ =~)

(x)k(Y)n-k

k=1

(n ~

1 )

+

(~ =~)} (x)k(y)n-k + (x)n·

Therefore, on using Pascal's triangle (2.7), we deduce

(x

+ Y)n =

t (~)

(x)k(y)n-k·

k=O

Thus, (3.4) holds true for nand, according to the principle of mathematical induction, it holds true for every positive integer n. I

Example 3.1 Mean of hypergeometric probabilities Suppose that n balls are randomly drawn one after the other, without replacement, from an urn containing r white and s black balls. Clearly, the probability of drawings k white balls in then drawings is given by (see Section 2.7.2)

Pn,k Note that Pn,k

~

0, k

n

=

(r + s)n , k = (n)k (r)k(s)n-k

= 0, 1, ...

{;Pn,k = (r

0, 1, ... , n.

, nand, according to Vanderrnonde's formula, 1

n(n)k (r)k(s)n-k = 1,

+ s)n {;

3.2. FACTORIALS

107

implying that this is a legitimate probability mass function. The expected value (or the mean) of the number of white balls drawn in n drawings is given by the sum n 1 n J.l

=L

kPn,k

=(

r

k=l

+

) 8

L k (n) k (r)k(s)n-k·

n k=l

This sum, upon using the expressions

reduces to J.l = (r ;rs)n

~ (~ =~) (r- 1)k_l (s)n-k·

Thus, by virtue of Vandermonde's formula and since (r (r + s- 1)n-l. we get nr

J.L=--.

r+s

+ s)n

(r

+

s) ·

D

As has already been noted in Remark 2.1, n! = 1 · 2 · 3 · · · n increases rapidly with increasing n. A very useful approximation is given by Stirling's formula, the proof of which requires the Wallis formula, stated in the following lemma. LEMMA3.1 The sequence Wn

22n(n!)2 = (2 n)!y'n' n = 1, 2, ...

is convergent and (3.5)

Let us consider the sequence of integrals

PROOF

Ir Clearly, I 0 d

r/2

= Jo

sinr tdt, r

= 0, 1, ....

= 1r /2, I 1 = 1 and, integrating the identity

dt (sinr-l t cost)

= (r- 1) sinr- 2 t- r sinr t,

r

= 2, 3, ...

,

FACTORIALS, BINOMIALS AND MULTINOMIALS

108

in the interval [0, 1r /2], we deduce the recurrence relation

Ir

r-1

= --Ir-2, r

r

= 2, 3, ....

Putting r = 2n and applying successively the resulting recurrence relation, we conclude that

(2n)!

hn

1r

= 22n(n!)2

2

Similarly, from the recurrence relation with r = 2n + 1, it follows that

22n(n!)2 hn+l

1

= (2n + 1)! = (2n + 1)I2n

Note that, for 0 :::; t :::; 1r /2, we have 0 sin 2n t :::; sin 2n-l t. Therefore

7r

2

< sin t < 1 and so sin 2n+l t
0, n = 1,2, ... , 2

= ( n)!y'n

the double inequality 1r :::;

w;, : :;

1r (

1+

2~) .

Taking the limit for n -+ oo, we conclude the relation lim

n-too

w;, =

1r,

which implies formula (3.5) of Wallis, since Wn

> 0.

I

3.2. FACTORIALS

109

We are now in position to derive Stirling's approximation formula of n factorial. THEOREM 3.2 Stirling's formula If n is a positive integer; then

n!

e-nnn+lf2y'2;,

0,

k

= 0, 1, ... , n

_~ (n)

~

~Pn,k - ~

k n-k _ ( n _ k P q - P + q) - 1,

implying that this is a legitimate probability mass function. The mean of the number of white balls drawn in n drawings is given by the sum /J =

~kPn,k = ~k(~)pkqn-k.

This sum, upon using the expression

(n) =n (n -1)

k k

k-1 '

112

FACTORIALS, BINOMIALS AND MULTINOMIALS

reduces to Jl

= np

t (~ =~)pk-lqn-k. k=l

Thus, by virtue of Newton's binomial formula, we get Jl

= np.

D

Definition 3.1 of the factorial of x of degree k allows the following useful extension of the notion of the binomial coefficient.

DEFINITION 3.2 The binomial coefficient of order k is defined for every real number x and a nonnegative integer k by

G) = (~~k,

k

= o, 1, ....

(3.11)

Note that, in addition to the case x = n is a positive integer, for which the binomial coefficient (~) is a positive integer and gives the number of k-combinations of n, in the case x = -n, with n a positive integer, the binomial coefficient Ct) is also an integer and has the sign of ( -1) k. The positive integer ( -1 )k (-t) gives the number of k-combinations of n, with repetition, as it follows from the relation (see Remark 3.1) (3.12) An extension of Newton's binomial formula (3.10) to the case where the exponent of the left-hand side is a negative integer is given in the next theorem.

THEOREM 3.4 Newton's negative binomial formula Let x andy be real numbers, with y =j:. 0, -1 < x / y < 1, and n a positive integer. Then (3.13)

PROOF

Note first that (3.13) is equivalent to (3.14)

3.3. BINOMIAL COEFFICIENTS

as it follows directly by putting t

113

= -xjy, y =f. 0 and using (3.12). Further,

(1- t)-n

=/I (t)f2(t) · · · fn(t),

where fi(t) = (1- t)- 1 , i = 1, 2, ... , n, and, using the expression of the sum of an infinite number of terms of a geometric progression with ratio t, 00

fi(t)

= 1 + t + t 2 + ··· = L

tT;, i

= 1, 2, ...

, n.

Ti=O

If the operations (multiplications and additions) are executed by selecting the term tT;, ri ~ 0, from the factor fi(t), i = 1, 2, ... ,nand forming the product tT 1 tT 2 • • • tTn = tT 1 +T2 +··+Tn, with r1 + r2 + · · · + rn = k, a summand of the form bn,ktk, k = 0, 1, ... is produced, where the coefficient bn,k is the number of ways of selecting the terms from the n factors. Since, to each such selection there corresponds a nonnegative integer solution (ri ~ 0, i = 1, 2, ... , n) of the linear equation r1

+ r2 + · · · + rn

= k,

and vice versa, the number bn,k, according to Theorem 2.12, equals (n+z-I). Consequently, by the summation principle, expression (3.14) is deduced and the I proof of the theorem is completed. The next theorem is concerned with the monotonicity of the sequence of the terms of the binomial expansion. THEOREM3.5

Let an,k(X, y)

= (~) xkyn-k,

k

= 0, 1, ... , n,

with n a fixed positive integer and x andy given positive real numbers. Also let m = (n + 1)/(1 + yjx). (a) lfm is an integer, then

an,o(x, y) < an,l (x, y) < · · · < an,m-1 (x, y), an,m-1 (x, Y) an,m(x,y)

= an,m(X, y),

> an,m+I(x,y) > ... > an,n(x,y).

(b) If m is not an integer and r

= (m ], the integer part of m, then

an,o(x,y) < an,I(x,y) < · · · < an,T(x,y),

FACTORIALS, BINOMIALS AND MULTINOMIALS

114

an,r(x,y) PROOF

> an,r+1(x,y) > ... > an,n(x,y).

On using the relation

n) = n(n- 1) · · · (n- k + 2) . n- k + 1 = n- k + 1 ( n ) (k (k- 1)! k k k- 1 '

= 0, 1, ... , n, is

the following recurrence relation for the sequence an,k(x, y), k obtained:

( )_(n-

an,k x, y -

= Setting m = (n

k

k

+1.

=:) (k-n1)x y

n-k+1 (yfx)k an,k-1 (x, y), k

+ 1)/(1 + yfx)

k-1

y

n-(k-1)

= 1, 2, ...

, n.

and since

n-k+1 (n+1)-(1+y/x)k 1+yfx --...,.--- = 1 + = 1+ (yfx)k (yfx)k yfx

m-k k

.--,

it follows that

an,k(x,y) = (1 + x; y · m; k) an,k-dx,y), k = 1,2, ... ,n. Note that 1 < m < n + 1 and, by the last recurrence relation, we conclude that: (a) If m is an integer, then

an,k-1 (x, y)

< an,k(x, y), k

an,m-1(x,y)

= 1, 2, ... , m- 1,

= an,m(x,y),

an,k-1(x,y) >an,k(x,y), k=m+1,m+2, ... ,n. (b) If m is not an integer, then m

~

k

-:f.

0, k = 1, 2, ... , nand

an,k-1 (x, y)

< an,k(x, y), k

= 1, 2, ...

an,k-1 (x, y)

> an,k(x, y), k

= r

The proof of the theorem is thus completed.

, r, r

= [m]

+ 1, r + 2, ...

, n.

I

The next corollary is concerned with a particular case, x = y = 1, of special interest.

COROLLARY 3.1 The sequence of binomial coefficients C(n,k) =

(~),

k=0,1, ... ,n,

3.3. BINOMIAL COEFFICIENTS

115

(a) for a given odd positive integer n, strictly increases for k = 0, 1, ... , + 1)/2, assumes its maximum value at the points m- 1 and m and strictly decreases fork= m, m + 1, ... , n, while (b) for a given even positive integer n, strictly increases fork = 0, 1, ... , r, r = n/2, assumes its maximum value at the point rand strictly decreases for k = r, r + 1, ... , n.

m- 1, m = (n

Isaac Newton obtained in 1676 an extension of the binomial formula (3.10), as well as the negative binomial formula (3.13), to the case where the exponent of the left-hand side is a real number. This general binomial formula is stated in the following theorem, without proof. It is worth noting that there does not exist a combinatorial derivation of this general formula, since the binomial coefficient G) emerging in it has not, for every real number x, a combinatorial meaning. An analytic proof can be found in most advanced books on infinitesimal calculus. Newton's general binomial formula will be revisited in Chapter 6 on generating functions. THEOREM 3.6 Newton's general binomial formula Let t and x be real numbers, with -1 < t < 1. Then (3.15)

Cauchy's binomial convolution formula, which by virtue of (3.11) may be considered a reformulation of Vandermonde's factorial convolution formula, is stated in the following corollary of Theorem 3.1. This corollary may also be deduced from Newton's general binomial formula. Two particular cases of such a derivation are worked out in Examples 3.6 and 3.7 that follow. COROLLARY 3.2 Let x andy be real numbers and n a positive integer. Then (3.16)

Some interesting applications of these theorems in the evaluation of sums involving binomial coefficients and in the derivation of combinatorial identities are worked out in the following examples.

Example 3.3 The number of subsets of a finite set Let us consider a finite set W n = { w 1 , w 2 , ... , Wn}, of n elements, and let Ak be the set of all subsets Ak ofWn, with N(Ak) = k. Then, according to the definition

FACTORIALS, BINOMIALS AND MULTINOMIALS

116

of a k-combination of n (without repetition), Ak = Ck (Wn) and N(Ak) = (~) Evaluate the sums:

Newton's binomial formula (3010), with x

= y = 1, yields

= n, equals 2n (in

Therefore, the (total) number of subsets of Wn, with N(Wn) agreement with the result of Example 1.7)0 For the evaluation of the other two sums, note that [n/2]

S2

+ S3

=

L (;J 0

[(n-1)(2] )

j=O

+

0

n

L (2J n+ 1) = L (~) = 2n °

k=O

j=O

and _

L:

(n) _ L:

j=O

j=O

_ [nf2]

s2 s3-

[(n-1)(2] (

0

2 J

n ) _L:( k(n)

0+

2J

Further, Newton's binomial formula (3010), with x

n

1

_

1)

-

k 0

k=O

= -1 andy = 1, yields

Thus, the number S2 of subsets with an even number of elements equals the number S 3 of subsets with an odd number of elements for any number n of elements of Wno Consequently,

Example3.4 Evaluate the sums

The first sum, on using the relation

3.3. BINOMIAL COEFFICIENTS

117

may be written as

S = 4

~

(n -1)

nL.....- k- 1 k=l

=

~

nL.....-

(n -1)

j=O

. J

·

The last sum, by Newton's binomial formula with n- 1 instead of n, equals

~ (n ~ 1) = 2n-l J

j=O

and so

84 = n2n-l. The second sum may be split up into two sums as

and so

85 = r2n + sn2n-l = (2r + sn)2n-l. Note that the sum 8 4 can be evaluated by taking the derivative of (3.1 0) with respect to x at a suitable point as follows: putting y = 1 in (3.1 0) and then taking the derivative of the resulting expression with respect to x,

at x = 1, we get

Example3.5 Evaluate the sums 86

n

= {;

1 (n) 87 k+1 k '

n

= {;

(-1)k+l (n) 88 k+1 k '

The first sum, on using the relation

(n

1 (n) 1 + 1) k+1 k =n+1 k+l'

[n/

2

= ?;

]

2r

1 (n) + 1 2r .

FACTORIALS, BINOMIALS AND MULTINOMIALS

118

may be written as

S = _1_ n ( n + 1) = _1_ n+l 6 n+1{:; k+1

n+1~

(

n + 1) j

and since, by Newton's binomial formula,

it follows that

2n+1- 1

n+ 1

Sa=

.

In the same way

s7 = _1_ ~( -1)k+l n+1L..,.

(n

+ 1) k+1

k=O

= _1_ ~( -1)i n+1L..,.

(n ~

1)

J

j=l

and since

it follows that

1

s1 = ---.

n+l

In order to evaluate the third sum, note first that

S _S = ~ _ 1 (n) _~ (-1)k+I (n) = ~ 1- (-1)k+I (n) 6

~k+1 k

7

~ k+1

~

k

k+1

Since

1- (-1)k+l = { 2, 0,

k = 2r, k

= 2r + 1,

it follows that

Therefore

2n Ss = - - . n+l

r = 0, 1, .. . r

= 0, 1, .. .

k.

3.3. BINOMIAL COEFFICIENTS

119

Note that these sums can be evaluated by an integration of (3.10) with respect to X in a SUitable interval as' follows: putting y = 1 in (3.10) and integrating the resulting expression with respect toxin the interval [xi, x2].

and since

the following expression is deduced:

t

x~+:: ~~+I (~)

=

(x

2

+ 1)n+~: iXI + 1)n+l

k=O

By suitably choosing the limits particular that: (a) For XI = 0 and x 2 = 1,

86

XI

and x 2 of the integration interval, it follows in

1

n

=~ k +1

(b) For XI = -1 and x2

(n) k

=

2n+I - 1 n +1

= 0,

-S7 =

~

(-1)k L.,..k+1

k=O

(n) k

1 n+1

(c) For XI= -1 andx2 = 1,

S 8

= [n/2] _1_

L 2r + 1 r=O

(n) = ~ ~ n

2r

2

k=O

1- (-1)k+I k +1

(n) k

D

Example3.6 For r, s and n positive integers, (a) derive analytically the combinatorial identity

and (b) conclude the identities

FACTORIALS, BINOMIALS AND MULTINOMIALS

120

The expansion of the identity

using Newton's binomial formula, yields

Executing the multiplication in the left-hand side, the general term anxn, n = 0, 1, ... , r + s, is formed by multiplying the term G) xk of the first factor by the term (n~k)xn-k of the second factor for all values k = 0, 1, ... , n. Thus, by the addition principle, an = and

~ G) (n ~ k)

~{~G) (n ~ k)} xn = ~ (r:

8

)xn

and, equating the coefficients of xn of both sides the combinatorial identity,

is deduced. Note that this relation constitutes a particular case, with x = r and = s positive integers, of Cauchy's binomial convolution formula (3.16). Putting in (a} s = r, n = r - j and since

y

we conclude that

Also, setting in (a} r

we find

= s = n, and since

3.3. BINOMIAL COEFFICIENTS

121

Finally, executing the multiplication in the right-hand side of the expression

we get

where the inner sum, by virtue of (a) with s = r, equals

Therefore

D Example3.7 For r, s and n positive integers, derive analytically the combinatorial identity

The expansion of the identity

(1 _ t)-r(l- t)-s = ( 1 _ t)-(r+s), using Newton's negative binomial formula (3.14), yields

and

for every real number t E ( -1, 1). Therefore

122

FACTORIALS, BINOMIALS AND MULTINOMIALS

Note that this relation also constitutes a particular case, with x = -randy = -s, of Cauchy's binomial convolution formula (3.16). 0

Example3.8 For s, k and n positive integers, with s, k :S n, derive analytically the combinatorial identity

Multiplying by t 5 both members of the equivalent to Newton's negative binomial formula,

and putting n = s

+ j, we get the expansion

In the same way we deduce that:

Expanding the identity

by using the preceding three formulas, we get

[f (r- 1)tr]· [ f ( )tjl = f: (n)tn r=k

k - 1

j=s-k

8

j

-

and

for every real number t E ( -1, 1). Therefore

k

n=s

8

3.4. MULTINOMIAL COEFFICIENTS

3.4

123

MULTINOMIAL COEFFICIENTS

The number

n! where kr = n- (k1 + kz + ··· + kr-d, ki = 0,1, ... ,n, i = 1,2, ... ,r, n = 1, 2, ... , is called multinomial coefficient, since it is the coefficient of the general term of the multinomial expansion. This expansion is combinatorially derived in the next theorem.

THEOREM 3.7 Multinomial formula Let Xi, i = 1, 2, ... , r be real numbers and n a positive integer. Then

(X1 + Xz + · · · + Xr )n

= """ L...... (

n ) x k1 x k2 k1 , kz, . . . , kr -1 1 2

where the summation is extended over all ki = 0, 1, ... , n, i that k1 + kz + · · · + kr-1 + kr = n.

· · ·

xrkr , (3.17)

= 1, 2, ...

, r, such

PROOF Note that each term in theexpansionof(x 1 +x 2 +· · +xr)n is of degree n with respect to the variables x 1 , x 2 , ... , Xr and can be formed by executing the multiplication of then factors Pi = Pj(Xl, xz, ... , Xr) = X1 + xz + · · · + Xr, j = 1, 2, ... , n. Thegeneraltermofthisexpansion, x~ 1 X~ 2 • • • x~r, is produced by selecting Xi from ki different factors, i = 1, 2, ... , r. To each such selection, there corresponds a division of the set {p1 , pz, ... , Pn}, of then factors, into r subsets that include k 1 , k 2 , ... , kr factors, respectively, with ki ?: 0, i = 1, 2, ... , r and k1 + kz + · · · + kr = n. Consequently, according to Theorem 2.8, the general term x~ 1 x~ 2 • • • x~r appears

times in the expansion. Thus,by the addition principle, (3.17) is deduced.

I

REMARK 3.3 The number of terms in expansion (3.17) equals the number of nonnegative integer solutions of the linear equation k1 + k 2 + · · · + kr = n and, I according to Theorem 2.12. is equal to c+~- 1 ). Putting Xi = 1, i = 1, 2, ... , n in (3.17) and taking into account Theorem 2.8, the next corollary is deduced.

FACTORIALS, BINOMIALS AND MULTINOMIALS

124

COROLLARY 3.3 The number of divisions (AI, A2, ... , Ar) of a finite set Wn. with N(Wn) = n, in r (ordered) subsets, equals

where the summation is extended over all ki that k1 + k2 + · · · + kr = n.

3.5

= 0, 1, ...

, n, i

= 1, 2, ...

, r, such

BIBLIOGRAPHIC NOTES

Although James Stirling (1676-1770) was first to recognize the importance of the factorial in his work Methodus Differentiallis (1730), he did not use any special notation for it. The approximate formula for n factorial to which his name was attached was actually developed by Abraham De Moivre (1667 -1754). The first notation of the factorial was introduced by N. Vandermonde (1772), who also derived the factorial convolution formula. Further, he extended the definition of the factorial to negative order. The binomial formula appeared in various forms in early manuscripts, but it was James Bernoulli in his Ars Conjectandi (1713) who stated and proved it. The negative and general binomial formulae were worked out by Isaac Newton in 1676. It seems that the first notation of the binomial coefficient was introduced by Leonhard Euler (1707- 1783) in 1781. The notation, most in use now, is attributed to J. L. Raabe (1851). The combinatorial identities in Exercise 29 are due to E. S. Andersen (1953).

3.6

EXERCISES 1. Let a and b be real numbers and n a positive integer. Evaluate the

sum

Sn,r =

~(k)r (~) (a)k(b)n-k,

2*. Let x and y be real numbers and n a positive integer. Using Vandermonde's formula, show that

~(n) L

k=O

k

(

(x)k X

+y

) = k

(x+y+n)n ( ) , y y +n n

-I-

-1, -2, ... , -n

3.6. EXERCISES

125

and conclude that

t(k=O

and

t(- (n) 1)k

1

n

,

(y +n n) -

1

_Y = k y+ k

k=O

(x-1)-

=

1 )n-k(n)_x k x- k

3*. Let x and y be real numbers and n a positive integer. Vandermonde's formula, show that

(Y)n ,x ) (x+yn

+y

Using

-J.

;- 0, 1, 2 , ... , n - 1

and conclude that

~

4. For r, s and n positive integers, with n

t (n + 1) +(

s )k

k -

k=O

and conclude that

k

t k=O

(r

s)n+k

r, show that

1

= (r)n

(s)k =r+s+1. (r+s)k r+1

5. (Continuation) Evaluate the sum

_~ (n + 1) (

Sn-

~k

k=1

k -

k

s )k (r+s)n+k

and, more generally, the sum Sn,m= t(k)m(n+k-1) (s)k . k=m k (r + s)n+k

6. Let 0 < p < 1, q = 1 - p and n a positive integer. Evaluate the sum Sn,r

= t(k)r(~)pkqn-k, k=r

r

= 1,2, ...

,n.

FACTORIALS, BINOMIALS AND MULTINOMIALS

126

7. For 0 < p < 1, q = 1- p and n a positive integer, evaluate the sum Sn,r

(n+ -1)

~ = t:'r(k)r

kk

k p n q, r

= 1,2,000

o

8. Evaluate the sums

s1

= f(-1)k-1k2 (~),

s2

= t(-1)k-1k4 (~),

k=1

k=1

9. Evaluate the sums 31

~

k- 1

= k~-o k + 1

(n)

k '

32

~ k(k + 4) = L....- (k + 1)(k k=O

+2 + 2)

(n)

0

k

10. For n and k positive integers, show that

and

~( -1)s-k (:) (:) = ok,n, where on,n

= 1 and ok,n = 0,

k

=/:-

n 2 k,

no

11. Consider the sum - n k-1 1 ( n ) Sn - {; ( -1) k k , n = 1,2,0 00 0

Show that Sn

and since

1

= Bn-1 + -, n

n

= 2,3,0° 0

sl = 1, conclude that

12. Expanding the function fn(t) = [1- (1- t)n]/t, where t is a real number different from 0 and n a positive integer, derive the expression

3.6. EXERCISES

integrating it in the interval (0, 1], show that

13. (Continuation). Show that

1()

n

2:)- 1)k-\2 ~

nk1 2:::2::: kr· k=1r=1

=

k=1

14. Let

Sn(z)

= ~(-1)k z:k(~), z-::j.

-1,-2, ... ,-n, n=0,1, ....

Using Pascal's triangle, show that

n Sn(z) = --Sn-1 (z), n = 1, 2, ... , So(z) = 1 z+n and thus conclude that

15. (Continuation). Show that

s1 -

and

n

1_ k_

-1

{;(

)

(n)

1 + 2k k

22n--

(2n) - 2n + 1 n

Sz = ~( -1)k_1_ (n) = 22n (2n) ~ 1- 2k k n

1

-1

k=O

16. Leibnitz numbers. Let

L( r, n) =

i)

-1) n-k r _

k=O

~ + 1 (~) , n = 0, 1, ... , r, r = 0, 1, ....

Show that

n L(r,n) = --L(r-1,n-1), n= 1,2, ... ,r, r= 1,2, ... , r+1 with L(r, 0) = 1/(r + 1) and conclude that

L(r, n) = (r

+~!)n+1

= [ (r

+ 1) (:) r1

FACTORIALS, BINOMIALS AND MVLTINOMIALS

128

The numbers L(r, n), n

= 0, 1, ...

, r,

r

= 0, 1, ...

are called Leibnitz num-

bers. 17*. Let n and r be positive integers and x a real number. Show that

and conclude that

18*. For r a positive integer, show that

and

(2r + 1) = ~2(4r2r ++ 2) . ~ ~

k=O

2

k

1

19. Let n and k be positive integers with n 2 k. Show that

20. Show that

and conclude that

21. Show that

i)- )n-k( 1

k=O

and conclude that

r )(s+k) n- k k

= (s-r+n), n

s2 r

3.6. EXERCISES

129

22. (Continuation). Show that

and conclude that

23. Let r, s and n be positive integers with s

2: n. Show that

24 *. For r, s and n positive integers with s

r

~

~

n, show that

25*. Let r, s, j and n be nonnegative integers with j that

~

r

~

j

+ n.

Show

and conclude that

26. Recurrence relations for the binomial coefficients. Prove that the binomial coefficient (~), where x is a real number and k a nonnegative integer, satisfies: (a) The "triangular" recurrence relation

(b) The "vertical" recurrence relation

130

FACTORIALS, BINOMIALS AND MULTINOMIALS

(c) The "horizontal" recurrence relation k

G)= ~(-1)k-re;1). 27. Expanding the identity

(1 + t + U + tu)x

= (1 + t)x(1 + u)x

into powers oft and u, show that

for every real number x and positive integers n and k and conclude that

(x)n(x)k =

~ (~) G)j!(x)n+k-j·

28. Show that

and

29*. Let n and r be positive integers with r Prove that

and

t

k=O

1-

(x) ( x ) k n-k+1

30. For xi, i

= 1, 2, ...

~ n

= n(1- x)- r (xn(n+1)

r

and x a real number.

1) (

-x ) . n-r

, r, real numbers and n a positive integer, show

that

where the summation is extended over all ki k1 + k2 + · · · + kr = n; conclude that

L k lk n!

1 ••• 1· 2·

k 1 (x1)k, (x2)k 2 r·

• • •

(xr)k,

~

0, i

=

1, 2, ... , r, with

= (x1 + X2 + · · · + Xr)n,

where the summation is taken as in the preceding sum.

Chapter4 THE PRINCIPLE OF INCLUSION AND EXCLUSION

4.1

INTRODUCTION

The basic principles of counting the elements of a union of n finite and pairwise disjoint sets (principle of addition) and of a subset of the Cartesian product of n finite sets (multiplication principle) were presented in Chapter 1. The principle of inclusion and exclusion, or the sieve formula of Eratosthenes, is also a powerful counting tool and this chapter is devoted to its presentation. The number of elements in a union (and in the intersection of the complements) of any n subsets of a finite set is computed. More generally, the numbers of elements that are contained in k and in at least k among n subsets of a finite set are evaluated. Further, a series of alternating inequalities for these numbers, due to Bonferroni, is derived. In the case of ordered subsets of a set, the notion of the rank of an element is introduced. Then, the elements of this set of a given rank are enumerated. The important case of exchangeable sets, in which the number of elements that are contained in the intersection of any r of them depends only on r, is separately examined in all the preceding enumeration problems. The Mobius inversion formula, which is also a useful counting tool, is presented a'3 a complement in the Exercises. Note that the principle of inclusion and exclusion and, more generally, the problem of counting the elements of a finite set are presented by several authors, equivalently, according to the definition of a set: A = {a : a has property P}, by using the corresponding characteristic properties of the sets. So, in this presentation, the number of elements that have at least one among n given properties expresses the cardinal of the union of the corresponding n sets, while the number of elements with none of n properties expresses the cardinal of the intersection of the complements of then sets.

132

4.2

THE PRINCIPLE OF INCLUSION AND EXCLUSION

NUMBER OF ELEMENTS IN A UNION OF SETS

The number of elements (cardinal) in a union of two sets is derived in the next theorem. THEOREM4.1 If A and B are any finite sets, then

N(A U B)= N(A)

+ N(B)- N(AB).

(4.1)

PROOF In order to calculate the number of elements of the union A U B, the elements that belong either to A or B should be counted, but each element should be included only once. Since in the sum N(A) + N(B) the elements that belong to both sets A and Bare counted twice, the number N(AB) should be subtracted from it and so expression (4.1) is established. I REMARK 4.1 Expression (4.1) constitutes a generalization of the addition principle, N (A+ B) = N (A) + N (B), to which it reduces if the finite sets A and Bare supposed to be disjoint, whence N(AB) = 0. Note also that (4.1) may be derived by using the addition principle as follows: if A and Bare any finite sets, then the sets A and B- A= A' nB are disjoint, An (A' nB) =(AnA') n B = 0 n B = 0 and AU (A' n B)= (AU A') n (AU B) = il n (AU B)= AU B. Consequently, by the addition principle,

N(A U B)= N(A + (B- A))= N(A) and, since N(B- A) deduced. I

+ N(B- A)

= N(B)- N(AB), (see Theorem 1.4), expression (4.1) is

COROLLARY 4.1 If A and Bare any subsets of a finite set il, with N(il) = N, then

N(A' B') = N- N(A)- N(B)

+ N(AB).

(4.2)

PROOF Since by De Morgan's formula A' B' = (AU B)', expressing the number of elements of (A U B)' in terms of the number of elements of A U B,

N(A'B') = N((A U B)')= N- N(A U B) and then, using (4.1 ), expression (4.2) is established.

I

4.2. NUMBER OF ELEMENTS IN A UNION OF SETS

133

Example4.1 Calculate the number of positive integers less than or equal to 100 that are divisible by 3 or by 5. Let A and B be the sets of positive integers less than or equal to 100 that are divisible by 3 and 5, respectively. Then N ( AUB) is the number of positive integers less than or equal to I 00 that are not divisible by 3 or 5 and, by (4.1 ), N(A u B)= N(A)

+ N(B)- N(AB).

Denoting by [x] the integer part of x, we have

N(A)

= [100/3] = 33,

N(B)

= [100/5] = 20,

N(AB)

= [100/15] = 6.

Therefore

N(A u B)= 33 + 20- 6

= 47.

D

Example4.2 Suppose that the elevator of a four-floor building starts from the basement with three passengers. Calculate the number of different ways of discharging at least one passenger at each of the first two floors. Each way that the three passengers may get off the elevator may be represented by an ordered selection of three floors (h , fi 2 , fi 3 ), with repetition, from the set {h, h, h, f 4 } of the four floors, where fir is the floor at which the r-th passenger gets off the elevator, r = 1, 2, 3. One may argue that there are (~) = 3 two-element subsets of the set {p1 , P2, P3} of the three passengers and, for each of these subsets, the two passengers get off the elevator, one passenger at the first and the other at the second floor, in 2! = 2 different ways. Since it is required that at least one passenger get off the elevator at each of the first two floors, there are four different choices for the third passenger to get off the elevator. Thus, by this argument and according to the multiplication principle, the number of different ways of discharging at least one passenger at each of the first two floors equals 3. 2. 4 = 24. Although all the steps of this derivation seem to be justified, a well-disguised error allows certain ways of discharging the passengers to be counted twice. A closer inspection reveals that the following 3-permutations of the set { h, h, h, J4 } are counted twice:

For example the first of these permutations is counted as one of the four permutations

134

THE PRINCIPLE OF INCLUSION AND EXCLUSION

and also as one of the four permutations

Consequently, the correct number of different ways of discharging at least one passenger at each of the first two floors equals

24-6 = 18. This number can be effectively evaluated by the aid of Corollary 4.1 as follows. Let f! be the set of different ways of discharging the three passengers. Also, let A and B be the sets of different ways of discharging the three passengers without stopping at the first and second floor, respectively. Then N(A' B') is the number of different ways of discharging at least one passenger at each of the first two floors, and so, by (4.2),

N(A'B')

= N- N(A)- N(B) + N(AB).

Clearly, N = N ( f!) = 43 = 64, which is the number of the 3-permutations, with repetition, of the set {!I, /2, /3, j 4 }, of the four floors. Also, N(A) = 3 3 = 27, which is the number of the 3-permutations, with repetition, of the set {/2, /3, J4 }, of three floors, and similarly, N(B) = 33 = 27. Further, N(AB) = 23 = 8, which is the number of the 3-permutations, with repetition, of the set {h, f 4 }, of two floors. Hence, the required number equals

N(A' B')

= 64- 2. 27 + 8 = 18.

D

The next theorem constitutes a generalization of Theorem 4.1 to n sets.

THEOREM 4.2 Inclusion and exclusion principle The number Ln,l = N (A1 U A2 U · · · U An), of elements that are contained in at least one among n finite sets A 1, A2, ... , An. is given by (4.3)

with

n

Sn,l =

L N(Ai), i=l

n-1

Sn,2 =

n

L L

N(AiAj)

i=l j=i+l

and, in general, (4.4)

where the summation is extended over all r-combinations {i 1, i2, ... , ir} of then indices{1,2, ... ,n}.

4.2. NUMBER OF ELEMENTS IN A UNION OF SETS

135

PROOF The number Ln, 1 = N(A 1 U A2 U · · · U An) is deduced by counting the elements included either in A1 or in A2, ... , or in An, but each element should be counted only once. This deduction may be achieved initially by taking the sum n

Sn,1 =

L N(A;). i=1

Note that, in this sum, the elements included in any one set A; only are counted once, in the term N(A;), i = 1, 2, ... , n, while the elements common to any two sets A; and Aj, with {i,j} ~ {1, 2, ... , n }, are counted twice, in each of the terms N(A;) and N(AJ)· Thus the sum n-1

Sn,2

=L

n

L

N(A;Aj)

i=1 j=i+1

should be subtracted from Sn, 1 • Further, the elements common to any three sets A;, A 1 and A 8 , with {i, j, s} ~ {1, 2, ... , n }, are counted in the sum Sn, 1 three times. in each of the terms N(A;), N(A 1 ) and N(As), and in the sum Sn,2 again three times, in each of the terms N(A;Ai ), N(A;A 8 ) and N(AjA 8 ). Thus, these elements are not counted, in total, in the difference Sn,2 - Sn,1 and, consequently, the sum Sn,3 = N(A;AjA 8 ),

L

should be added to it. Continuing this process, having considered the elements common to anyn-1 setsA;u A; 2 , ••• , A;n_,. {i 1, i2, ... , in-d ~ {1, 2, ... , n }, and after algebraically adding the sum

we end up with the algebraic sum Sn, 1 - Sn,2 + · · · + (-1)n- 2 Sn,n-1• in which these elements are counted, in total, only once. Finally, the elements common to then sets A1, A2, ... , An are counted (~) times in the sum Sn,k. in each of the termsN(A; 1 A; 2 • • • A;k), {i 1, i 2 , ••. , ik} ~ {1, 2, ... , n},ofit, k = 1, 2, ... , n. According to Newton's binomial formula (3.1 0),

and so these elements are counted, in total, zero times if n is odd and two times if n is even. Consequently, the term

should be added to the algebraic sum Sn,1 - Sn,2 (4.3) is established. I

+ · · · + (-l)n- 2 Sn,n-1. and so

THE PRINCIPLE OF INCLUSION AND EXCLUSION

136

REMARK 4.2 The term inclusion and exclusion refers to the process in which, initially, all the elements under consideration are indiscriminately included; and those elements that should not be included are excluded, then those elements that should not be excluded are included, and so on, alternately including and excluding. I REMARK 4.3 The following proof of (4.3) by mathematical induction is of interest. Note first that, according to (4.1), (4.3) holds for n = 2. Then, supposing that (4.3) holds for n - 1, it should be shown that it also holds for n. From (4.1), with A = A 1 U A2 U · · · U An_ 1 , B = An and since AB = (AI An) U (A2An) U · · · U (An-I An), it follows that

N(AI U A2 U · · · U An)= N(A1 U A2 U · · · U An-d+ N(An) -N(B1 U B2 U · · · U Bn_I), whereB1 = A1An,B2 hypothesis,

= A2An, ... ,Bn-I

=An-IAn. Thus, by the induction

n-1 N(A1 U A2 U · · · U An)= L( -1r- 1Sn-I,r

n-1 + N(An)- 2::(-l)r-IQn-I,n

r=1

with Sn-1,r =

Qn-l,r

r=1

L N(Ai Ai 1

2 • • •

Ai,),

= LN(BitBi2 ···Bir) = LN(Ai1Ai2 ···AirAn),

where, in both sums, the summation is extended over all r-combinations {i 1, i 2 , ... , ir} of then- 1 indices {1, 2, ... , n- 1}. Note that n-1 Sn-1,1 + N(An) = L N(Ai) i=l

n

+ N(An) = L

N(Ai)

= Sn,1·

i=l

Further, for r = 2, 3, ... , n- 1,

Sn-I,r

+ Qn-l,r-1

= L

N(Ai 1Ai 2 ···Air)+ L

is the sum of the terms N (Ai 1 Ai 2

• •

N(Ai 1Ai 2 ···Air- I An)

·Air), with the summation extended over the

r-combinations {i 1, i 2, ... , ir} of the n indices { 1, 2, ... , n - 1, n} that do not include the index n and over the

-1)

n ( r-1

4.2. NUMBER OF ELEMENTS IN A UNION OF SETS

137

r-combinations {i 1,i 2, ... ,ir_ 1 ,n} of then indices {1,2, ... ,n- 1,n} that include the index n. Thus, Sn-l,r

+ Qn-l,r-1 = L

N(Ai, Ai2 ... AiJ

= Sn,r,

r

= 2, 3, ... , n- 1,

where the summation is extended over the

r-combinations {i 1 , i2, ... , ir} of then indices {1, 2, ... , n }. Also

Consequently, N(Al U A2 U · · · U An)= Sn,l- Sn,2

+ · · · + (-1)n-lSn,n

and so it is shown that (4.3) also holds for n. Therefore, according to the principle of mathematical induction, (4.3) holds true for every integer n ~ 2. I COROLLARY 4.2 If A 1 , A 2 , ... , An are subsets of a finite set fl, then the number Nn,o = N (A~ A~ · · ·A~) of elements of n that are not contained in any of these n sets is given by

Nn,O = Sn,O- Sn,l

where Sn,o

+ ·· · + (-1)nSn,n,

= N(fl) and Sn,r• r = 1, 2, ...

(4.5)

, n, is given by (4.4).

PROOF Since by De Morgan's formula (A 1 U A2 U · · · UAn)' = A~ A~··· A~. upon using the expression N(A') = N(fl)- N(A), with A= A 1 UA2 U· · · UAn, it follows that N(A~A~ ···A~)= N(fl)- N(A1 U A2

Introducing expression (4.3) into it, we conclude (4.5).

u · · · U An)·

I

The inclusion and exclusion principle enables completion of the discussion, started in Section 2.5, on the number of integer solutions of the linear equation XI

+ X2 + · · · + Xn = k,

(4.6)

which satisfy a given set of restrictions, with k an integer. The next theorem is concerned with the enumeration of the integer solutions of (4.6) that are bounded both from above and below.

THE PRINCIPLE OF INCLUSION AND EXCLUSION

138

THEOREM4.3 The number of integer solutions (rt, r2, ... , rn) of the linear equation (4.6), with the restrictions (4.7)

=

for given integers Si, mi. i 1, 2, ... , n, with s :S k :S m, s = St + s2 + · · · + Sn, m = m 1 + m2 + · · · + mn, and for Ui = mi - Si 2 0, i = 1, 2, ... , n, is given

by An,k(Ut,U2, ... ,un) =

+

(n + ~ =: -

1 )

f)- YL (n+k-s-Ui -::~···-ui~ 1

1

-r-1),

(4.8)

r=l

where, in the inner sum, the summation is extended over all r-combinations {i 1, i2, ... , ir} of then indices {1, 2, ... , n }.

PROOF On using the transformation Yi =Xi - si, i equation (4.6) and the restrictions (4.7) reduce to

= 1, 2, ... , n, the linear (4.9)

Yt + Y2 + · · · + Yn = k - s, with k - s a nonnegative integer, and 0

:S Yi :SUi, i = 1, 2, ... , n, U = Ut + U2 + · · · + Un 2 k- s.

(4.10)

Since the transformation is one-to-one, the number An,k (u 1 , u 2 , ... , un) of the integer solutions of (4.6), with the restrictions (4.7), equals the number of integer solutions of (4.9), with the restrictions (4.10). In order to evaluate this number, consider the set D of nonnegative integer solutions of (4.9), without any restriction, and let Ai be the subset of nonnegative integer solutions of (4.9), with the restriction Yi 2 Ui + 1, i = 1, 2, ... , n. Then

An,k(Ut, U2, ... , Un)

= N(A~A~ ···A~)

and, for its evaluation, Corollary 4.2 can be applied. Note first that Sn,o = N (D) is the number of nonnegative integer solutions of (4.9) which, according to Theorem 2.12, equals

_(n + s- 1) _(n + s- 1)

Sno'

kk-s

-

kn-1

·

Further, N(Ai 1 Ai, · · · Ai.) is the number of nonnegative integer solutions of (4.9) with the restrictions

Yi; 2 ui;

+ 1,

j

= 1,2, ... ,r,

4.2. NUMBER OF ELEMENTS IN A UNION OF SETS

139

which, according to Corollary 2.4, is given by

N(A- A- ... A- ) = (n ·~

•2

+ k- s- Ui

1

-

Ui 2

-

• • ·-

ui. - r-

n- 1



1)

if ui 1 + Ui 2 + · · · + ui. + r > k- s. Introducing these expressions into (4.5), the I required expression (4.8) is deduced. REMARK 4.4 Combinations with restricted repetition. As has been noted in Section 2.5, to each nonnegative integer solution (r 1 , r 2 , ... , rn) of (4.6), there uniquely corresponds a k-combination {a 1 , az, ... , ak} of the set W n = { w 1 , w 2 , ... , wn}, with repetition, in which the element Wi is included Ti 2: 0 times, fori = 1, 2, ... , n. Thus, the number of k-combinations of n in which the element wi is included no less than si and no more than mi times, for i 1, 2, ... , n, is given by (4.8). I Example4.3 Consider a collection of seven nickels, four dimes and two quarters. Assume that coins of any denomination are identical. Find the number of different subcollections often coins. Consider a sub-collection of ten coins and let x 1 be the number of nickels, x 2 the number of dimes and x 3 the number of quarters contained in it. Then the number of different sub-collections of ten coins equals the number of integer solutions of the linear equation XI

+ Xz + X3 = 10,

with the restrictions 0 ~ x 1 ~ 7, 0 ~ x 2 with n = 3, k = 10 and u 1 = m 1 = 7, u 2 that the required number equals

2 C2 ) -

~

5 and 0

~

x3

~

2. Applying (4.8),

= m 2 = 5, u 3 = m 3 = 2, we conclude

{G) + G) + G)} + G)

= 66- (6

+ 15 + 36) + 3 = 12.

Clearly, these 12 solutions are the following:

(7, 3, 0), (7, 2, 1), (7, 1, 2), (6, 4, 0), (6, 3, 1), (6, 2, 2), (5,5,0), (5,4,1), (5,3,2), (4,5,1), (4,4,2), (3,5,2).

0

Example 4.4 Euler's function Let n be a positive integer and let us denote by ¢(n) the number of positive integers less than or equal ton that are relatively prime ton. The function ¢(n)

140

THE PRINCIPLE OF INCLUSION AND EXCLUSION

is called the Euler's function of n. In order to compute this function, consider the decomposition of n into prime factors:

n

= 8 k,1 8 2k2 ... 8 rkr '

where si are prime numbers and k; positive integers, i = 1, 2, ... , r and let [} be the set of positive integers that are less than or equal to n. If Ai is the set of positive integers less than or equal ton that are divided by si, i = 1, 2, ... , r, then ¢( n) = N (Ai A; · · ·A~) is the number of positive integers less than or equal n that are relatively prime to n. Thus, according to Corollary 4.2, r

¢(n)

= N(A~A~ .. ·A~)=:~::) -1)kSr,k, k=O

with

where the summation is extended over all k-combinations {i 1 , i 2 , ... , ik} of the r indices {1, 2, ... , r }. Clearly,

and so the Euler's function of n is given by the expression

This expression may be written in the form

Table 4.1 gives Euler's function ¢(n) for n

Table 4.1

= 1, 2, ...

D

, 15.

Euler's Function 2

3 4

5 6

9

10

2242646

7

8

4

II 10

12 4

13 12

14 6

15 8

Example 4.5 The menages problem A classical enumeration problem formulated and solved by E. Lucas in 1891, known as the menages problem, asks the following. What is the number of different

4.2. NUMBER OF ELEMENTS IN A UNION OF SETS

141

seatings of n married couples (menages) around a circular table so that men and women alternate and no man is next to his wife? Assume that n of the 2n seats are green and the rest n seats are red and that the green and red seats are arranged around the table in alternate positions. Suppose (without any loss of generality) that the wives are seated first. Since men and women ought to be in alternate positions, then women may sit either on the green seats, which may be done in n! ways, or on the red seats, which also may be done inn! ways. Consequently, according to the addition principle, then women can be placed around the table in 2n! ways. Let us now number (a) then women from 1 to n in the ordinary direction (counterclockwise) starting from any one of them, (b) the n empty seats from 1 to n in the ordinary direction starting from the seat that is to the left of the woman with the number 1 and (c) then men by assigning to every man the number of his wife. In this way the enumeration of the different ways of placing then men on then empty seats so that no man is seated next to his wife is reduced to the enumeration of the number Mn of permutations (i1, i2, ... , in) of {1, 2, ... , n} that satisfy the restrictions:

ir -:f:- r, ir -:f:- r

+ 1, r =

1, 2, ... , n- 1, in -:f:- n, in -:f:- 1.

n

In order to enumerate the number M n. let us consider the set of then! permutations (i 1 , }2, ... , in) of { 1, 2, ... , n} and its subsets A 1 , A2, ... , An, which are defined as follows: A 2 r-l is the set of permutations with ir = r, r = 1, 2, ... , n, A 2r the set of permutations with ir = r + 1, r = 1, 2, ... , n - 1 and A2n the set of permutations with in = 1. Then Mn = N(A~ A2 · · · A2n) and, according Corollary 4.2,

2n Mn = l:)-1)kS2n,k, k=O

with

S2n,o

= N(D) = n!,

S2n,k

=L

N(Ai 1 Ai2

• • •

Aik), k

= 1, 2, ...

, 2n,

where the summation is extended over all k-combinations {i 1, i 2, ... , ik} of the 2n indices {1, 2, ... , 2n}. Note that

N(Ai 1 Ai 2

• •

·A;.k)

=0

in the case where, between the indicated sets, there are at least two with consecutive indices: Ai. and A;,+J, since if is = 2r- 1, an odd number, then ir = rand Jr = r + 1, while if is = 2r, an even number, then ir = r + 1 and ir+l = r + 1, which cannot happen in the same permutation (i 1 , }2, ... , in) of { 1, 2, ... , n}. Therefore S2n,k = 0 for k = n + 1, n + 2, ... , 2n, since all the terms of this sum include at least two sets with consecutive indices. Further, the number of nonzero terms of S2 n,k. k = 0, 1, ... , n, equals

~(2n-k) 2n- k

k

'

THE PRINCIPLE OF INCLUSION AND EXCLUSION

142

the number of k-combinations { ii, i 2 , ... , ik} of the 2n indices {1, 2, ... , 2n} displayed on a circle that include no pair of consecutive integers (see Example 2.29). In addition, in the case where, between the indicated sets, there is no pair with consecutive indices, the general term of S2 n,k, k = 0, 1, ... , n, equals

N(A-~1 A-~2 .. ·A-)= (n- k)'•' Zk the number of permutations of the remaining n- k elements, the positions of which are not determined by the indicated sets. Hence

Mn =

'f)-1)k~ ( 2n- k) (n- k)!. 2n- k k

k=O

The number Mn is called the reduced menages number. The total number of different seatings of n manied couples around a circular table so that men and women alternate and no man is next to his wife equals 2n!Mn. Table 2.2 gives reduced menages numbers Mn for n = 2, 3, ... , 12. 0

Table 4.2 Reduced Menages Numbers 2 0

3

4 2

5 13

6 80

7 579

8 4738

9 43387

10 439792

II 4890741

12 59216642

Some interesting corollaries may be deduced from Theorem 4.2 and Corollary 4.2 in the case of the existence of some kind of symmetry with respect to the sets. Such symmetry, appearing in several applications, constitutes the case where the sets are exchangeable in the following sense.

DEFINITION 4.1 The sets AI, A2, ... , An are called exchangeable if, for every collection of r indices {ii, i 2 , ... , ir} from then indices { 1, 2, ... , n }. the number (4.11)

depends only on rand not on the specific collection of indices. COROLLARY 4.3 'An be exchangeable subsets of a finite set Let AI' A2, 0

0

0

n.

Then (4.12)

4.2. NUMBER OF ELEMENTS IN A UNION OF SETS

143

and

(4.13) where

llo

= N(fl) and llr = N(Ai 1 A; 2

• • •

A;r), r = 1, 2, ... , n.

PROOF The assumption of the exchangeability of the n sets A 1 , A 2 , ... , An entails that each of the (~) terms of the sum in the right-hand side of (4.4) equals N(A; 1 A;2 ···A;.)= llr and so Sn,r

=

(;)vr,

r

= 1,2, ...

,n.

Expressions (4.12) and (4.13) are then immediately deduced from (4.3) and (4.5), respectively. I

Example4.6 A secretary with mathematical interests is about to place four letters, numbered {1,2,3, 4}, into four envelopes, also numbered {1, 2, 3,4}. She is wondering in how many ways this can be done so that no letter is placed in the correct envelope. Note first that each placement of the four letters into the four envelopes may be represented by a permutation of the four letters in which the positions represent the four envelopes. Consider the set fl of permutations of the four letters and let A; ~ fl be the subset of permutations of the four letters in which the i-th letter is placed in the i-th position, i = 1, 2, 3, 4. Then N(A~A~A~A~) is the number of different placements in which no letter is placed in the correct envelope. Further, for any collection of r indices {i 1 , i 2 , •.. , ir} from the set {1, 2, 3, 4 },

which is the number of permutations of the other 4 - r numbers. Thus, the sets A1,A2,A 3 ,A4 are exchangeable and, according (4.13), the required number is given by

N (A I1 A2I A13 A41 ) = 4!

(

1 1 1- 1 +--2! 3!

1) +4!

= 9.

Clearly, these nine placements are the following: (2, 1, 4, 3), (2, 4, 1, 3), (2, 3,4, 1), (3, 1, 4, 2), (3, 4, 1, 2), (3,4,2,1), (4,1,2,3), (4,3,1,2), (4,3,2,1). This problem constitutes a particular case of the more general problem of evaluation of permutations with a given number of fixed (unchanged) points, which is presented at length in Chapter 5. 0

144

THE PRINCIPLE OF INCLUSION AND EXCLUSION

Example 4.7 Combinations with restricted repetition Find the number of k-combinations of the set Wn = { w1, w2, ... , wn} with repetition and the restriction that each element is allowed to appear at most s times. Consider the set of k-combinations of W n with (unrestricted) repetition and let Ai be its subset that includes the k-combinations, in which the element wi appears at least s + 1 times, i = 1, 2, ... , n. Then E 8 (n, k) = N(A~A2 ···A~) is the number of k-combinations of Wn with repetition and the restriction that each element is allowed to appear at most s times. Further, for any collection of r indices {i 1 , h, ... , ir} from then indices {1, 2, ... , n }, we have n (

k-r(s+1) n

(

+ k - r(s + 1) - 1) + k- r(s + 1)- 1), r = 1,2, ... ,n, n-1

since the r(s + 1) elements of each k-combination are determined, while the remaining k- r( s + 1) elements are chosen with (unrestricted) repetition from the n. Therefore the sets A 1 , A2 , ... , An are exchangeable and, according to (4.13 ),

Note that, for s 2: k all the terms of this sum, except the first (r this number reduces to

= 0), vanish and

which is the number of k-combinations of W n with unrestricted repetition.

4.3

0

NUMBER OF ELEMENTS IN A GIVEN NUMBER OF SETS

The number Nn,k of elements that are contained in k among n subsets AI' A2' ... ' An of a finite set n' in the particular case k = 0 has been expressed in the form of an algebraic sum of the number Sn,r = 2:: N(Ai, Ai2 • • • AiJ (see Corollary 4.2). An analogous expression in the general case with 0 ~ k ~ n is given in the next theorem.

4.3. NUMBER OF ELEMENTS IN A GIVEN NUMBER OF SETS 145

THEOREM 4.4 General inclusion and exclusion principle The number Nn,k of elements that are contained ink among n subsets A 1 , A 2 , ... , An, of a .finite set is given by

a,

(4.14) where Sn,o

= N(a) and Sn,r• r = 1, 2, ...

PROOF

Clearly,

Nn,k

=

L

N(Ai 1 Ai 2

• •

, n, is given by (4.4).

·Ai.Aj 1 Aj2

• •

·Aj,_.),

(4.15)

it, ... ,ik

where the summation is extended over all k-combinations {i 1, i 2, ... , ik} of then indices {1, 2, ... , n} and {jl, iz, ... , Jn-d = {1, 2, ... , n} - {i1, iz, ... , ik }. Let us first calculate the number N ( Ai 1 Ai 2 • • · Ai. Aj 1 Aj 2 • • • Aj, _•), of elements of a that are contained ink specified subsets among then subsets. Applying the expression N(AB') = N(A- B) = N(A)- N(AB) (see Theorem 1.4) to the sets A = Ai 1 Ai 2 • • • Ai> and B = Aj 1 U A12 U · · · U Ai .. -•• whence B' = Aj 1 Aj 2 • • • Aj,_., and putting Cj. = Ai 1 Ai 2 • • • Ai• Aj., s = 1, 2, ... , n - k, we deduce the relation

N(At1 A t2 ... A tk A'.)I A')2.... A'·)n-k ) =N(At1 A t2 ... A tk )-N(C·)l UC·)2 u .. ·UC·)n-k ) > from which, using (4.3), we conclude the expression n

N(Ai 1 Ai 2

••

·Ai.Aj 1 Aj2 ···Aj,_.)

= L(-1y-kQn,k,r(ii,iz, ...

,ik),

r=k with

for r = k, k + 1, ... , n, where the summation is extended over all (r - k)combinations { h 1 , h 2 , ... , hr- k} of the n - k indices {il , iz, ... , in_ k}. Introducing this expression into expression (4.15) of the number Nn,k. we get n

Nn,k =

L

L(-Iy-kQn,k,r(ii,iz, ... ,ik) (4.16)

r=k

THE PRINCIPLE OF INCLUSION AND EXCLUSION

146

where

Sn,k,r =

L L

Qn,k,r(ii, iz, · · · , ik)

it, ... ,ik

L

N(A;lA;2···A;kAhtAh2···Ahr-k).

it, ... ,ik ht, .. ,h,._k

Note that this sum includes

termsoftheform: N(Am 1 Am 2 ···AmJ, {m 1 ,mz, ... ,mr} C {1,2, ... ,n}. Further, among these terms, the distinct ones are equal to

the number of r-combinations {m 1 , m 2 . . . , mr} of the n indices { 1, 2, ... , n} and each such term is included in the sum as many times as the number

of ways of selecting k indices {i 1 , i 2 , •.• , ik} from the set {m 1 , m 2 , .•. , mr }, so that

which is a simple combinatorial identity. Consequently,

where the summation is extended over all r-combinations {m 1 , m 2 , .•. , mr} of the n indices { 1, 2, ... , n}. Introducing it into expression (4.16), we deduce I (4.14).

REMARK 4.5 The following proof of (4.14) is of broader interest. Its technique can be used in the proof of (4.3) and other analogous expressions. Note that, in general, an arbitrary element w in D is contained in s subsets A; 1 , A; 2 , ••• , A;. among the n subsets A 1 , Az, ... , An, with 0 :::; s :::; n. If 0 :::; s < k, then this element is not counted in expression (4.14), while if s = k, it is counted only once in the sum

4.3. NUMBER OF ELEMENTS IN A GIVEN NUMBER OF SETS 147

specifically in the term N (Ai, Ai2

• • •

Aik), and is not counted in the sum

< s ~ n, then the element w is counted in the sum Sn,r• r = k, k + 1, ... , s, as many times as is the number (:) of terms N (Am, Am 2 · • • Am,), with

If k

{m1,m2,··· ,mr} ~ {i1,i2,··· ,i 8 },andisnotcountedinthesumSn,r•r

=

s + 1, s + 2, ... , n. Consequently, this element is counted in (4.14) as many times as is the number

~( -1r-k G)(;) = G)~( -1r-k G=~) = o. Therefore, in (4.14) only the elements of D that are contained ink among then subsetsA 1,A 2, ... ,An are counted. I COROLLARY 4.4 Let A 1 , A2 , .•• , An be exchangeable subsets of a finite set D. Then the number N n,k of elements of D that are contained in k among these n subsets is given by (4.17)

where Vo = N(D) and Vr = N(Ai, Ai 2 PROOF

• • •

AiJ, r = 1, 2, ... , n.

The sum

where the summation is extended over all r-combinations {i 1, i 2, ... , ir} of the = Vr, of the

n indices {1,2, ... ,n}, under the assumption N(Ai,Ai 2 ···AiJ exchangeability of then sets A 1 , A 2, ... , An, is given by

Introducing it into expression (4.14) of the number Nn,k> we get

Nn,k = =

~(-1y-kG) (~)vr = (~) ~(-l)r-k(~=~)vr (~) ~(-1)i(n7k)vk+i•

k=0,1, ... ,n,

THE PRINCIPLE OF INCLUSION AND EXCLUSION

148

which is the required expression.

I

As regards the number Ln,k of elements that are contained in at least k among n subsets of a finite set n, which is connected with the number Nn,s, we deduce the next corollary of Theorem 4.4 .

COROLLARY 4.5

The number Ln,k of elements that are contained in at least k among n subsets n, is given by

A1 , A2, ... , An, of a finite set Ln,k =

~( -1y-k

G=~)

(4.18)

Sn,r, k = 1, 2, ... , n,

where the sum Sn,r is given by (4.4 ). If, in addition, the sets A 1 , A 2 , ... , An are exchangeable, then

Ln,k

= n(~

=~) ~(-1)j (n ~ k) ~~j·, k= j=O

J

J

1, 2, ...

,n,

(4.19)

PROOF Since an arbitrary element w is contained in at least k among the n subsets of n if and only if it is contained either ink or ink+ 1, ... , or in all the n subsets, applying the addition principle and using (4.14), it follows that

where, according to (2.8),

If the sets A 1 , A 2 ,

... ,

An are exchangeable, then

4.3. NUMBER OF ELEMENTS IN A GIVEN NUMBER OF SETS 149

and Ln,k

= ~( -1)r-k

G=~) (;)

Vr

nG =~) f)-1r-k(; =:) ~ = n(n -1) ~(- 1 ) 1 (n-_ k) k-1 . =

r=k

]=0

which completes the proof.

J

vk+i., k+J

I

Example4.8 Consider an ordered series of eight lottery-urns, each containing ten balls numbered from 0 to 9. In a drawing, one ball is drawn from each of the eight urns and an eight-digit number is formed. Calculate the different six-digit numbers in which only half of the ten digits appear. Let Ai be the set of eight-digit numbers, in which the digiti- 1 does not appear, i = 1, 2, ... , 10. Then the different eight-digit numbers in which (exactly) five of the ten digits appear equals the number of elements that are contained in (exactly) five of the ten sets AI, A 2 , . .. , A 10 . These sets are exchangeable. Indeed, for any collection of r indices {i 1 , i 2 , ... , ir} from the ten indices { 1, 2, ... , 10}, we have

which is the number of the 8-permutations with repetition of the 10 - r nonexcluded numbers. Thus, by Corollary 4.4, the required number equals

Note that the total number of 8-digit numbers is 100,000,000.

0

Example 4.9 Divisions with a given number of empty sets A division of a finite set W in r subsets is an ordered r-tuple of sets (AI, A 2 , ... , Ar) that are pairwise disjoint subsets of W and their union is W. In a division of a set, the inclusion of one or more empty sets is not excluded (see Section 1.2.7). Let D be the set of divisions of W, with N (W) = n, in r subsets. The number of elements of this set equals N (D) = rn, the number of n-permutations of r with repetition (see Corollary 3.3 ). Calculate the number of divisions of the set W, of n elements, in r subsets with (a) k empty subsets and (b) at least k empty subsets.

THE PRINCIPLE OF INCLUSION AND EXCLUSION

150

Let D i ~ n be the set of divisions ( A 1 , A2 , •.• , Ar) of the set W of n elements in r subsets, in which Ai = 0, i = 1, 2, ... , r. Note that, for any collection of s indices {i 1 , i 2 , ... , is} from the r indices { 1, 2, ... , r }, we have

since the number of divisions of the set W of n elements in r subsets, in which s specified sets are empty, equals the number of divisions of the set W of n elements in r- s subsets. Consequently the sets D 1 , D 2 , ... , Dr are exchangeable. (a) The number of divisions of the set W of n elements in r subsets among which k are empty, according to Corollary 4.4, equals

Nr,k

=

G) ~(-1)i (r ~ k) (r- k-

= (~) ~(- 1 )r-k-i

j)n

(r ~ k>n·

(b) The number of divisions of the set W of n elements in r subsets among which at least k are empty, according to Corollary 4.5, equals

_ (r- 1) ~ _ (r - k) (r- k-+ .

Lr,k - r k- 1

~( 1)

j

j=O

= r

(r1) ~( _1 k-1 ~

r-k-i

i=O

k

. J

j)n

J

(r--_z k) ~r-z

Note that Nr,k

= (r)r-kS(n, r- k),

where S(n,r)

= r.~ :i)-1)r-i (~)in, z

r = 0, 1, ... ,n, n

= 0, 1, ...

i=O

are the Stirling numbers of the second kind . These numbers appear in several interesting problems in combinatorics and for this reason are thoroughly examined in Chapter 8. 0 Example 4.10 Sum of multinomial coefficients Evaluate combinatorially the sum

4.3. NUMBER OF ELEMENTS IN A GIVEN NUMBER OF SETS 151

where the summation is extended over all kj 2: 1, j = 1, 2, ... , r, with k 1 + k2 + ... + kr-1 + kr = n. The combinatorial evaluation of a sum requires, at first, a suitable combinatorial interpretation. The multinomial coefficients and the sum Cn,r admit of several combinatorial interpretations. Let us consider the following combinatorial interpretation relative to the divisions of a finite set with a given number of empty sets, which thus allows the use of the conclusion of the previous example. The multinomial coefficient

n! k,!k2!···kr-l!kr!' according to Theorem 2.8, equals the number of divisions (A 1 , A2 , ... , Ar) of a finite set W, of n elements, in r subsets with N(Ai) = ki, j = 1, 2, ... , r. Consequently, the sum Cn,r expresses the number of divisions of the set W of n elements in r non-empty subsets, since N(Aj) 2: 1, j = 1, 2, ... , r, and so, according to conclusion (a) of the previous example with k = 0, equals Cn,r = t(-l)r-i

•=0

(:)in= r!S(n,r),

where S(n, r) is the Stirling number of the second kind.

0

Example 4.11 Coupon collector's problem For the promotion of sales of an industrial product, the producing company has printed s series of coupons numbered from I to s. A coupon is placed in each package box of the product. A customer who collects k different coupons gets k units of the product free, while in the exceptional case of collecting a complete series of coupons, the prize is a special gift from the company. Calculate the number of collections of n coupons that include (a) k different coupons and (b) a complete series of coupons. Consider the set fl of collections of n coupons and let Ai ~ fl be the set of collections of n coupons that do not include any coupon bearing the number i, i = 1, 2, ... , r. Then for any collection of m indices {i 1 , i 2 , ... , im} from the set of r indices {1, 2, ... , r }, we have

which is the number of n-combinations of the remaining s(r - m) coupons, after excluding the sm coupons bearing them specified number. Consequently, the sets A,, A2, ... , Ar are exchangeable. (a) The number of collections of n coupons that include k different coupons equals the number of elements of fl that are contained in r - k among the r

THE PRINCIPLE OF INCLUSION AND EXCLUSION

152

subsets A 1 , A2 , ... , Ar and according to Corollary 4.4, k

(r ~ k) ~(-1)1

Nr,r-k = is given by

Nr,r-k

C)vr-k+j,

G) t,( G) c(k: j)) G) t,(-1)k-iG) (~).

=

-1) 1

(b) The number of collections of n coupons that include a complete series of coupons equals

Note that

(r)k

Nr,r-k = ~C(n, k; s), where the numbers

1 L..)-1) ~ C(n,k;s) = k!

k-i(k)i (sz)n, . r =0,1, ... ,n, n =0,1, ... ,

•=0 which are called generalized factorial coefficients, are thoroughly examined, together with the Stirling numbers with which they are connected, in Chapter 8. D

4.4

BONFERRONI INEQUALITIES

A series of alternating inequalities for the number Nn,k of elements that are contained in k and the number Ln k of elements that are contained in at least k among n subsets of a finite set 'may be deduced from relations (4.14) and (4.18) and their inverses, respectively. The next lemma is concerned with the inversion of (4.14) and (4.18). LEMMA4.1 The inverse relations of(4.14) and (4.18) are

Sn,r =

t

k=r

G)Nn,k

(4.20)

4.4. BONFERRONI INEQUALITIES

153

and =

Sn,r

(k- 1)

L n

r- 1

(4.21)

Ln,k,

k=r

respectively. PROOF get

Multiplying (4.14) by (~) and summing for k

t

, n, we

t f) (~) (~) t, {t,(-1)"-· m(~)} s.,,

(~) Nn,k =

-1)r-k

J

k=J

= j, j + 1, ...

Sn,r

k=J r=k

= where the inner sum

_ Sr,j-

(k) (r)k ,

~ r-k f=;(-1) j

is evaluated by the aid of the relation

C)(~) = C)(~=~) and is equal to -

Sr,j-

r

(

j

)

the Kronecker delta:

T t;(-1)

6 1 ,1

= 1,

r-k

6r,i

(

r- J

-

k -")j -

= 0, r -::j:. j.

(

r

j

)

(1-1)

Consequently,

Multiplying (4.18) by (~:=:) and summing fork= j,j the same way (4.21).

r-j -6r,j,

+ 1, ...

, n, we deduce in

I

THEOREM 4.5 Bonferroni inequalities Let Nn,k be the number of elements that are contained ink and Ln,k the number of elements that are contained in at least k among n subsets A1 , A2 , •.. , An of a

154

THE PRINCIPLE OF INCLUSION AND EXCLUSION

finite set fl. Then, for s = k, k + 1, ... , n, the following alternating inequalities hold true:

k = 0, 1, ... ,n,and ( -1)s-k+l

{L - ~(-1)r-k (rS }> 0 k _ 1) 1 n,k

~

n,r

_

'

(4.23)

r=k

k = 1, 2, ... , n, where the sum Sn,r• r = 0, 1, ... , n, is given by (4.4).

PROOF

Consider, for fixed nand s = k, k

+ 1, ... , n, k

= 0, 1, ... , n, the

sequence

which, by virtue of (4.20), vanishes for s =nand any k = 0, 1, ... , n, while, for s = k, k + 1, ... , n - 1 is given by Mn,k,s=

t

(-1r-•-lG)sn,,., k=0,1, ... ,n-1.

r=s+l Upon using (4.20), this sequence can be written as a linear combination of Nn,j. j = s + 1, s + 2, ... , n:

Note that the coefficient of the general term of this expression,

according to (2.8), is equal to

155

4.5. NUMBER OF ELEMENTS OF A GIVEN RANK

that is, is positive, which implies (4.22). The inequalities (4.23) are deduced in the same way from (4.18) and (4.21). I The inequalities (4.22) in the particular case k = 0 reduce to

REMARK 4.6

while the inequalities (4.23) in the particular case k

= 1 reduce to

which, for s = 1, yields the Boole inequality n

N(Al U A2 U · · · U An):::;

L N(Ai). i=l

Further, from (4.22) and (4.23), with s = k and s = k + 1, we deduce the double inequalities, Sn,k - (k + l)Sn,k+l :::; Nn,k :::; Sn,k and

respectively.

4.5

I

NUMBER OF ELEMENTS OF A GIVEN RANK

In the enumeration of the elements that are contained in a given number of subsets among n subsets of a finite set, there does not enter any ordering of these subsets. When the considered subsets are ordered, some interesting problems of enumeration of elements, according to the rank (order) of the first set in which they are contained, emerges. This is clarified in the next combinatorial model. Let WI' w2, ... 'H'n be finite sets and let n be their Cartesian product,

n =WI

X w2 X ... X H'n

= {(wl,w2,··.

,wn):

Wj

E

wj,

j

= 1,2, ...

,n}.

Let us consider, for a given element Wj E wj, the subset Aj of n that includes the elements w = (wl 'W2, ... 'Wn) E n for which the j-th coordinate

156 is

Wj,

THE PRINCIPLE OF INCLUSION AND EXCLUSION

j = 1,2, ... ,n. The ordering (wt,W2,··· ,wn) of the elements

= 1, 2, ... , n induced the ordering (At, A2, ... , An)

Wj,

of the corresponding subsets Aj, j = 1, 2, ... , n. The enumeration of the elements of D that, for a given index k, are not contained in any of the sets At, A2, ... , Ak-t and are contained in Ak (the first in-order set in which they are contained) is one of the interesting problems that emerged. Note that, in the corresponding probabilistic model, D is the sample space of a sequence of Bernoulli experiments and A j is the event of a success at the j-th experiment, j = 1, 2, .... The calculation of the probability that the first success is realized at the j-th experiment requires the enumeration of the sample points (elements of D) that are not contained in the events (subsets of D) At, A2, ... , Ak-t and are contained in Ak· As regards the general problem, the notion of the rank of an element is formally introduced in the next definition. j

DEFINITION 4.2 Let (At, A2, ... , An, ... ) be ordered subsets of a set fl. An element w E D that is contained in the set A~ A; · · · A~_ 1 Ak is said to be of rank k. In the case of a .finite number ofn ordered subsets (At, A2, ... , An), an element w E D that is not contained in any of then subsets is said, by convention, to be of rank n + 1 .

The next theorem is concerned with the number of elements of a given rank. THEOREM4.6 Let (At,A2,··· ,An,···) be ordered and .finite subsets of a set fl. Then the number Rk = N(A;A2 · · · A~_ 1 Ak), of elements ofD of rank k, is given by, Rk = Qk-t,o- Qk--1,t

+ · · · + (-1)k- 1Qk-t,k-1,

k = 1, 2, ... , (4.24)

with

and (4.25)

where the summation is extended over all r-combinations {it, i2, ... , ir} of the k- 1 indices {1, 2, ... , k- 1}. PROOF Applying the expression N(AB') = N(A) - N(AB) (see Theorem 1.4) to the sets A = Ak and B = At U A2 U · · · U Ak-t. whence B' =

157

4.5. NUMBER OF ELEMENTS OF A GIVEN RANK

A]. A~··· sion

A~-1'

and setting Cj = AjAk. j = 1, 2, ... , k- 1, we get the expres-

Further, using (4.3) and since

we deduce (4.24).

I

REMARK 4.7

An alternative expression of the munber of elements of a given rank may be derived by an application of the expression N ( AB') = N (A) N(AB) to the sets A = AJ. A~··· A~-t and B = A~. whence B' = Ak. Then N(A~A~ · · · A~_tAk) = N(A~A~ · · · A~_ 1 )- N(A~A~ ···A~ A~)

and so Rk = Nk-t,o- Nk,o,

I

where Nn,o is given by (4.5).

COROLLARY 4.6 Let (At, A 2, ... , An, ... ) be ordered and finite subsets of a set If, in addition, for a given k the sets A 1 , A2, ... , Ak are exchangeable, then the number of elements of of rank k is given by

n.

n

Rk = ( k -0 1) Vt - (k1 1) V2

+ ... + (-1) k-t (kk - 1) 1 Vk'

(4.26)

PROOF

The assumption of exchangeability of the sets At, A2, ... , Ak implies that each of the (k~t) terms of the sum Qk-t,r in (4.25) is given by N(Ai, Ai2 ... AirAk) = N(AtA2 ... Ar+l) = Vr+t' r = 0, 1, ... 'k- 1.

Therefore Qk-t,r=

(k-1) r

Vr+t, r=0,1, ... ,k-1

and, by (4.24), expression (4.26) is deduced.

I

Example 4.12 Consider a lottery-urn containing ten balls numbered from 0 to 9 and assume that balls are drawn one after the other without replacement. This procedure is

158

THE PRINCIPLE OF INCLUSION AND EXCLUSION

terminated at the k-th trial if number k is drawn, k = 1, 2, ... , 9; otherwise it is terminated at the tenth trial whether or not number 0 is drawn. Calculate the number Tk of different series of drawings that are terminated at the k-th trial, k = 1, 2, ... ' 10. Let n be the set of the 10! different series of drawings and consider the ordered subsets (A 1 , A2, ... , A10 ) of n that are defined as follows: the set Ai contains those series of drawings in which number j is drawn at the j-th trial, j = 1, 2, ... , 9. Especially the set A 10 contains those series of drawings in which number 0 is drawn at the tenth trial. These sets are exchangeable. Indeed,

which is the number of different series of drawings of the other 10- r numbers. The number Rk of different series of drawings of rank k, using Corollary 4.6, is obtained as k-1

Rk=~(-1r

(k- 1) r

(9-r)!, k=1,2, ... ,10.

Especially, the number Ru = N (A~ A~ · · · A~ 0 ) of different series of drawings of rank ll, using Corollary 4.3, is obtained as 10 (10) Ru = ~( -1r r (10- r)!.

Clearly, the number Tk of different series of drawings that are terminated at the k-th trial is given by Tk = Rk, k = 1, 2, ... , 9 and T10 = R 10 + R 11 . Note that, from a probabilistic point of view, the quotient Pk = Tk/10!, k = 1, 2, ... , 10,

gives the probability that the drawing is terminated at the k-th trial.

4.6

0

BIBLIOGRAPHIC NOTES

This chapter was devoted to a thorough presentation of the counting principle of inclusion and exclusion. In probability theory books, Theorem 4.2, expressed in terms of probabilities, is attributed to H. Poincare (1896) and is referred to as Poincare formula. However, it seems that this formula was also known to J. Sylvester (1883) and to Euler (1760) when he evaluated ktk.

(6.41)

k=O

Indeed, from (6.36) and (6.37), we have

and, using (6.41) with e1 instead oft, we get M(t) = A(e 1 ), A(u) = M(log u),

(6.42)

while, from (6.39) and (6.40), we find

and so B(t)

= A(1 + t),

A(u)

= B(u- 1).

(6.43)

From (6.42) and (6.43) it follows that M(t)

= B(et- 1),

B(t)

= M(log(1 + t)).

(6.44)

6.4. MOMENT GENERATING FUNCTIONS

217

Expanding the second of (6.43) into powers of u, using (6.40) and (6.41), we get

and thus 1 oo (-1y-k

= k! L

(r- k)! f..L(r)· r=k Introducing the binomial moments b(r) = f..L(r)/r!, r = 0, 1, 2, ... , this expression takes the form ak

Note that the last expression is similar to (4.14), which expresses the number Nn,k, k = 0, 1, ... , n, of elements that are contained in k among n subsets, A1 , A2 , •.• , An, of a finite set D, in terms of the numbers Sn,r = L: N(Ai, Ai2 • • • AiJ, r = 0, 1, ... , n, where the summation is extended over all r-combinations, {h,i 2 , ... ,ir}, of then indices {1,2, ... ,n}. Example 6.17 Let us determine the factorial moments f..L(r)• r = 0, 1, ... , of the sequence of geometric probabilities Pk = pqk, k = 0, 1, ... , where 0 < p < 1 and q = 1 - p. The probability generating function, on using the geometric series, is obtained as 00

00

A(t) = LPktk = p L(qt)k = _P_, 1 - qt k=O k=O

ltl < 1/q.

Therefore, by the first of (6.43), the factorial moment generating function is given by 1

B(t) = 1 _ (qfp)t'

ltl < pfq

which, expanded into powers oft, B(t)

=

1

00

= "'(qjp)rtr, 1- (qfp)t ~

by virtue of (6.40), yields f..L(r)

= r!(qfpY,

r

= 0, 1,... .

0

218

GENERATING FUNCTIONS

Example 6.18 Let us determine the sequence of probabilities Pk, k moments

=

b(r)

(;)pr,

r

= 0, 1, ... , with binomial

= 0, 1, ... ,

where 0 < p < 1 and n is a positive integer. The binomial moment generating function, on using Newton's binomial formula, is obtained as

Consequently, by virtue of the second of (6.43), the generating function of the sequence Pk· k = 0, 1, ... , is given by

and so

Example 6.19 Let us consider the number Nn,k. k = 0, 1, ... , n, of elements that are contained ink among n subsets A1 , A2 , •.. , An. of a finite set fl, and

where the summation is extended over all r-combinations {i 1 , i 2 , ... , ir} of the n indices {1, 2, ... , n}. Then, according to (4.14) and (4.20),

Consequently, Sn,r• r = 0, 1, ... , n, is the sequence of binomial moments of the sequence Nn,k, k = 0, 1, ... , n. Thus, if n

Nn(t)

=L

n

Nn,ktk, Sn(t)

k=O

= L Sn,rtr,

(6.45)

r=O

then, according to (6.43), Sn(t) = Nn(t

+ 1),

Nn(t) = Sn(t- 1).

(6.46)

219

6.5. MULTIVARIATE GENERATING FUNCTIONS

In the particular case with D the set of permutations (il, h, ... , in) of { 1, 2, ... , n} and As the subsets of these permutations for which the point j s is a fixed point, s = 1, 2, ... , n, we have

.

Nnk = Dnk, Snr ' '

= n!fr!,

where Dn,k is the coincidence number (see Section 5.2). The generating function n

L Dn,ktk,

Dn(t) =

k=O according to (6.45) and (6.46), is written as n

Dn(t) =

L

I

n; (t-It. r. r=O

Differentiating it we get the relation

Also, we find

Dn(t) = nDn-dt)

+ (t- l)n.

These relations imply the recurrence relations:

kDn,k = nDn-I,k-1 and

respectively.

6.5

0

MULTIVARIATE GENERATING FUNCTIONS

The notion of a generating function can be extended to cover the case of a double-index and, more generally, a multi-index sequence. Specifically, the following definitions are introduced.

DEFINITION 6.4

Let an,k> k

= 0, 1, ... , n = 0, 1, ...

be a sequence of real

numbers. The sum 00

A(t, u) =

L

00

L:::an,ktkun n=Ok=O

(6.47)

GENERATING FUNCTIONS

220

is called (ordinary) generating function, while the sum oo tk un L::an,k k! n! n=Ok=O oo

L

E(t, u) =

is called exponential generating function of the sequence an,k· k n = 0,1, ....

(6.48)

= 0, 1, ... ,

It should be noted that the absolute convergence of the series (6.47) and (6.48) is required for the existence of the corresponding generating functions. REMARK 6.2 cases of

Both generating functions A(t, u) and E(t, u) are particular 00

G(t, u) =

00

L L an,dk(t)gn(u),

(6.49)

n=Ok=O where the functions fk(t), k = 0, 1, ... , as well as the functions 9n(u), n = 0, 1, ... , are linearly independent and so (6.49) is uniquely defined. It is worth noting that, with 00

Fn(t)

= L an,kfk(t),

00

Gk(u)

= L an,k9n(u), n=O

k=O (6.49) may be written in the form 00

G(t, u)

= L Gk(u)fk(t), k=O

or in the form 00

G(t, u)

=L

Fn(t)gn(u).

n=O Note that the last two expressions are of the general form (6.13) of a generating function. With this remark, the study of generating functions of double-index sequences is reduced to the previous study of generating functions of single-index sequences. In the particular case of triangular double-index sequences an,k· k = 0, 1, ... , n = 0, 1, ... , for which an,k = 0 for k > n, it is more convenient to use the generating function (6.50)

6.5. MULTIVARIATE GENERATING FUNCTIONS

221

In an analogous way, a multivariate generating function G (t 1 , t 2 , ... , tr) of a multi-index sequence ak,,k 2 , ... ,kr• k; = 0, 1, ... , i = 1, 2, ... , r, may be introduced and studied. I Example 6.20 Let us consider the double-index sequence: an,k=

(~),

k=0,1, ...

,n,

n=0,1, ....

For fixed n, using Newton's binomial formula, the ordinary generating function of this sequence is readily deduced as

Consequently, the bivariate generating function of the double-index sequence an,k. k = 0, 1, ... , n, n = 0, 1, ... , is obtained as n

oo

00

n=O

n=Ok=O 00

= L)(l + t)u]n = [1- (1 + t)ut 1 • n=O

Since the considered double-index sequence is triangular, its generating function of the form (6.50) is derived as

The exponential generating function of the same sequence is quite involved and thus not of any interest. D Example 6.21 Consider the coincidence number (see Theorem 5.3),

D

- n! n-k (-1)i

n,k - k!

L J..

. j=O

1

,

k

= 0, 1, ... , n,

n

= 0, 1, ...

.

222

GENERATING FUNCTIONS

For fixed n, the generating function of this sequence is (see Example 6.19), n

Dn(t)

=L

k

Dn,kt

k=O

n

= n! L

(t-It r!

r=O

Then, the bivariate generating function oo

D(t, u) =

n

n

L L Dn,ktk ~! ,

n=Dk=O is obtained as

D(t,u) =

f r=O

[u(t~ lW r.

0

fun-r = (1- u)-1eu(t-1). n=r

Example 6.22 Let us consider the multi-index sequence , C(n,k1,k2, ... ,kr-1)=(k k n k ) - k 1 n! 1, 2, · · ·, r-1 1·k2! .. · kr-1!kr.1

ki = 0, 1, ... ,n,i = 1,2, ... ,r-l,kr = n-(k1+k2+·· ·+kr_!),n = 0, 1, .... For fixed n, the multivariate generating function of this sequence, on using the multinomial formula (see Theorem 3.7), is obtained as An(t1,t2, ... ,tr-d=L(k k n k )t~ 1 t~ 2 1' 2, · · • , r-1 = (1 + t1 + t2 + · · · + tr_I)n.

···t~:_J. 1

Consequently,

A(h,t2, ... ,tr-1,u)=E'L:(k k n k n=O 1 , 2, · · · , r-1

)t~ 1 t~2 ···t~:_-11 un

00

= L[(l n=O

+ t1 + t2 + · · · + tr-dut

= ~ [(1

+ t1 + t2 + · · · + tr_I)u]n

and

~

n! n=O = e(l+fl+h+··+tr-du. Other bivariate generating functions are discussed in the exercises.

0

6.6. BIBLIOGRAPHIC NOTES

6.6

223

BIBLIOGRAPHIC NOTES

The roots of generating functions may be traced in the work of Abraham De Moivre (1718). Also, generating functions were used by L. Euler (1746) in his study on the partitions of integers. The development of the theory of generating functions arose in conjunction with the calculus of probability. P. S. Laplace (1812) devoted half of his book to a systematic and complete treatment of generating functions and especially the moment generating functions; he is considered the inventor of the method of generating functions. P. MacMahon (1915, 1916) extensively used enumerating generating functions in his treatise on combinatorial analysis. The basic elements of the symbolic calculus included in this chapter are based on the paper of E. T. Bell (1940) and the book of J. Riordan (1958). The exponential Bell numbers were examined in E. T. Bell (1934a,b). Abel's generalization of Newton's binomial formula first appeared in N. H. Abel (1826) and Gould's generalization of Vandermonde's formula was derived in H. W. Gould (1956). An illuminating historical coverage of the use of generating functions in probability theory is given by H. L. Seal (1949). A wealth of information can be found in the survey article on generating function by R. P. Stanley (1978).

6.7

EXERCISES

1. Construct a generating function for the number ak of k-combinations of the set W5 = {W1, W2, ... , W5}, with repetition, in which the element W1 appears at least once, each of the elements w 2 , W3 and w4 appears at least twice and the element w 5 may appear without any restriction. Expanding the generating function, deduce the number ak, k = 7, 8, .... 2. Suppose that three distinguishable dice are rolled. Construct a generating function of the number ak of possible results in which the sum of the three numbers equals k. Derive the numbers a 9 and a 10 (see Exercise 2.11). 3. Consider ten urns, each containing five numbered balls. The balls of each of the first five urns bear the even integers {0, 2, 4, 6, 8}, while the balls of each of the other five urns bear the odd integers { 1, 3, 5, 7, 9}. Assume that one ball is drawn from each of the urns. Construct a generating function for the number ak of drawings in which the sum of the two numbers equals k. Derive the numbers a 7 , a 9 and a 11 •

GENERATING FUNCTIONS

224

4. Consider a collection of 52 cards of four different kinds with 13 cards like from each kind. Construct a generating function for the number ak of different sub-collections of k cards. Expanding it, deduce the numbers a 13 and a26·

5. Suppose that five letters {h, l2, ... , l 5 } from an alphabet are given. Construct a generating function for the number of k-letter words that can be formed (a) without repeated letters and (b) without any restriction. 6. Calculate the number of k-permutations of the set {0, 1, ... , 9} in which (a) each of the digits 0 and 5 appears an odd number of times and (b) each of the digits 0 and 5 appears zero or an even number of times, using suitable generating functions. 7. Calculate the number of k-permutations of the set {0, 1, ... , 9} (a) with zero or an even number of Os and odd number of 5s and (b) in which the total number of Os and 5s is zero or even. 8. In the quaternary number system each number is represented by an ordered sequence of the digits from the set {0, 1, 2, 3}. Using suitable generating functions, calculate the number of k-digit quaternary sequences in which (a) each of the digits 1 and 3 appears an even number of times and (b) the total number of appearance of the digits 1 and 3 is an even number. 9. Let T(n, k) be the number of k-combinations of n with repetition and the restriction that each element may appear at most two times. For fixed n, construct a generating function for the sequence T(n, k), k = 0, 1, ... , and derive the expressions

and

10. (Continuation). Show that

T(n, k) = T(n- 1, k)

+ T(n-

1, k- 1)

+ T(n-

1, k- 2),

for k = 2, 3, ... , 2n and n = 1, 2, ... , with initial conditions

T(n, 0)

= 1,

T(n, 1)

= n,

= 0,

k > 2n.

+ 2nT(n-

1, k- 2),

T(n, k)

11. (Continuation). Show that

kT(n, k) = nT(n- 1, k- 1)

6. 7. EXERCISES

for k

= 2, 3, ...

225

, 2n, n

= 1, 2, ... , and

k(k- 1)T(n, k) = 2n(2n- 1)T(n- 1, k- 2) for k

= 2, 3, ...

, 2n and n

T(n, 0)

= 1,

+ 3n(n- 1)T(n- 2, k-

2),

= 2, 3, ... , with initial conditions T(n, 1)

= n,

= 0,

T(n, k)

k > 2n.

=

12. (Continuation). Let Tn T(n, n) be the number of n-combinations of n with repetition and the restriction that each element may appear, at most, twice. Show that

nTn- (2n- 1)Tn-1- 3(n -1)Tn-2 and

= 0,

n

= 2,3, ...

, To= T1

=1

00

T(t) = LTntn = (1 - 2t- 3t 2 )- 1 f 2 . n=O

13*. (Continuation). From the generating function

2n Tn(t) = LT(n, k)tk k=O

and using Lagrange formula, 1

00

~

[dn n ] un dtn f(t)g (t) t=O · n!

deduce that

= f(t)

(

dg(t))1- u---;[t ,u

t

= g(t),

00

T(u)

= LTnun = (1- 2u- 3u 2 )- 112 . n=O

14. (Continuation). Let A(n, r, k) be the number of k-combinations of with repetition and the restriction that each of n specified elements may appear at most twice, while each of the other r elements may appear at most once. For fixed n and r, construct a generating function for the sequence A(n, r, k), k = 0, 1, ... , and derive the expressions

n

+r

""' (n) (n + J)

[k/2]

A(n, r, k) = ~ ]=0

.

. J

k _r - . 2J

and k

A(n,r,k) =

~ (:)r(n,k-i).

,

GENERATING FUNCTIONS

226

15. Let G(n, k) be the number of k-combinations of n with repetition and the restriction that each element appears zero or an even number of times. For fixed n, construct a generating function for the sequence G(n, k), k = 0, 1, ... and, expanding it, show that

1 G(n,2j)=(n+;- ), j=0,1, ... , G(n,2j+1)=0, j=0,1, .... 16. Let H (n, k) be the number of k-combinations of n with repetition and the restriction that each element appears an odd number of times. For fixed n, construct a generating function for the sequence H(n, k), k = 0, 1, .... If n = 2r, conclude that

= (r ~ j -

H(2r, 2j)

J-r

1 ), j

= r, r + 1, ... ,

H(2r, 2j) = 0, j = 0, 1, ... , r- 1, H(2r, 2j + 1) = 0, j = 0, 1, ... ,

while if n = 2r + 1, conclude that H(2r + 1, 2j + 1) =

(~ + j),

j = r, r + 1, ... ,

J-T

H(2r+1,2j+1)=0, j=0,1, ... ,r-1, H(2r+1,2j)=O, j=0,1, .... 17. Let B(n, k; s) be the number of k-combinations of the set Wn+I = {wo, w1 , ... , Wn} with repetition and the restriction that the element wo may appear at most s times and each of the other elements at most once. Using a suitable generating function, show that

B(n,k;s)

=

f::

j=O

(k: .), m = min{k,s} J

and

B(n,k;s)-B(n,k-1;s)=(n)-(

k

with B(n, 0; s) = B(n, n

n

k-s-1

),

+ s; s) = 1.

18. Let E 8 (n, k) be the number of k-combinations of n with repetition and the restriction that each element may appear at most s times. Using a suitable generating function, show that

E 8 (n, k) = E 8 (n- 1, k) + E 8 (n- 1, k- 1) + · · · + E 8 (n- 1, k- s), k 2::: s, Es(n, k) = (n + ~- ), k 5: s. 1

6. 7. EXERCISES

227

19. (Continuation). Showthat k

L Es(r,j)E.(n- r, k- j) = E (n, k), 8

j=O

and k

L

(~)Es-I(n-j,k-n+j) =E (n,k),

m=max{O,n-k}.

8

J

J=m

20. Let Pn be the (total) number of permutations of n: n

Pn = L(n)k, n = 0, 1, ... . k=O

Show that

and Pn = nPn-1

+ 1,

n = 1, 2, ... , Po= 1.

21. Let A(n, k) be the number of k-permutations of n with repetition and the restriction that each element appears zero or an even number of times. Using a suitable generating function, show that

A(n, 2s)

=Tnt(~) (n- 2j) 28 , j=O

and, for A1 (r,s) = A(2r

A(n, 2s

+ 1)

= 0, s = 0, 1, ...

J

+ 1,2s),

A2(r,s) = A(2r,2s), that

A 1 (r, s) = (2r + 1){(2r + 1)A 1 (r, s- 1)- 2r AI(r- 1, s- 1)}, A2(r,s) = 2r{2rA 2(r,s -1)- (2r -1)A2(r -1,s -1)}. 22. Let B(n, k) be the number of k-permutations of n with repetition and the restriction that each element appears an odd number of times. Using a suitable generating function, show that

B(2r, 2s) = 2- 2(r-s)+l

i)

2 -1)j ( :) (r- j) 28 , J

j=O

B(2r, 2s + 1)

= 0,

228

GENERATING FUNCTIONS

and

B(2r

+ 1, 2s + 1) =

T

2 (r-s)+l

i)

2 -1)j ( r

+ 1, 2s) =

23. (Continuation). For B 1 (r,s) B(2r, 2s), show that

B 1 (r, s) = (2r

(r- 2j

+ 1/2) 28 + 1 ,

J

j=O

B(2r

~ 1)

0.

= B(2r + 1,2s + 1)

and B 2 (r,s)

+ 1){(2r + 1)B1 (r, s- 1) + 2rBt(r- 1, s- 1)},

and

B 2 (r, s) = 2r{2r B 2 (r, s- 1)

+ (2r-

1)Bz(r- 1, s- 1) }.

24. Let R(n, k) be the number of k-permutations of n with repetition and the restriction that each element appears at most twice. Using a suitable generating function, deduce the recurrence relations

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

and R(n, k with R(n,O)

+ kR(n, k-

1)

+ (~) R(n, k- 2),

= nR(n,k)- nG)R(n -1,k- 2)

+ 2) = n(2n- 1)R(n- 1, k)- n(n- 1)R(n- 2, k)

= 1, R(n, 1) = 1, R(n,2) = n 2 .

25. (Continuation). Let R(n) be the (total) number of permutations of n with repetition and the restriction that each element appears at most twice: 2n

R(n)

=L

R(n, k), n

= 0, 1, ....

k=O

Show that

R(n)- n(2n- 1)R(n- 1) + n(n- 1)R(n- 2) with R(O)

= n + 1,

= 1, R(1) = 3.

26. Parcelling out procedures. Let Kn be the number of ways of parcelling out a stick of n units length into n unitary parts when, at each step, all the parts of length greater than one unit are parceled out into two parts. Show that n-1

Kn

=L

j=l

KjKn-j, n

= 2, 3, ... '

Kt

=1

229

6. 7. EXERCISES

and conclude that 1 Kn = Cn = n

where Cn, n

= 1, 2, ... , are the

(2n2) n-1

, n = 1,2, ... ,

Catalan numbers.

27*. Triangulation of convex polygons. Let Tn be the number of triangulations of a convex n-gon (ways to cut up a convex polygon of n vertices into n- 2 triangles by means of n- 3 non-intersecting diagonals). Show that n-1 Tn = LTkTn-k+l, n = 3,4, ... ' T2 = 1. k=2

Deduce the generating function t

00

T(t) = LTntn =

2 (1- v'f=4t)

n=2

and conclude that

Tn = Cn-1 = n _1 1

(2nn _ 24) ,

n = 2,3, ... ,

where Cn, n = 1, 2, ... , are the Catalan numbers. 28. Convolution of Catalan numbers. Let Cn, n = 1, 2, ... , be the sequence of Catalan numbers. For fixed k = 2, 3, ... , the sequence

c~k)

n-1

= L CjC~~jl)'

n

= 1, 2, ...

'

j=l

with C~ l = Cn, n = 1, 2, ... , is called k-fold convolution of the sequence Cn, n = 1, 2, ... (a) Derive the generating function

1

00

Ck(t)

=L

c~k)tn

= Tk(1- v'f=4t)k

n=l

and (b) deduce the recurrence

c~k)

= c~k+l) + c~~--;l)'

k

= 2,3, ... '

n

= 1,2, ...

'

1

with C~ l = C~2 l = Cn. (c) Show that

C(k) _ ·'· _ 'n:._ n - 'f'n-l,n-k -

(2nn-_k - 1) 1

, n

= 1, 2, ...

, k

= 2, 3, ...

,

GENERATING FUNCTIONS

230

where '1/Jn,k, k

= 0, 1, ...

, n, n

= 0, 1, ... , are the

ballot numbers.

29*. Let Sn be the number of permutations of {1, 2, ... , n} without a succession. If Sn,k is the number of permutations of { 1, 2, ... , n} with k successions, then (see Theorem 5.6)

-1) Sn-k,

Sn,k= ( n k

k=0,1, ... ,n-1, n=1,2, ....

Using this relation and the symbolic calculus, show that

30*. (Continuation). Show that oo

S(t, u)

n

=LL

n=Ok=O

:! n

Sn+l,ktk

= (1- u)- 2 eu(t-l).

31. Determine the sequence of probabilities Pk, k = 0, 1, ... , with factorial moments J.l(r) = _xr, r = 0, 1, ... , where .X > 0.

32. Let k

Sn,k(x,z)=L(x+rz)n, n=0,1, ... , k=0,1, ... r=O Show that

and

33. Let k

Cn,k(x,z) = L(x+rz)n, n=0,1, ... , k=0,1, .... r=O Show that 00 un (1 Ck(u, x, z) = '"""'Cn L... ' k(x, z)n.1 = n=O

+ u)"'[(1 + u)(k+l)z- 1] (1 + u ) z -1

231

6. 7. EXERCISES

and

oo oo

C(t,u,x,z)

tk un

= "'"'cnk(x,z)-k = 1 ~ ~ ' . n.1

n=Ok=O

34. Let an,k

(1

+ u)x((1 + uyet(I+u)• (1 + u )z - 1

= min{n, k}, k = 1, 2, ... , n = 1, 2, ....

- et]

·

Show that

35*. Generating function of the cycles of binomial coefficients. The product ak,r

=

(r+ k) (k + r) k

r

, k

= 0, 1, ...

, r

= 0, 1, ...

,

is called cycle of binomial coefficients of length 2. Show that A(t,u) =

~~ c:k) e;r)tkur = ~~ (r:k)

= ((1- t

+ u) 2 -

4ut 112 .

2

tkur

Chapter 7 RECURRENCE RELATIONS

7.1

INTRODUCTION

Recurrence relations were introduced in Chapter 1, on the basic counting principles, and encountered in several places in subsequent chapters. As has been already noted, in certain enumeration problems, the number of configurations satisfying specified conditions can only be expressed recursively. Also, even when the direct expression of this number in a closed form is possible, a recurrence relation is useful at least for tabulation purposes. This chapter presents the basic methods of solving linear recurrence relations. Specifically, after the introduction of the basic notions of linear recurrence relations, the iteration method is employed to derive the solutions of linear recurrence relations of the first order. This recursive, step-by-step, derivation of the solutions contributes to the understanding of the term recurrence relation. Then, the method of characteristic roots for the solution of linear recurrence relations with constant coefficients is presented. The last section is devoted to the use of generating functions in solving linear recurrence relations with constant or variable coefficients.

7.2

BASIC NOTIONS

Consider a sequence of numbers an, n = 0, 1, ... , and let bo(n)an+r

+ bl(n)an+r-1 + · · · + br(n)an =

u(n), n = 0, 1, ... , (7.1)

where u(n) and the coefficients bj(n), j = 0, 1, ... , r, with b0 (n) -:j:. 0 and br(n) -:j:. 0, are given functions of n. Recurrence relation (7.1) is called linear recurrence relation of order r. If u(n) = 0, n = 0, 1, ... , (7.1) is called homogeneous; otherwise is called complete. If the coefficients are

RECURRENCE RELATIONS

234

constant (independent of n), bj(n) = bj, j = 0, 1, ... , r, n = 0, 1, ... , (7.1) is called linear recurrence relation of order r with constant coefficients. In the case of a double-index sequence an,k, n = 0, 1, ... , k = 0, 1, ... , the recurrence relation bo,o(n, k)an+r,k+s

+ bo,1 (n, k)an+r,k+s-1 + · · · + br,s(n, k)an,k = u(n, k), (7.2)

=

=

n 0, 1, ... , k 0, 1, ... , where u(n, k) and the coefficients b;,j(n, k), i = 0, 1, ... , r, j = 0, 1, ... , s, with bo,o(n, k) =f. 0 and br,s(n, k) =f. 0, are given functions ofn and k, is called linear recurrence relation of order (r, s). Solution of recurrence relation (7.1) or (7.2) in a set S is called a se-

quence that makes this equation an identity in S. A general solution of recurrence relation (7.1) includes r arbitrary constants. The knowledge of the r initial conditions (values) ao, a 1 , •.. , ar- 1 specifies the constants and makes the solution unique. In the case of recurrence relation (7.2), the knowledge of the r + s initial conditions (sequences) ao,k, a 1,k, ... , ar-I,k and an,o, an, 1 , ... , an,s- 1 guarantees the uniqueness of its solution. Let us now consider the homogeneous linear recurrence relation of order r corresponding to (7.1): bo(n)an+r

+ b1(n)an+r-I + · · · + br(n)an =

0, n = 0, 1, ... ,

(7.3)

where the coefficients bi(n), j = 0, 1, ... ,r, with b0 (n) =f. 0 and br(n) =f. 0, are given functions of n. Note that, if a 1 (n) and a 2 (n) are any solutions of (7.3), then c 1 a 1 (n)+cza 2 (n), where c1 and cz are arbitrary constants, is also a solution of (7.3). In general, it can be shown that the set of solutions of (7.3) constitutes a linear r dimensional vector space. Note that r solutions a 1 (n ), az (n ), ... , ar( n) of (7.3) are linearly independent if and only if their Wronski determinant az(n) az(n + 1)

Wr(n) = a1

(n

+ r- 1)

a 2 (n

+ r-

1) .. · ar(n

+ r-

1)

is different from zero for some index n = m. Consequently, if the r solutions a 1 (n), a 2 (n), ... , ar(n) of the homogeneous linear recurrence relation of order r (7.3) are linearly independent, then they constitute a base for the r dimensional linear vector space of its solutions. Further, every solution of (7.3) is of the form (7.4)

where c1 , c2 , ...

, Cr

are arbitrary constants. The solution (7.4) is called

general solution of (7.3). In the case where r values am, am+1, •.. , am+r-I

7.3. RECURRENCE RELATIONS OF THE FIRST ORDER

235

are given, the system

c1a1(m) + c2a2(m) + · · · + Crar(m) =am, c1a1(m + 1) + c2a2(m + 1) + · · · + Crar(m

+ 1) = am+l,

since Wr(m) -1- 0, has a unique solution with respect to c 1 ,c2 , ... ,cr. Introducing this solution into (7.4), the unique solution of (7.3) is deduced. Further, if w(n) is a particular solution of the complete linear recurrence relation of order r (7.1), then, according to the preceding analysis, it follows directly that

is the general solution of (7.1).

7.3

RECURRENCE RELATIONS OF THE FIRST ORDER

Let us first consider the complete linear recurrence relation of the first order with variable coefficient, an+l- b(n)an = u(n), n

= m,m + 1, ...

,

(7.5)

where b(n) f::- 0, n = m,m + 1, ... and m is a given nonnegative integer. The solution of this recurrence relation is deduced in the following theorem by employing the iteration method. This recursive, step-by-step, derivation of the solution serves to the better understanding of the term recurrence relation.

THEOREM7.1 The solution of the linear recurrence relation (7.5 ), with am a given initial condition, is n-2

an= ambn-l,m

L

+

u(r)bn-l,r+l

+ u(n- 1),

(7.6)

r=m

for n

= m + 1, m + 2, ... , where n

bn,r =

II b(k). k=r

(7.7)

RECURRENCE RELATIONS

236

PROOF

Introducing the transformation

hn

= an/bn-l,m,

n

= m + 1, m + 2, ...

, hm =am

and setting w(n) = u(n)/bn-l,m• n = m,m + 1, ... , recurrence relation (7.5) is transformed to the recurrence relation

hn+l=hn+w(n), n=m,m+1, ... , where hm = am is a given initial condition. Iterating (applying repeatedly) this recurrence, we get hm+l = hm + w(m), hm+2 = hm+l + w(m + 1) = hm + w(m) + w(m + 1)

and

hn+l = hn + w(n) = {hm + w(m) + w(m + 1) + · · · + w(n- 1)} + w(n). Consequently, n

hn+l=hm+Lw(r), n=m,m+1, .... r=m

Returning to the sequence an, n = m, m the inverse transformation

+ 1, ... , the last expression, upon using

and since u(n) = w(n)bn-l,m• n = m, m

+ 1, ... , implies

n-l an+l = ambn,m + L u(r)bn,r+l + u(n), n = m, m + 1, ... , r=m

which is the required expression with n

I

+ 1 instead of n.

The solution of the complete linear recurrence relation of the first order with constant coefficient,

an+l -ban= u(n), n = m, m

+ 1, ...

,

(7.8)

where b -::/:- 0, n = m, m + 1, ... and m is a given nonnegative integer, is readily deduced from Theorem 7.1 by setting b(n) = b, n = m, m + 1, ... . Also, its particular case with u(n) = u constant for all n = m, m + 1, ... , upon using the geometric progression summation formula, is concluded. These solutions of (7.8) are given in the following corollary.

7.3. RECURRENCE RELATIONS OF THE FIRST ORDER

237

COROLLARY 7.1 The solution of the linear recurrence relation (7.8), with am a given initial condition, is

n-1

an

L u(r)bn-r-!,

= ambn-m +

= m + 1, m + 2,...

n

.

(7.9)

r=m

In particular; with u(n)

an

= u constant for all n = m, m + 1, ... ,

= { ambn-m + U · (1- bn-m)/(1- b),

b-::/:- 1,

am+ u · (n- m), b = 1, for n = m

(7.10)

+ 1, m + 2, ....

REMARK 7.1 If the term am is not given, (7.6) with am = c, an arbitrary constant, constitutes a family of solutions, which is the general solution of recurrence relation (7.5). Similarly, (7.9) and (7.10) with am = care the respective general I solutionsof(7.8).

Example 7.1 Tennis tournament Let 2n players participate in a singles tennis tournament. Determine, by the aid of a recurrence relation, the number an of different pairs that can be formed for the n matches of the first round. Consider the player with the number 2n in the list. This player can be paired with any of the other 2n- 1 players. Since an-! different pairs can be formed by the remaining 2(n - 1) players for the other n - 1 matches of the first round, it follows that an = (2n- 1)an-1, n = 2, 3, ... , a1 = 1.

This is a homogeneous linear recurrence relation of the first order with variable coefficient. Thus from (7.6), with m = 1, u(n) = 0, b(n) = 2n + 1, n = 1, 2, ... , and a 1 = 1, we deduce the expression

an

= 1 · 3 · · · (2n- 1),

n

= 1, 2, ....

Mulliplying it by 2 · 4 · · · 2n = 2nn! and dividing the resulting expression by the same number, we find the following equivalent expression for an: 1· 2. 3 ... (2n- 1)(2n)

2nn!

(2n)!

= 2nn! ,

n == 1, 2, .. ..

D

Example 7.2 Regions of a plane Determine, using a recurrence relation, the number an of regions into which a plane is separated by n circles, with each pair of circles intersecting in exactly two points and with no triple of circles having a common intersecting point.

RECURRENCE RELATIONS

238

Consider n circles on a plane, with each pair of circles intersecting in exactly two points and no triple of circles having a common intersecting point. Then these circles separate the plane into an regions. Now add another circle, which intersects each of the n circles at exactly two points and does not intersect any pair of circles at any of their intersecting points. Thus, this circle intersects the n circles at a total of 2n points, passing through 2n regions. Each of these regions is separated into two regions. Consequently, the addition of the (n + 1)st circle increases the number of regions by 2n and so

an+1

= an +

2n, n

= 1, 2, ... ,

a1

= 2.

This is a complete linear recurrence relation of the first order with constant coefficient. Hence, from (7.9), with m = 1, b = 1, a 1 = 2 and u(r) = 2r, we deduce the expression

n-1 an= 2+2Lr, r=1

which, upon using the arithmetic progression summation formula, reduces to

an= n(n- 1)

+ 2,

n

= 1, 2,...

.

0

Example 7.3 The transfer of the Hanoi tower Consider three pegs A, B and C and n cyclic discs of different diameters {d 1, d 2 , ... , dn}. with d 1 < d2 < · · · < dn. Initially, the discs are placed on peg A in decreasing order of size from the bottom to the top. Let an be the minimum number of movements of discs required for the transfer of the tower from peg A to peg B, using peg C as an auxiliary, under the restriction that, in each movement, only one disc is transferred and no disc is placed over a disc of smaller size. In order to find a recurrence relation for an, note that then- 1 discs { d 1 , d2, ... , dn- 1} of the tower can be transferred to peg C after an- 1 movements. Then, in one movement, the last disc dn is transferred from peg C to peg B. Finally, the tower of then- 1 discs is transferred from peg C to peg B, over the disc dn, after an-1 movements. Consequently,

an

= 2an-1 + 1,

n

= 2, 3, ...

, a1

= 1.

This is a complete recurrence relation of the first order with constant coefficient. Hence, from (7.10), with m = 1, a 1 = 1 and u = 1, we get

an

= 2n-1

- (1 - 2n-1)

= 2n- 1.

According to legend, at the creation God established the tower of Hanoi at the temple of Benares with n = 64 gold discs. Since then, the tower is being transferred by priests, with the prediction that when the transfer of the tower is completed the world will vanish. Note that a2 = 3, a3 = 7, a 4 = 15, a 1s = 65,535, a32 = 4,294,967,295 and as 4 = 18,446,744,073,709,551,615. 0

7.4. THE METHOD OF CHARACTERISTIC ROOTS

7.4

239

THE METHOD OF CHARACTERISTIC ROOTS

Let us first consider the homogeneous linear recurrence relation of the second order with constant coefficients: (7.11) where b2 =f. 0 and m is a given nonnegative integer. Clearly, a sequence of the form a(n) = pn, n = m, m + 1, ... , is a solution of (7.11) if and only if p is a root of the equation

tn+ 2

+ b1tn+1 + b2tn = 0.

Dividing both sides of this equation by tn, for t equation of the second order,

=f. 0,

we obtain the following (7.12)

which is called the characteristic equation of the recurrence relation (7.11). Further, the discriminant bt- 4~ of the characteristic equation determines the kind of its roots. Specifically, if bt- 4b2 > 0, (7.12) has two distinct real roots, PI=

-b~ -

..Jbr - 4b2 2

, P2 =

-bi +

..Jbr - 4b2 2

,

while, if bi -4b2 = 0, it has one double root p = -bi/2. Also, ifbt-4b2 (7.12) has two conjugate complex roots Pl =

< 0,

-bi- i..J4b2- bi -bl + i..J4b2- bi , P2 = , 2 2

where i = A is the imaginary unit. These complex numbers, on using the length p = b2 and argument 0, with tanO = -..J4b1 - bi/b1, may be written in trigonometric form as PI =p(cosB+isinO), p 2 =p(cosO-isinO). The general solution of recurrence relation (7.11) depends on the kind of roots of the characteristic equation (7.12). More precisely, we prove the following theorem. THEOREM7.2 The general solution of the homogeneous linear recurrence relation of the second order with constant coefficients, (7. 11 ), is given by (7.13)

RECURRENCE RELATIONS

240

where c 1 and c2 are arbitrary constants. Further, (7.12) has: (a) two distinct real roots Pl and p2 , then

if the characteristic equation

(7.14)

(b) one double root p, then (7.15)

(c) two conjugate complex roots Pl and P2 = and -0, respectively, then

p1 ,

with length p and argument() (7.16)

PROOF (a) Since p 1 and p2 are roots of the characteristic equation (7.12), a 1 ( n) = pf and a 2 ( n) = p~ are solutions of (7 .11 ). The Wronski determinant of these solutions is

with p 1 P2 "/:- 0, since b2 "/:- 0, and Pl "/:- P2. Hence, W2 (n) "/:- 0 and so the solutions in (7.14) constitute a base of the two-dimensional linear vector space of the solutions of (7 .11 ). (b) Since pis a solution of the characteristic equation (7.12), a(n) = pn is a solution of (7 .11 ). A base of the two-dimensional vector space of the solutions of (7 .11) is composed of two linearly independent solutions. In order to determine them, we set (7.17) where hn, n = m, m (7.11), we get

+ 1, ... , is a sequence to be determined. 2 p hn+2

Introducing it into

+ b1phn+l + b2hn = 0,

and, since b1 -2p, b2 = p 2 , with p "/:- 0, we deduce for hn, n m + 1, ... , the recurrence relation hn+2 - 2hn+l

+ hn = 0, n = m, m + 1, ....

Putting hn+l - hn

= 9n,

n

= m, m + 1, ...

)

we get the homogeneous linear recurrence relation of the first order 9n+l- 9n

= 0,

n

= m, m + 1, ...

,

m,

7.4. THE METHOD OF CHARACTERISTIC ROOTS

241

the general solution of which, according to Remark 7 .l, is given by Yn = c1, n = m, m

+ 1, ....

Consequently,

hn+l-hn=CI, n=m,m+1, .... The general solution of this recurrence relation, again according to Remark 7.1, is given by hn = c1 + c2n, n = m, m + 1, .... Introducing this general solution into (7.17), we deduce the required expression of the general solution of (7.11). Note that the Wronski detenninant of the solutions a 1 (n) = pn and a2(n) = npn is given by

and since p ;f. 0, W 2 (n) ;f. 0. (c) Since p and p 2 = ih are conjugate complex roots of the characteristic equation (7.12), an = pf and iin = pf are conjugate complex solutions of (7.11), which may be written in trigonometric fonn as

an = pn cos( nO) + ipn sin( nO), lin = pn cos( nO) - ipn sin( nO). Interested only in the real solutions of recurrence relation (7.11), it is necessary to isolate them. In this respect, note that, if an = a 1(n) + ia2 (n) is a complex solution of the characteristic equation (7 .12), then each of a 1(n) and a2 (n) is also a solution of the same equation since [a 1(n + 2) + b1a 1(n + 1) + b2a 1(n)] +i[a 2(n + 2) + b1a 2 (n + 1) + b2a2(n)]

= 0,

n = m, m + 1, ... ,

implies

and

a2(n + 2) + b1a2(n + 1) + b2a2(n)

= 0,

Consequently, a1 (n) = pn cos( nO), a2(n)

n = m, m + 1, ....

= pn sin(nO)

are two real solutions of (7 .11 ). The Wronski determinant of these solutions is given by

I

pn sin( nO) pn+I sin(nO

+ 0)

RECURRENCE RELATIONS

242

Thus, W 2 (n) = ln+ 1 [cos(n0) sin( nO+ 0)- sin( nO) cos( nO+ 0)]

and since sin(nO + 0) = sin(nO) cos 0 +cos( nO) sin 0, cos( nO+ 0) =cos( nO) cos 0- sin(nO) sin 0, the Wronski determinant reduces to W2(n) = ln+I sinO[cos 2 (nO) + sin 2 (n0)] = /n+l sinO,

which, by virtue of p f:- 0 and sin 0 f:- 0, implies W 2 ( n) ¥- 0. Hence, the solutions in (7 .16) constitute a base of the two-dimensional linear vector space of I the solutions of (7 .11) and the proof of the theorem is completed.

Example 7.4 Gambler's ruin A gambler plays a series of games of chance against a casino (or against an adversary). In any game the probability of the gambler to win $1 is p and to loose $1 is q = 1 - p. Assume that initially the gambler possesses n dollars and the casino (or his adversary) possesses k- n dollars. Find the probability Pn of the gambler's ruin. In the first game, the gambler may either win or loose $1, with probabilities p and q, respectively. If he wins the first game, then his fortune is increased ton+ 1 and so his ruin probability becomes Pn+l· If he looses the first game, his fortune is decreased to n - 1 and so his ruin probability becomes Pn-l· Hence Pn = PPn+l

+ QPn-1,

n = 1, 2, ... , k- 1

or PPn+2 - Pn+l

+ QPn = 0,

n

= 0, 1, ...

, k- 2,

with Po= 1, Pk

= 0.

This is a linear recurrence relation with constant coefficients. The roots of its characteristic equation, 2 pt - t + q = 0, are PI = 1 and P2 = qfp. If p ¥- 1/2, whence q ¥- 1/2, these two roots are distinct, while if p = 1/2, whence q = 1/2, p2 = p 1 = 1. Thus, according to Theorem 7 .2, the general solution of the recurrence relation: (a) for p ¥- 1/2 is

= C1 + C2 ( q / P) n,

Pn

n

= 0, 1, ...

, k,

while (b) for p = 1/2 is Pn = c1 +c2n, n = 0,1, ... ,k.

7.4. THE METHOD OF CHARACTERISTIC ROOTS

Using the initial conditions we get: (a) for p

243

-:f. 1/2,

C1 + C2 = 1, C1 + C2(qfpl = 0, whence

Ct =

(qjp)k 1 1- (qjp)k' C2 = 1- (qjp)k'

while (b) for p = 1/2,

c1 = 1, c1 + c2 k = 0, whence

c1 = 1, c2 = -

1

k.

Consequently, the solution of the recurrence relation that satisfies the initial conditions: (a) for p -:f. 1/2 is

Pn

=

(qjp)n _ (qjp)k , n _ (qjp)k 1

= 0, 1, ... , k

and (b) for p = 1/2 is

k-n

Pn = -k-' n = 0, 1, ... , k.

D

Example 7.5 Determine the sequence an, n = 0, 1, ... , for which the general term is the arithmetic mean of its two preceding terms and the first two terms are 0 and 1. The sequence an, n = 0, 1, ... , according to its definition, satisfies the linear recurrence relation 1

an= 2(an-t + an-2), n = 2, 3, ... , or

2an+2 - an+t -an = 0, n = 0, 1, ... , with initial conditions a 0

= 0 and a 1 = 1. The roots of the characteristic equation, 2t 2

-

t- 1 = 0,

are Pt = 1 and P2 = -1/2. Thus, according to Theorem 7.2, the general solution of the recurrence relation is

( -l)n an=c1+c2--, n=0,1, .... 2n The initial conditions require that 1

c1 + C2 = 0, C1 - 2C2 = 1.

RECURRENCE RELATIONS

244

Hence

and

Let us now consider the complete linear recurrence relation of the second order with constant coefficients:

(7 .18) where b2 i 0 and m is a given nonnegative integer. According to what was stated in Section 7.2, if c 1 a 1 (n) + c2a 2(n), n = m, m + 1, ... , is the general solution of the corresponding homogeneous linear recurrence relation (7.11) and w(n), n = m, m + 1, ... , is a particular solution of (7.18), then the general solution of (7.18) is given by

Consequently, the derivation of a particular solution of (7.18) is what remains to be done. Consider the case

u(n)=bntuj(~),

n=m,m+1, ... ,

(7.19)

J

j=O

where b and ui, j = 0, 1, ... , s, are constants. The method of arbitrary constants for the derivation of a particular solution of (7.18) is stated in the following theorem. THEOREM7.3 A particular solution of the complete linear recurrence relation of the second order with constant coefficients (7.18) in the case the function u(n) is given by (7.19), with b a root of the characteristic polynomial ¢(t) = t 2 + b1 t + b2 of multiplicity k ~ 0, is given by

w(n) = bn-k

I: j=k

Wj

(~),

n = m, m

+ 1, ...

, k = 0, 1, 2,

(7.20)

J

where the coefficients Wj. j = k, k of the s + 1 equations: (a) fork= 0,

+ 1, ...

,k

+ s, are determined by the system

7.4. THE METHOD OF CHARACTERISTIC ROOTS

1/J(b)ws-1 ¢(b)wj

+ b¢' (b)ws

=

+ b¢'(b)wj+ 1 + b2wj+2 = Uj,

245

(7.21)

U 8 -I,

j

= 0, 1, ...

, s- 2,

(b)for k = 1.

¢'(b)wj+I

+ bwj+2 = Uj,

j

= 0, 1, ...

, s- 1,

(7.22)

(c)fork=2, Wj+2=Uj, j=0,1, ... ,s,

(7.23)

with ¢'(b) the derivative of the characteristic polynomial ¢(t) at the point t =b. PROOF Introducing (7.19) into (7.18) and requiring (7.20) to satisfy theresulting recurrence relation, we get

Using the recurrence relations

and

we deduce the relation

+b1b

~ Wj (~) + b1b ~ Wj ( . : ) 1 j=k J j=k J

+ b2 ~ Wj (~) j=k

J

= bk

t

Uj

j=O

(~). J

Introducing the characteristic polynomial ¢(b) = b2 + b1b + b2 and its derivative 1/J'(b) = 2b + b1 , we get

~ ¢(b)wj (~) +I:j=k b¢'(b)wj (J. : 1) J=k J

+I:

t

(~).

2 b wi ( . : ) = bk Uj j=k J 2 j=O J

Equating the coefficients of the binomials {]) of both sides of this expression and since (a) fork = 0, ¢(b) f. 0, (b) fork = 1, ¢(b) = 0, ¢'(b) f. 0 and

RECURRENCE RELATIONS

246

=

0, ¢>'(b)

2, ¢>(b) (c) fork respectively. I

= 0,

we conclude (7.21), (7.22) and (7.23),

Example 7.6 Expected time to gambler's ruin Consider the gambler's ruin problem of Example 7.4 and let dn be the expected value of the number of games until the gambler is ruined. Derive a recurrence relation for dn and from that deduce an explicit expression for the expected time to gambler's ruin. In the first game, the gambler may either win or loose $ 1, with probabilities p and q, respectively. If he wins the first game, then his fortune is increased ton+ 1 and, after that game, the expected time to his ruin becomes dn+i· If he looses the first game, his fortune is decreased to n - 1 and, after that game, the expected time to his ruin becomes dn-i· In both cases, adding the first game we deduce the following recurrence relation

dn = p(dn+l

+ 1) + q(dn-i + 1),

n = 1, 2, ... , k- 1,

or

dn+2- (1/p)dn-1

+ (qfp)dn

= -1/p, n = 0, 1, ... , k- 2,

with initial conditions

do= 0, dk = 0. This is a complete linear recurrence relation with constant coefficients. The general solution of the corresponding homogeneous recurrence relation,

dn+2 - (1/p)dn+l

+ (qfp)dn

= 0, n = 0, 1, ... , k- 2,

according to Example 7.4: (a) for p -:j: 1/2 is

while (b) for p = 1/2 is

dn = c1

+ c2n,

n

= 0, 1, ...

, k.

The function u( n) of the complete linear recurrence relation is of the form (7 .19), with b = 1, s = 0 and u 0 = -1/p. Note that (a) if p "1- 1/2, b = 1 is a simple root (k = 1), while (b) if p = 1/2, b = 1 is a double root (k = 2) of the characteristic polynomial ¢>(t) = t 2 - (1/p)t + (qfp). Thus, according to Theorem 7.3, a particular solution of the complete linear recurrence relation with constant coefficients: (a) for p "1- 1/2 is given by w(n) = w 1 n, where, by (7.22) and since ¢>'(1) = (2p- 1)/p. we get w 1 = 1/(1- 2p) and so

n w(n) = 1- 2p'

7.4. THE METHOD OF CHARACTERISTIC ROOTS

247

Also, a particular solution (b) for p = 1/2 is given by w(n) = w 2 n(n- 1)/2, where, by (7.23), w 2 = -2 and so

w(n)

= -n(n- 1).

Consequently, the general solution of the complete linear recurrence relation with constant coefficients: (a) for p ::/- 1/2 is given by

dn = c1

+ c2

(~) n + 1 .:: 2P,

n = 0, 1, ... , k,

while (b) for p = 1/2 is given by

+ c2n- n(n- 1),

dn = c1

n = 0, 1, ... , k.

Using the initial conditions, we get (a) for p ::/- 1/2, Ci

k + C2 = 0, Ci + C2 ( -q)k + - - = 0,

p

1- 2p

whence

k c~----·

-

1- 2p

k 1 1 --· ' 1 - (qfp)k, c 2 = 1 - 2p 1 - (qjp)k

while (b) for p = 1/2. c1=0, c2k-k(k-1)=0, whence C1 = 0, C2 = (k- 1). Therefore, the unique solution of the complete linear recurrence relation: (a) for p ::/- 1/2 is given by

dn

= _n_ 1- 2p

_ _ k_ . 1- (qfp)n -----'---'-:----'---,-k n 1- 2p 1- (qjp) ,

= 0, 1, ... , k

= n(k- n),

, k.

and (b) for p = 1/2 is

dn

n

= 0, 1, ...

0

Let us finally consider the general case of the linear recurrence relation of the r-th order with constant coefficients:

an+r

+ blan+r-1

+···+bran= u(n), n

= m, m + 1, ...

,

(7.24)

RECURRENCE RELATIONS

248

where br -1- 0 and m is a given nonnegative integer. Let

u(n)=bntuj(~),

n=m,m+1, ....

(7.25)

J

j=O

The corresponding homogeneous linear recurrence relation of the r-th order with constant coefficients is given by (7.26)

where br -1- 0 and m is a given nonnegative integer. The characteristic polynomial of this recurrence relation is (7.27)

The general solution of (7.26) and a particular solution of (7.24) in the case where u(n) is given by (7.25) are stated in the following two theorems. The proofs, similar to the proofs of Theorems 7.2 and 7.3, respectively, are omitted. THEOREM7.4 The general solution of the homogeneous linear recurrence relation of orderr with constant coefficients, (7.26), is given by Vt

an =

""'( L....., Cj,l

+ Cj,2n + ... + Cj,k;n k·-1) ] Pjn

j=l V2

+

L

(cj,l + Cj,2n + · · · + Cj,k;nk;- 1 )p'J cos(nOi)

j=v+l V2

1 + ""' )pnJ sin(nO·) L....., (d·1 ], + d·], 2n + .. · + d·J, k·nk;] J ' j=v+l

where Pi is a real root of the characteristic polynomial (7.27) of multiplicity ki ~ 0, j = 1,2, ... ,v 1 , withk 1 +k2 + ... +kv1 = vandpj(cosOi +isinBj) is a complex root of multiplicity ki ~ 0, j = v + 1, v + 2, ... , v 2, with 2(kv+l + kv+2 + ... + kv2) = r - v.

THEOREM7.5 A particular solution of the complete linear recurrence relation of order r with constant coefficients, (7.24 ), in the case the function u( n) is given by (7.25 ), with b a root of the characteristic polynomial (7.27) of multiplicity k ~ 0, is given by w(n) = bn-k

k+s L j=k

Wj

(

~) J

,

n = m, m

+ 1, ...

, k = 0, 1, ... , r,

7.4. THE METHOD OF CHARACTERISTIC ROOTS

where the coefficients Wj, j = k, k of the s + 1 equations s

L

+ 1, ...

,k

+ s are determined by the system

bv-j (v

+k

249

_ j)!(v+k-j)(b)wv = Uj, j

= 0, 1, ... , s,

II=J

with (v+k-j) (b) denoting the derivative of order v polynomial¢(t) at the point t = b.

+k

- j of the characteristic

Example 7.7 Determine the general solution of the recurrence relation

This relation is written as

which is a complete linear recurrence relation of the fourth order with constant coefficients. The corresponding homogeneous recurrence relation is

Its characteristic polynomial is given by ¢( t) = t 4

-

2t3 + 2t 2

-

2t + 1.

Note that ¢(1) = 0 and ¢'(t) = 2(2t3 - 3t2 + 2t- 1), whence ¢'(1) = 0. Thus p = 1 is a double real root of the characteristic polynomial. Dividing it by (t- 1 ) 2 we deduce the expression

which implies that the characteristic polynomial also has the conjugate complex roots Pl = i and P2 = -i, with i = A. The complex root Pl = i has length I and argument 0 = 1r /2. The general solution of the homogeneous recurrence relation, according to Theorem 7 .4, is given by

an= c1 + c2n

+ c3 cos(nn/2) + c4 sin(nn/2),

n

= 0, 1, ....

Further, the function u(n) = (5n- 2)2n of the complete recurrence relation is of the form (7.25), with b = 2, s = 1, u 0 = -2 and u 1 = 5. Thus, from Theorem 7.5 and since b = 2 is not root of the characteristic polynomial, whence k = 0, we conclude that w(n) = (wo +w1n)2n, n = 0, 1, ...

RECURRENCE RELATIONS

250

is a particular solution of the complete recurrence relation. The coefficients w 0 and w 1 are determined from the equations: ¢(2)wl Since u 0

= u1,

¢(2)w0

+ 2¢' (2)wl = uo.

= -2, u 1 = 5, ¢(2) = 5 and¢' (2) = 5wl = 5, 5wo

14, these equations become

+ 28w1

= -2

and so w 1 = 1 and w0 = -6. Therefore, w(n) = (n- 6)2n and the general solution of the complete recurrence relation is given by an = c 1 + c 2 n forn=0,1, ....

7.5

+ c3 cos(mr /2) + c4 sin(mr /2) + (n- 6)2n,

0

THE METHOD OF GENERATING FUNCTIONS

In Chapter 6, we have examined how generating functions may be used in coping with combinatorial problems. The direct determination of generating functions by invoking the assumptions and restrictions imposed by these problems was a crucial characteristic of many of them. However, a direct determination of a suitable generating function is not always possible. In many problems, a linear recurrence relation for the sequence of the numbers under consideration can be derived by appealing to the assumptions and restrictions imposed by them. We have already dealt with several such problems. In this way, the interest is converted to the solution of a linear recurrence relation. In this section, generating functions are used in solving a linear recurrence relation of order r with constant or variable coefficients and a bivariate linear recurrence relation of order (r, s) with constant coefficients. Let us, first, consider the linear recurrence relation with constant coefficients, (7.28) where b0 ::/:- 0, br ::/:- 0 and u(n), n = 0, 1, ... , is a given sequence (function) of n. The determination of~ sequence ak, k = 0, 1, ... , satisfying this recurrence relation requires the knowledge of r initial values ao, a1, ... , ar-1· Since the coefficients b0 , b1, ... , br-l are known, the numbers k ck

= l:aJbk-j, j=O

k

= 0, 1, ...

,r -1

(7.29)

7.5. THE METHOD OF GENERATING FUNCTIONS

251

can be calculated. The derivation of the solution ak, k = 0, 1, ... , of (7.28) by using a generating function is carried out in two steps. At the first step, on using (7.28) and its initial values, the generating function of the sequence ak, k = 0, 1, ... is derived in the next theorem. THEOREM7.6 Letak, k = 0, 1, ... , be a sequence satisfying the linear recurrence relation (7.28). Then the generatingfunction 00

A(t)

= L>ktk,

(7.30)

k=O is given by A()= C(t) + trU(t) t Br(t) '

(7.31)

where r

r-1

Br(t) = L>ktk, C(t) = :~:::>ktk k=O k=O

(7.32)

and 00

U(t) =

L u(n)tn.

(7.33)

n=O

PROOF

bo

Multiplying (7.28) by tn+r and summing for n = 0, 1, ... , we get

00

00

00

00

n=O

n=O

n=O

n=O

2: an+rtn+r +b1t 2: an+r-ltn+r-l +·. ·+brtr L:antn = tr 2: u(n)tn.

Since

oo

s-1

L an+stn+s = A(t) - L aktk'

s = 1, 2, 'r, n=O k=O upon introducing the generating functions (7 .30) and (7 .33), we deduce the relation

and so

0

0

0

RECURRENCE RELATIONS

252

Clearly, on using (7.29) and (7.32), we deduce expression (7.31).

I

After the derivation of expression (7.31) for the generating function A(t), the next step is the determination of the sequence ak, k = 0, 1, ... , which requires the expansion of the right-hand side of (7.31) into powers oft. Note that the polynomial Br(t) is connected with the characteristic polynomial r

L bktr-k

c/>r(t) =

k=O by the relation Br(t) = tr¢>r(1/t).

Further, when the r initial values

a 0,a1, ... ,ar-l are not given, the numbers ck, k = 0,1, ... ,r -1, de-

fined by (7.29), enter in expression (7.31) of the generating function and, consequently, in the solution of (7.28) as r arbitrary constants. In order to expand the generating function (7.31), we express it as a sum of algebraic fractions of the form, c/(1- pt)k, by the aid of the method of partial fractions. Specifically, if p 1 , P2, ... , Ps are the roots of the characteristic polynomial ¢>r (t), with multiplicities m 1 , m 2 , ... , m 8 , respectively, so that m1 + m2 + · · · + m 8 = r, then

c/>r(t)

= bo(t- PI)m' (t- P2)m

2

• • •

(t- Ps)m•

and the denominator in (7.31) is factored as follows:

Br(t)

= bo(1- p1t)m' (1- P2t)m

2

• • •

(1- p8 t)m•.

Therefore, the generating function (7.31) may be written in the form 8

( )

A t =

s

fflj

~~

""'""'

Ck,j

(1- Pit)k

II 1 t U(t) i=l (1- Pit)m;'

-1 r

+ bo

where ck,j, k = 1,2, ... ,mj, j = 1,2, ... ,s, are constants to be determined from the system of r equations that follows from the equation of the coefficients of tk, for k = 0, 1, ... , r- 1, in both members of the identity

C(t) - ~ ~ Ck,j Br(t) - L..t L..t (1 - p ·t)k · ]=l k=l J The generating function A(t), on using Newton's general binomial formula, may be expanded into powers of t as

7.5. THE METHOD OF GENERATING FUNCTIONS

253

Thus

an=

t,~Ck,je::~ 1)pj +b0

1

~ u(n- k- r) k=O

LIT (mj:. ~; j=l

1

)P7

3

,

(7.34)

J

where, in the inner sum of the second summand, the summation is extended over all n 3 = 0, 1, ... , k, j = 1, 2, ... , s, with n 1 + n 2 + · · · + n 8 = k. The use of generating functions in solving linear recurrence relations is illustrated in the following examples.

Example 7.8 Fibonacci numbers revisited Consider n points, each being either 0 or 1, and let Qn be the number of arrangements of them in a row so that no two zeros are consecutive. The numbers Ia = 1, II = 1, In = Qn-1• n = 2, 3, ... , are the Fibonacci numbers (see Example 2.28). Derive a recurrence relation for the numbers ln. n = 0, 1, ... , and solve it by using a generating function. In order to derive a recurrence relation for the numbers ln. n = 0, 1, ... , note that, in an arrangement of n points in a row, each being either 0 or 1 so that no two zeros are consecutive, the first position is occupied either by 1 or by 0. If it is occupied by 1, then there are In arrangements of the remaining n - 1 points so that no two zeros are consecutive. If the first position is occupied by 0, the second position is necessarily occupied by 1 and then there are ln-l arrangements of the remaining n - 2 points so that no two zeros are consecutive. Therefore, according to the addition principle, we deduce the following recurrence relation

In+ 1 = In + In-l, n

= 3, 4, ....

In particular, for n = 1, 2 we have the initial conditions h = 2, h = 3. Note that these initial conditions can be replaced by the values of Ia and II, which it should be noted that they do not have any combinatorial meaning. The values Ia and II are deduced from the extension of the recurrence relation at the point n = 1: h - h - II = 0, whence II = h - h = 3 - 2 = 1 and at the point n = 2: h - II - Ia = 0, whence Ia = h - II = 2 - 1 = 1. Thus, we may have the second order recurrence relation with constant coefficients,

ln+2-

ln+l -In= o, n = o, 1, ...

(7.35)

and initial conditions Ia = 1 and !I = 1. Using recurrence relation (7.35) and its initial conditions, Table 7.1 of Fibonacci numbers ln. n = 0, 1, ... , 14, is constructed.

RECURRENCE RELATIONS

254

Table 7.1

Fibonacci Numbers

0

2 2

3 3

4 5

5 8

6 13

7 21

8 34

9 55

10 89

II 144

12 233

13 377

14 610

The generating function

n=O is determined by multiplying the recurrence relation (7.35) by tn+ 2 and summing forn = 0, 1, .... Then 00

L

fn+2tn+ 2 - t

n=O and

00

00

n=O

n=O

L fn+ltn+I- t2 L

fntn = 0

[F(t)- 1- t] - t[F(t) - 1]- t 2F(t)

= 0,

whence

F(t) =

1 • 1 - t - t2

(7.36)

In order to expand it into powers of t, we calculate the roots of the characteristic polynomial (h(t) = t 2 - t- 1. These roots are

PI

1+VS

= --2-,

P2

1-vs

= --2-

and so

Then, the generating function (7.36) is written in the form 1

F(t) where

CI

C1

C2

= (1- Pit)(1- p2t) = 1- Pit+

and c2 are constants to be determined. Since

these constants satisfy the following system of equations: C1

+ C2

= 1,

C1{J2

+ C2Pl

= 0.

1- P2t'

7.5. THE METHOD OF GENERATING FUNCTIONS

Therefore, C1

P1

P1

= --'-P1- Pz

v's'

cz

Pz

255

Pz

= - -Pl.....:....:_'--P-2 = - v'5

and

whence

!.=

v'5r-('- v'5rl

~{ (1+2

2

n=D,i, ... ·

0

Example 7.9 Partial sums Consider a sequence ak, k = 0, 1, ... , and let 00

A(t) = L aktk. k=O

The sequence of partial sums n

sn=Lak, n=0,1, ... , k=O

is of interest, especially in probability theory. Clearly, this sequence satisfies the relation Sn- Sn-1 =an, n = 1,2, ... , which is a first order linear recurrence relation with constant coefficients. Multiplying it by tn and summing for n = 1, 2, ... , we get 00

00

L Sntn- t L n=1

00

Sn-1tn-

1

= L

n=1

antn.

n=1

Thus, the generating function 00

S(t) = L Sntn n=O

satisfies the relation S(t)- s0

-

tS(t) = A(t)- a0 and since s 0 = a0 ,

S(t) = (1- t)- 1 A(t). Let us apply this result to the sequence

ak=(x+~- 1 ),

k=O,l, ... ,

(7.37)

RECURRENCE RELATIONS

256

where xis a real number. Then, according to Newton's general binomial formula,

the generating function of the partial sum

on using (7.37), is obtained as 00

S(t) =

L Sntn = (1- t)-x-

1

.

n==O

This generating function is expanded into powers oft as

and so

Consider now the linear recurrence relation of order r with variable coefficients:

bo(n)an+r

+ b1(n)an+r-1 + · · · + br(n)an = u(n),

n

= 0, 1, ... , (7.38)

where u(n) and the coefficients bj(n), j = 0,1, ... ,r, with b0 (n) -:f. 0 and br(n) -:f. 0, are given functions of n. The derivation of the solution ak, k = 0, 1, ... , of this recurrence, by using a generating function, when the coefficients bj(n) are polynomials in n of order sj, j = 0, 1, ... , r, may be carried out as follows. Multiplying (7.38) by tn+r and summing for n = 0, 1, ... , we get for the generating function 00

A(t) =

L aktk, k==O

a linear differential equation of order at most s = max{ s 0 , s1, ... , Sr}. The solution of this equation gives A(t) and its expansion into powers oft yields ak, j = 0, 1, .... This method is illustrated in the following examples.

7.5. THE METHOD OF GENERATING FUNCTIONS

257

Example 7.10 Let ak, k = 0, I, ... , n, be the number of k-combinations of the set Wn { w 1 , w2, ... , Wn}. A recurrence relation for the sequence ak. k = 0, I, ... , n may be obtained as follows. Attaching in every k-combination { Wi 1 , Wi 2 , ••• , wik} of Wn any one of then- k elements of Wn- {Wi 1 , Wi 2 , ••• , wik }, we get all the (k +I)-combinations { Wi 1 , Wi 2 , ••• , wik+l} ofWn, k +I times each. Specifically, the (k +I)-combination { wii, Wi 2 , ••• , Wik+'} of Wn, is obtained from each of the k-combinations

by attaching the elements integer n, we get

wi,, Wi 2

, ••• ,

respectively. Thus, for a fixed

Wik+l,

(k + I)ak+l - (n- k)ak = 0, k = 0, I, ... , n- I, ao = I,

which is a first order linear recurrence relation with variable coefficients. Its solution may be obtained by using a generating function n

A(t) =

L>ktk, k=O

as follows.

Multiplying the recurrence relation by

tk

and summing for k

0, I, ... , n- I, we get n-1

n

n

L

L

L(k + I)ak+1tk- n aktk + t kaktk-l = 0. k=O k=O k=l

Further, :t A(t) =

n

n-1

k=l

r=O

L kaktk-l =

and so

d

(I+ t) dt A(t) Therefore

1

1 0

dA(s) --n A(s) -

L(r + I)ar+lt''

= nA(t).

1 1

0

-dsI+ s

and log A(t) -log A(O) = n log(I + t) - n log 1. Since A(O) = a 0 = I and log I = 0, it follows that

RECURRENCE RELATIONS

258

and so

ak =

(~),

Example 7.11 Consider the sequence ao = 1, an =

0

k=0,1, ... ,n.

e;), n = 1, 2, ... , and let

In order to determine this generating function, note that

an 1 = (2n + 2) = 2(2n + 1) (2n) = 2(2n + 1) an. + n+1 n+1 n n+1 Thus, the sequence an, n = 0, 1, ... , satisfies the first order linear recurrence relation with variable coefficients:

(n + 1)an+1- 2(2n + 1)an = 0, n = 0, 1, ... , ao = 1. Multiplying it by tn and summing for n = 0, 1, ... , since d

dtA(t)

00

00

n=1

k=O

= L nantn- 1 = L(k + 1)ak+1tk,

we get the first order differential equation d (1- 4t) dt A(t) = 2A(t).

Hence

t }0

t

dA(s) 2ds A(s) = } 0 1- 4s

and so log A(t) -log A(O) = -

1

{log(1 - 4t) -log 1}.

2

Since A(O) = a0 = 1 and log 1 = 0, it follows that

A(t)

= (1- 4t)- 112 .

0

Let us finally consider the bivariate linear recurrence relation of order (r, s) with constant coefficients:

bo,oan+r,k+s + bo,!an+r,k+s-1 + b1,oan+r-1,k+s +

0

0

0

+ br,san,k = w(n, k), (7.39)

7.5. THE METHOD OF GENERATING FUNCTIONS

259

where w(n,k) is a given function and the coefficients bi,j, i = 0,1, ... ,n, The determination of the doubleindex sequence an,k, n = 0, 1, ... , k = 0, 1, ... , that satisfies the recurrence relation (7.39) requires the knowledge of r + s independent sequences,

j = 0, 1, ... , k, are given constants.

ai,k, k=0,1, ... , i=0,1, ... ,r-1,

(7.40)

an,j, n = 0, 1, ... , j = 0, 1, ... , s- 1,

(7 .41)

the initial conditions. The derivation of the solution of (7.39) by using a generating function is carried out in two steps. In the first step, we determine the bivariate generating function 00

00

A(t,u) = L Lan,ktkun, n=Dk=O which, on using the sequence of generating functions 00

An(t) = L an,ktk, n = 0, 1, ... , k=O is written in the form 00

A(t, u) = L An(t)un. n=O For the derivation of the sequence of generating functions An(t), n 0, 1, ... , we multiply (7.39) by tk+ 8 and sum fork= 0, 1, .... Then r

L i=O

s

oo

oo

L bi,jti L an+r-i,k+8-jtk+o-j = t 8 L w(n, k)tk, n j=O k=O k=O

= 0, 1, ...

and, since oo

8-1

""a ·k ·tk+ 8-j -A · ·tm-j , ~ n+r-~, +S-J - n+r-~·(t)- ""a ~ n+r-~,m-J k=O m=j for j = 0, 1, ... , s- 1, we deduce the relation r

L i=O

r

8

oo

8-1 8-1

L bi,jtj An+r-i(t) - L j=O i=O

L L an+r-i,m-jtm = t 8 L w(n, k)tk' j=O m=j k=O

for n = 0, 1, .... Introducing 8

bi(t) =

'2.:: bi,jti, j=O

i

= 0, 1, ...

, r,

RECURRENCE RELATIONS

260

and

00

Wn(t) = L w(n, k)tk, k=O this relation may be written in the form bo (t)An+r(t)

+ b1 (t)An+r-1 (t) + 000+ br(t)An(t) = Cn (t) + t"Wn(t), (7.42)

for n = 0, 1, 0000 The last relation is a linear recurrence relation of order r for the sequence of generating functions An(t), n = 0, 1, 000 with constant, with respect ton, coefficients bi(t), i = 0, 1, 000 , ro Note that the generating functions 00

ai,kl, i = 0, 1, 000 , r - 1,

Ai(t) = L

(7.43)

k=O which, according to the initial conditions (7.40), are known, constitute the initial conditions of (7.42)0 Considering t as a parameter, the recurrence relation (7.42) is solved in exactly the same way as the recurrence relation (7028)0 So, multiplying (7.42) by un+r and summing for n = 0, 1, 000, we deduce the relation

A( t, u )

= C(t,u) +urt"W(t,u) Br,s(t, U)

where

r

r

i=O

=L

L bi,jtiui,

i=O

00

W(t, u)

s

= L bi(t)ui = L

Br,s(t, u)

00

Wn(t)un

=L

'

j=O

00

L w(n, k)tkun

n=O

n=Ok=O

An-i(t)bi(t)un

+L

and r-1

C(t, u) =

s-1 m

n

LL

L A:n_j(u)bj(u)tm

m=Oj=O

n=Oi=O r-1 s-1

n

-L L

n

LLan-i,m-jbi,jtmun, n=O m=O i=O j=O

with

00

Aj(u)=Lan,jUn, j=0,1,00o,s-1, n=O

(7044)

7.5. THE METHOD OF GENERATING FUNCTIONS

261

known generating functions, according to the initial conditions (7.41), and r

bj(u)

= L)i,ju,

j

= 0, 1, ...

, s.

i=O

After the derivation of the generating function A(t, u), the next step is the determination of the sequence an,k, k = 0, 1, ... , n = 0, 1, ... , which requires the expansion of the right-hand member of (7.44) into powers of t and u. For this purpose, considering t as a parameter, we expand this function into powers of u, and then we expand the resulting expression into powers of t. This procedure is further clarified in the following examples. Example 7.12 Sums of sums Let us consider a sequence ak, k

= 0, 1, ... , with generating function 00

A(t)

=L

aktk.

k=O

Further, consider the sum j s1,j

= ~ ai, j = 0, 1, ... , i=O

the double sum r

r

j

B2,r=~~ai=Lsl,j, r=0,1, ... j=O i=O

j=O

and, generally, the n-tuple sum k

Sn,k = ~ Sn-l,r, k = 0, 1, ... , n = 0, 1, .... r=O

Clearly, Sn,k - Sn,k-1 = Sn-l,k, k = 1, 2, ... , n = 1, 2, ....

Multiplying this relation by tk and summing fork = 1, 2, ... , we get 00

00

00

~ Sn,ktk- t ~ Sn,k-ltk-l k=l

and, since sn,o

k=l

= ~ Sn-l,ktk k=l

= Bn- 1,o, we deduce for the generating function 00

Sn(t)

=L k=O

Sn,ktk ', n

= 0, 1, ...

,

RECURRENCE RELATIONS

262

the first order linear recurrence relation with constant, with respect ton, coefficients

(1- t)Sn(t)

= Bn-1 (t),

n

= 1, 2, ... ,

and initial condition 00

So(t)

00

= "2:: so,ktk = "2:: aktk = A(t). k=O

k=O

Multiplying it by un and summing for n 00

(1 - t)

00

L

Sn(t)un

= U"2:: Sn-1 (t)un- 1.

n=l

n=l

Further, using the initial condition S 0 (t) variate) generating function 00

S(t, u)

= 1, 2, ... , we get

= A(t), we deduce for the double (bi-

00

00

= L "2:: Bn,ktkun = L

Sn(t)un,

n=O

n=Ok=O the expression

S(t, u) = (1- t)(1- t- u)- 1 A(t). Expanding the right-hand side of this expression into powers of u, we find

Sn(t) = (1- t)-n A(t) and since

we conclude that

Bn,k =

2:: j=O k

0

(

n+J-

.

1) ak-j·

D

J

Example 7.13 Distribution of shares Let us consider two players K and R playing in a series of games in which winner is declared the one who first wins n games. Assume that the probability of K to win in a game is p and so that of R is q = 1 - p. Further, suppose that, for some reason, the series of games is interrupted when K has won n - k games and n n - r games, with k, r < n. In this case, what should be the shares of the two players from a total stake of s dollars? The total stake should be distributed to the two players in shares proportional to the probability that each one has to win the series of games if it is continued.

7.5. THE METHOD OF GENERATING FUNCTIONS

263

So, let Pk,r be the probability of K to win the series of games, when k wins of K are required before r wins of R. Note that K may win or lose the next game with probability p or q = 1 - p, respectively. If K wins the next game, then the probability of winning the series is Pk- 1 ,r. while if K loses (whence R wins) the next game, then the probability of winning the series is Pk,r- 1 • Consequently, the probability Pk,r• r = 1, 2, ... , k = 1, 2, ... , satisfies the recurrence relation

Pk,r

= PPk-1,r + QPk,r-1,

r

= 1, 2, ... ,

k

= 1, 2, ...

,

with initial conditions

Po,r

= 1,

= 1, 2, ...

r

= 0,

, Pk,O

k

= 1, 2, ....

Multiplying this recurrence relation by tr and summing for r 00

L

00

Pk,rtr

and, since Pk,o

00

=PL

r=1

= 1, 2, ... , we get

Pk-1,rtr

+ qt LPk,r-1tr- 1 ,

r=1

k

= 1, 2, ...

r=1

= 0, we deduce for the sequence of generating functions 00

Pk(t) = LPk,rtr, k = 1,2, ...

1

r=1

the first order recurrence relation with constant, with respect to k, coefficients:

(1- qt)Pk(t) = pPk- 1(t), k = 1, 2, ... and initial condition 00

Po(t)

00

= LPo,rtr = Ltr = t(1- t)- 1 . r=1

r=1

Multiplying this recurrence relation by uk and summing fork = 1, 2, ... , we get 00

(1 - qt) L

00

Pk (t)uk

= pu L

k=1

Pk- 1(t)uk- 1

k=1

and using the initial condition P0 (t) generating function 00

=

t(1 - t)- 1 , we deduce for the double 00

00

P(t,u) = LPk(t)uk = LLPk,rtruk, k=1

the expression

k=lr=1

P(t, u) = t(1- t)- 1 (1- qt- pu)- 1pu.

RECURRENCE RELATIONS

264

Expanding the right-hand side of this expression into powers of u, we get

P(t,u) = t(1- t)- 1 (1- p(1- qt)- 1 u)- 1 p(1- qt)- 1 u 00

= t(1- t)-1 LPk(l- qt)-kuk k=l

and so

Pk(t) = t(1- t)- 1pk(1- qt)-k. Finally, expanding this generating function into powers oft, by using Newton's negative binomial formula, we deduce for the probability Pk,r the expression

Pk,r

=p

k r-1

L

(k + 1) ql.. j k - 1

J=O

Consequently, from the total stake of s dollars, player K might get a share of SPk,r and player R a share of s(1 - Pk,r) dollars. Note that, for p = q = 1/2, the probability Pk,r reduces to the probability derived in Section 2. 7 .I. 0

7.6 BIBLIOGRAPHIC NOTES The first recurrence relation was given in 1202 by Leonardo Fibonacci in his book on abacus (Liber Abaci). This recurrence relation of the Fibonacci numbers is deduced and solved in Example 7.8. The derivation of the solution by using a generating function is due to Abraham De Moivre (1718). E. Lucas (1891) named this sequence of numbers after Fibonacci and also examined the related sequence of Lucas numbers. An extensive coverage of the Fibonacci and Lucas numbers and some of their extensions and generalizations is provided by V. E. Hoggatt (1969). The interest of E. Lucas (1891) in the problem of the Hanoi tower contributed the most in its popularization. The gambler's ruin is an old problem; in 1657, Christian Huyghens' treatise, which was included in the book Ars Conjectandi of J. Bernoulli, discussed the particular case of n = k- n = 12 tokens and pfq = 5/7. Bernoulli considered and solved the general case.

7.7

EXERCISES

1. An amount of a0 = $10,000 is deposited in a bank at the beginning of an interest period at interest rate r. If the interest is compounded each

7. 7. EXERCISES

265

period, show that the amount an on deposit after n periods satisfies the first order linear recurrence relation an+l = (1

+ r)an,

n = 0, 1, ....

Iterate it to derive an. 2. Let an be the number of n-digit nonnegative integers in which no two same digits are consecutive. Show that an+ I

with a 1

= 10.

= 9an,

n

= 1, 2, ...

,

Iterate this recurrence relation to derive an.

3. A player decides to play a series of games against a casino (or against an adversary) until he wins. In any game, if he wins he gets b + 1 times the amount of his stake, while if he looses he stakes a new amount. Let an be the player's stake on the n-th game, n = 1, 2, .... Provided that, if the player wins the n-th game, he gets back not only the stakes he lost in the n- 1 previous games but also an amount a, which is fixed in advance, show that ban= (b+ 1)an-I, n = 2,3, ... , with a 1

= a/b.

Iterate this recurrence to find an.

4. Consider the set of sequences of flips of a coin that are terminated when heads appear for the second time. Let an be the number of such sequences that are terminated before or at the n-th flip. Show that an+l

with a2

= 1.

= an + n,

n

= 2, 3, ...

,

Iterate this recurrence relation to derive an.

5. Let Rn be the number of regions in which a plane can be divided by n lines, each two of them having a point in common but no three of them having a point in common. Show that

Rn = Rn-1

+ n,

n = 2, 3, ...

with R 1 = 2. Further, show that the unique solution of this recurrence relation is given by

6. Let an be the number of n-permutations of the set {0, 1, 2} with repetition that include an even number of zeros. Show that an+l=an+3n, n=1,2, ... ,

RECURRENCE RELATIONS

266

with a 1 = 2. Iterate this recurrence relation to derive an. 7. Assume that the sequence an, n = 0, 1, ... , satisfies the recurrence relation 2(n + 1)an+l = (2n + 1)an, n = 0, 1, ... , with initial condition a0 = 1. Show that its unique solution is given by

= 2!n

an

c:),

n

= 0, 1, ....

8. Let an and bn be the numbers of n-permutations of the set {0, 1, ... , 9} with repetition that include an odd and even number of 5s, respectively. Show that with a 1 = 1, a 2 = 18 and

with b1 = 9, b2 = 82. Note that both sequences an, n = 1, 2, ... , and bn, n = 1, 2, ... , satisfy the same recurrence relation but with different initial conditions. Further, derive the unique solutions a n = ~2 ( 10n - 8n) , n

= 1, 2, ...

and

9. Let an be the number of n-digit nonnegative integers in which no three same digits are consecutive. Show that

with a 1 = 10 and a 2 = 100. Further, show that the unique solution of this recurrence relation is given by an =

9

5 (3)n v'l3 2 { ( 3 + v'l3)n+l -

(3 -

v'l3)n+l} .

10. Let an be the number of n-permutations of the set {0, 1, 2} with repetition and the restriction that no two zeros are consecutive. Show that an+2

= 2an+1 + 2an,

n

= 0, 1, ... ,

7. 7. EXERCISES

267

with ao = 1 and a 1 = 3. Further, show that the unique solution of this recurrence relation is given by an =

4

1 { ( 1 + J3 )n+2 J3

(1-

J3)n+2} .

11. Let an be the number of n-permutations of the set {0, 1, 2} with repetition and the restriction that no two zeros and no two ones are consecutive. Show that an+2 = 2an+l +an, n = 0, 1, ... ,

with a0 = 1 and a 1 = 3. Further, show that the unique solution of this recurrence relation is given by

12. Let

Show that

and thus conclude the recurrence relations: an= 2an-l- an-2, n

= 2,3, ... ,

with a0 = 1, a 1 = 2, and bn with bo

= 1, b1 = 3.

= 2bn-l -

bn-2, n

= 2, 3, ...

'

Solve these recurrence relations to get

an = n

+ 1,

bn = 2n + 1, n = 0, 1, ....

13. Find the unique solution of the recurrence relation

an+l

1

= 4(an+2- an),

with initial conditions a0

n

= 0, 1, ...

,

= 1 and a 1 = 4.

14. Find the general solution of the recurrence relation

RECURRENCE RELATIONS

268

15. Find the general solution of the recurrence relation

16*. Let Qr(n, k) be the number of k-permutations of n with repetition in which no r like elements are consecutive r = 2, 3, .... Show that r-1

Qr(n, k)

= (n- 1) L

Qr(n, k- j), k?. r, Qr(n, k)

= nk,

k

n,

s(O, 0; r)

= S(O, 0; r) = 1.

8.5.

NON-CENTRAL STIRLING AND RELATED NUMBERS

Further, replacing t by -t in expansion (8.58) and since (t (-1)n(-t- r)n, we deduce the expression

315

+ r + n- 1)n =

n

(t

+ r + n- 1)n =

L

(8.60)

ls(n, k; r)ltk, n = 0, 1, ... ,

k=O

where the coefficient

= (-1)n-ks(n, k; r), k = 0, 1, ... , n,

ls(n, k; r)l for r

n

= 0, 1, ...

, (8.61)

> 0, as sum of products of positive numbers, is positive. Specifically, ls(n, k; s)l =

L(r + i1)(r + i2) · · · (r +in-k),

where the summation is extended over all (n- k)-combinations {i 1, i 2, ... , in-d of the n integers {0, 1, ... , n- 1}. The coefficient ls(n, k; r)l, for r > 0, of expansion (8.60), of the rising non-central factorials into powers, is called non-centro/ signless or absolute Stirling number of the first kind. Expansions (8.58) and (8.60) imply that the non-central Stirling numbers of the first kind are derivatives of factorials, while expansion (8.59) entails that the non-central Stirling numbers of the second kind are differences of powers. Specifically,

s(n, k;r)

ls(n, k; r)l

=

[:,Dk(t)n L=-r, k = 0, 1, ... , n, n = 0, 1, ... ,

= (:, Dk(t + n- 1)n

L=r, k = 0, 1, ... , n, n = 0, 1, ...

and

S(n, k; r)

= [:, Llktn]

, k

= 0, 1, ... , n, n = 0, 1, ....

t=r

Note that, for r = 0, these numbers reduce to the corresponding usual (central) Stirling numbers. For r f= 0 the non-central Stirling numbers may be expressed in terms of the corresponding central Stirling numbers. Specifically, expanding the rising non-central factorial of t of order n, (t + r + n- 1)n, into powers of u = t + r, using (8.4), and then expanding the power of u = t + r into powers oft, using Newton's binomial formula, we deduce the expression ls(n, k; r)l

=

t (~)

r 1-kls(n,j)l.

J=k

Also, expanding the non-central factorial oft of order n, (t + r + n- 1)n, into factorials oft, using Vandermonde's formula, and then expanding the

STIRLING NUMBERS

316

factorials oft into powers oft, using (8.2), we conclude the expression

ls(n, k; r)l =

t (~) j=k

(r

+ n- j -

1)n-jls(j, k)l.

J

Similarly

t. (t)

S(n, k; r)

=

S(n,k;r)

=

and

t (~) j=k

(r)j-kS(n,j)

rn-is(j,k).

J

The non-central Stirling numbers retain the orthogonality relation of the central Stirling numbers. Specifically, for any real parameter r, n

n

= 8n,k, "'L,S(n,j;r)s(j,k;r) = 8n,k,

"'L,s(n,j;r)S(j,k;r) j=k

j=k

where 8n,k = 1, if k = n and 8n,k = 0, if k =f. n is the Kronecker delta. The exponential generating functions of Is( n, k; r) I, n = k, k + 1, ... and S(n, k; r), n = k, k + 1, ... , for fixed k and r, may be obtained as ~ un 9k(u; r) = L...- ls(n, k; r)l n! n=k

= (1- u) -rl-log(1-u)jk k! , k=

0, 1, ...

and .

-

fk(u,r)-

L S(n,k,r) unn! -oo



ru (eu- 1)k k! , k- 0, 1, ... ,

e

n=k respectively. The non-central Stirling number of the second kind, on using the expression of the k-th power of the difference operator in terms of the shift operator, is expressed in the form of a single sum of elementary terms as k

S(n,k;r) =

~! "'L,(-1)k-j (~)

(r+j)n.

(8.62)

J

j=O

Triangular recurrence relations for the non-central Stirling numbers, analogous to those for the central Stirling numbers, can be similarly deduced:

s(n + 1, k; r) = s(n, kfork= 1, 2, ... , n

+ 1, n

1; r)-

(n

+ r)s(n, k; r),

= 0, 1, ... , with

s(O,O;r) = 1, s(n,O;r) = (-r)n, n > 0, s(n,k;r) = 0, k > n.

8.5.

NON-CENTRAL STIRLING AND RELATED NUMBERS

317

and

+ 1, k; r) = S(n, k- 1; r) + (k + r)S(n, k; r), , n + 1, n = 0, 1, ... , with

S(n

for k = 1, 2, ...

S(O,O;r) = 1, S(n,O;r) = rn, n > 0, S(n,k;r) = 0, k > n.

Using (8.61), the first recurrence relation yields for the non-central signless Stirling numbers of the first kind the triangular recurrence relation ls(n + 1, k; r)l = ls(n, k- 1; r)l for k = 1, 2, ... , n

+ 1, n

+ (n + r)ls(n, k; r)l,

= 0, 1, ... , with

is(O, 0; r)l = 1, is(n, 0; r)l = (r

+ n- 1)n,

n > 0, is(n, k; r)l = 0, k > n.

The triangular recurrence relation for the non-central Stirling numbers of the second kind can be used for the derivation of the (power) generating function k

00

IT

¢k(u; r) = L S(n, k; r)un = uk (1- ru- ju)- 1 , n=k j=O

fork= 1, 2, .... Setting u = 1/t, we get 00

1

1

LS(n,k;r)---=i=T=( ) ,k=1,2, .... tn t- r k+l n=k

Using the orthogonality relation of the non-central Stirling numbers, this expansion can be inverted as 1

= tk+l' k = 1, 2, ... . Equivalently, this expression may be written as 00

Lls(n,k;r)l( n=k t

1

+r +n

)

n+ 1

=

1

t

k+I'

k= 1,2, ....

Consider the non-central generalized factorial of t of order n, scale parameters and non-centrality parameter r, (st + r)n, and let n

(st

+ r)n = L k=O

C(n, k; s, r)(t)k, n

= 0, 1, ... .

(8.63)

STIRLING NUMBERS

318

The coefficients C(n, k; s, r) are called non-central generalized factorial coefficients or Gould-Hopper numbers. Clearly, C(n,k;s,r)

= 0, k > n, C(O,O;s,r) = 1.

Further, expansion (8.63) implies that the non-central generalized factorial coefficients are differences of non-central generalized factorials. Specifically, , k=0,1, ... ,n, n=0,1, ....

C(n,k;s,r) = [k\Llk(st+r)n] ·

t=O

Note that, for r = 0, these numbers reduce to the corresponding central numbers. For r =f. 0, the non-central generalized factorial coefficients may be expressed in terms of the corresponding central generalized factorial coefficients. Specifically,

=

C(n, k; s, r)

:t (~)

(rfs)j-kC(n,j; s)

]=k

and C(n, k; s, r)

=

:t (~) j=k

(r)n-jC(j, k; s).

J

The non-central generalized factorial coefficient C(n, k; s, ps-r) is a polynomial ins of degree n, the coefficient of general term of which is a product of the non-central Stirling numbers of the first and second kind, n

C(n,k;s,ps-r)

= "L,s(n,j;r)S(j,k;p)si. j=k

k

The exponential generating function of the sequence C(n, k; s, r), n k and r, may be obtained as

+ 1, ... , for fixed

oo

= k,

n

!k(u;s,r) = "L,c(n,k;s,r); n. n=k = (1

+ u)

r[(1+u)s-1]k , k = 0, 1, ... . k.1

The non-central generalized factorial coefficients, on using the expression of the k-th power of the difference operator in terms of the shift operator, is expressed in the form of a single sum of elementary terms as k

C(n,k;s,r) =

~! ~)-1)k-j (~) j=O

J

(sj+r)n·

8.6. BIBLIOGRAPHIC NOTES

319

A triangular recurrence relation for the non-central generalized factorial coefficients, analogous to that for the central generalized factorial coefficients, can be similarly deduced:

C(n + 1, k; s, r) = (sk for k

+ r- n)C(n, k; s, r) + sC(n, k- 1; s, r),

= 1, 2, ... , n + 1, n = 0, 1, ... , with

C(O, 0; s, r) = 1, C(n, 0; s, r) = (r)n, n

> 0, C(n, k; s, r)

= 0, k

> n.

This triangular recurrence relation can be used to show that 00

1 -() - = L:sC(n,k;s,r)(

t

8.6

k+l

n=k

1

st + r

)

n+l

.

BffiLIOGRAPHIC NOTES

The Stirling numbers were so named by N. Nielsen (1906) in honor of James Stirling, who introduced them in his Methodus Differentialis (1730) without using any notation for them. The notation adopted in this book is due to J. Riordan (1958). Recurrence relations and certain number theoretic properties of the Stirling numbers of the first kind were derived by L. Lagrange (1770). P. S. Laplace (1812) and A. Cayley (1887) provided several approximations of the Stirling numbers of the second kind. J. A. Grunert (1822, 1843), A. Cauchy (1833), 0. Schlomilch (1852, 1895), G. Boole (1860), L. Schlafli (1867), J. Blissard (1867) and J. Worpitzky (1883) explored further the Stirling numbers of both kinds. The work of N. E. Norlund (1924) inspired several publications on certain generalizations of the Stirling numbers and their connection with the Bernoulli and the generalized Bernoulli numbers. Also, the books by N. Nielsen (1906, 1923), E. Netto (1927), J. F. Steffensen (1927) and L. M. Milne-Thomson (1933) are worth mentioning. A thorough presentation of the Stirling numbers and their most important properties provided by Ch. Jordan (1933) in an excellent paper, which was included as Chapter 4 in his classical book on the calculus of finite differences (1939a), revived the interest in the Stirling numbers. Since then, a large number of publications on these numbers appeared in the literature. The more recent book of L. Comtet (1974) devotes a chapter to these numbers and provides a very rich bibliography. The expression of the nth power of the operator e = tD in terms of powers of the operator D was obtained by J. A. Grunert (1843). The derivation of this expression in Example 8.4 is due to Ch. Jordan (1933, 1939a), who also derived the

STIRLING NUMBERS

320

expression of the n-th power of the operator tJi = tL.l in terms of powers of the operator L.l given in Example 8.5. H. W. Gould (1964) expressed the operator (a 1D)n in terms of powers of the operator D with the Stirling numbers of the first kind as coefficients. L. Comtet (1973) expressed the more general operator (>.(t)D)n in terms of powers of the operator D with coefficients Bell partition polynomials. A generalization to another direction was discussed by L. Carlitz (1932). 0. Schlomilch (1852) used the same symbol, Cf, to denote the Stirling numbers of both kinds calling them factorial coefficients. In this unified notation, Cf = ls(n, k)l and CJ:n = S(k, n). N. E. Norlund (1924) introduced the generalized Bernoulli numbers Br;), n = 0, 1, ... , with generating function the r-th power of the generating function of usual Bernoulli numbers.

=

(n-1)

(n)

(n) (-k) . Bn-k and S(n, k) = k Bn-k. (see Exerctse 1 19). Properties of the generalized Bernoulli numbers were studied by L. Carlitz (1960). F. N. David and D. E. Barton (1962) devoted a chapter to these numbers. The first short table of the Stirling numbers of the second kind, up to n = 9, was published by James Stirling (1730). Extensive tables of the Stirling numbers of both kinds were constructed by H. Gupta (1950), R. A. Fisher and F. Yates (1953), F. N. David, M. G. Kendall and D. E. Barton (1966) and M. Abramowitz and I. A. Stegun (1965). A variety of asymptotic expressions for the Stirling numbers exist in the literature. The approximate expressions given in Exercise 7 are due to Ch. Jordan (1933, 1939a). Several references on other approximations are given in the review paper by Ch. A. Charalambides and J. Singh (1988). The coefficients L(n, k), k = 0, 1, ... , n, n = 0, 1, ... of the expansion of the rising factorials into falling factorials, introduced by I. Lah (1955), were called Lah numbers by J. Riordan (1958). Extending these numbers, Ch. A. Charalambides (1976, 1977a, 1979a) systematically studied the coefficients C (n, k; s) of the expansion of the generalized factorials into falling factorials. These numbers were noted before by Ch. Jordan (1933) and appeared as coefficients of a generalized Hermite polynomial in E. T. Bell (1934b), and in several other forms in H. W. Gould (1958), R. Shumway and J. Gurland (1960), L. Bernstein (1965), L. Carlitz (1965), W. Feller (1968), L. Comtet (1973). Later, L. Carlitz (1979) studied these numbers under the name degenerate Stirling numbers. The non-central Stirling numbers of the second kind appeared in N. Nielsen (1906) as differences of the powers at an arbitrary point. J. Riordan (1937) used them as connection constants of power moments about an arbitrary point and factorial moments (see Example 8.3). Also, they appeared as coefficients in a modification of the classical occupancy problem discussed by D. E. Barton and F. N. David (1959). Recently, these numbers were studied by L. Carlitz (1980a,b) as weighted Stirling numbers, by M.

Then Js(n, k)l

k_

8. 7. EXERCISES

321

Koutras (1982) as non-central Stirling numbers, by A. Z. Broder (1984) as r-Stirling numbers and also by R. Shanmugan (1984). The differences of the generalized factorials at an arbitrary point (Gould-Hopper numbers) were studied by Ch. A. Charalambides and M. Koutras (1983). The associated Stirling numbers, introduced by J. Riordan (1958), are closely related to the numbers of Ch. Jordan (1933, 1939a) and M. Ward (1934), which are the coefficients of the representation of s(n, n- k) and S(n, n- k) as sums of binomials of n. These numbers were further discussed by L. Carlitz (1971). Recurrence relations and other properties of the r-associated Stirling numbers and generalized factorial coefficients were discussed by J. Riordan (1958), L. Comtet (1974) and Ch. A. Charalambides (1974).

8. 7 EXERCISES 1.

Additional vertical recurrence relations for the Stirling numbers.

Show that (a) the Stirling numbers of the first kind s(n, k), k = 0, 1, ... , n, n = 0, 1, ... , with s(O,O) = 1, satisfy the recurrence relation n

s(n, k)

=L

nr-k s(n + 1, r + 1), k

= 0, 1, ...

, n, n

= 0, 1, ...

,

r=k and (b) the Stirling numbers of the second kind S(n, k), k = 0, 1, ... , n, n = 0, 1, ... , with S(O, 0) = 1, satisfy the vertical recurrence relation n

S(n,k)

= Lkn-rs(r -1,k -1), k = 1,2, ...

,n, n

= 1,2, ....

r=k 2. Show that

t S(n, r)s(r r=k

+ 1, k + 1) = (-1)n-k (~)

and

ts(n+1,r+1)s(r,k)= r=k

(~).

3". Show that

k (k-n) S(n,n-k)=?; k+r (k+n) k-r !s(k+r,r)!.

STIRLING NUMBERS

322

4. Show that

( k; r) s(n, k + r)

=~ (

J) s(j, k)s(n-

j, r)

and conclude its inverse relation

(7) s(n-i,r)

=

~ (k;r) S(k,i)s(n,k+r).

5. Show that

and conclude its inverse relation

(7) S(n-i,r)

=

~ (k;r) s(k,i)S(n,k+r).

6*. Let C(n, k; s) be the generalized factorial coefficient. Show that

(-1 ) k C(n,n-k;s -1 ) = ~ ~ (k-n) k+r (k+n) k-r C(k+r,r;s). 7. (Continuation). Show that

( k;

r) C(n, k + r; s) = ~ ( J) C(j, k; s)C(n-

j, r; s)

and

8*. Show that the signless Stirling number of the first kind is given by

L-;=

8 where (n(s) = 1 lfj , m = [n/2] and the summation is extended over all nonnegative integer solutions of the equation r 1 + 2r2 + · · · + krk = k.

8. 7. EXERCISES

323

9*. Asymptotic expressions for the Stirling numbers. For fixed k and n -too, show that

ls(n

+ 1, k + 1)1

~ n![log(n

+ 1) + C]k/k!

and

S(n,k)

~

knfk!,

where C = 0.57721 is the Euler's constant. Also, for fixed k, s and n -t oo derive for the generalized factorial coefficients C(n, k; s) the asymptotic expression C(n, k; s) ~ (sk)nfk!. 10. Associated Stirling numbers of the first kind. Using the triangular recurrence relation

s(n

+ 1, k) = s(n, k- 1) s(O,O)

= 1,

- ns(n, k), k

s(n,O)

= 0,

= 1, 2, ...

n > 0, s(n,k)

,n

+ 1,

n

= 0, 1, ...

= 0, k > n,

show that

s(n, n)

= 1,

s(n, n- 1)

= - ( ~) , s(n, n -

2)

= 2 ( ~) + 3 ( ~)

and, generally, setting k

s(n,n-

k) = Ls2(k + (k: ·), j,j)

J

j=O

derive the bivariate generating function

and deduce the generating function /k.2(u)

=

~

un L...- s2(n, k) 1 n. n=2k

=

[log(1

+ u)- u]k k' .

, k

= 0, 1, ...

Further, show that

s 2(n for n

+ 1, k) =

-ns 2(n, k)- ns 2(n- 1, k- 1),

= 2k, 2k + 1, ... , k = 1, 2, ... , with s2(0, 0)

= 1,

s2(n, 0)

= 0,

n > 0, s2(n, k)

= 0,

2k > n,

.

,

324

STIRLING NUMBERS

and

k

s 2(n,k)

= ~)-1)i (~)

for n

s(n-j,k-j),

J

j=O

= 2k, 2k + 1, ... , k = 0, 1, ....

11. (Continuation). Consider, more generally, the numbers Sr (n, k), n = rk, rk + 1, ... , k = 0, 1, ... , r = 2, 3, ... , defined by their exponential generating function n

OC>

!k,r(u) =

L

1

[

sr(n, k); = kl log(1 n. ·

n=rk

k

r-l

j

j=l

J

+ u)- L( -1)j-l ~

Derive the recurrence relation sr(n + 1, k) for n

l

= (-1r- 1 (n)r- 1 sr(n- r + 1, k- 1)- nsr(n, k),

= rk, rk + 1, ... , k = 1, 2, ... , r = 2, 3, ... , with = 1,

sr(O, 0)

sr(n, 0)

= 0,

n

> 0, sr(n, k) = 0, rk > n.

Also, show that k

(n)rj Sr+l (n, k) -- "'(-1)rj L .1 j Sr (n - rJ,. k- J") , r -- 1, 2, ... i=O J .r and k

(n)rj Sr (n, k) -- "'(-1)rj+l L .1 j Sr+l (n - rJ,. k- J") , r -- 1, 2, .... j=O J.r 12. Associated Stirling numbers of the second kind. Using the triangular recurrence relation S(n

+ 1, k) = S(n, k- 1) + kS(n, k), S(O,O)

= 1,

S(n,O)

= 0,

n

k

= 1, 2, ...

,n

+ 1,

n

= 0, 1, ...

> 0, S(n,k) = 0, k > n,

show that S(n, n)

= 1,

S(n, n- 1)

= ( ~) , S(n, n- 2) = ( ~) + 3 ( ~)

and, generally, setting S(n,n-k) = ts2(k+j,j) (k n .) , j=O +J

,

8. 7. EXERCISES

325

derive the bivariate generating function

g2(t,u)

oo [n/2]

n

n=O k=O

S2(n,k)tk; n.

=L

L

= exp[t(eu -1- u)]

and deduce the generating function

Also, show that

S2(n for n

+ 1, k)

= kS2(n, k)

+ nS2(n- 1, k-

1),

= 2k, 2k + 1, ... , k = 1, 2, ... , with S2(0, 0) = 1, S2(n, 0) = 0, n

> 0, S 2(n, k)

= 0, 2k

> n,

and S2(n, k) for n

k

(~)

j=O

J

= L( -1)i

S(n- j, k- j),

= 2k, 2k + 1, ... , k = 0, 1, ....

13. (Continuation). Consider, more generally, the numbers Sr (n, k), n = rk, rk + 1, ... , k = 0, 1, ... , r = 1, 2, ... , defined by their exponential generating function n

oo

!k,r(u)

=

L

Sr(n,k);

n=rk

n.

r-1

1

= kl

·

eu(

k j

L ~I j=O ).

)

Derive the recurrence relation

for n = rk, rk

+ 1, ... , k

= 1, 2, ... , r = 1, 2, ... , with

Sr(O, 0) = 1, Sr(n, 0) = 0, n > 0, Sr(n, k) = 0, rk > n. Further, show that k

Sr+t(n,k)

= L(-1)j J..~n()~)iSr(n-rj,k-j), r. J j=O

r= 1,2, ...

326

STIRLING NUMBERS

and

k

(n )rj =" ~' -:r-( !)J Sr+I (n- TJ,. k - J') , r j=O J. r.

Sr (n, k )

= 1, 2, ....

14. Associated generalized factorial coefficients. Using the triangular recurrence relation C(n

+ 1, k; s) + 1, n

for k = 1, 2, ... , n

= (sk- n)C(n, k; s)

+ sC(n, k-

1; s),

= 0, 1, ... , with initial conditions

> 0, C(n,k;s)

C(O,O;s) = 1, C(n,O;s) = 0, n

= 0, k

> n,

show that C(n,n;s)

= sn,

C(n,n -1;s)

C(n, n- 2; s) = sn- 3 (s)3 (

= sn- 2(s)2 (~),

~) + 3sn- 4 [(shf ( ~)

and, generally, setting k

C(n,n-k;s)=LC2(k+j,j;s)sn-k-j j=O

(k: .), J

derive the bivariate generating function oo [n/2]

n

92(t,u;s) = L L C2(n,k;s)tk; = exp{t[(1 +uV -1- su]}, n=O k=O n.

and conclude the generating function 00

un [(1 !k,2(u; s) = L C2(n, k; s) n! = n=2k

+ u)

8

-

k!

1 - su]k

, k = 0, 1, ....

Also, show that C2(n

for n

+ 1, k; s)

= (sk- n)C2 (n, k; s)

+ n(s)2C2(n-

1, k- 1; s),

= 2k, 2k + 1, ... , k = 1, 2, ... , with C2(0,0;s) = 1, C 2 (n,O;s) = 0, n

and

> 0, C 2(n,k;s)

= 0, 2k

k

C 2(n, k; s)

= L( -1)1 (~) j=O

J

siC(n- j, k- j; s),

> n,

8. 7. EXERCISES

327

for n = 2k, 2k + 1, ... , k = 0, 1, .... 15. (Continuation). Consider, more generally, the numbers Cr(n, k; s), n = rk, rk + 1, ... , k = 0, 1, ... , r = 1, 2, ... , defined by their exponential generating function

Derive the recurrence relation Cr(n

+ 1, k; s) =

(sk- n)Cr(n, k; s)

+ ( r ~ 1) for n = rk, rk

+ 1, ... , k =

(s)rCr(n- r

+ 1, k-

1; s),

1, 2, ... , r = 1, 2, ... , with

> 0, Cr(n, k; s)

Cr(O, 0; s) = 1, Cr(n, 0; s) = 0, n

= 0, rk

> n.

Also, show that Cr+l (n, k; s)

)j r

k = ~( -1)1 (n!,rj J.

( 8

j=O

Cr(n- rj, k- j; s), r

= 1, 2, ...

and k

Cr(n, k; s)

j

= ~ (n!!rj j=O

(;) Cr+l (n- rj, k- j; s), r

= 1, 2, ....

J

16. Cauchy numbers. The sequence of the Cauchy numbers Cn, n = 0, 1, ... , has generating function oo

f(t)

tn

t

= ~ Cnn! = log(1 + t) ·

Show that (n)kl C n-k, n = 1, 2, ... , vo ,--, = 1 Cn = ~( L.J -1 )k-1 k

+

k=l

and n

Cn =

1

r

1

L k + 1 s(n, k), n=O L S(r, n)Cn = r + 1 , k=O

STIRLING NUMBERS

328

where s(n, k) and S(r, n) are the Stirling numbers of the first and second kind, respectively. 17. Bernoulli numbers. The sequence of the Bernoulli numbers Bn,

n

= 0, 1, ... , has generating function oo

g(t)

=L

tn Bn n!

n=O

Show that Bn

=

t (~)

Bk, n

t

= et -

1.

= 1, 2, ... , B 0 = 1

k=O

and n ( -1)kk! r ( -1Yr! Bn=L k+ S(n,k),Ls(r,n)Bn= r+ , 1 1 k=O n=O

where s(n,k) and S(r,n) are the Stirling numbers of the first and second kind, respectively. 18. (Continuation). (a) Show that B 2r+l = 0, r = 1, 2, ... , and conclude that oo t2r 2 1+ -1Y2 r B2r ( r)! = t cot t. 2

?;(

(b) Using the expansion 00

t2

1 + 2""' 2 ~ t - n 21r 2 n=O

= t cot t,

show that 00

B2r

= (-1Y+l2(2r)!(27r)- 2r((2r),

((s) =

L n-s n=l

and conclude that IB2rl = ( -1Y+l B2r, r

= 1, 2, ... , and

(27ryr ((2r) = - ( 1 IB2rl, r = 1, 2, .... 2 2r). 19. Norlund-Bernoulli numbers. The sequence of numbers Btl, n = 0, 1, ... , where r is a real number, with generating function

8. 7. EXERCISES

329

has been defined by Norlund and, in the particular case of r = 1, reduces to the sequence of Bernoulli numbers. Show that

B~+t)

= ( 1 - ~) B~) - nB~~ 1 , n = 1, 2, ... , B~r) = 1

and conclude that

B~) = s(r, r- n)/ ( r ~ 1 )

,n

B~-r) = S(n + r, r)/ ( n: r)

= 0, 1, ... ,n

, r- 1, r

= 1, 2, ... ,

= 0, 1, ... , r = 1, 2, ...

,

where s(n, k) and S(n, k) are the Stirling numbers of the first and second kind, respectively. 20. Consider the sequence B(n; s), n = 0, 1, ... , where sis a real number, with generating function tn

oo

g(t;s) =

~B(n;s)n!

t = ( 1 + t)B

-1'

Show that B(n; s)

=

t (~)

(s)n-kB(k; s), n

= 1, 2, ... , B(O; s) = 1/s

k=O

and

~ ~

B = n

k=O

(1/sh+t ) k+ 1 C( n, k·,s,

where C(n, k; s) is the generalized factorial coefficient. Further, show that lim sB(n; s) = Cn, lim s-n+I B(n; s) = Bn,

s--+ 0

s--too

where Cn and Bn are the Cauchy and Bernoulli numbers, respectively. 21 *. Garlitz-Riordan numbers of the first kind. Consider the expansion of central factorial of t of order n,

t[n] = t (t

+~-

= t (t + ~2 with t[OJ

1) (t

+ ~- 2) ··· (t- ~ + 2)

1) , n-1

n

= 1, 2, ...

,

= 1, into powers oft: n

t[n] =

L r(n, k)tk, k=O

n = 0, 1, ... .

(t-

~ + 1)

STIRLING NUMBERS

330

Show that oo

n

U

n

g(t,u)= LLr(n,k)tk:! n=Ok=O

= ((u/2)+V1+(uf2) 2 )

,

and conclude that oo un [2log((u/2)+J1+(u/2F)r fk(u)=Lr(n,k)n! = k! , k=0,1, .... n=k

Derive the recurrence relation r(n

fork= 2, 3, ... , n

+ 2, k) = r(n, k- 2)- (n/2) 2 r(n, k),

+ 2, n = 0, 1, ... , with

r(O, 0) = 1, r(n, k) = 0, k

> n, r(2n, 2k + 1) = 0, r(2n + 1, 2k) = 0.

22*. Garlitz-Riordan numbers of the second kind. Consider the expansion of the n-th order power of t into central factorials of it: n

t 0 =LR(n,k)t[kJ, n=0,1, .... k=O

Show that n

n

Lr(n,j)R(j,k)

= c5n,k,

j=k

LR(n,j)r(j,k)

= c5n,k

j=k

and

Derive the explicit expression

(k) (k-2 - )n

1 "'(-1)3 k . R(n k) = ' k! L.....t j j=O

j

23*. (Continuation). Show that R(n + 2, k) = R(n, k- 2)- (k/2) 2 R(n, k),

fork= 2, 3, ... , n

+ 2,

n = 0, 1, ... , with

R(O, 0) = 1, R(n, k) = 0, k > n, R(2n, 2k + 1) = 0, R(2n + 1, 2k) = 0

8. 7. EXERCISES

331

and deduce the generating function

k = 2s + 1.

24. Consider the sequence of non-central signless Stirling numbers of the first kind ls(n, k; r)l, k = 0, 1, ... , n, n = 0, 1, ... , for fixed r, which are defined by (see Section 8.5) n

(t

+ r + n- 1)n =

L

ls(n, k; r)itk, n

= 0, 1, ....

k=O

Show that oo

g(t, u; r)

=L

n

L

n=Dk=O

n

ls(n, k;r)ltk; n.

= (1- u)-t-r

and conclude that

. -~ . un_ -rf-log(1-u)]k _ fk(u, r) - L....is(n, k, r)l n! - (1- u) k! , k- 0, 1, .... n=k

25. (Continuation). Show that the non-central signless Stirling numbers of the first kind ls(n, k; r)l, k = 0, 1, ... , n, n = 0, 1, ... , satisfy the triangular recurrence relation ls(n for k

+ 1, k; r)l

= ls(n, k- 1; r)l

= 1, 2, ... , n + 1, n =

+ (n + r)ls(n, k; r)l,

0, 1, ... , with initial conditions

ls(O, 0; r)l = 1, ls(n, 0; r)l = (r

+ n- 1)n,

n > 0, ls(n, k; r)l = 0, k > n.

Also, show that ls(n, k; r)l =

t (~) j=k

(m

+ n- j -

1)n-jls(j, k; r- m)l

J

and conclude that n

ls(n, k; r )I = L(n)n-j ls(j, k; r- 1)1 j=k

STIRLING NUMBERS

332

and

ls(n, k; r)l =

t (~) j=k

+ n- j -

(r

1)n-jls(j, k)l·

J

26. Suppose that, balls are successively drawn one after the other from an urn initially containing w white and b black balls, according to the following scheme. After each trial the drawn ball is placed back in the urn along with s black balls. Show that (a) the probability p(k; n, r) of drawing k white balls in n trials is given by

is(n,k;r)IOk . )_ p (k ,n,r- (O+r+n- 1)n' k=0,1, ... ,n and (b) the probability q( n; k, r) that n trials are required until the k-th white ball is drawn is given by

q(n;k,r) =

ls(n- 1, k- 1; r)IOk (O ) , n = k,k +r+n-1n

+ 1, ...

,

where 0 = w/s and r = bfs.

27. Consider the sequence of non-central Stirling numbers of the second kind S(n, k; r), k = 0, 1, ... , n, n = 0, 1, ... , for fixed r, which are defined by (see Section 8.5) n

(t

+ r)n = L

S(n, k; r)(t)k, n

= 0, 1, ....

k=O Show that

n

oo

f(t, u; r)

n

=L

L S(n, k; r)(t)k; n=O k=O n.

= e(t+r)u

and conclude that .

-

oo



Un -

fk(u,r)- LS(n,k,r)n! -e n=k

ru ( eu -

k!

1) k

-

, k-0,1, ....

Further, derive the explicit expression

~(S( n, , r - !._ k! L....t j=O

k. )_

1 )k-j (k). (r + J·)n . J

28. (Continuation). Show that the non-central Stirling numbers of the second kind S(n,k;r), k = 0,1, ... ,n, n = 0,1, ... , satisfy the triangular recurrence relation

S(n

+ 1, k; r)

= S(n, k- 1; r)

+ (k + r)S(n, k; r),

8. 7. EXERCISES

for k = 1, 2, ... , n

333

+ 1, n

= 1,

S(O,O;r)

= 0, 1, ... , with initial conditions

S(n,O;r) =rn, n > 0, S(n,k;r)

= 0,

k > n.

Also, show that S(n,k;r)

=

t

(~) mn-jS(j,k;r-m)

j=k

J

and conclude that S(n, k; r)

=

and S(n,k;r) =

t (~) t (~) j=k

J

j=k

J

S(j, k; r- 1)

rn-jS(j,k).

29. (Continuation). Show that

~s(n,j;r1)S(j,k;r2) = (~) (r2 -rl)n-k,

t

S(n,j; ri)s(j, k; r2) = (

~) (r1 -

r 2 )n-k,

J=k and conclude that n

n

Ls(n,j;r)S(j,k;r) j=k

= On,k.

LS(n,j;r)s(j,k;r) j=k

= On,k·

30. (Continuation). Show that ( k

t m ) s (n, k + m; r 1 + r 2) = %' (;) s (j, k; r1) s( n - j, m; r2)

and conclude its inverse relation

31. (Continuation). Show that ( k

t

m) S(n, k

+ m;r 1 + r 2) =

~ ( ; ) S(j, k;r1)S(n- j,m;r2)

STIRLING NUMBERS

334

and conclude its inverse relation

(7)

~ ( k ~ m) s(k, i; r1)S(n, k + m; r 1 + r2).

S(n- i, m; r 2) =

32. (Continuation). Show that k

00

¢k(u; r) =

2: S(n, k; r)un = uk II (1- ru- ju)n=k

1

,

k = 1, 2, ...

j=O

and conclude the inverse relations 00

(t+r)-k

= '2:(-1)n-kS(n-1,k-1;r+ 1)t-n, k = 1,2, ... , n=k 00

(t- r)-k

= 2:( -1t-ks(n- 1, k- 1; r + 1)(t)-n, k = 1, 2, .... n=k

33. Suppose that, balls are successively drawn one after the other from an urn initially containing m white and r black balls, according to the following scheme. After each trial, if the drawn ball is white, a black ball is placed in the urn, while if the drawn ball is black, it is placed .back in the urn. Show that (a) the probability p(k; n, r) of drawing k white balls in n trials, with n ~ m, is given by

. _S(n,k;r)(m)k _ p(k,n,r)( ) ,k-0,1, ... ,n m+r n and (b) the probability q(n; k, r) that n trials are required until the k-th white ball is drawn, with k ::::; m, is given by

q(n; k, r) =

S(n- 1, k- 1; r)(m)k ( ) , n = k, k m+r n

+ 1, ....

34. Consider the sequence of the non-central generalized factorial coefficients C(n, k; s, r), k = 0, 1, ... , n, n = 0, 1, ... , for fixed s and r, which are defined by (see Section 8.5) n

(st

+ r)n

=

'2: C(n, k; s, r)(t)k> n = 0, 1, .... k=O

Show that oo

n

n

f(t,u;s,r) = LLC(n,k;s,r)(t)k; = (1 +u)st+r n=O k=O n.

8. 7. EXERCISES

335

and conclude that oo un [(1 fk(u;s,r)=l:C(n,k;s,r)--,-=(1+uY

+ u)s-

n.

n= k

k'

1Jk

.

,k=0,1, ....

Using a suitable generating function, show that

C(n,k;s,r)

=

t (t)

(r/s)J-kC(n,j;s),

J=k

and

C(n,k;s,r)

=

t (~) j=k

(r)n-jC(j,k;s).

J

35. (Continuation). Show that the non-central generalized factorial coefficient C(n, k; s, r), k = 0, 1, ... , n, n = 0, 1, ... , is given by the sum

C(n,k;s,r)= :,t(-1)k-J (;) (sj+r)n. J=O

36. (Continuation). Show that the non-central generalized factorial coefficients C(n, k; s, r), k = 0, 1, ... , n, n = 0, 1, ... , satisfy the triangular recurrence relation

C(n for k

+ 1, k; s, r) = (sk + r- n)C(n, k; s, r) + sC(n, k-

= 1, 2, ...

,n

+ 1, n = 0, 1, ... , with

1; s, r),

initial conditions·

C(O,O;s,r) = 1, C(n,O;s,r) = (r)n, n > 0, C(n,k;s,r) = 0, k > n. 37. (Continuation). Show that lim s-kc(n, k; s, r)

s-+0

= s(n, k; -r)

and, for lim r / s = p, that s-+oo

lim s-nc(n, k; s, r)

s-+oo

= S(n, k; p).

38. (Continuation). Non-central Lah numbers. Consider the expansion n

(-(t- r))n =

2::: L(n, k; r)(t)k, n = 0, 1, ... . k=O

STIRLING NUMBERS

336

The coefficient L(n, k; r) is called non-central Lah number; it is a particular case, s = -1, of the non-central generalized factorial coefficient. Show that n

n! (n- r- 1)

L(n,k;r)=(-1) k!

k-r- 1

.

39. (Continuation). Show that n

C(n, k; s, ps- r)

=L

s(n,j; r)S(j, k; p)sl

j=k

and conclude that ts(n,j;r)S(j,k;p) )=k t(-1)n-js(n,j;r)S(j,k;p) )=k

= (~) (p-r)n-k, = (~)

(p-r+n-1)n-k·

40. (Continuation). Show that n

LC(n,j;sl,ri)C(j,k;s2,r2) = C(n,k;s1s2,r1 +r2s1) j=k and conclude that 1 tc(n,j;s,ri)C(j,k;s- ,r2) = J=k

and

(~) (r1 +r2s)n-k,

n

L C(n, j; s, r)C(j, k; s- 1, -rs- 1) j=k

= 8n,k·

41. (Continuation). Let 1

00

cPk(u;s,r) = LC(n-1,k-1;s,r)(u)n' k = 1,2, .... n=k

Show that cPk(u; s, r)

= (u

1

_ r)js _ (k _ 1) c/Jk-du; s, r), k

= 2, 3, ...

,

8. 7. EXERCISES

with ¢ 1 (u;s,r)

337

= 1/(u- r), and conclude that 1

¢k(u; s, r)

= s (( u-r )/ s )k

and 00

1

sC(n- 1, k- 1; s, r) (

-)( = L

t k

n=k

1

st

+r

) . n

42. (Continuation). Show that

(

k+m) k C(n,k+m;s,r 1 +r2 )

=

~ (~) C(j, k; s, rt)C(n- j, m; s, r2) j=k

J

and conclude its inverse relation

(7) C(n-i,m;s,r2)

'E' (k~m)

=

C(k,i;s- 1 ,-r1 s- 1 )C(n,k+m;s,r, +r2).

43. (Continuation). Show that n

(tb+! D)n f(t) = L( -1)n-kbna-kC(n, k; s, r)tbn-ak(Dta+l )k f(t), k=O where s

= ajb, r =

(a+ 1)/b, and conclude that n

(tb+l D)n J(t)

= L( -1)nbnC(n, k; s)tbn+k Dk f(t), s = -1/b k=O

and

n

(tDt f(t) = LS(n, k)tkDk f(t). k=O 44. Consider an urn containing s identical series of coupons, each consisting of m coupons bearing the numbers 1, 2, ... , m and r additional coupons, all bearing the number m + 1. Suppose that coupons are drawn one after the other, at random, without replacement. Show that (a) the probability

STIRLING NUMBERS

338

p(k; n) of drawing exactly k of them numbers {1, 2, ... , m} in n drawings, with n ::=; m, is given by . ) = C(n, k; s, r)(m)k k = 1 0 , , ... ,n (k p,n ( ) , sm +r n and (b) the probability q(n; k) that n drawings are required until the kth different number, among the m numbers { 1, 2, ... , m}, is drawn, with k ::=; m, is given by

q(n; k)

=

C(n- 1,k- 1;s,r)s(m)k (sm +r )n ,n

= k, k + 1, ...

, sm

+ r.

45. (Continuation). Suppose that from the urn coupons are drawn one after the other, at random, by returning in the urn, after each drawing, the chosen coupon together with another coupon bearing the same number. Show that (a) the probability p(k; n) of drawing exactly k of the m numbers {1, 2, ... , m} in n drawings is given by p (k ,n)

= JC(n,k;-s,-r)J(m+k-1)k k=O ( ) , , 1, ... ,n sm + r + n -1 n

where JC(n, k; -s, -r)J = ( -1)nC(n, k; -s, -r). Further show that (b) the probability q(n; k) that n drawings are required until the k-th different number, among the m numbers { 1, 2, ... , m}, is drawn is given by

. k) _ JC(n- 1, k- 1; -s, -r)Js(m q (n, ( ) sm + r + n -1 n

+ k- 1)r

_ k k

,n-

, + 1, ....

Chapter 9 DISTRIBUTIONS AND OCCUPANCY

9.1

INTRODUCTION

A considerable number of combinatorial configurations, such as permutations, combinations and partitions of a finite set under various conditions, can be described by the model of distribution (allocation) of balls (objects) into urns (cells, boxes), introduced by P. MacMahon. It is an advantageous approach, since urn models can be easily visualized and are very flexible. Further, these models admit many equivalent interpretations. In general, the balls are of the type (r 1 , r2, ... , rm) with r1 + r2 + · · · + rm = n, that is, ri of the n balls are of the i-th kind, i = 1, 2, ... , m. The urns are of the type (si,s2,··· ,sv) with s1 + s2 + ··· + Sv = k, that is, Sj of the k urns are of the j-th kind, j = 1, 2, ... , v. Moreover, the urns may be of limited or unlimited capacity and the balls in each urn may be ordered or unordered. The enumeration of the assignments of the balls to the urns is a distribution problem, while the enumeration of the balls in specified or arbitrary urns is an occupancy problem. This general consideration reveals a host of enumeration problems. Particular cases of such problems have been examined in Chapter 2 as applications of enumeration of certain permutations and combinations. In the present chapter, more general distribution and occupancy problems are studied by using the inclusion and exclusion principle and generating functions. Specifically, the classical occupancy problem and some of its modifications are examined in length. Then the distributions of balls into urns, when the ordering of the balls in the urns counts, are enumerated. Further, the problem of enumeration of the distributions of balls of a general specification into distinguishable urns is treated by using the inclusion and exclusion principle. As applications, a variety of committee problems is discussed. Finally, the use of generating functions in coping with the same general problem is demonstrated.

DISTRIBUTIONS AND OCCUPANCY

340

9.2

CLASSICAL OCCUPANCY AND MODIFICATIONS

Let us first consider n distinguishable balls and k distinguishable urns and assume that the capacity of each urn is unlimited. The urns as distinguishable, without any loss of generality, may be numbered from 1 to k. Then, the number of distributions of n distinguishable balls into k distinguishable urns equals

the number of n-permutations of the set {1, 2, ... , k }, with repetition (see Theorem 2.3). Further, the number of distributions of n distinguishable balls into k distinguishable urns with rj balls in the j-th urn, j = 1, 2, ... , k, r1 + r2 + · · · + rk = n, equals

n!

the number of divisions of the set of n balls {1, 2, ... , n} into k subsets containing r 1, r2, ... , rk balls, respectively (see Theorem 2.8). In the classical occupancy problem, the number of distributions with a given number of occupied urns is of interest. The next theorem is concerned with this number.

THEOREM9.1 The number of distributions of n distinguishable balls into k distinguishable urns so that r urns are occupied is given by N(n, k, r) = (k)rS(n, r),

where S(n, r) =

~ r.

i)

-1)j

j=O

(9.1)

(~) (r- j)n, J

is the Stirling number of the second kind. PROOF Consider the set [l of distributions of n distinguishable balls into k distinguishable urns and let Ai be the subset of these distributions in which the i-th urn remains empty, i = 1, 2, ... , k. Then, for any selection of s indices {i 1 ,i2, ... ,i.},outofthekindices{l,2, ... ,k},

9.2.

CLASSICAL OCCUPANCY AND MODIFICATIONS

341

which is the number of distributions of n distinguishable balls into the remaining (after excluding the s specified urns) k - s distinguishable urns. This expression implies the exchangeability of the sets A 1 , A2 , ... , Ak. Further, the number N(n, k, r) of distributions of n distinguishable balls into k distinguishable urns, which leave k - r urns empty (and consequently r urns occupied), equals the number Nk,k-r of elements of [l that are contained in k - r among the k sets A 1 , A2, ... , Ak. Thus, according to Corollary 4.4, we deduce the expression

which, upon using the explicit expression of the Stirling numbers of the second I kind (see Section 8.3), implies (9.1). COROLLARY 9.1 The number of distributions of n distinguishable balls into k distinguishable urns so that, out of s specified urns, r urns are occupied is given by

N(n,k,s,r) where S (n, r; k - s) =

~

= (s)rS(n,r;k-s)

t(

-1 )i

j=O

(~) ( k -

s

+r

(9.2)

- j) n,

J

is the non-central Stirling number of the second kind. PROOF Note that i balls can be selected from n distinguishable balls in (~) ways, i = 0, 1, ... , n. Further, for each selection, thei balls, according to Theorem 9.1, can be distributed into the s specified urns, so that r among them are occupied in

ways, while the remaining n - i balls can be distributed into the remaining k - s urns, without any restriction, in (k - s )n-i ways, i = 0, 1, ... , n. So, according to the multiplication principle, there are

different such distributions. Thus, summing fori = 0, 1, ... , n, according to the addition principle, the number of distributions of n distinguishable balls into k

DISTRIBUTIONS AND OCCUPANCY

342

distinguishable urns so that r among s specified urns are occupied is obtained as

N(n, k, s, r) =

The last expression, using the explicit expression of the non-central Stirling numI bers of the second kind (see Section 8.5), implies (9.2). COROLLARY 9.2 The number of distributions of n distinguishable balls into k indistinguishable urns so that r urns are occupied is given by

·(r)

1 ~ S(n,r)=;:yL...(-1)1

. (r-j)n,

(9.3)

J

j=O

the Stirling number of the second kind, while, without any restriction, it is given by k

B(n,k)

= LS(n,r),

(9.4)

r=l

the Bell number. PROOF Note first that r urns can be selected from k indistinguishable urns in only one way. Further, let R(n, r) and N(n, r) be the number of distributions of n distinguishable balls into r indistinguishable urns and into r distinguishable urns, respectively, so that no urn remains empty. Consider a distribution of n distinguishable balls into r indistinguishable urns so that no urn remains empty. If the r indistinguishable urns are transformed to distinguishable, by numbering them, and permuted in all possible ways, r! distributions of n distinguishable balls into r distinguishable urns, so that no urn remains empty, are constructed. Consequently r!R(n, r) = N(n, r) and since, by Theorem 9.1, N(n, r) = r!S(n, r), it follows that R(n, r) = S(n, r). Thus, the number R(n, k, r) of distributions of n distinguishable balls into k indistinguishable urns so that r urns are occupied is given by (9.3). As regards the evaluation of the number B(n, k) of distributions of n distinguishable balls into k indistinguishable urns, without any restriction, note that, in such a distribution, 1 or 2 or , ... , or k urns are occupied. Since the number of distributions of n distinguishable balls into k indistinguishable urns with r occupied urns equals S(n, r), summing for all values r = 1, 2, ... , k, according to the addition principle, we deduce (9.4). I

9.2.

CLASSICAL OCCUPANCY AND MODIFICATIONS

343

Consider now n indistinguishable (like) balls and k distinguishable urns. Again, the urns as distinguishable may be numbered from 1 to k. The number of distributions of n indistinguishable balls into k distinguishable urns equals the number of nonnegative integer solutions of the linear equation r 1 + r2 + · · · + rk = n, where Tj is the number of balls in the j-th urn, j = 1, 2, ... , k. Thus, according to Theorem 2.12, the number of distributions of n indistinguishable balls into k distinguishable urns equals

the number of n-combinations of the k urns {1, 2, ... , k} with repetition. Further, the number of distributions of n indistinguishable balls into k distinguishable urns so that no urn remains empty equals the number of positive integer solutions of the linear equation r 1 +r 2 +· · · +rk = n, which, according to Corollary 2.5, equals

(n-1)

k -1 ,

the number of n-combinations of the k urns { 1, 2, ... , k}, with repetition and the restriction that each urn is included at least once. As a consequence of these remarks, the following corollary, analogous to Theorem 9.1, is deduced. COROLLARY 9.3 The number of distributions of n indistinguishable balls into k distinguishable urns so that r urns are occupied is given by (9.5)

PROOF Note that r urns can be selected from k distinguishable urns in (~) ways and n indistinguishable balls can be distributed into these r urns, so that no urn remains empty, in (~::::D ways. Thus, according to the multiplication principle,

the required number of distributions is deduced as (9.5).

I

Let us, more generally, consider n indistinguishable (like) balls and k distinguishable urns, each divided into s distinguishable cells (compartments). Further, assume that each cell is of capacity limited to one ball. Then, the number of distributions of n indistinguishable balls into the k distinguishable urns (sk distinguishable cells) equals

DISTRIBUTIONS AND OCCUPANCY

344

while the number of distributions of n indistinguishable balls into the k distinguishable urns with Tj balls in the j-th urn, j = 1, 2, ... , k, Tt + r2 + · · · + Tk = n, equals

(~) (;J ... (~).

The next theorem is analogous to Theorem 9.1.

THEOREM9.2 The number of distributions of n indistinguishable balls into k distinguishable urns, each with s distinguishable cells ofcapacity limited to one ball, so that r urns are occupied, is given by

(k)r R(n,k,s,r) = - 1-C(n,r;s) n.

where

C(n,r;s)

(9.6)

= ~ t(-1r-i(~)(sj)n J

j=O

is the generalized factorial coefficient. PROOF Consider the set[} of distributions of n indistinguishable (like) balls into k distinguishable urns, each with s distinguishable cells of capacity limited to one ball. Let Ai be the subset of these distributions in which the i-th urn remains empty, i = 1, 2, ... , k. Then, for any selection of j indices {i~, i 2 , .•. , ij }, out of the k indices {1, 2, ... , k },

vi= N(Ai,Ai 2 ···AiJ = (

s(kn

j)) .

, J = 1,2, ... ,k,

which is the number of distributions of n indistinguishable balls into the remaining (after excluding the j specified urns) k - j distinguishable urns (s(k - j) distinguishable cells each of capacity limited to one ball). This expression implies the exchangeability of the sets At, A2 , ••• , Ak. Further, the number R( n, k, s, r) of distributions of n indistinguishable balls into k distinguishable urns that leave k- r urns empty (and consequently r urns occupied) equals the number Nk,k-r of elements of [} that are contained in k - r among the k sets At, A2, ... , Ak. Thus, according to Corollary 4.4, we get the expression

which, using the explicit expression of the generalized factorial coefficient (see Section 8.4), implies (9.6). I

9.2.

CLASSICAL OCCUPANCY AND MODIFICATIONS

345

REMARK 9.1 The number of distributions of n distinguishable balls into k distinguishable urns, each with s distinguishable cells of capacity limited to one ball, equals (sk)n,

while, with the restriction that r urns are occupied, is given by n!R(n, k, s, r) = (k)rC(n, r; s),

where C (n, r; s) is generalized factorial coefficient.

(9.7)

I

Assume now that, in the preceding model, the cells are of unlimited capacity. Then, the number of distributions of n indistinguishable balls into the k distinguishable urns (sk distinguishable cells), equals

while the number of distributions of n indistinguishable balls into the k distinguishable urns, each with s distinguishable cells, with r1 balls in the j-th urn, j = 1, 2, ... , k, r 1 + r2 + · · · + Tk = n, is given by

The next theorem is analogous to Theorem 9.1 and 9.2. THEOREM9.3 The number of distributions of n indistinguishable balls into k distinguishable urns, each with s distinguishable cells of unlimited capacity, so that r urns are occupied, is given by

T(n, k, s, r)

= -(k)r IC(n, r; -s)l, n.1

(9.8)

where IC(n, r; -s)l = ( -1)nC(n, r; -s) =

~ r.

i)

J=O

-1r-j (~) (sj J

+ n- 1)n

is the generalized factorial coefficient. PROOF Consider the set fl of distributions of n indistinguishable (like) balls into k distinguishable urns, each with s distinguishable cells of unlimited capacity. Let Ai be the subset of these distributions, in which the i-th urn remains empty,

DISTRIBUTIONS AND OCCUPANCY

346

i = 1, 2, ... , k. Then, for any selection of j indices {it, i 2 , •.. , ij }, out of the k indices {1, 2, ... , k },

v1 = N(A;,A; 2

...

A;,)= (

s(k- j) + n- 1) . n , J = 1,2, ... ,k,

which is the number of distributions of n indistinguishable balls into the remaining (afterexcluding the j specified urns) k - j distinguishable urns (s(k - j) distinguishable cells, each of unlim1ted capacity). This expression implies the exchangeability of the sets At, A2, ... , Ak. Further, the number T(n, k, s, r) of distributions of n indistinguishable balls into k distinguishable urns, which leave k- r urns empty (and consequently r urns occupied), equals the number Nk,k-r of elements of fl that are contained in k - r among the k sets A 1 , A 2 , . . . , Ak. Thus, according to Corollary 4.4, we deduce the expression

which, upon introducing the explicit expression of the generalized factorial coefficient, implies (9.8). I REMARK 9.2 The enumeration of distributions of indistinguishable balls into indistinguishable urns with or without restrictions cannot be handled by using the inclusion and exclusion principle. Further, it cannot be connected with the enumeration of distributions of indistinguishable balls into distinguishable urns, as the enumeration of distinguishable balls into indistinguishable urns is connected with the enumeration of distributions of distinguishable balls into distinguishable I urns. This problem will be separately examined in the next chapter.

Example 9.1 The Morse code A letter in the Morse code is formed by a succession of dashes and dots with repetitions allowed. The two symbols, dash and dot, may be considered as two distinguishable urns and then different positions (first, second, ... , n-th) of a letter as n distinguishable balls. Thus, a formation of a letter of n symbols corresponds to a distribution of n distinguishable balls into k = 2 distinguishable urns. Consequently, there are 2n different letters of n symbols. Further, the number of letters of n symbols that include both the dash and dot symbols, according to Theorem 9.1, equals

t(-1)j j=O

(~) (2- j)n = 2n- 2. J

In the more general k-symbol code, there are kn different letters of n symbols. Further, the number of letters of n symbols that include rout of s specified symbols,

9.2.

CLASSICAL OCCUPANCY AND MODIFICATIONS

347

according to Corollary 9 .I , is given by N(n,k,s,r) = (8)rS(n,r;k- 8), where S (n, r; k - 8) is the non-central Stirling number of the second kind.

0

Example 9.2 Decomposition of a product of primes into factors Consider a product Pn = a 1 a2 ···an. where ai, i = 1, 2, ... , n, are different prime numbers. Find the number of decompositions of the product Pn· of n different prime numbers, into k factors. The n different prime numbers {a 1 , a 2 , •.• , an} may be considered as n distinguishable balls and the k factors, which are not ordered, as k indistinguishable urns. Thus, a decomposition of a product of n different prime numbers into k factors corresponds to a distribution of n distinguishable balls into k indistinguishable urns with no urn empty and vice versa. For instance, the different decompositions of the product p3 = a 1 a 2 a 3 of n = 3 different prime numbers into k = 2 factors, and their corresponding distributions of three distinguishable balls into two indistinguishable urns with no urn empty, are the following:

Hence, the number of decompositions of a product of n different prime numbers into k factors equals the number of distributions of n distinguishable balls into k indistinguishable urns with no urn empty. According to Corollary 9.2, this is given by S (n, k), the Stirling number of the second kind. 0

Example 9.3 Selection of a central committee For the selection of the n members of the central committee of a federation of k associations, each association submits a list of 8 candidates. Find the number of different selections of the n members of the central committee in which r associations are represented in the committee. The n members of the central committee may be considered as n indistinguishable balls and the k associations ask distinguishable urns, each with 8 distinguishable cells of capacity limited to one ball. Thus, a selection of the n members of the central committee from the k lists, each with 8 candidates, corresponds to a distribution of n indistinguishable balls into k distinguishable urns, each with 8 distinguishable cells of capacity limited to one ball. Consequently, the number of selections of the n members of the central committee from the k lists, each with 8 candidates, so that r associations are represented in the committee, according to Theorem 9.2, is given by (k)r R (n,k,8,r ) = - 1-C(n,r;8),

n.

where C(n, r; s) is the generalized factorial coefficient.

0

348

9.3

DISTRIBUTIONS AND OCCUPANCY

ORDERED DISTRIBUTIONS AND OCCUPANCY

The case with ordered balls in each urn is of particular interest. The urns with ordered balls are simply called ordered urns. The enumeration of the distributions of balls of any specification into distinguishable ordered urns, with or without restrictions, is closely related to the enumeration of the distributions of indistinguishable (like) balls into distinguishable (nonordered) urns. Specifically, we have the next theorem.

THEOREM9.4 The number ofdistributions ofn balls of the type (r 1, r2, ... , rm). where r 1 +r2 + · · · + rm = n, into k distinguishable ordered urns without any restriction is given by (9.9)

and, with the restriction that r urns are occupied, is given by (9.10)

PROOF Note that any distributionofn balls of the type (r 1, r 2, ... , rm) into k distinguishable ordered urns, with or without restrictions, may be carried out in two consecutive stages. Initially, the n balls are distributed into the k distinguishable urns, without taking into account which elements and in what order are placed into each urn. The number Q(n, k) of these distributions equals the number of the distributions of n indistinguishable balls into k distinguishable urns. This number, in the absence of any restriction, is given by

and, with the restriction that r urns are occupied, according to Corollary 9.3, is given by

Further, for each such distribution, by taking into account that the n balls are of the type (r 1 , r 2 , ... , r m) and permuting them, all possible orderings in the urns are accomplished. Since the number of permutations of the n balls of the type

9.3. ORDERED DISTRIBUTIONS AND OCCUPANCY

349

(r 1 , r 2 , ... , rm), according to Theorem 2.4, is given by

n!

applying the multiplication principle, (9.9) and (9 .I 0) are deduced.

I

The following corollary of Theorem 9.4 is concerned with the particular case of n distinguishable balls.

COROLLARY 9.4 The number of distributions of n distinguishable balls, into k distinguishable ordered urns, without any restriction, is given by

n.1

(k + nn -1) -(k+n-1)n, _

(9.11)

and, with the restriction that r urns are occupied, is given by (9.12)

Example 9.4 Priority lists Suppose that n persons have applied for certain vacant positions ink organizations of the public sector. Each candidate is placed on only one of k different priority lists and each organization is filling its vacant positions from the corresponding priority list. Find the number of ways of placing the n candidates on the k priority lists. Then candidates may be considered as n distinguishable balls and the kdifferent priority lists ask distinguishable ordered urns. Then, the number of ways of placing the n candidates on the k priority lists without any restriction, according to (9 .11 ), is given by

n.1

(k + nn -1) -_(k + n-

1)n,

and, with the restriction that each of r organizations should fill at least one position, according to (9.12), is given by

DISTRIBUTIONS AND OCCUPANCY

350

9.4

BALLS OF GENERAL SPECIFICATION AND DISTINGUISHABLE URNS

In the introduction to this chapter, the balls of a general specification were classified according to the kind to which they belong and the notation (r 1, r 2 , ... , rm), with r1 +r2+ · · ·+rm = n, where ri is the number of balls of the i-th kind, i = 1, 2, ... , m, was used. These balls may also be classified according to their multiplicity and the notation [m 1 , m 2 , ... , mnJ, with m 1 + 2m 2 + · · · + nmn = n, where mi ~ 0 is the number of distinguishable kinds of balls, each including i like balls, i = 1, 2, ... , n, may be used. In this case, the partition notation (1m, 2m 2 • • • n m,.) may also be used.

THEOREM9.5 The number of distributions ofn balls of the specification [m 1, m2, ... , mn], with mi ~ 0, i = 1, 2, ... , nand m 1 +2m 2 + · · · + nmn = n, into k distinguishable urns is given by

(k)1 (k +2 1) m,

m

2

...

(k + n _ 1) n

m,.

. (9.13)

PROOF

Note first that the number of distributions of i like balls into k distinguishable urns equals (k+!- 1), i = 1, 2, ... , n. Further, by the multiplication principle, the number of distributions of mi ~ 0 distinguishable kinds of balls, each including i like balls, into k distinguishable urns is given by (k+!- 1 ) m,, i = 1, 2, ... , n. Applying, once more, the multiplication principle, we conclude that the number of distributions of n balls of the specification [m 1 , m 2 , ... , mn], with mi ~ 0, i = 1, 2, ... , nand m 1 +2m 2 +···+ nmn = n, into k distinguishable urns is given by the expression (9.13). I

THEOREM9.6 The number of distributions ofn balls of the specification [m 1, m2, ... , mn], with mi ~ 0, i = 1, 2, ... , nand m 1 +2m 2 +···+ nmn = n, into k distinguishable urns so that r urns are occupied is given by

PROOF

Consider the set Jl of distributions of n balls of the specification [m 1, m 2, ... , mn] into k distinguishable urns and let Ai be the subset of these distributions in which the i-th cell remains empty, i = 1, 2, ... , k. Then, for any

9.4.

BALLS OF GENERAL SPECIFICATION

351

selection of s indices {i 1, i2, ... , is} out of the k indices {1, 2, ... , k }, according to Theorem 9.5,

This expression implies the exchangeability of the sets A 1 , A 2 , ... , Ak. Further, the number R(m 1 , m 2 , .•. , mn; k, r) of distributions of n balls of the specification [m 1, m2, ... , mn] into k distinguishable urns, which leave k - r urns empty (and consequently r urns occupied), equals the number Nk,k-r of elements of Jl that are contained in k - r among the k sets A 1 , A2 , ... , Ak. Thus, according to Corollary 4.4, (9.14) is established. I Some particular cases of (9.14), of special interest, have been already examined in Section 9.2. The case of n distinguishable balls corresponds to m 1 = n, mi = 0, i = 2, 3, ... , n, while the case of n indistinguishable (like) balls corresponds to mi = 0, i = 1, 2, ... , n-1, mn = 1. Another particular case that corresponds to m 8 = m, mi = 0, i = 1, 2, ... , s- 1, s + 1, ... , n is explicitly presented in the next corollary.

COROLLARY 9.5 The number of distributions of sm balls, which belong in m distinguishable kinds with s like balls of each kind, into k distinguishable urns so that r urns are occupied is given by

(9.15)

Let us now consider the case of the existence of restrictions in the capacity of the urns. Specifically, the placement of a ball into an urn excludes the possibility of placing any other like ball into it. Thus, the balls that are allowed to be placed in any urn are all distinguishable.

THEOREM9.7 The number of distributions ofn balls of the specification [m 1, m2, ... , mn]. with mi 2: 0, i = 1, 2, ... , nand m 1 +2m 2 + · · · + nmn = n, into k distinguishable urns, each of which may accommodate at most one ball from each kind, is given by

V(m1,m2, ... ,mn;k) =

(k)1 (k)2 m,

m2

(k)

.. · n

mn

(9.16)

PROOF Note first that, since each urn may accommodate at most one ball from each kind, the number of distributions of i like balls into k distinguishable urns

352

DISTRIBUTIONS AND OCCUPANCY

equals(~), i = 1, 2, ... , n. Further, by the multiplication principle, the number of distributions of m; ;::: 0 distinguishable kinds of balls, each including i like balls, into k distinguishable urns is given by (~) mi, i = 1, 2, ... , n. Applying, once more, the multiplication principle, we conclude that the number of distributions of n balls of the specification [m 1, m 2, ... , mn], with m; ;::: 0, i = 1, 2, ... , n and m 1 + 2m 2 + · · · + nmn = n, into k distinguishable urns, each of which may I accommodate at most one ball from each kind, is given by (9.16).

Using the inclusion and exclusion principle and Theorem 9. 7, the next theorem (analogous to Theorem 9.6) is deduced.

THEOREM9.8 The number of distributions ofn balls of the specification [m1, m2, ... , mn], with m; ;::: 0, i = 1, 2, ... , nand m 1 +2m 2 +···+ nmn = n, into k distinguishable urns, each of which may accommodate at most one ball from each kind, so that r urns are occupied, is given by

COROLLARY 9.6 The number of distributions of sm balls, which belong in m distinguishable kinds with s like balls of each kind, into k distinguishable urns, each of which may accommodate at most one ball from each kind, so that r urns are occupied, is given by Q(m,8,k,r)

=G) ~(-1r-iG) (!)m

(9.18)

Example 9.5 Formation of committees Assume that, for the 8m = n positions of m committees, each with 8 positions, there are k candidates. Find the number of ways then members of the committees can be selected so that r of the k candidates will participate in at least one committee. The 8m = n positions of the m committees, each with 8 positions, may be considered as m distinguishable kinds of balls, each with 8 balls, and the k candidates as k distinguishable urns. Thus, the placement of a ball of the i-th kind into the j-th urn corresponds to the selection of the j-th candidate for a position of the i-th committee. We assume that no candidate can be assigned to more than one position of the same committee, but can participate in more than one committee. This assumption implies that each urn may accommodate at most one ball from each kind. Consequently, according to Corollary 9.6, the number of ways then members of

9.5. GENERATING FUNCTIONS

353

the committees can be selected so that r of the k candidates will participate in at least one committee is given by

Q(m,8,k,r)

=G) ~(-rr-j(:) (!)m

In the particular case when each of the k candidates must participate in at least one committee, the number of ways the n members of the committees can be selected is given by

Example 9.6 Formation of committees from grouped candidates Assume that each of k different political groups submits a full priority list of n candidates to the president's office for the 8m = n positions of m committees, each with 8 positions. Find the number of ways then members of the committees can be selected so that r of the k political groups will be represented in at least one committee. As in the preceding example, the 8m = n positions of the m committees, each with 8 positions, may be considered as m distinguishable kinds of balls, each with 8 balls, and the k political groups as k distinguishable urns. In this case, there is no restriction on the number of balls of the same kind that each urn may accommodate. Consequently, according to Corollary 9.5, the number of ways then members of the committees can be selected so that r of the k political groups will be represented in at least one committee is given by P(m,8,k,r)

=G) ~(-rr-jG)

e+: -l)

m

In the particular case when each of the k political groups must be represented in at least one committee, the number of ways the n members of the committees can be selected is given by

9.5

GENERATING FUNCTIONS

The use of generating functions in the study of distributions and occupancy leads to a more extensive development of this subject. In this section,

DISTRIBUTIONS AND OCCUPANCY

354

we present the generating functions of the cases of distinguishable or indistinguishable balls and distinguishable urns, as well as the case of balls of a general specification and distinguishable urns. Consider first the case of distinguishable balls and urns. Let us attach the occupancy indicator Xj to the j-th urn, j = 1, 2, ... , k, so that the homogeneous product of order n, x~' x~ 2 • • • x~k, with r 1 + r 2 + · · · + rk = n, uniquely determines the distribution of n distinguishable balls into k distinguishable urns, with Tj balls in the j-th urn, j = 1, 2, ... , k. Then the indicator (generating function) of the distributions of a single ball into k distinguishable urns is

and hence the generating function of the distributions of n distinguishable balls into k distinguishable urns, with respect to the numbers of balls in the urns, is (9.19) Note that (9.19) expanded into powers of x 1 , x2, ... , Xk by using the multinomial theorem,

2:

n! I I · · "Tk·l TI.T2·

x2 rk x r, 1 x 2 ···xk

= ( x 1 +x 2 + ···+xk )n ,

gives the number of distributions of n distinguishable balls into k distinguishable urns with ri balls in the j-th urn, j = 1, 2, ... , k, r 1 + r 2 + · · · + Tk = n. The exponential generating function of the sequence 9n(x 1 , x 2, ... , xk), n = 0, 1, ... , of generating functions (9.19) is oo

G(t;xl,X2,··. ,xk)

= L9n(XI,X2,···

tn ,xk)!

n. = exp{(x1 + x2 + · · · + xk)t} n=O

Therefore, the enumerator for occupancy of k distinguishable urns is given by (9.20) where the enumerator for occupancy of the j-th urn is given by x2t2

E(t;xi)

= 1 +xit + - 12.- 1- + ··· = e"''t,

j = 1,2, ... ,k,

(9.21)

exactly as in the case of permutations with repetition (see Section 6.3). The occupancy for each urn is specified independently of the other urns. Thus,

9.5. GENERATING FUNCTIONS

355

if the j-th urn must contain at least r and at most s balls, the enumerator for its occupancy is

xrtr Er,s(t; Sj) =

xr+ltr+l

~! + Cr + 1)! + · · · +

xsts

7

(9.22)

and (9.20) is accordingly modified. In the case of n indistinguishable balls, there exists only one distribution of them into k distinguishable urns so that the j-th urn contains r i balls, for j = 1, 2, ... , k and r 1 + r2 + · · · + rk = n. Hence, the generating function of the distributions of n indistinguishable balls into k distinguishable urns, with respect to the numbers of balls in the urns, is given by (9.23)

where the summation is extended over all rj 2: 0, j = 1, 2, ... , k with r 1 +r 2 +· · ·+rk = n. The function hn(x1,x2, ... ,xk) is called homogeneous product sum of weight k. Note that the corresponding generating function of the distributions of n distinguishable balls is given by

gn(x1,x2, ... ,xk) = [hl(x1,x2, ... ,xk)]n, where hi(XI,X2, ... ,xk) =XI+ X2 + · · · + Xk· The ordinary generating function of the sequence hn n = 0, 1, ... , of generating functions (9.23), since 00

00

LLx~'x~ 2 n=O

..

00

00

·x~ktn = L:Cx1tf' L:Cx2tr 2 rt=O

=hn (x1, x2, ... , Xk), ...

r2=0

L(xktfk, rk=O

is deduced as 00

H(t; XI, X2, ... , Xk) = L hn(XI, X2, ... , Xk)tn n=O 1

(9.24)

Therefore, the enumerator for occupancy of k distinguishable urns is given by

H(t; x1, x2, ... , xk) = F(t; xi)F(t; x2) · · · F(t; Xk),

(9.25)

where the enumerator for occupancy of the j-th urn is given by

F(t;xi) = 1 +xit +x]t 2 + ·· · = (1- x 3t)- 1 , j = 1,2, ... ,k, (9.26) exactly as in the case of combinations with repetition (see Section 6.3). The occupancy for each urn is specified independently of the other urns. Thus,

DISTRIBUTIONS AND OCCUPANCY

356

if the j-th urn must contain at least r and at most s balls, the enumerator for its occupancy is · (9.27)

and (9.25) is accordingly modified. Let us finally consider the general case of n balls of the specification [m 1, m2, ... , mn], with m 1 +2m2 + · · · + nmn = n, where mi 2: 0 is the number of balls of multiplicity i (that is, the number of distinguishable kinds of balls, each including i like balls), i = 1, 2, ... , n. The generating function of the distributions of i indistinguishable (like) balls into k distinguishable urns, with respect to the numbers of balls in the urns, according to (9.23), is given by hi(x 1, x2, ... , Xk), the homogeneous product sum of weight i. Since the mi 2: 0 distinguishable kinds of balls, each of which includes i like balls, are independently distributed, the generating function of the distributions of these balls is given by [hi(x 1, x2, ... , xk)]m•, i = 1, 2, ... , n. Therefore, the generating function of the distributions of n balls of the specification [m 1, m2, ... , mnJ, mi 2: 0, i = 1, 2, ... , n, m 1 + 2m2 + · · · + nmn = n, into k distinguishable urns, with respect to the numbers of balls in the urns, is given by n

hm 1 ,m2 , ... ,mn(XI,X2,··· ,Xk)

= II[hi(XI,X2,···

,Xk)]m'.

(9.28)

i=l

Note that (9.28), for xi = 1, j = 1, 2, ... , k, yields the total number of distributions of then balls of the specification [m 1, m2, ... , mn] into k distinguishable urns. The fact that this number agrees with that of Theorem 9.5 follows from the expression hi(1, 1, ... , 1) = (k+!-I), i = 1, 2, ... , n. The enumerator for occupancy of the j-th cell by n balls of the specification [m1, m2, ... , mn], with mi 2: 0, i = 1, 2, ... , n, m1 +2m2+·· ·+nmn = n and m 1 + m 2 + · · · + mn = m, where m is the total number of distinguishable kinds of balls, is given by

F(t1,t2,···,tm;Xj)=

1

)

(1- Xjt1)(1- Xjt2 · · · (1- Xjtm

)'

where the term (xitd"' (xit 2)"2 • • • (xjtm)"m indicates the occupancy of the j-th urn by v = v 1 + 112 + · · · + Vm balls, among which 111 are of the l-th kind, l = 1, 2, ... , m. The occupancy of each urn is specified independently of the other urns and so the enumerator for occupancy of the k urns is given by

H(t1,t2,··· ,tm;XI,X2,··. ,xk) = F(t1,t2,··· ,tm;xi)F(ti,t2,··· ,tm;X2)···F(t1,t2,··· ,tm;Xk)· Two illustrative examples follow.

9.5. GENERATING FUNCTIONS

357

Example9.7 The generating function G (t), of the number of distributions of n distinguishable balls into k distinguishable urns, without any restriction, is deduced from (9.20) and (9.21) by setting Xj = 1, j = 1, 2, ... , k. Then, •

E(t; 1)

=G(t; 1, 1, ... , 1) = ekt = L kn 1tnn. , co

= et, G(t)

n=O

and hence the number of distributions of n distinguishable balls into k distinguishable urns equals In the case ofthe restriction that each urn should contain at least one ball, it follows from (9.20) and (9.22) that t2

E1(t; 1) = t +I+···= et- 1, G 1(t) =: GI(t; 1, 1, ... , 1) = (et- 1)k. 2.

Expanding the generating function GI(t) into powers oft by using Newton's binomial theorem, we find

Therefore, the number of distributions of n distinguishable balls into k distinguishable urns so that all k urns are occupied is given by N(n, k)

=

t( j=O

-1)j

(~) (k- j)n = k!S(n, k), J

in agreement with (9.1) in the particular case of r = k.

0

Example9.8 The generating function, H ( t), of the number of distributions of n indistinguishable balls into k distinguishable urns, without any restriction, is deduced from (9.25) and (9.26) by setting Xj = 1, j = 1, 2, ... , k. Then

F(t; 1) = (1- t)- 1 , H(t) =:H(t;1,1, ... ,1) = (1-t)-k =

co 2)-l)n

n=O

(-k) tn, n

358

DISTRIBUTIONS AND OCCUPANCY

and hence the number of distributions of n indistinguishable balls into k distinguishable urns equals

in agreement with the results stated in Section 9.2. In the case of the restriction that each urn should contain at least one ball, it follows from (9.25) and (9.27) that

Expanding the generating function H 1 (t) into powers oft by using Newton's negative binomial theorem, we find

Therefore, the number of distributions of n indistinguishable balls into k distinguishable urns, so that all k urns are occupied, is given by

-1)

n ( k -1

.

Further applications may be found in the exercises.

0

9.6 BIBLIOGRAPHIC NOTES P. A. MacMahon (1915, 1916) in his treatise on combinatorial analysis introduced and extensively studied, mostly through generating functions, the theory of distribution of balls (objects) into urns (cells, boxes). Theorem 9.5, which is concerned with the distributions of balls of a general specification into distinguishable urns, was derived by the aid of generating functions. Also, Section 9.5 on the study of distributions through enumerating generating function is based on the books of P. A. MacMahon (1915, 1916) and J. Riordan (1958). W. Feller (1968) treated the classical occupancy problem and the coupon collector's problem by using the inclusion and exclusion principle. N. L. Johnson and S. Kotz (1977) devoted a chapter to the occupancy theory containing a wealth of information and an extensive Jist of references.

9. 7. EXERCISES

9.7

359

EXERCISES

1. Let N 1 (n, k, r) be the number of distributions of n distinguishable balls into k distinguishable urns, so that r urns are occupied, each by j balls. Show that .

_

N1 (n,k,r)-

(k)r ~( k

_

1)

i-r

r) (ki-r

'

n. _ · n-ij (j!)i(n-ij)!(k z) .

2. (Continuation). (a) Show that

and hence that

=Nj(n, /-l(i)(n, k,j), i 0, 1, ... , k, are the factorial moments of the = k, r), r 0, 1, ... , k, show that n' .. /-l(i)(n,k,j) =(k)i(j!)i(n.-ij)!(k-i)n-•J, i =0,1, ... ,k.

(b) If /-l(i) sequence ar

= =

3. Let B(n, k) be the number of distributions of n distinguishable balls into k indistinguishable urns. Show that

B(n, k)

k = k!1 ~

where

(k) rnk-j, j

k

Dk

.

= k! L (--~)· z.

i=O

is the k-subfactorial. 4. Let Q1 (n, k, r) be the number of distributions of n indistinguishable balls into k distinguishable urns, so that r urns are occupied, each by j balls. Show that

Qj(n, k,

r) =(k) ~) _1 r

i=r

r) (k + n- i(j -~ 1)- 1).

)i-r (~z- r

n - ZJ

DISTRIBUTIONS AND OCCUPANCY

360

5. (Continuation). (a) Show that

and hence that 00

L

k

L Qj(n, k, r)xr tn = [(1- t)- 1

+(x- 1)tj]k.

n=Or=O

= k,j), 0, 1, ... , k, are the binomial moments of the =bci)(n, Qj(n, k, r), r 0, 1, ... , k, show that . -(k)(k+n-i(j+1)-1) . ... ,k. b(i)(n,k,J)= . .. , z=0,1, z n- ZJ

(b) If b(i) sequence ar

i =

=

6. Show that the number of distributions of n indistinguishable balls into k distinguishable urns, each of capacity limited to s balls, is

and, with the restriction that r urns remain empty, equals k

L(n,k,s,r)

=G) L(-1)i-r(:~;)L(n,k-i,s). t=r

7. (Continuation) Let Lj(n, k, r) be the number of distributions of n indistinguishable balls into k distinguishable urns, each of capacity limited to s balls so that each of r urns is occupied by j balls. Show that

and, for j = s, conclude that

L 8 (n, k, s, r) =

G)

8. (Continuation). (a) Show that

L(n- sr, k- r, s).

9. 7. EXERCISES

361

and hence that sk

k

L L Qj(n,k,r)xrtn = [(1- t + )(1- t)8

1

1

+ (x -1)ti]k.

n=Or=O

=

(b) If b(i) b(i)(n, k, s,j), i = 0, 1, ... , k, are the binomial moments of the sequence ar Lj(n, k, s, r), r = 0, 1, ... , k, show that

=

b(i)(n,k,s,j) =

(~)L(n-ij,k-i,s),

i=0,1, ... ,k.

9. (Continuation). Let Mj(n, k, s) be the number of distributions of n indistinguishable balls into k distinguishable urns, each of capacity limited to s balls, so that each urn is occupied by at least j balls. Show that

Mj(n, k, s) = L(n- kj, k, s- j) =

t,( _G) (n1)

kj

+ k ~ ~s - j + 1)- 1).

1

10. Let n like balls be distributed into k distinguishable urns. (a) If hn(x) is the enumerator for the occupancy of a single urn, show that 00

H(t; x) =

L

hn(x)tn = (1- xt)- 1 (1- x)-k+l

n=O

and

(b) If B(n, k, r) is the number of distributions of n like balls into k distinguishable urns so that a specified urn contains r balls, r = 0, 1, ... , n and b(s) b(s) (n, k), s = 0, 1, ... , n, are the binomial moments of the sequence ar B(n, k, r), r = 0, 1, ... , n, conclude that

= =

B(n, k, r) =

k - r - 2) (n+ n-r

, b(s)(n, k) =

(n +n-s k - 1)

.

11. (Continuation). If hn(x, y) is the enumerator for the occupancy of a pair of urns, show that 00

H(t; x, y)

=L

n=O

hn(x, y)tn

= (1- xt)- 1 (1- yt)- 1 (1- x)-k+ 2

362

DISTRIBUTIONS AND OCCUPANCY

and hence conclude that

hn(x,y) =

~~ L....tL....t

•=0 r=O n n-j

= 2: 2: j=O i=O

(n

+ k- r- s- 3)xrys n-r-s

(: ~ ~ =J~) (x- 1)i(y -

1)j.

12. Let n like balls be distributed into k distinguishable urns, each with

s distinguishable cells of capacity limited to one ball. Show that (a) the enumerator for occupancy of the j-th urn is

and (b) the generating function of the distributions with r1 balls in the j-th urn, j = 1, 2, ... , k, is

where the summation is extended over all 0 r1 + r2 + · · · + rk = n.

:S r1 :S s, j

= 1, 2, ... , k, with

13. (Continuation). In the case of cells of unlimited capacity, show that (a) the enumerator for occupancy of the j-th urn is

G.(t;

Sj)

=

~ (s + ~ -

= ~(-1r (~

1 )xjtr 8

)x;tr = (1- x1t)-•,

j

= 1,2, ...

,k

and (b) the generating function of the distributions with r1 balls in the j-th urn, j = 1, 2, ... , k, is

where the summation is extended over all r1 + r2 + · · · + rk = n.

rj

2: 0, j

= 1, 2, ... , k,

with

14. Let us consider k distinguishable urns, each with s distinguishable cells of capacity limited to one ball. Show that the number of distributions

9. 7. EXERCISES

363

of n like balls into the k urns so that each of r urns contains j balls equals

and conclude that the number of distributions of n like balls into the k urns so that r urns are completely occupied is given by

R(n, k,

s, r)

=

(k) ~( _1)i-r (~- r) (s(k- i)). r

L....t i=r

t -

r

sk - n

15. (Continuation). (a) Show that

~

s(k-r)+jr

Rj(n,k,s,r)tn=

(kr) [(;)ti] (1+t)B-; r [

(

)

ti

] k-r

and hence that

16. Let us consider k distinguishable urns, each with s distinguishable cells of unlimited capacity. Let Tj(n, k, s, r) be the number of distributions of n like balls into the k urns so that each of r urns contains j balls. Show that

TJ(n, k, s, r)

=

G) t( _ 1 =;) (s +;- 1) (s(k- i)n+_nj~ 1). )i-r (:

17. (Continuation). (a) Show that 00

LTJ(n, k, s, r)tn n=O

and hence that

i

ij-

DISTRIBUTIONS AND OCCUPANCY

364

18. Let us consider kr distinguishable cells, each of capacity limited to one ball, arranged in k columns and r rows. Show that the number of distributions of n like balls into the kr cells so that j from 8 predetermined columns of cells are occupied (each by at least one ball) equals

19. (Continuation). Show that the number of distributions of n like balls into the kr cells so that no row and no column of cells remain empty equals

A(n, k, r) =

t t(

-1)k+r-j-i

(~) (:) (~) J

t=OJ=O

and conclude that the number of distributions of n distinguishable balls into the kr cells so that no row and no column of cells remain empty equals n!A(n,k,r)

= tt(-1)k+r-j-i(~) J

t=O J=O

(:)(ij)n·

20. Let us consider kr distinguishable cells of unlimited capacity, arranged in k columns and r rows. Show that the number of distributions of n like balls into the kr cells so that j from 8 predetermined columns of cells are occupied (each by at least one ball) equals

T(n, k,

8,

r,j) =

G) ~(-1)i G) (r(k- + j: 8

i)

+ n-

1).

21. (Continuation). Show that the number of distributions of n like balls into the kr cells so that no row and no column of cells remain empty equals B(n, k, r) =

t t( •=0]=0

-1)k+r-j-i

(~) (:) (ij J

+:- i).

22. Let M(n, k, 8) be the number of distributions of n distinguishable balls into k distinguishable urns, each of capacity limited to 8 balls. Show that sk tn ( t2 t• ) k Mk(t) = M(n, k, 8) 1 = 1 + t + 2l + ... + 1 n=O n. . 8.

L

9. 7. EXERCISES

365

and M(n+1,k,s)=k{M(n,k,s)- (:)M(n-s,k-1,s)}, n?.s, M(n,k,s) = kn, n

~

s.

Further, derive the vertical recurrence relation M(n, k, s) =

f: (~)M(n-

j, k- 1, s), m = min{n, s }.

J

j=O

23. Let Sr(n, k) be the number of distributions of n distinguishable balls into k distinguishable urns so that each urn contains at least r balls. Show that

tn

00

sk ,r (t) = '""' sr (n ' k)-1 = ~ n.

n=rk

(

r-1 ) k

et - 1 - t - ... - -,----------:-:(r _ 1)1.

and Sr(n

+ 1,k) =

k { Sr(n,k)

Sr(n, k)

= 0,

+

(r:

n

1

)sr(n- r

< rk,

+ 1,k -1)},

Sr(rk, k)

=

n?. rk,

(rk)! (r!)k ·

Further, derive the recurrence relation

24. Let us consider k distinguishable urns, each with s distinguishable cells of capacity limited to one ball. Let G(n, k, s, r) be the number of distributions of n like balls into the k urns so that each urn contains at most r balls. Show that

and (n

+ 1)G(n + 1, k, s, r)

= (sk- n)G(n, k, s, r)

-1)

-sk ( s r

G(n-r,k-1,s,r), n?. r,

DISTRmUTIONS AND OCCUPANCY

366

G(n,k,s,r) =

(s:),

n-:; r.

Further, derive the vertical recurrence relation G(n, k, s, r) =

f: (~)

G(n- j, k- 1, s, r), m = min{n, s, r }.

J

j=O

25. (Continuation). Let Cr(n,k,s) be the number of distributions ofn like balls into the k urns so that each urn contains at least r balls. Show that 8

Gk,r(t)= i::kCr(n,k,s)tn= [(l+t) -1- G)t- .. ·-

c~1)tr-lr

and (n

+ 1)Cr(n + 1, k, s) = (sk- n)Cr(n, k, s) 1 r-1

+sk (s- ) Cr(n- r + 1, k- 1, s), rk

Cr(n,k,s)

= 0,

Cr(sk, k, s)

n

= 1,

< rk, Cr(rk,k,s) Cr(n, k, s)

= 1,

< n < sk,

= (;) k' n

> sk.

Further, derive the recurrence relation

26. Let us consider k distinguishable urns, each with s distinguishable cells of unlimited capacity. Let H(n, k, s, r) be the number of distributions of n like balls into the k urns so that each urn contains at most r balls. Show that rk

Hk(t)

= L H(n, k, s, r)tn n=O

= [1 +

C) s

t+ (

s+1

2 ) t2 + ... +

k

s+r-1 (

r

)

tr ]

and (n + 1)H(n + 1, k, s, r)

= (sk + n)H(n, k, s, r) -sk ( s +r) r H(n-r,k-1,s,r), n 2: r,

9. 7. EXERCISES

367

1 (sk+:- ), n:::;r.

H(n,k,s,r)=

Further, derive the vertical recurrence relation

~ H(n,k,s,r)=~

(s -1) +j.

i=O

.

H(n-J,k-1,s,r), m=min{n,r}.

J

27. (Continuation). Let Dr(n, k, s) be the number of distributions of n like balls into the k urns so that each urn contains at least r balls. Show that 00

Dk,r(t) =

L

Dr(n, k, s)tn

n=k

=[(1-t)

-s

)t- .. ·-(

s - 1 - (1

s

+ r- 2 r- 1

)t

k r-1

]

and (n

+ 1)Dr(n + 1, k, s) = (sk + n)Dr(n, k, s) +sk ( s

Dr(n, k, s)

= 0,

n

+ rr-1

1)

Dr(n- r

+ 1,k- 1,s),

< rk, Dr(rk, k, s) = (

s

+ rr

1)

n

> rk,

k

Further, derive the recurrence relation

28. Let us consider n + r balls among which n are distinguishable and the other r are indistinguishable. Let U(n, r, k) be the number of distributions of these balls into k distinguishable urns without any restriction and W(n, r, k) the corresponding number with the restriction that no urn remains empty. Show that

and

368

DISTRIBUTIONS AND OCCUPANCY

29. (Continuation). Show combinatorially that

W(n,r,k)=~ m

(

r+J·

k-

1

1)

where

. . (k)jS(n,J), m=mm{n,k},

j

S(n,j)

= ~ L( -1)j-l (~)in 0

~

J. i=O

is the Stirling number of the second kind. Also, show that W(n, r, k)

= k{W(n- 1, r, k) + W(n- 1, r, k- 1)},

W(n,O,k) = kn, W(O,r,k) = (r

30. (Continuation). Show that

and

Further, conclude that

1

+ :·- ),

W(n,r,k) = 0, k

>n +r

Chapter 10 PARTITIONS OF INTEGERS

10.1

INTRODUCTION

The theory of partitions of integers, established by Euler in the 18th century and enhanced by Hardy, Rarnanujan and Rademacher, belongs to both combinatorics and number theory. As regards the combinatorial aspect of partitions, note first .that the positive integer solutions of the linear equation x 1 + x 2 + · · · + ck = n with n a positive integer, enumerated in Chapter 2, are ordered solutions. Further, the enumeration of the corresponding non-ordered solutions, the partitions of the integer n, is of great interest. Note also that, the enumeration of distributions of indistinguishable balls into indistinguishable urns is merely a partition enumeration problem. In this chapter, after the introduction of the notion of a partition of a positive integer n, recurrence relations and generating functions for the total number of partitions of n and the numbers of partitions of n into k and into at most k parts are derived. Then, a universal generating function for the number of partitions of n into parts of specified or unspecified number, whose number of parts of any specific size belongs to a subset of nonnegative integers, is obtained. As applications of this generating function several interesting sequences of partition numbers are presented. Furthermore, relations connecting various partition numbers are deduced by using their generating functions. Also, after introducing the Ferrers diagram of a partition and the notion of a conjugate (and a self-conjugate) partition, additional interrelations among certain partition numbers are derived. Euler's pentagonal theorem on the difference of the number of partitions of n into an even number of unequal parts and the number of partitions of n into an odd number of unequal parts is obtained. The last section is devoted to the derivation of combinatorial identities; the Euler and Gauss-Jacobi identities are deduced. As a complement to this subject, a collection of exercises on q-numbers, q-factorials and q-binomial coefficients, as well as on q-Stirling numbers of the first and second kind, is provided.

PARTITIONS OF INTEGERS

370

10.2

RECURRENCE RELATIONS AND GENERATING FUNCTIONS

DEFINITION 10.1 A partition ofa positive integer n is a non-ordered collection ofpositive integers whose sum equals n. These integers (terms ofthe sum) are called summands or parts of the partition.

In the case of a partition of n into a specified number of parts, say k, then the term partitions of n into k parts is used. Since the order of parts in a partition does not count, they are registered in decreasing order of magnitude. Thus, a partition of n into k parts is a solution in positive integers of the linear equation: (10.1)

In a partition of n, let Yi fori= 1, 2, ... , n. Then Y1

2: 0 be the number of parts that are equal to i,

+ 2y2 + · · · + nyn = n,

Yi

2: 0,

i

= 1, 2, ... , n

(10.2)

In the case of a partition of n into k parts, in addition, Y1

+ Y2 + · · · + Yn

(10.3)

= k.

If {Yi 1 , Yi 2 , ••• , Yir-l, Yir }, with i1 < i2 < · · · < ir-1 < ir, is the set of the positive Yi in (10.2), the corresponding partition of n is denoted by

omitting the exponents that are equal to 1. REMARK 10.1 It is important to point out the clear distinction between a partition of a positive integer and a partition of a non-empty set. Thus, a partition of the positive integer n into k parts is a solution of the equation X1

+ X2 + · · · + Xk = n,

X1

2:

X2

2: · · · 2:

Xk

2:

1

in positive integers, say {r 1, r 2, ... , r k} ,r1 2: r2 2: · · · 2: rk 2: 1, which corresponds to a distribution of n indistinguishable balls (the units) into k indistinguishable urns containing r 1, r 2, ... , rk balls. In contrast, a partition of a non-empty set B, with N(B) = n elements, into k subsets is a solution of the set-theoretic equation

10.2.

RECURRENCES AND GENERATING FUNCTIONS

371

in non-empty disjoint sets, say {A 1 ,A 2 , ... ,Ak}, N(AI) 2: N(A 2 ) 2: ··· 2: N(Ak) 2: 1, Ai n Ai = 0, i =j:. j, with N(Ai) = ri, i = 1, 2, ... , k, which corresponds to a distribution of n distinguishable balls (the elements of B) into k indistinguishable urns containing r 1 , r 2 , ••• , rk balls. I Example 10.1 Let us determine the partitions of the integers I, 2, 3, 4, 5 and 6. Clearly, number 1 has only one partition with one part equal to I, number 2 has two partitions: 2, 12 and number 3 has three partitions: 3, 21, 13 . Further, since 4 = 3 + 1 = 2 + 2 = 2 + 1 + 1 = 1 + 1 + 1 + 1, the partitions of number 4 are: 4, 31, 22 , 21 2 , 14 . Also, since 5 = 4 + 1 = 3 + 2 = 3 + 1 + 1 = 2 + 2 + 1 = 2 + 1 + 1 + 1 = 1 + 1 + 1 + 1 + 1, the partitions of number 5 are: 5, 41, 32, 31 2 , 22 1, 21 3 , 15 . Finally, since 6 = 5 + 1 = 4 + 2 = 3 + 3 = 4 + 1 + 1 = 3 + 2 + 1 = 2 + 2 + 2 = 3+1+1+1=2+2+1+1=2+1+1+1+1=l+l+l+l+l+l,fue partitions of number 6 are: 6, 51, 42, 32 , 41 2 , 321, 23 , 31 3 , 22 12 , 21 4 , 16 • D

Let p(n) be the number of partitions of nand p(n, k) be the number of partitions of n into k parts. Then n

p(n)

= '2:p(n,k),

n

= 1,2, ....

(10.4)

k=l

If P(n, k) is the number of partitions of n into at most k parts, then k

P(n, k)

= '2:p(n, r),

(10.5)

r=l

p(n, k) = P(n, k)- P(n, k- 1)

(10.6)

P(n, k) = p(n), k 2: n.

(10.7)

and

A recurrence relation for the calculation of the number of partitions of n into k parts is given in the following theorem. THEOREM 10.1 The number p(n, k) of partitions ofn into k parts satisfies the recurrence relation m

p(n,k)='2:p(n-k,r), k=2,3, ... ,n-1, n=2,3, ... , r=l

with m = min {k, n - k} and initial conditions p(n, 1) = p(n, n) = 1, n = 1, 2, ... , p(n, k) = 0, k > n.

(10.8)

372

PARTITIONS OF INTEGERS

PROOF Setting in the linear equation (10.1) z; = x;- 1, i = 1, 2, ... , k, we deduce the linear equation Zt

+ Zz + · · · + Zk = n - k,

Zt ~

~

Zz

· · · 2: Zk

~

0.

(10.9)

Since the transformation is one to one, the number p(n, k) of solutions of (10.1) equals the number of solutions of (10.9). If P is the set of solutions of (10.9) and Pr ~ P is the subset of solutions of (10.9) for which Zr ~ 1 and z; = 0, i = r + 1,r +2, ... ,k, r = 1, 2, ... ,m, m = min{k, n- k}, then P; npi = 0, i =f. j and P = P 1 + Pz + · · · + P m. Therefore, according to the addition principle, m

p(n,k)

= N(P) = LN(Pr) r=l

and, since N(Pr) equals the number p(n- k, r) of solutions of the linear equation Zt

+ Zz + · · · + Zr = n- k,

Zt ~

Zz

~

· · · ~ Zr 2: 1,

I

(10.8) is established. Its initial conditions are obvious.

Using recurrence relation (10.8) and its initial conditions, Table 10.1 of the numbers p(n, k) is constructed. Summing the elements of each row we get, according to (10.4), the numbers p(n).

Table 10.1 The Numbers p(n, k) and p(n)

k

l

2

I l I l l l l l l l

l l 2 2 3 3 4 4

3

4

5

6

7

8

9

10

p(n)

n l 2 3 4 5 6 7 8 9 10

5

l l 2 3 4

5 7 8

l l 2 3

5

l l 2 3

6 9

5 7

l l 2 3

5

l l 2 3

l l 2

l l

l

l 2 3 5 7 II 15 22 30 42

REMARK 10.2 From recurrence relation (10.8) the following relations are readily deduced: fork~ n/2, whence n- k:::; n/2, and by the expression (10.4), n-k

p(n, k)

=L

r=l

p(n- k, r)

= p(n- k),

(10.10)

10.2.

RECURRENCES AND GENERATING FUNCTIONS

while, fork< n/2, whence n- k

> n/2, k-1

k

p(n, k)

373

= LP(n- k, r) = LP(n- k, r) + p(n- k, k) r=l

r=l

= p(n- 1, k- 1)

+ p(n- k, k).

(10.11)

Note that this recurrence relation may also be derived independently of the recurI rence relation (1 0.8) (see Exercise I). From Theorem 10.1, using (10.5), (10.6) and (10.7), the following corollary is deduced.

COROLLARY 10.1 The number P(n, k) ofpartitions ofn into at most k parts satisfies the recurrence relation P(n, k) = P(n, k- 1) fork

= 2, 3, ...

, n - 1, n

+ P(n- k, k),

(10.12)

= 2, 3, ... , with initial conditions P(n, 1) = 1, P(O, k) = 1.

Using recurrence relation (10.12) and its initial conditions, Table 10.2 of the numbers P(n, k) is constructed.

Table 10.2 The Numbers P(n, k)

k

1

2

3

4

5

6

7

8

9

10

1 1 1 1 1 1 1 1 1 1

1 2 2 3 3 4 4

1 2 3 4

1 2 3

1 2 3

1 2 3

1 2 3

1 2 3

1 2 3

1 2 3

5

5 7

6 9 11 15 18 23

5 7 10 13 18 23 30

5 7 11 14 20 26 35

5 7 11 15 21 28 38

5 7 11 15 22 29 40

5 7 11 15 22 30 41

5 7 11 15 22 30 42

n 1 2 3 4

5 6 7 8 9 10

5 5 6

8 10 12 14

Bivariate and vertical generating functions for the numbers p(n, k), k = 1, 2, ... , n, n = 1, 2, ... , are derived in the next theorem.

PARTITIONS OF INTEGERS

374

THEOREM 10.2 (a) The bivariate generating function of the numbers p(n, k) of partitions ofn intokparts, k = 1, 2, ... , n = 1, 2, ... , is given by n

CXl

(X)

(10.13)

n=Dk=O

i=l

where p(O, 0) = 1. (b) The vertical generating function of the numbers p(n, k) of partitions of n into k parts, n = k, k + 1, ... , for fixed k, is given by k

(X)

Gk(t)

=L

p(n, k)tn

= tk II (1- ti)- 1 .

n=k

(10.14)

i=l

PROOF (a) Using the fact that the number p(n, k) of partitions of n into k parts equals the number of nonnegative integer solutions of (10.2) and (10.3), it follows that CXl

G(t, u) =

n

L L (I: uYl+Y2+" ·+YntYl+2Y2+"·+nYn)' n=Dk=O

where in the inner sum the summation is extended over all nonnegative integer solutions of (10.2) and (10.3). Since this inner sum is summed over all k 0, 1, ... , nand n 0, 1, ... , it follows

=

=

establishing ( 10.13). (b) Interchanging the order of summation in (10.13), we get (X)

G(t, u) =

L Gk(t)uk k=O

and since

G(t,ut) = (1- ut)G(t,u), we deduce the recurrence relation

Consequently,

10.2.

RECURRENCES AND GENERATING FUNCTIONS

375

and k

Gk(t) = tk

II(l-

ti)-1'

i=1

I

which completes the proof of the theorem.

The bivariate generating function (10.13) of p(n, k) for u = 1 yields, by virtue of (10.4), the generating function of p(n). This is given in the following corollary of Theorem 10.2. COROLLARY 10.2 The generating function of the number p(n) of partitions of n, n = 1, 2, ... , is given by 00

G(t)

n=O

where p(O)

00

=bP(n)tn =II (1-

1 ti)- ,

(10.15)

i=1

= 1.

Bivariate and vertical generating functions for the numbers P(n, k), k = 0, 1, ... , n = 0, 1, ... , are derived in the following corollary of Theorem 10.2. COROLLARY 10.3 (a) The generating function of the numbers P( n, k) of partitions of n into at most kparts, k = 0, 1, ... , n = 0, 1, ... , is given by 00

00

00

(10.16) n=Dk=O

i=O

(b) The vertical generating function of the numbers P(n, k), n = 0, 1, ... , for fixed k, is given by k

00

Fk (t)

=L P(n, k)tn =II (1- nn=O

1

.

(10.17)

i=1

PROOF (a) The bivariate generating function F(t, u) of the numbers P(n, k), k = 0, 1, ... , n = 0, 1, ... , upon introducing (10.5), may be expressed as

00

00

= (1- u)- 1 LLP(n,r)urtn, n=Or=O

PARTITIONS OF INTEGERS

376

which, by virtue of(l0.13), implies (10.16). (b) Expanding into powers of u both members of the relation

F(t,ut) = (1- u)F(t,u), according to 00

F(t,u) = LFk(t)uk, k=O

it follows that

Thus

Fk(t)

= (1- tk)- 1 Fk-! (t),

k

= 1, 2, ...

, Fo(t)

=1

and k

Fk (t)

= II (1- ti)-1' i=l

which completes the proof of the corollary.

10.3

I

A UNIVERSAL GENERATING FUNCTION

The generating functions (10.13), (10.15) and (10.16) constitute particular cases of the generating function of the number of partitions of n into parts of specified or unspecified number, whose number of parts of any specific size belongs to a subset of nonnegative integers. Specifically, let A = (a;,j), i = 1, 2, ... , j = 0, 1, ... , be an infinite matrix with elements a;.,j = 0 or 1. The matrix A determines a sequence Y;, i = 1, 2, ... of subsets of nonnegative integers and vice versa as follows: for a specific i = 1, 2, ... , Y; = {j : ai,j = 1} is the set of indices j of the elements of the i-th row of the matrix A that are equal to 1. Let us denote by p(n; A) the number of partitions of nand by p(n, k; A) the number of partitions of n into k parts whose number y; of parts that are equal to i belongs to Y;, i = 1, 2, .... Also, let us denote by P(n, k; A) the number of partitions of n into at most k parts whose number y; of parts that are equal to i belongs to Yi, i = 1, 2, .... Note that, in particular for a;,j = 1, i = 1, 2, ... , j = 0, 1, ... , whence Y; = {0, 1, ... }, i = 1, 2, ... , p(n; A) := p(n), p(n, k; A) := p(n, k) and P(n, k; A) := P(n, k). A bivariate generating function for p(n, k; A), k = 0, 1, ... , n, n = 0, 1, ... is derived in the next theorem.

10.3. A UNIVERSAL GENERATING FUNCTION

377

THEOREM 10.3 Let A = (ai,J), i = 1, 2, ... , j = 0, 1, ... be an infinite matrix with elements ai,j = 0 or 1 and p(n, k; A) be the number of partitions of n into k parts whose number Yi of parts that are equal to i belongs to the set Yi = {j : ai,j = 1}, i = 1,2, .... Then

(10.18)

PROOF The number p(n, k; A) equals the number of nonnegative integer solutions of (1 0.2) and (1 0.3) with Yi E

Yi = {j : ai,J = 1}, i = 1, 2, ....

(1 0.19)

Consequently, oo

G(t, u; A)=

n

L L (2: uY1+Y2+·+YntY1+2Y2+·+nYn)' n=Ok=O

where, the summation in the inner sum is extended over all nonnegative integer solutions of (1 0.2) and (1 0.3) that satisfy (1 0.19). Introducing the elements a;,j of the matrix A into this sum, we get the expression oo

n

G(t ' u·A) =""'""'("'a a2 ,y2 ···a n,yn uY1+Y2+··+YntY1+2Y2+··+nyn) ' ~~ ~ l,yl

'

n=Ok=O

where, the summation in the inner sum is extended over all nonnegative integer solutions of (1 0.2) and (1 0.3). Note that this transformation of the inner sum incorporates condition ( 10.19), adding zero terms and thus saves from the concern of selecting the solutions of ( 10.2) and ( 10.3) that satisfy ( 10.19). Since this inner sum is summed over all k = 0, 1, ... , nand n = 0, 1, ... , it follows

which is the required expression of the generating function.

I

COROLLARY 10.4 Let A = (ai,J ), i = 1, 2, ... , j = 0, 1, ... , be an infinite matrix with elements ai,j = 0 or 1. Also let p(n; A) be the number of partitions of nand P(n, k; A) be the number of partitions of n into at most k parts whose number Yi of parts that

PARTITIONS OF INTEGERS

378

are equal to i belongs to the set Yi

= {j : ai,j = 1}, i = 1, 2, ....

Then

(10.20)

and

PROOF Expressing the number p(n; A) as a sum of the numbers p(n, k; A), k =0,1, ... ,n,weget oo

00

n=O

n

n=Ok=O

and so, from (10.18) with u = 1, (10.20) is deduced. Similarly we get oooo

ooook

F(t,u;A) = LLP(n,k;A)uktn= LLLP(n,r;A)uktn n=Ok=O n=Ok=Or=O

n

oo

= (1- u)- 1 L

LP(n,r; A)urtn n=Or=O

and so, by virtue of (I 0.18), (I 0.21) is deduced.

I

Several particular cases of the generating functions (10.18) and (10.20) are presented in the following examples. Example 10.2 Partitions into unequal parts Let q(n) be the number of partitions of n into unequal (different) parts and q(n, k) be the number of partitions of n into k unequal (different) parts. Determine the generating functions ex>

H(t) = L q(n)tn, H(t, u) n=O

ex>

=L

n

L q(n, k)uktn,

n=Ok=O

ex>

Hk(t)

=L

q(n, k)tn.

n=O

Note that, in this case, the number Yi of parts that are equal to i may take the values 0 or I, i = 1, 2, .... Consequently, q(n) = p(n; A), q(n, k) = p(n, k; A),

10.3. A UNIVERSAL GENERATING FUNCTION

= =0,1 and

with ai,j 1, j and (10.20),

ai,j

oo

=0, j =2, 3, ... , i =1, 2, .... Thus, by (10.18) n

00

n=Ok=O and

i=l

00

H(t)

379

00

=L

q(n)tn

n=O

=II (1 + ti). i=l

For the calculation of the third generating function, note that

H(t, u)

= (1 + ut)H(t, ut)

and since

00

=L

H(t, u)

Hk(t)uk,

k=O it follows that

Therefore

and

Hk(t)

=

00

L q(n,k)tn n=k(k+l)/2

k

k

j=l

j=l

=II ti(l- tj)-l =tl+2+ .. ·+k II(l- ti)-1.

Hence k

Hk(t) = tk(k+l)/2

II (1- tj)-l.

0

j=l Example 10.3 Partitions into even and odd parts (a) LetPo(n) be the number of partitions ofn into even parts and Po(n, k) be the number of partitions of n into k even parts. Determine the generating functions oo

Go(t)

oo

= LPo(n)tn, n=O

Go(t, u)

n

=L

LPo(n, k)uktn. n=Ok=O

In this case, the number y 2 i of parts that are equal to 2i belongs to the set Y2i = {0, 1, ... }, while the number Y2i-l of parts that are equal to 2i- 1 belongs tothesetY2 i-l {O},i 1,2, .... Consequently,po(n) =p(n;A),po(n,k)

=

=

=

PARTITIONS OF INTEGERS

380

p(n, k; A), with ai,O = 1, a2i,j Thus, by (10.18) and (10.20),

= 1 and a2i-l,j = 0, i = 1, 2, ... , j = 1, 2, .... n

oo

00

n=Ok=O

and

i=l

00

00

n=O

i=l

(b) Let Pt (n) be the number of partitions of n into odd parts and p 1 ( n, k) be the number of partitions of n into k odd parts. Then, proceeding as in the previous case, we conclude that n

oo

Gt (t, u)

=L

oo

:~::> 1 (n, k)uktn

=II (1- ut 2 i-l)- 1

n=Ok=O

and

i=l

00

00

n=O

i=l

(c) Let q0 ( n) be the number of partitions of n into unequal even parts and q1 ( n) the number of partitions of n into unequal odd parts. Determine the generating functions 00

Ho(t)

00

=L

=L

qo(n)tn, Ht(t)

n=O

qt(n)tn.

n=O

In the first case Y2i = 0 or I, Y2i-1 = 0, i = 1, 2, ... and so qo(n) = p(n; A), with a2i,j = 1, j = 0, 1, a2i,j = 0, j = 2, 3, ... , i = 1, 2, ... and a2i-t,o = 1, a2i-l,J = 0, j = 1,2, ... , i = 1,2, .... In the second case Y2i-l = 0 or I, Y2i = 0, i = 1, 2, ... and so q1 (n) = p(n; A), with a2i-l,J = 1, j = 0, 1, a2i-l,J = 0, j = 2, 3, ... , i = 1, 2, ... and a2i,o = 1, a2i,j = 0, j = 1, 2, ... , i = 1, 2, .... Thus, by virtue of ( 10.20), it follows that 00

Ha(t)

00

=L

qo(n)tn

n=O

=II (1 + t 2 i) i=l

and 00

Ht(t)

=L

00

qt(n)tn

n=O

= II(1 + t 2 i-l).

0

i=l

Example 10.4 Partitions into parts of restricted size Let R(n, k) be the number of partitions ofn with no part greater thank. Determine the generating 00

Rk(t) =

L R(n, k)tn. n=O

10.3. A UNIVERSAL GENERATING FUNCTION Note that R(n, k) = p(n; A), with ai,O 1,2, ... ,k,ai,j = O,i = k+1,k+2, ... ,j

381

= 1, i = 1, 2, ... , ai,j = 1, i = = 1,2, .... So,accordingto(l0.20),

00 k Rk(t) = L R(n, k)tn = (1 - ti)- 1 . i=l n=O

IT

Note that this generating function equals the generating function (1 0.17), Rk(t) = Fk(t). Consequently, the number R(n, k), of partitions of n with no part greater than k, equals the number P(n, k), of partitions of n into at most k parts, R(n, k) = P(n, k). 0

Example 10.5 Partitions into an even and an odd number of parts (a) Let P0 (n) be the number of partitions of n into an even number of parts and P 1 (n) be the number of partitions of n into an odd number of parts. Determine the generating functions 00 00 Ao(t) = LPo(n)tn, A1(t) = LP1(n)tn. n=O n=O The numbers P0 ( n) and P 1 ( n) may be expressed in terms of the number p( n, k) of partitions of n into k parts, k = 1, 2, ... , n, as [n/2]

P0 (n)

=

L

p(n,2r)

n

1

= 2 L{p(n,k) + (-1)kp(n,k)} k=O

r=O

and [(n-1)/2]

P 1 (n)

=

L r=O

p(n, 2r + 1)

=

1

n

L {p(n, k)- ( -1)kp(n, k)}, 2 k=O

respectively. Therefore, using (10.13) with u = ±1, it follows that

and

g(l-

00 1{00 At(t) = ~P1(n)tn = 2

ti)- 1

-

g(1 + 00

ti)- 1 }

.

(b) Let Q 0 ( n) be the number of partitions of n into an even number of unequal parts and Q1 (n) be the number of partitions of n into an odd number of unequal parts. Determine the generating functions 00

Ba(t)

=L n=O

00

Qo(n)tn, Bt (t)

=L

QI (n)tn.

382

PARTITIONS OF INTEGERS

The numbers Q 0 ( n) and Q1 ( n) may be expressed in terms of the number q( n, k) of partitions of n into k unequal parts, k = 1, 2, ... , n, as [n/2]

Qo(n)

=

L

q(n,2r) =

r=O

1

n

L{q(n,k)

2 k=O

+ (-1)kq(n,k)}

and [(n-1)/2]

Ql (n) =

L

q(n, 2r

+ 1)

=

r=O

1

n

L {q(n, k)- ( -1)kq(n, k)},

2 k=O

respectively. Therefore, using the generating function H(t, u) of Example 10.2 with u = ±1, it follows that

and

Example 10.6 Partitions into specified parts In the partitions of a positive integer n, without any restriction, XJ

+ X2 + · · · + Xk = n,

X! ~ X2 ~ · · • ~ Xk ~

1, k

= 1, 2, ...

, n,

the parts Xi, i = 1, 2, ... , n belong to the set { 1, 2, ... , n}. Let us now consider the partitions of n whose parts Xi, i = 1, 2, ... , n belong to a subset {it, i 2, ... , ir} of { 1, 2, ... , n}. In this case, if Yi. is the number of parts that are equal to i 8 , s = 1,2, ... ,r, then

The number D(n; it, i 2, ... , ir) of partitions ofn whose parts belong to the subset {it, i2, ... , ir} of { 1, 2, ... , n} equals the number of nonnegative integer solutions of this equation. Determine the generating function 00

D; 1 ,i2 ... ,dt)

= LD(n;it,i2,··.

,ir)tn.

n=O

=

Note that D(n;i 1 ,i 2 , ... ,ir) p(n;A), where the elements of the matrix A= (a;,j),i = 1,2, ... , j = 0,1, ... ,aregivenbyai,O = 1,i = 1,2, ... ,

383

10.4. INTERRELATIONS AMONG PARTITION NUMBERS

=

l,i E {it,i2,···,ir},ai,j Hence, by (I 0.20),

ai,j

= O,i

¢ {it,i2,···,ir},j r

00

Di 1 .i2, ... ,ir(t)

= 1,2, ....

=L

D(n; it, i2, ... , ir)tn

n=O

=II (I- ti·)-

1

.

s=l

The money-changing problem is a characteristic example requiring the calculation of partitions into specified parts. Specifically, let us consider a cashier that has an unrestricted number of coins of 5, 10, 25 and 50 cents. Calculate the number of ways of forming a given amount of, say, $ I. This number equals D(IOO; 5, 10, 25, 50) = D(20; 1, 2, 5, 10), the number of nonnegative integer solutions of the linear equation Sy5 + 10y10 + 25Y25 + SOy50 = 100 or, equivalently, the equation Yt + 2y2 + 5y 5 + 10y 10 = 20, which equals the coefficient of t 20 in the expansion of the generating function D1,2,5,10(t)

10.4

= [(1- t)(I- t 2)(1- t 5)(1- t 10 )t 1.

o

INTERRELATIONS AMONG PARTITION NUMBERS

The generating functions of the numbers of partitions that satisfy certain conditions may be used to deduce relations between these numbers. Such relations are derived in the following theorems.

THEOREM 10.4 The number q(n) of partitions ofn into unequal parts equals the number p 1 (n) of partitions ofn into odd parts: (10.22) q(n) = Pt(n). PROOF The generating function of the number q(n) of partitions of n into unequal parts is given by (see Example 10.2) 00

00

H(t) = L q(n)tn n=O

= II (1 + ti) i=l

and the generating function of the number p 1 ( n) of partitions of n into odd parts is given by (see Example 10.3) 00

Gt(t) = LPt(n)tn

n=O

00

=II (I- t2i-l)-1. i=l

Using the identity (1

+ ti)(I- ti) = (1- t 2i),

i

= 1,2, ...

,

PARTITIONS OF INTEGERS

384

the generating function H(t) may be written in the form 00

H(t)

00

00

=II (1- t i)(1- ti)- =II (1- t i) II (1- ti)1

2

2

i=1

i=1

1

.

j=1

If, in the last product the terms with j even are separated from those with j odd, then it is written as 00

00

00

j=1

i=l

i=1

and so 00

H(t)

=II (1- t2i-1 )-1 = Gl (t). i=1

The last relation implies (10.22).

I

THEOREM 10.5 The number P(n, k) of partitions of n into at most k parts, which equals the number R(n, k) of partitions of n with no part greater thank, is equal to the number p( n + k, k) of partitions of n + k into k parts:

P(n, k)

= R(n, k) = p(n + k, k).

(10.23)

PROOF

The generating function of the numbers P(n, k) 0, 1, ... is (see Corollary 10.3 and Example 10.4) 00

Fk(t) = LP(n,k)tn = LR(n,k)tn = n=O

II(1- ti)-

00

n=O

00

II (1- ti)- 1. i=l

00

= LP(r,k)tr-k = LP(n+k,k)tn. r=k

The last relation implies (10.23).

n=O

I

1

,

= k, k + 1, ... , is (see

k

00

Gk(t) = LP(r, kW = tk r=k

=

i=1

while the generating function of the numbers p(r, k), r Theorem 10.2)

LP(n,k)tn

R(n, k), n

k

00

n=O

=

10.4. INTERRELATIONS AMONG PARTITION NUMBERS

385

THEOREM 10.6 The number q( n, k) of partitions of n into k unequal parts equals the number P( n - k( k + 1) /2, k) of partitions of n - k( k + 1) /2 into at most k parts, which is equal to the number p(n- k(k- 1)/2,k) of partitions ofn- k(k- 1)/2 into k parts: q(n, k) = P(n- k(k PROOF

+ 1)/2, k)

= p(n- k(k- 1)/2, k).

(10.24)

Since (see Example 10.2 and Corollary 10.3) ~

Hk(t)=

k

L

q(n,k)tn=tk(k+l)/2IT(I-ti)-l

n=k(k+l)/2

and

i=l

~

Fk(t)

=

k

LP(r,kW r=O

~

= II(l-ti)-1, i=l

~

L q(n, k)tn n=k(k+l)/2

=L

P(r, k)tr+k(k+l)/2

r=O ~

=

L P(n- k(k n=k(k+l)/2

+ 1)/2, k)tn.

The last relation implies the first part of (1 0.24). Its second part is deduced from (10.23) by noting that n- k(k + 1)/2 + k = n- k(k- 1)/2. I REMARK 10.3 The following combinatorial derivation of (10.24) possesses its own merits. The number q(n, k) of partitions of n into k unequal parts equals the number of integer solutions of the linear equation X1

(a) Putting z; to the equation Zr

(10.25) + X2 + · · · + Xk = n, Xr > X2 > · · · > Xk ~ 1. = x;- (k-i+ 1), i = 1, 2, ... , k, equation (1 0.25) is transformed

+ Z2 + · · · + Zk = n- k(k + 1)/2,

z 1 ;:::

Z2 ;::: · · · ;::: Zk-1 ;::: Zk ;::: 0,

whose number of integer solutions equals the number P(n- k(k + 1)/2, k) of partitions of n - k(k + 1) /2 into at most k parts. (b) Setting Wi = xi - (k- i), i = 1, 2, ... , k, equation (10.25) is transformed to the equation W1

+ w 2 + · · · + Wk

= n- k(k- 1)/2, Wr ;::: W2 ;::: · · · ;::: Wk-1 ;::: Wk ;::: 1,

PARTITIONS OF INTEGERS

386

whose number of integer solutions equals the number p(n- k(k- 1)/2, k) of I partitions of n - k (k - 1) /2 into k parts. A simple and instructive representation of the partition of a positive integer n is its Ferrers diagram, which is defined as follows. Ferrers diagram of a partition of a positive integer n into parts Xi, i = 1,2, ... 'k, ... ' X1

+ X2 + · · · + Xk + · · · =

n,

X1

:2:

X2

:2: · · · :2:

Xk

:2: · · · :2: 1, (10.26)

is called the diagram of (equidistant) points whose i-th horizontal row of points (numbering from the bottom up) has Xi points, i = 1, 2, ... , k, .... To each partition there corresponds its conjugate partition, defined as follows. Conjugate partition of the partition (10.26) is called the partition of n into parts YJ> j = 1, 2, ... , r, ... , Y1

+ Y2 + · · · + Yr + · · · =

n,

Y1

:2:

Y2

:2: · · · :2: Yr :2: · · · :2: 1, (10.27)

whose Ferrers diagram the number YJ of points of the j-th horizontal row equals the number of points of the j-th column (numbering from left to right) of the Ferrers diagram of the partition (10.26). Self-conjugate partition is called a partition that coincides with its conjugate partition. FIGURE 10.1 Ferrers diagram y

6



5





4







3







2











1













0

1

2

3

4

5

6

X

Example I 0. 7 Figure 10.1 gives the Ferrers diagram of the partition 653 2 21 of 20. Clearly, its D conjugate partition is 6542 2 1.

10.4. INTERRELATIONS AMONG PARTITION NUMBERS

387

Some interesting interrelations among partition numbers are derived by considering the Ferrers diagrams of partitions and their conjugate partitions. Thus we have:

THEOREM 10.7 The number p( n, k) of partitions of n into k parts equals the number of partitions ofn into parts of which the maximum is k. PROOF Consider a partition of n into k parts and its Ferrers diagram. Associate to it its conjugate partition, which is also a partition of n into parts of which the maximum is k. Since this correspondence is one to one, the required conclusion is deduced. I

THEOREM 10.8 The number of self-conjugate partitions ofn equals the number q 1 ( n) of partitions of n into unequal odd parts. Consider a self-conjugate partition of n into parts xi. i = 1, 2, ... ,

PROOF X1

+ Xz + · · · + Xk + · · · =

n,

X1

~ Xz ~ · · · ~ Xk ~ · · · ~

1, (10.28)

and its Ferrers diagram. Note that this diagram is symmetric with respect to the line x = y. This symmetry implies that the pairs of straight-line sections defined by the points {(i,i), (x;,i)} and {(i,i), (i,yi)}, i = 1,2, ... ,k .. . , since xi= y;, i = 1, 2, ... , k, ... , form isosceles angles. The number Zi ofpointsofthediagram that lie on the i-th isosceles angle is odd, Zi

and since x 1

~

x2

= 2(xi -1) + 1, i = 1,2, ...

~ · • · ~ Xk ~ • • · ~ Z1

,k, ... ,

(10.29)

1, we have in addition

> Zz > · · · > Zk > · · · ~ 1.

Let us now correspond to the self-conjugate partition of n (10.28) the partition of n into unequal odd parts, Z1

+ Zz + · · · + Zk + · · · = n,

Z1

> Zz > · · · > Zk > · · · ~ 1. (10.30)

This correspondence of (1 0.28) to (I 0.30), according to (I 0.29), is one-to-one and thus the number of self-conjugate partitions of n equals the number of partitions of n into unequal odd parts. I REMARK 10.4 The one-to-one correspondence between the self-conjugate partitions of n and the partitions of n into unequal odd parts is further clarified by considering the following specific cases.

PARTITIONS OF INTEGERS

388 FlGURE 10.2

0

1 2 3 4 5 6

X

0

1 2 3 4 5 6 7 8 9 10 11

Z

(a) Consider the self-conjugate partition 62 53 2 2 of 25 into the parts x 1 = 6, = 6, x3 = 5, x 4 = 3, x 5 = 3, x 6 = 2. Figure 10.2 (left) represents its Ferrers diagram in which the three pairs of straight-line sections: x2

({ (1, 1), (6, 1)}, {(1, 1), (1, 6)} ), ({ (2, 2), (6, 2)}, { (2, 2), (2, 6)} ), ( {(3,3), (5,3)}, {(3, 3), (3, 5)}) form isosceles angles. The number z;, of points of this diagram that lie on the i-th isosceles angle, is z; = 2(x; - 1) + 1, i = 1, 2, 3: z1 = 11, z2 = 9, z 3 = 5. Hence, to the self-conjugate partition 6 + 6 + 5 + 3 + 3 + 2 = 25 there corresponds the partition 11 + 9 + 5 = 25 into unequal odd parts the Ferrers diagram of which is represented in Figure 10.2 (right). FlGURE 10.3

w

y



5

I

x=y

4

3



3 2 1

0

z3

123456789z

0

1

2

3

4

5

X

(b) Consider the partition 971 of 17 into unequal odd parts: z1 = 9, z2 = 7, = 1. Figure 10.3 (left) represents its Ferrers diagram. We have x; = y; =

10.4. INTERRELATIONS AMONG PARTITION NUMBERS

389

+ (zi- 1)/2, i = 1, 2, 3: x1 = Y1 = 5, x2 = Y2 = 5, x3 = y 3 = 3 and so the. Ferrers diagram of the corresponding self-conjugate partition forms three isosceles angles:

i

( {(1, 1), (5, 1)}, {(1, 1), (1, 5)} ), ( {(2, 2), (5, 2)}, {(2, 2), (2, 5)} ),

({(3,3),(3,3)}, {(3,3),(3,3)}) Note that the third angle degenerates to the point (3, 3) of the straight line x = y. Figure 10.3 (right) represents this diagram. From this diagram it follows that the I self-conjugate partition that corresponds to the partition 971 is 52 32 2 •

THEOREM 10.9 Euler's pentagonal theorem Let Qo (n) be the number of partitions of n into an even number of unequal parts and Q1 ( n) be the number of partitions of n into an odd number of unequal parts. Then, the difference E(n) = Qo(n)- Q 1 (n) is given by

E(n)

(-1)k, n = (3k 2 ± k)/2

={ 0,

(10.31)

otherwise.

PROOF Let us, initially, consider the Ferrers diagram F of a partition of n in any (even or odd) number of unequal parts and let: (i) A be the straight-line section that starts from the easternmost point (of the first horizontal line) of the diagram F, forms an angle of 3Jr /4 with the horizontal axis and thus, passing through only the outer points ofF, ends in the northernmost of them. (ii) B be the straight-line section that starts from the northernmost point (of the first column) of the diagram F, is parallel to the horizontal axis and thus, passing through only the outer points ofF that have the same ordinate, ends in the easternmost of them. It should be noted that B, as well as A, may contain only one point ofF (degenerate to a point straight-line sections). Further, let N (A) = r and N (B) = s be the number of points of the diagram F that lie on A and B respectively. Now, we associate with the partition of n into unequal parts with Ferrers diagram F, the partition of n into unequal parts with Ferrers diagram G that is defined as follows: (a) If r < s, the Ferrers diagram G is deduced from F by removing the points that lie on A and adjoining them to the first columns, one to each one of them (Figure 10.4), except when A and B have a common point and r = s - 1. In the latter case the corresponding partition of n into unequal parts has k = r parts and xk = s = k + 1 so that n

= 2k + (2k-

1)

+ · · · + (k + 2) + (k + 1) = (3k 2 + k)/2

(10.32)

and to its Ferrers diagram F we do not associate any diagram G (Figure 10.5).

PARTITIONS OF INTEGERS

390

FIGURE 10.4 y 5 4

y

. ..... -. B

F

-

1

0

1 2 3

5 6

7 8

X

G

1

• • • • • • • • • • • • • • • • •

.

0

1 2

7

3 2

..

4

·-· • •

4

• • • • • • • • • • ' A • • • • • • • •

3 2

B'

5

3 4 5 6

A'

X

FIGURE 10.5 y 5

F

B

4

• - • - -· - • -

3









• '•, A

2











1

• • • • • • • '•

0

1 2 3 4 5 6 7 8

-a,

'

• ..

X

(b) If r :2: s, the Ferrers diagram G is deduced from F by removing the points that lie on B and adjoining them to the first rows, one to each one of them (Figure 10.6), except when A and B have a common point and r = s. In the latter case the corresponding partition of n into unequal parts has k = r parts and Xk = s = k so that

n = (2k- 1)

+ (2k- 2) + · · · + (k + 1) + k =

(3k 2

-

k)/2

(10.33)

and to its Ferrers diagram F we do not associate any diagram G (Figure 10.7). The transition from F toG changes (increases or decreases) by one the number of parts of the corresponding partition, without altering the unequality of the parts. Thus, ifF belongs to the set of Ferrers diagrams :F0, of the partitions of n into an even number of unequal parts, then G belongs to the set of Ferrers diagrams :F1, of the partitions of n into an odd number of unequal parts, while, if F belongs to :F1, then G belongs to :F0 and vice versa. Consequently, if n f. (3k 2 - k) /2 and n f. (3k 2 + k) /2, then the correspondence is one to one and so E( n) = Qo (n) Q 1 (n) = 0. Ifn = (3k 2 ± k)/2 and k is even, the Ferrers diagram of the partition (10.32) or (10.33) belongs to :Fo and has no image in :F1. while ifn = (3k 2 ± k)/2 and k is odd the Ferrers diagram of the partition (l 0.32) or (l 0.33) belongs to :F1

10.5. COMBINATORIAL IDENTITIES

391

FIGURE 10.6

y 5 3 2 1

• F • • • • • • • •', A • • • • • '41. ' • • • • • • '•

0

1 2 3 4 5 6 7

4

y 5

B

B'

X

G

·------·

4

3 2 1

• • • • • • • • • • • • • • • • • • •

0

1 2 3 4 5 6 7 8

A' X

FIGURE 10.7

y 5

F

B

4

·-·--·-·--· • • • • •

3 2 1

• • • • • • ' •' • • • • • • •' ' • • • • • • • • '•

0

1 2 3 4 5 6 7 8 9

"

A

"

X

andhasnoarchetype(pre-image)inF0 . HenceE(n) = Q0 (n)-Q 1 (n) for n = (3k 2 ± k)/2, and the proof of the theorem is completed. I

10.5

= (-1)k,

COMBINATORIAL IDENTITIES

Some interesting combinatorial identities may be deduced from the relation ()()

G(t, u; A)= L Gk(t; A)uk, k=O which connects the generating functions oo

G(t,u;A)

n

= LLP(n,k;A)uktn, n=Ok=O

oo

Gk(t;A)

= LP(n,k;A)tn, n=k

of the numbers p(n, k; A) of partitions of n into k parts, whose number of parts equal to i belongs to the set {j : ai,j = 1}, i = 1, 2, ... , where

PARTITIONS OF INTEGERS

392

=

=

=

A= (ai,j), i 1, 2, ... , j 0, 1, ... , with ai,J 0 or 1. In the literature, in expressing these identities instead of the variables t and u the variables q and x, respectively, are used. Further, such an identity is referred to as q-identity. Two typical q-identities are given in the following theorem. THEOREM 10.10 00

00

k

i=l

k=O

j=l

IT (1- xqi)-1 =I: xkqk IT (1- qi)-1, 00

00

k

i=1

k=O

j=1

(10.34)

IT (1 + xqi) =I: xkqk(k+1)/2 IT (1- qi)-1. PROOF

(10.35)

Introducing into the relation 00

G(t,u) = 'L:Gk(t)uk, k=O expressions ( 10.13) and (10.14) of the generating functions, n

oo

G(t,u)

=L

oo

LP(n, k)uktn n=Ok=O

=IT (1- uti)-

1

,

i=l k

00

IT(1-

Gk(t) = LP(n,k)tn = tj)- 1, j=l n=k of the numbersp(n, k) of partitions of n into k parts, and putting t

= q and u = x,

(10.34) is readily deduced. Similarly, introducing into the relation 00

H(t,u) = LHk(t)uk, k=O the expressions of the generating functions (see Example 10.2), oo

H(t, u)

=L

n

00

Hk(t)

=

oo

L q(n, k)uktn n=Ok=O

L q(n, k)tn n=k(k+l)/2

=IT (1 +uti), i=l k

= tk(k+I)/ 2 IT (1- ti)- 1, j=1

of the numbers q( n, k) of partitions of n into k unequal (different) parts, and putting

t = q and u = x, (10.35) is deduced.

I

10.5. COMBINATORIAL IDENTITIES

393

Combinatorial identities may also be deduced from the relation 00

G(t; A) = L

p(n; A)tn

n=O

when the number p(n; A), of partitions of n whose number of parts equal to i belongs to the set {j : ai,j = 1}, i = 1, 2, ... , where A = (ai,j), i = 1, 2, ... , j = 0, 1, ... , with ai,j = 0 or 1, can be evaluated independently of the generating function G(t; A). A characteristic case of such q-identity is Euler's identity that is deduced in the following corollary of Euler's pentagonal theorem.

COROLLARY 10.5 00

00

i=l

k=l

(10.36)

PROOF The generating functions of the numbers Q 0 (n) and Q 1 (n) of partitions of n into an even and odd number of unequal parts, respectively, are given by (see Example 10.5)

and

Hence

00

00

n=O

i=l

Further, the difference E (n) = Q 0 ( n) - Q1 ( n) has been evaluated in Theorem 10.9 as 2 (-1)k, n = (3k ± k)/2 E(n) = { 0, otherwise and so

00

LE(n)tn

00

=1+

n=O

L(-1)k{tk(3k-I)/2 +tk(3k+I)/2}. k=l

Consequently,

rr(l- ti> 00

i=l

z:(00

= 1+

k=l

1)k{tk(3k-I)/2 + tk(3k+I)/2}

PARTITIONS OF INTEGERS

394

and, putting t

= q, (10.36) is deduced.

I

COROLLARY 10.6 The number p( n) of partitions of n satisfies the recurrence relation n1

p(n)

n2

= ~)-1)k-

1

p(n- k(3k- 1)/2) + ~)-1)k- 1 p(n- k(3k + 1)/2),

k=I

k=I

(10.37) where ni is the largest positive integer satisfying fori = 1 the inequality n 1 (3n 1 1) ::=; 2n and for i = 2 the inequality n 2(3n2 + 1) ::=; 2n. Expression ( l 0.15) may be rewritten as

PROOF

Replacing the first factor of the left-hand side by expression ( 10.36), it follows that

{1_

~(- 1 )k-l{tk(3k-l)/2 + tk(3k+I)f2}}. {~p(n)tn} = 1

and, since p(O) = 1,

~ p(n)tn = {~ p(n)tn}. {~( -1)k-l {tk(3k-l)/2 + tk(3k+l)f2}} =

~ {~( -1)k- p(n- k(3k- 1)/2) 1

+ ~(-1)k-Ip(n- k(3k + 1)/2)} tn. Equating the coefficients of tn in both members of the last identity, (10.37) is I deduced. In the next theorem, using (10.34) and (10.35), the Gauss-Jacobi identity is derived.

THEOREM 10.11 Gauss-Jacobi identity ~

+~

I1( 1 -q2i)( 1 +xq2i-I)( 1 +x-Iq2i-I)= L i=l

k=-~

xkqk

2 •

(10.38)

10.5. COMBINATORIAL IDENTITIES

395

PROOF Replacing q by q2 in ( 10.35) and, in the resulting expression, replacing xq by x, it follows that

oo

oo

n

i=l

n=O

j=l

II(l +xq2i-l) = "L:>nqn 2 II( 1 -

q2j)-l.

0: (1 - q i) and using the relation 2

Multiplying both members by

1

00

n

00

i=l

j=l

j=l

we get 00

00

00

i=l

n=O

j=l

II (1 _ q2i)(1 + xq2i-l) = "L:>nqn 2 II (1 _ q2n+2j) 00

=

2:::: n=-oo

xnqn

2

00

II (1 _ q2n+2i), j=l

where the last equation holds since the additional terms are zero because, for any negative integer n, the factor j = -n in the product is zero. Also, replacing q by q2 and x by -q 2 n in (10.35), we get

j=l

r=O

i=l

and, introducing it into the previous expression, we sequentially deduce

oo

II( 1 i=l

+oo

oo r 2 2 xnqn L:xrqr +r+2rn 1 - q2i)-l n=-oo r=O i=l oo r +oo =L:(-1Y(-x-lqfii(1-q2i)-l xn+rq(n+r)2 n=-oo r=O i=l oo r +oo ="L::(-1f(-x-lqfii(1-q2i)-l xkqk2. r=O i=l k=-oo

q2i)( 1 + xq2i-l) =

II(

2::::

L

L

Further, replacing q by q2 in (10.34) and, in the resulting expression, replacing xq by -x- 1 , it follows that

Introducing it into the previous expression, we deduce (10.38).

I

PARTITIONS OF INTEGERS

396

10.6 BIBLIOGRAPHIC NOTES The roots of partitions of integers, according to L. E. Dickson (1920), may be traced in a letter from Gottfried Wilhelm Leibnitz to John Bernoulli in 1669. Their systematic study and development started in 1746 with Leonhard Euler and his two-volume work Introductio in Analysin Infinitorum. The proof of Euler's pentagonal theorem given here is due to Fabian Franklin (1881). The contribution of G. H. Hardy and Ramanujan (1917, 1918) and Rademacher (1937a,b, 1940, 1943) enhanced this subject. In his two-volume treatise, P. A. MacMahon (1915, 1916) discussed at length combinatorial aspects of partitions. For further reading on partitions of integers, refer to the books of J. Riordan (1958), L. Comtet (1974) and G. E. Andrews (1976).

10.7

EXERCISES

1. Show combinatorially that the number p(n, k) of partitions of n into k parts satisfies the recurrence relation

= p(n- 1, k- 1) + p(n- k, k),

p(n, k)

k < n/2,

with initial conditions

p(n,1)=p(n,n)=1, n=1,2, .... 2. Show combinatorially that the number P(n, k) of partitions of n into at most k parts satisfies the recurrence relation

P(n,k)=P(n,k-1)+P(n-k,k), k=2,3, ... ,n, n=2,3, ... , with initial conditions P(n,1)=1, n=1,2, ... , P(O,k)=1, k=0,1, .... 3. Partitions into parts of restricted number and restricted size. Let P(n, k, r) be the number of partitions of n into at most k parts, none of which is greater than r. Show that oo

Fr(t,u)

oo

r

= LLP(n,k,r)uktn = II(l- uti)- 1 n=Ok=O

i=l

397

10. 7. EXERCISES

and

r

oo

Fr,k(t)

=L

P(n, k, r)tn

=II (1- tr+i)(1- ti)-

n=O

1

.

i=1

4. Let r(n, k) be the number of partitions of n whose smallest part equals k. Show that 00

00

n=O

i=k

and r(n, k) = r(n- 1, k- 1)- r(n- k, k- 1),

fork= 2,3, ... , [(n

+ 1)/2], n = 3,4, ... , with

r(n, 1) =p(n-1),n = 2,3, ... ,r(n,n) = 1,n = 1,2, ... ,r(n,k) = O,n

< k.

5. Show combinatorially that the number q(n, k) of partitions of n into k unequal parts satisfies the recurrence relation q(n, k) = q(n- k, k)

+ q(n- k, k- 1),

k = 2, 3, ... , [n/2], n = 4, 5, ... ,

with initial conditions q(n, 1) = 1, n

= 1, 2, ... , q(n, k)

= 0, n

< k(k + 1)/2,

q(k(k + 1)/2, k) = 1.

6. Let Q(n, k) be the number of partitions of n into at most k unequal parts. Show that 00

F(t, u) =

00

00

LL

Q(n, k)uktn

= (1 - u)- 1

n=Ok=O

II (1 +uti) i=1

and, using the identity

(1- u)F(t, u) = (1- u 2t 2)F(t, ut), conclude that the generating function 00

Fk(t)

=L

Q(n, k)tn

n=O

satisfies the recurrence relation

(1- tk)H(t) = Fk_I(t)- tkFk-2(t), k = 2,3, ... , with F0 (t) = 2, F 1 (t) = (1- t)- 1 .

PARTITIONS OF INTEGERS

398

7. Partitions into even and odd unequal parts. Let q0 (n, k) be the number of partitions of n into k even unequal parts and q1 (n, k) be the number of partitions of n into k odd unequal parts. Show that n

oo

00

n=Ok=O oo

i=l

n

oo

H1 (t, u) = L L q1 (n, k)uktn n=Ok=O

=II (1 + ut i-I) 2

i=l

and k

00

Ho,k(t) = Lqo(n,k)tn = tk(k+I) n=O

II(l- t i)-I, 2

i=l

k

00

HI,k(t) = Lql(n,k)tn = tk2 n=O

II(l-

t2i)-1.

i=l

8. Partitions into parts of restricted size. Let p(n, k, r) be the number of partitions of n into k parts, none of which is greater than r. Show that oo

n

r

Gr(t, u) = L LP(n, k, r)uktn n=Ok=O

=II (1- uti)- 1 i=l

and conclude that (1- ut)Gr(t, u) = (1- utr+I )Gr(t, ut). Using this recurrence relation show that k

00

Gr,k(t)

=L

p(n, k, r)tn

n=k

= tk II (1- tr+i-l )(1- ti)- 1 . i=l

9. Let 00

L Gr(t, u)gr(t)ur = G(t, u), r=O where Gr(t, u) is the generating function of the number p(n, k, r) of partitions of n into k parts, none of which is greater than rand G(t,u) is the generating function of the number p(n, k) of partitions of n into k parts. Using the relations (1- ut)G(t,u) = G(t,ut), (1- ut){Gr(t, u) + utr+ 1Gr+1 (t, u)} = Gr(t, ut),

10. 7. EXERCISES

399

show that

r

gr(t)

= tr2 II (1- ti)-1 i=1

and conclude the identity r

oo

2:: II (1tr2

r=O

oo

ti)-2

=II (1-

i=1

ti)-1.

i=1

10. Show that k-1

II (1 +

2k-1 t2.)

=

2:: tn

n=O

i=O

and thus conclude that 00

II(l +

2 t .)

= (1- t)- 1 ,

itl

< 1.

i=O

Using the last identity, show that for every nonnegative integer n there exists a unique finite sequence ni E {0, 1}, i = 0, 1, ... , r, such that r

n

= Z::ni2i, i=O

where the positive integer r is determined by the inequalities 2r :S n

< 2r+1.

11. (Continuation). Show that the number R 0 (n) of partitions of n into an even number of parts, with values (sizes) in the set {1, 2, 22 , ••• }, equals the number R 1 (n) of partitions of n into an odd number of such parts, for n = 2,3, ....

12. Show that

and thus conclude that

Using the last identity, show that for every nonnegative integer n there exists a unique finite sequence ni E {0, 1, ... , i}, i = 1, 2, ... , r, such that r

n = Z::nii!, i=1

PARTITIONS OF INTEGERS

400

where the positive integer r is determined by the inequalities r! (r + 1)!.

~ n


k = 0, 1, ... , n. Setting r = i, k = j + 1 and multiplying the resulting relation by - ~ - i + 1) = (j + r - ~ - i) + (j + r - ~ - i + 1) , (j + rr-z+1 r-z r-z+1

fori= 1,2, ... ,r,weget

(j + rr --

k - i + 1) _ N·-1 3· i +1 ' '

(j + rr -- i) N· · + (j +r -r - + 1 i) N _(j + rr-i+1 + 1) ki

k-

'• 3

i

k- i

·

t,J

N .

t,J+I,

fori = 1, 2, ... , r. Summing this expression for j = k, k + 1, ... , n and since (/-i1 1 ) = 0, Ni,n+l = 0, we get

(j + r-i+1 k- i + 1) N·_ . = ~ (j + k- i) N· . ' r-i '• ~ (j + r - k - i) N· . _ ~ (j + r - k - i + 1) N· . + r-z. + 1 r-z + 1

~

r-

~ j=k

~

j=k+l

13 '

t,J

~ j=k

~

j=k

r-

3

.

t,J+l,

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

522

fori = 1, 2, ... , rand so

n 2:

(j

j=k

2:n

+ r -· k - i + 1) N·_ .= , 13 r-i+1 '

(j

j=k

+ r - k - i) N·, . , i = 1, 2, ... , r. r-i '1

Applying it successively, we get

In particular, for i = r we deduce the expression Nr+l,k

~ = {;;:.

(j

+rr

k) Nj.

Using (14.1), the r-th order sample moment mr. is expressed as mr

= ~ tFNJ = ~ ttA(r,k)(j +~- k)Nj J=Ok=O

J=O

=

~

t

A(r, k)

k=O

t (j

+ ~- k) NJ

J=k

and so

1

mr

T

= N 2: A(r, k)Nr+l,k·

0

k=O

14.3

CARLITZ NUMBERS

Consider the generalized binomial of t of order n and scale parameter s, st) _ (st)n _ st(st- 1) · · · (st- n + 1) _ (st) _ , n- 1, 2 , ... , - 1, (n n.1 n.1 0 with s a real number. It can be expressed as a sum of binomials oft+ n- k of order n fork = 0, 1, ... , n with coefficients depending on the nonnegative integers n and k and the parameter s. Specifically, we get successively the expressions

523

14.3. GARLITZ NUMBERS

and, generally, (14.12)

Then, the following definition is introduced. DEFINITION 14.2 The coefficient B(n, k; s) of expansion (14.12), of the n-th order generalized binomial oft with scale parameters into binomials of the n-th order, is called Carlitz number.

Clearly, this definition implies B(n, k; s) REMARK 14.3 using the relation

= 0, k > n.

Expansion ( 14.12), upon replacing t by - t and s by - s and

is transformed to

or, equivalently, to

Consequently,

B(n,k;s)

= (-1)nB(n,n- k + 1; -s)

fork= 0, 1, ... , nand n = 0, 1,....

(14.13)

I

An explicit expression and a recurrence relation for the Garlitz numbers are derived in the following two theorems. THEOREM 14.5 The Carlitz number B(n, k; s), k = 0, 1, ... , n, n = 0, 1, ... , is given by the sum

(14.14)

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

524

From expansion (14.12), replacing the variable k by j and putting

PROOF

t = k - r, for r = 0, 1, .. . , k, we deduce the expression

which, upon using the relation

(

n+k-r-j) = n

(n+k-r~j) =(- 1)k-r-j( k-r-J

-n-1.),

k-r-J

may be written as

Multiplying both sides of the last expression by (-1)r(n~ 1 ) and summing for r = 0, 1, ... , k, we get

and since, by Cauchy's formula,

~ ~

(n + 1) (

1) (k-j 0 ) =l5k,j,

-n k-j-r

r

expression (14.14) is deduced.

=

I

THEOREM 14.6

The Carlitz numbers B(n, k; s ), k = 0, 1, ... , n, n = 0, 1, ... , satisfy the triangular recurrence relation (n

+ 1)B(n + 1, k; s) = (sk- n)B(n, k; s) +[s(n- k + 2) + n]B(n, k-

fork= 1, 2, ... , n

+ 1, n

1; s),

= 0, 1, ... , with initial conditions

B(O,O;s) = 1, B(n,O;s) = 0, n

> 0, B(n,k;s)

= 0, k

> n.

(14.15)

525

14.3. GARLITZ NUMBERS

PROOF

Expanding the generalized binomials in both sides of the identity

by using (14.12),

~ ~(n + 1)B(n + 1, k; s) (t+n-k+1) n+1

k=O

=~ f='oB(n,k;s) (t+nn and, since

e

+:- k) (st- n)

k) (st-n)

= (sk- n) (t +: ~ ~ + 1) +[s(n-k+1)+n] (

t

+n+ n-

1

k) ,

we get the expression

~ (t+n- k+ t:'o(n + 1)B(n + 1, k; s) n+ 1

=

1)

~(sk-n)B(n,k;s)C+:~~+ 1 ) + ~[s(n- k + 1) + n]B(n, k; s)

(t:: ~

k).

Equating the coefficients of binomials c+:~~+l) in both sides of this expression we deduce (14.15). The initial conditions follow from (14.12).

I

The Garlitz numbers can be tabulated by using the recurrence relation

(14.15) and its initial conditions. Table 14.2 gives the numbers B(n,k;s), k = 1, 2, ... , n, n = 1, 2, ... , 4. The derivation of a bivariate generating function of the Garlitz numbers is facilitated by an expression of the Garlitz polynomial, n

Bn(t;s)=l:B(n,k;s)tk, n=O,l, ... , k=O

deduced in the following lemma.

(14.16)

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

526

Table 14.2

Garlitz Numbers B(n, k; s)

k

3

2

1

4

n 1

2

3

4

G) e) G)

c;1) 4c;1) c;2) (:) C: 2) + wC: 1) 10 (s: 2) + c: 1) (s: 3)

LEMMA 14.2 The Carlitz polynomial Bn (t; s ), n

Bn(t; s)

= 0, 1, 2, ... , is alternatively expressed as

= (1- t)n+I

f: (sj)

i=O

ti, n

= 0, 1, ....

(14.17)

n

PROOF Introducing in polynomial (14.16) the explicit expression (14.14) of the Carlitz numbers, we get

Note that the inner sum, in agreement with B(n, k; s) = 0, k > n, vanishes for k = n + 1, n + 2, ... and so in the outer sum the summation may be extended to infinity without altering its value. Thus

Bn(t; s)

= ~ ~(

-1r (n ~ 1) (s(k: r)) tk

= ~(- 1 r(n~1)tr~ (s(k:r))tk-r

14.3. GARLITZ NUMBERS

527

and, since

~(-1r(n~ 1)tr = expression ( 14.17) is deduced.

(1- t)n+l,

I

THEOREM 14.7 The bivariate generating function of the Carlitz numbers B(n, k; s), k = 0, 1, ... , n, n = 0, 1, ... , is given by

=?; ,{; B(n, k; s)tkun =1 _ t[1 1-t + u( 1 _ t)jB. n

oo

g(t, u; s)

(14.18)

PROOF The bivariate generating function of the Carlitz numbers, using expression (14.17) of the polynomials ( 14.16), may be expressed as

g(t,u;s) =

~(1- t)n+l ~ (~)tiun

= (1- t) ~ti ~ (~)[u(1- t)t and, since

~ ( ~) [u(1 - t)t = ~o (t [1 + u(1 f='

t)

]s)j-

[1

+ u(1 1

+ u(1 -

1- t[1

8

t)] i,

t)]s,

I

expression (14.18) is readily deduced.

REMARK 14.4 The bivariate generating function of the shifted Carlitz numbers

B(n, k

+ 1; s), k = 0, 1, ... , n- 1, n = 1, 2, ... , oo n-1

h(t,u; s)

= 1+ L

L

n=lk=O

n

B(n, k

+ 1; s)tk;, n.

which emerges in their applications, is closely connected with the generating function (14.18). Specifically, since B(n, 0; s) = 0, n > 0, it follows that

g(t, u; s)- 1 . )_ h( t,u, s - 1 + t

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

528

and so

h(t, u; s)

n

un

=1+ L

L B(n, k; s)tk-l n! n=lk=l

which is the required generating function.

1- t

= [1 + u( 1 _

t)]-s _ t' (14.19)

I

The Carlitz numbers are connected with the generalized factorial coefficients (see Section 8.4) as shown in the following theorem. THEOREM 14.8 The Carlitz numbers B( n, k; s ), k = 0, 1, ... , n, n = 0, 1, ... , are expressed in terms of the generalized factorial coefficients C(n, k; s), k = 0, 1, ... , n, n = 0, 1, by 0

0

.,

(14.20)

and inversely

C(n,r; s)

= n!r!

k)

r (nL r _ k B(n, k; s). k=O

(14.21)

PROOF Expression ( 14.17) of the polynomial ( 14.16), upon expanding the generalized binomial of j of order n and scale parameters into factorials of j by using (8.39), may be written as

n I ( .) Bn(t;s)=(1-tt+ 1 LLr;c(n,r;s) 1 ti j=O r=O n. r

and, since

it reduces to n

Bn(t;s)

=L

r=O

I

r. C(n,r;s)r(1- t)n-r.

n.1

(14.22)

14.3. GARLITZ NUMBERS

529

Thus, by virtue of (14.16),

r!

(n-

n n n r) {;B(n,k;s)tk = ~n!C(n,r;sW~(-1)k-r k-r tk-r

=

E{t,(

-1)k-r :\

(~ =~) C(n, r; s)} tk

and, equating the coefficients of tk in the first and last member of this relation, we conclude (14.20). Again, from (14.22) and setting u = t/(1 - t), whence t = u/(1 + u), we get, by virtue of (14.16), n

L r=O

n

1

r. C(n,r;s)ur n.1

= LB(n,k;s)uk(1 + u)n-k. k=O

Thus

and, equating the coefficients of ur in the first and last member of this relation, we I conclude (14.21). A limiting expression of the Carlitz numbers as s -+ the following theorem.

±oo

is derived in

THEOREM 14.9 Let B(n, k; s) be the Carlitz number. Then

lim s-nn!B(n, k; s) 8--->±oo

= A(n, k),

( 14.23)

where A(n, k) is the Eulerian number. PROOF Multiplying both members of expression (14.14) by s-nn!, taking the limit ass-+ ±oo and since lims--->±oo s-n(s(k- r))n = (k- r)n, we get

~(

-1r lim s-nn!B(n, k; s) = s--->±oo L.... r=O

=

(n +

1 ) [ lim s-n(s(k- r))n] r 8--->±00

~(-1r(n; 1)(k- r)n.

Thus, by virtue of (14.3), the limiting expression (14.23) is established.

I

530

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

14.4 PERMUTATIONS WITH A GIVEN NUMBER OF RUNS The permutations of a finite set can be classified according to the number and the length of the increasing (or decreasing) sequences of consecutive elements they include. In this respect, the following definition is introduced.

DEFINITION 14.3 Let (jt,h, ... ,jn) be apennutation of the set {1, 2, ... , n}. The sequence of consecutive elements

Um,im+l, ... ,im+r-d,

with

im < im+l < · · · < im+r-1,

is called ascending run of length r, for 2 :S m :S n - 1, 1 :S r :S n - 2, if Jm-1 > im and Jm+r-1 > im+r: in particular, form = 1, 1 :S r :S n- 1, if Jr > Jr+b form = n- r + 1, 1 :S r :S n- 1, if in-r > Jn-r+b and for m = 1, r = n, without any additional condition. This sequence is called descending run of length r if the corresponding conditions are satisfied with the reverse inequalities.

Example 14.3 Consider the permutations (j 1 , )2, )3, j 4 ) of the set {1, 2, 3, 4}. Clearly these 24 permutations can be classified according to the number of their ascending runs as follows: (a) The permutation (1,2,3,4) is the only one that has one ascending run of length 4. (b) The permutations with two ascending runs are the following II:

(1,2,4,3), (1,3,2,4), (1,3,4,2), (1,4,2,3), (2,1,3,4), (2,3,1,4), (2,3,4,1), (2,4,1,3), (3,1,2,4), (3,4,1,2), (4,1,2,3). (c) The permutations with three ascending runs are the following II:

(1, 4, 3, 2), (2, 1, 4, 3), (2, 4, 3, 1), (3, 1, 4, 2), (3, 2, 1, 4), (3, 2, 4, 1), (3,4,2,1), (4,1,3,2), (4,2,1,3), (4,2,3,1), (4,3,1,2). (d) The permutation

(4, 3, 2, 1) is the only one that has four ascending runs, each of length I.

D

THEOREM 14.10 The numberofpennutations of the set {1, 2, ... , n} with k ascending runs equals A(n, k), the Eulerian number.

14.4. PERMUTATIONS WITH A GIVEN NUMBER OF RUNS

531

PROOF Note that, from any permutation of the set { 1, 2, ... , n }, by attaching the element n + 1 in any of the n + 1 possible positions (one before the first element, n - 1 between the n elements and one after the last element) n + 1 permutations of the set { 1, 2, ... , n + 1} are constructed. Further, this attachment either keeps unchanged or increases by one the number of runs. Specifically, (a) from each permutation of the set { 1, 2, ... , n} with k ascending runs, by attaching the element n + 1 after the last element of any of these runs, k permutations of the set { 1, 2, ... , n + 1} with k ascending runs are constructed. Also, (b) from each permutation of the set { 1, 2, ... , n} with k - 1 ascending runs, by attaching the element n + 1 in any of the possible positions except after the last element of any of these runs (n + 1) - (k - 1) = n- k + 2 permutations of the set {1, 2, ... , n+ 1} with k ascending runs are constructed. Consequently, the number a( n, k) of permutations of the set { 1, 2, ... , n} with k ascending runs satisfies the recurrence relation

a(n

+ 1, k)

= ka(n, k)

+ (n- k + 2)a(n, k-

fork = 2, 3, ... , n

+ 1, n

= 1, 2, ... , with

1),

a(n, 1) = 1, n > 0, a(n, k) = 0, k > n. Comparing this recurrence relation and its initial conditions with the recurrence relation (14.4) of the Eulerian numbers and its initial conditions, we conclude that a(n, k) = A(n, k). I REMARK14.5 Considerapermutation(j 1 ,h, ... ,in)oftheset{1,2, ... ,n} with k ascending runs. Then, the permutation (i 1 , i 2, ... , in) of the set {1, 2, ... , n }, with im = in-m+ 1 , m = 1, 2, ... , n, which is the reverse permutation, has k descending runs. Since this correspondence is one-to-one, it follows from Theorem 14.10 that the number of permutations of the set {1, 2, ... , n} with k descending runs equals the Eulerian number A(n, k). I REMARK 14.6 Rises and falls of permutations. The ascending or descending runs of a permutation of the set {1, 2, ... , n} are connected with its rises or falls. Specifically, consider a permutation (j 1 , h, ... , in) of the set {1,2, ... ,n}. The pair Ur,ir+l) is called a rise if ir < ir+l and a fall if ir > ir+l• r = 1, 2, ... ,n- 1. If the permutation (iJ,i2 , ... ,in) has k rises (or k falls) {(jr 1 ,ir 1 +!), Ur,ir 2 +I), ... ,(jrk,irk+J)}, then it has k + 1 descending runs (or k+ 1 ascending runs) { (j1, h, ... , ir 1 ), Ur 1 +1, ir 2 +2, ... , ir2 ), Urk + 1, irk+2, ... , in)} and inversely. Hence, by Theorem 14.10, the number of permutations of the set { 1, 2, ... , n} with k rises (or k falls) equals the shifted Eulerian number A(n, k + 1). I

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

532

Example 14.4 Consider an urn containing n numbered balls { 1, 2, ... , n} and suppose that the balls are randomly drawn one after the other, without replacement. If im is the number drawn at the m-th drawing for m = 1, 2, ... , n, then (it, h, ... , in) represents a drawing of then balls. Determine (a) the probability p(k; n) that the drawing of then balls has k ascending runs, fork = 1, 2, ... , n, and (b) the r-th factorial moment J.L(r) of the sequence of probabilities p(k; n), k = 1, 2, ... , n, for r = 1, 2, .... (a) The number of permutations (j 1 , )2, ... , in) of the set {1, 2, ... , n} with k ascending runs, according to Theorem 14.10, is given by the Eulerian number A(n, k). Thus, the probability p(k; n) that the drawing of then balls has k ascending runs, on using the Laplace's classical definition of probability, is given by A(n, k) p(k; n) = , k = 1, 2, ... , n. 1

n.

(b) The generating function of the sequence of probabilities p( k; n), k

= 1, 2,

... , n, by (14.5), is given by P(t)

= tp(k;n)tk = An~t) n.

k=1

and so the factorial moment generating function, B(t)

= P(t + 1), (see Section

6.4) is

tr _ An(t + 1) _ ~ B( t ) - ~ J.L(r) I I . r=O r. n. Further, by (14.7), the exponential generating of the Eulerian polynomial An(t), n = 0, 1, ... , may be written as

t

un

oo

~ An (t) n! = 1 - t + -1----=[-eu-,.(t,---_---,-,1),-----1],...-/-:-(1---t)" Expanding it into a geometric series of z = (eu(t-l) -1)/(1-t) and then expanding the powers of eu(t- 1 ) - 1 into a series of u( t- 1), by using the generating function of the Stirling numbers of the second kind, (8.17), we get oo

n

oo

L An(t) :, = 1 + t L[eu(t- 1 ) n=O

-

1]k(t- 1)-k

k=1 oo

= 1+t

n

oo

LL

k!S(n, k)(t- 1t-k;

k=I n=k = 1+

oo ~

{

n.

t ~ k!S(n, k)(t- 1)n-k n

}

n

:,

14.5.

PERMUTATIONS WITH REPETITION

533

and so n

An(t)

=t L

k!S(n, k)(t- 1)n-k

k=l

n

=L

k!{(k + 1)S(n, k + 1) + S(n, k)}(t- 1t-k.

k=O

Thus, on using the triangular recurrence relation of the Stirling numbers of the second kind, (8.27), we deduce the relation n

An(t) =

L k!S(n + 1, k + 1)(t- 1)n-k k=O

whence 00

B(t)

r

n

= Lll(r)! =L r. r=O

r=O

(

)'

n-,r "S(n+1,n-r+1W. n.

Consequently, ll(r)

and ll(r) = 0 for r

14.5

= S(n+1,n-r+1)/(~). > n.

r

= 1,2, ...

,n,

D

PERMUTATIONS WITH REPETITION AND A GIVEN NUMBER OF RUNS

The permutations of a finite set with repetition can be classified according to the number and the length of the non-decreasing (or non-increasing) sequences of consecutive elements they include.

DEFINITION 14.4 Let (h, jz, ... ,in) be ann-permutation of the set {1, 2, ... , s} with repetition. The sequence of consecutive elements

is called non-descending run of length r; for 2 ::; m ::; n - 1, 1 ::; r ::; n - 2, if im-1 > im and im+r-1 > im+r; in particular; form = 1, 1 ::; r ::; n- 1, if ir > ir+t.for m = n- r + 1, 1 ::; r ::; n- 1, if in-r > in-r+t. and for m = 1, r = n, without any additional condition.

534

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

This sequence is called non-ascending run of length r conditions are satisfied with the reverse inequalities.

if the

corresponding

Example 14.5 Consider the permutations (j 1 , jz, h) of the set {1, 2, 3} with repetition. Clearly these 27 permutations can be classified according to the number of their ascending runs as follows. (a) The permutations with one non-descending run are the following 10:

(1, 1, 1), (1, 1, 2), (1, 1, 3), (1, 2, 2), (1, 2, 3), (1, 3, 3), (2, 2, 2), (2, 2, 3), (2, 3, 3), (3, 3, 3). (b) The permutations with two non-descending runs are the following 16:

(1, 2, 1), (2, 1, 1), (1, 3, 1), (3, 1, 1), (2, 1, 2), (2, 2, 1), (3, 1, 3), (3, 3, 1), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (2, 3, 2), (3, 2, 2), (3, 2, 3), (3, 3, 2). (c) The permutation

(3,2,1) is the onlx one that has three non-descending runs. Each of these runs is of length one. U The enumeration of the permutations of a finite set with repetition and a given number of non-descending runs is facilitated by distinguishing them according to the last element they include. A bivariate generating function of the number of such permutations is derived in the following theorem.

THEOREM 14.11 Let Q(n, k; s, r) be the number of n-permutations of the set {1, 2, ... , s} with repetition and last element r, which have k non-descending runs. Then

~ ~ Q( k· ) k n ~~ n, ,s,r t u

t)(1- u(1- t)J-r 1-t(1-u(1-t)]-8

= ut(1-

(14.24)

n=lk=l

PROOF Distinguishing the n-permutations of the set { 1, 2, ... , s} with repetition and last element r that have k non-descending runs, according to the element before the last, we conclude the expressions r

8

Q(n,k;s,r)=LQ(n-1,k;s,j)+ L j=l

j=r+l

Q(n-l,k-1;s,j),

14.5.

535

PERMUTATIONS WITH REPETITION

for r = 1, 2, ... , s - 1, k = 1, 2, ... , n, n = 2, 3, ... , and 8

Q(n,k;s,s) = LQ(n-1,k;s,j), j=l fork= 1,2, ... ,n, n = 2,3, ... , with Q(n,O;s,r) = 0, n = 1,2, ... , Q(1, 1; s, r) = 1 and Q(1, k; s, r) = 0, k = 2, 3, .... Multiplying these expressions by tk and summing for k = 1, 2, ... , n, we get for the generating function n

fn(t;s,r) = LQ(n,k;s,r)tk, n = 1,2, ... , r = 1,2, ... ,s, k=l the recurrence relations T

fn(t;s,r)

S

= Lfn-t(t;s,j) +t j=l

for r

= 1, 2, ...

L fn-t(t;s,j), j=s+l

, s - 1, n = 2, 3, ... , and s

fn(t;s,s)

= Lfn-t(t;s,j), j=l

for n = 2, 3, ... , with ft (t; s, r) = t. Taking the difference of these relations with respect tor, we deduce the recurrence relation.

fn(t; s, r- 1) = fn(t; s, r) for r = 2, 3, ... , s, n = 2, 3, ... , with multiplying by

c~

1 ) (t _ 1)j =

G)

+ (t-

1)fn-1 (t; s, r),

ft (t; s, r)

(t _ 1)j-

and summing the resulting expression for j

= t. Replacing n by n- j,

G=~)

(t- 1)j

= 0, 1, ... , i, we get

~ (i ~ 1) (t- 1)j fn-j(t; s, r- 1) = 't (i.) (t- 1)j fn-j(t; s, r) ;=0

J

;=0

-'t (~ =~) j=l

(t- 1)1 fn-j(t; s, r)

J

+~

(i ~ 1) (t- 1)1+1fn-j-1 (t; s, r) J

j=O

and so

t (i.) j=O

J

(t- 1)i fn-j(t; s, r) =

~ (i ~ 1) (t- 1)j fn-j(t; s, r- 1). j=O

J

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

536

Applying successively the last relation, we deduce the expression

fn(t; s, r-

i) = t (i.) j=O

(t- 1)1 fn-j(t; s, r)

J

for n = 1, 2, ... , i = 0, 1, ... , r- 1, r = 1, 2, ... , s. Multiplying both members of this expression by un and summing for n = 1, 2, ... , we find for the bivariate generating function oo

f(t,u;s,r)

=L

oo

n

LQ(n,k;s,r)tkun

= Lfn(t;s,r)un,

n=lk=l

n=l

the relation

f(t, u; s, r- i)

= [1- u(1- t)]i f(t, u; s, r),

fori= 0, ... ,r -1, r = 1,2, ... , s. In particular, for r = s,

f(t, u; s, s- i) = [1- u(1- t)]i f(t, u; s, s), i = 0, 1, ... , s- 1. (14.25) Summing it fori = 0, 1, ... , s- 1, we get s-1

"'""'

[

.

~f(t,u;s,s-z)= i=O

tW f(t,u;s,s).

1 - 1 - u(1 ( ) U 1- t

Also s-1

~f(t,u; s,s- i)

s-1 oo

oo {s-1

= ~~ fn(t;s,s- i)un = ~

and, since In+ I (t; s, s) =

}

~fn(t; s,s- i) un

2:j= 1 fn(t; s, j),

s-1

"'""'!( . _ .) _ ~ t,u,s,s z i=O

f(t, u; s, s) - ut

.

U

Therefore

(1- t)f(t, u; s, s)- ut(1- t) = {1- [1- u(1- t)"]} f(t, u; s, s) and

f( t u· s s) -

' ' '

ut(1 - t)

- (1 - ut(1 - t)]• - t ·

Introducing the last expression into (14.25) and setting r i = s- r, we conclude that

!( t, u; s, r )

=

ut(1 - t)[1 - u(1 - t)]-r 1 - t [1 - u (1- t) ]-s

s - i, whence

14.6. BIBLIOGRAPHIC NOTES

537

and the derivation of generating function (14.24) is completed.

I

COROLLARY 14.1 Let Q(n, k; s) be the number of n-permutations of the set { 1, 2, ... , s} with repetition, which have k non-descending runs. Then oo

n

L L Q(n, k; s)t

k-1

u

n=l k=l

n

(

1- t)

= [1-u1-t ( )]

8

-t .

(14.26)

PROOF Notice that the attachment of the element s after the last element of an n-permutation of the set { 1, 2, ... , s} with repetition, which has k nondescending runs uniquely yields an (n +I)-permutation of the set {1, 2, ... , s} with repetition and last elements, which has k non-descending runs. Consequently, Q(n, k; s) = Q(n + 1, k; s, s) and introducing this expression into (14.24), we deduce (14.26). I

Clearly, comparing the generating function (14.26) with the generating function (14.19) of the Carlitz numbers we conclude the following corollary. COROLLARY 14.2 The numberofn-permutations of the set {1, 2, ... , s} with repetition, which have k non-descending runs is given by

Q(n,k;s) = IB(n,k;-s)i = (-l)nB(n,k;-s), where B(n, k; s) is the Carlitz number.

14.6

BIBLIOGRAPHIC NOTES

The problem of evaluating the power series with coefficients powers of fixed order led Euler to the introduction of Eulerian polynomials and numbers (see Example 14.1). Expression (14.1), of the n-th power of a number as sum of binomial coefficients of the n-th order with coefficients the Eulerian numbers, is due to J. Worpitzky (1883). Other properties of the Eulerian numbers and polynomials can be found in L. Carlitz (1959). Motivated by the problem of expressing the power moments of a frequency distribution in terms of cumulative totals (see Example 14.2), P. S. Dwyer (1938, 1940) introduced and studied the cumulative numbers, which are non-central Eulerian numbers. The Carlitz numbers were so named in honor of Leonard Car!itz for his stimulating contribution on the Eulerian

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

538

numbers, their generalizations and combinatorial applications. These numbers were first studied in L. Carlitz (1979) as degenerate Eulerian numbers. Ch. A. Charalambides (1982) further examined them as composition numbers. The general Simon Newcomb's problem was studied through generating functions by P. A. MacMahon (1915, 1916). J. Riordan (1958) and Ch. A. Charalambides (2002) examined it as a problem of enumeration of permutations with restricted positions by using power and factorial rook polynomials. An interesting combinatorial treatment of the same problem was provided by J. E. Dillon and D. P. Roselle (1969). The presentation of the section on the enumeration of permutations with repetition and a given number of runs (or rises) is based on the paper of L. Carlitz, D. P. Roselle and R. A. Scoville (1966).

14.7

EXERCISES

1. Non-central Eulerian numbers. Consider the expansion

~ (t+r) n =L..,A(n,k;r)

(t + n- k) n

, n=O,l, ....

k=O

The coefficient A(n, k; r) is called non-central Eulerian number or Dwyer number. Derive (a) the explicit expression

A(n, k; r) =

t(

~ 1) (k + r- it

-l)j (n

J

j=O

and (b) the triangular recurrence relation

A(n + 1, k; r) = (k for k

= 1, 2, ...

,n

+ r)A(n, k; r) + (n-

k- r

+ 1, n = 0, 1, ... , with initial

+ 2)A(n, k- 1; r),

conditions

A(O,O;r) = 1, A(n,O;r) = rn, n > 0, A(n,k;r) = 0, k > n.

2. (Continuation). Show that n

An(t; r) = L

oo

A(n, k; r)tk = (1- t)n+l L(i

k=O

and oo

g(t, u; r)

n

L A(n, k; r)t n=Ok=O

=L

+ r)nti

i=O

k

un n!

=

(1 _ t)eru(l-t) _ teu(l-t) · 1

14. 7. EXERCISES

539

3. (Continuation). Show that the non-central Eulerian numbers A(n, k; r), k = 0, 1, ... , n, n = 0, 1, ... are connected with the non-central Stirling numbers of the second kind S(n, k; r), k = 0, 1, ... , n, n = 0, 1, ... by A(n,k;r) =

t(-1)k-j(~=~)j!S(n,j;r) J

j=O

and S(n,j;r)

1

= -:-r Lj

J k=O

(

n- k k ) A(n,k;r).

._

J

4. Non-central Garlitz numbers. Consider the expansion

(

st n+

r)

= ~ L...t B(n, k; s, r)

(t + k) nn -

, n = 0, 1, ....

k=O

The coefficient B(n, k; s, r) is called non-central Carlitz number. Derive (a) the explicit expression

and (b) the triangular recurrence relation (n + 1)B(n + 1, k; s, r) = (sk + r- n)B(n, k; s, r) +[s(n- k + 2) + n- r]B(n, k- 1; s, r), for k

= 1, 2, ...

,n

+ 1, n

= 0, 1, ... , with initial conditions

B(O,O;s,r)=1, B(n,O;s,r)=(:). n>O, B(n,k;s,r)=O, k>n. 5. (Continuation). Show that

Bn(t; s,

r)

=

~ B(n, k; s, r)tk =

(1- t)n+l

t, (

sj:

r)

tj

and g(t,u;s,r) =

oo

Ln

k

L B(n,k;s,r)t u n=Ok=O

n=

(1 - t)[1 + u{1 - t}Y ( )] [ 1-t 1 +u 1-t s

6. (Continuation). Show that

lim s-nn!B(n,k;s,r)=A(n,k;p), if

s-+±oo

·

limr/s=p

s±oo

540

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

and

n

LB(n,k;s,r) = sn. k=O

7. (Continuation). Show that the non-central Carlitz numbers B(n, k; s, r), k = 0, 1, ... , n, n = 0, 1, ... are connected with the noncentral generalized factorial coefficients C(n, k; s, r), k = 0, 1, ... , n, n = 0, 1, ... by k

B(n,k;s,r)=L(-1) j=O

and C(n,j;s,r) =

k-· ( n-J") J.., . J k-. n!C(n,J;s,r) J

n! (n- k)

l" Lj

J k=O

. _ k B(n,k;s,r). J

8*. q- Eulerian numbers. Consider the expansion of the n-th power of the q-number [t]q into q-binomial coefficients of order n:

[t]~ =

t

qk(k-l)/2 A(n, klq) [t + ~- k] , n = 0, 1, ....

k=O

q

The coefficient A(n, klq) is called q-Eulerian number. (a) Show that A(n,klq)=A(n,n-k+1lq), k=0,1, ... ,n, n=0,1, ...

and (b) derive the explicit expression A(n,klq) =

q-k(k-l)/2

~(-1rqr(r-l)/2

[

n;

1

L

[k-

r]~,

for k = 0, 1, ... , n, n = 0, 1, .... 9*. k

(Continuation). Show that the q-Eulerian numbers A(n,klq), , n, n = 0, 1, ... , satisfy the triangular recurrence relation

= 0, 1, ...

A(n

for k

= 1, 2, ...

+ 1, klq) , n, n

= [k]qA(n, klq)

+ [n- k + 1]qA(n, klq),

= 0, 1, ... , with initial conditions

A(O, Olq) = 1, A(n, Olq) = 0, n

> 0 A(n, klq) = 0, k > n.

10*. Records. Let (]t,h, ... ,jn) be a permutation of {1,2, ... ,n}. The element ir, for 2 :S r :S n, is called a record of this permutation if Jr > j 8 , s = 1, 2, ... , r - 1. Especially, the first element h is regarded,

14. 7. EXERCISES

541

by convention, as a record. Show that the number of permutations of the set {1, 2, ... , n} that have k records equals ls(n, k)l, the signless (absolute) Stirling number of the second kind. 11. Inversions of permutations. Let (j1,h, ... ,jn) be a permutation of the set { 1, 2, ... , n }. If ir >is for 1 ::; r < s ::; n, this permutation has an inversion at the pair of points (r, s). Show that the number b(n, k) of permutations of the set { 1, 2, ... , n} with k inversions satisfies the horizontal recurrence relation k

b(n,k) =

L

b(n- 1,i), m = max{O,k- n

+ 1},

j=m

for k = 0, 1, ... , n(n- 1) /2, n = 1, 2, ... , with initial conditions

b(n, 0) = 1, b(O, k) = 0, k

~

1, b(n, k) = 0, k

> n(n- 1)/2

and conclude that

b(n, k)

= b(n, k- 1) + b(n- 1, k),

fork= 1, 2, ... , n- 1, n = 1, 2, ... and

b(n, k)

= b(n, k- 1) + b(n- 1, k)- b(n- 1, k- n),

fork= n,n + 1, ... ,n(n- 1)/2, n = 3,4, .... 12. (Continuation). Show that

~n(t) =

n(n-1)/2

L

n

b(n, k)tk

k=O

1

j

= IJ 1 -=. tt ,

n

= 1, 2, ...

j=l

and conclude that

b(n, n(n- 1)/2- k) = b(n, k), n(n-1)/2

L

k=O

n(n-1)/2

b(n, k) = n!,

L

(-1)kb(n,k) = 0.

k=O

13. Local maxima and minima. Let (j 1 , h, ... , in) be a permutation of the set { 1, 2, ... , n}. The element ir, for 2 ::; r ::; n - 1, is called a local maximum or a peak at the point r of this permutation if ir > ir-I and ir > ir+l· Especially, the element ii is a peak if i1 > h, while the element Jn is a peak if in > in- I· The element ir is a local minimum if the conditions are satisfied with the reverse inequalities. Show that the number T1 (n, k) of

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

542

permutations of the set {1, 2, ... , n} with k local maxima (minima) satisfies the triangular recurrence relation T1 (n + 1, k) = (2k

+ 2)T1 (n, k) + (n-

2k +- 1)TI(n, k- 1),

for k = 1, 2, ... , n = 2, 3, ... , with initial conditions T1 (n,0)=2n-I, n=2,3, ... , TI(2,k)=O, k=1,2, .... 14. Show that the number T2(n, k) of permutations of the set { 1, 2, ... , n} with k ascending runs, each of length greater than one, satisfies the triangular recurrence relation

T2(n

+ 1, k)

= (2k

+ 1)T2(n, k) + (n- 2k + 2)T2(n, k-

1),

for k = 1, 2, ... , n = 2, 3, ... , with initial conditions T2(n, 0) = 1, n = 2, 3, ... , T2(2, 1) = 1 T2(2, k) = 0, k = 2, 3, .... 15*. Consider the double sequence of numbers T(n, k), k = 0, 1, ... , n = 2,3, ... , where T 1 (n,k) = T(n,2k + 1) and T2(n,k) = T(n,2k) are the numbers of permutations of the set { 1, 2, ... , n} with k local maxima (minima) and with k ascending runs of length greater than one, respectively. (a) Show that

T(n

+ 1, k)

= (k

+ 1)T(n, k) + (n- k + 2)T(n, k- 2),

for k = 2, 3, ... , n = 2, 3, ... , with T(n, 0) = 1, T(n, 1) = 2n-I, n = 2, 3, ... ,

T(2, 2) = 1, T(2, k) = 1, k = 3,4, .... (b) Setting T(1, k)' = 1, k = 0,1 and T(1, k) = 0, k = 2, 3, ... , derive the generating function ~~

g(t, u) =

k

un-1

1 - t2

~ ~ T(n, k)t (n- 1)! = t(cosh z- 1)'

with z = u(1- t 2) 1 12 + arccosh(1/t), where coshz = (ez + e-z)/2 is the hyperbolic cosine and arccoshw is the arch of the hyperbolic cosine of w. 16*. Show that the number R(n,k) of permutations of {1,2, ... ,n} with k (ascending or descending) runs of length greater than one satisfies the recurrence relation

R(n

+ 1, k)

= kR(n, k)

+ 2R(n, k-

1) + (n- k + 1)R(n, k- 2),

14.7. EXERCISES

543

for k = 2, 3, ... , n = 2, 3, ... , with initial conditions

R(n, 0) = 0, R(n, 1) = 2, n = 2, 3, ... , R(2, k) = 0, k = 2, 3, .... 17*. Up-down and down-up permutations. A permutation (j 1 , h, ... , in) of the set { 1, 2, ... , n} is called up-down permutation if hr- 1 < hr for r = 1, 2, ... , [n/2] and hr > hr+ 1 for r = 1, 2, ... , [n/2] - 1, while it is called down-up permutation if hr- 1 > hr for r = 1, 2, ... , [n/2] and hr < hr+l for r = 1, 2, ... , [n/2]- 1. (a) Show that the number An of updown permutations of the set { 1, 2, ... , n}, which is equal to the number of down-up permutations of the same set, satisfies the recurrence relation

with An = 1, n = 0, 1, 2 and (b) deduce the generating function

L Ann!tn =tan ( 2t + 47r) . 00

A(t) =

n=O

18*. (Continuation). Euler numbers. The sequence of Euler numbers E 2 n, n = 0, 1, ... , (E2 n+ 1 = 0, n = 0, 1, ... ) has generating function

(a) Show that

IE2nl

= (-1)nE2n =

A2n,

where A 2 n is the number of up-down permutations of the set {1, 2, ... , 2n }. (b) Derive the expression

IE2nl

= i)-1)n-d 2

where

R(n,k)=

:)!

2

k=1

R(2n,2k)

~!t,(-1fG) (~-j)n

is the Carlitz-Riordan number of the second kind (see Exercise 8.22). 19*. (Continuation). Tangent coefficients. Consider the sequence T2 n+l, n = 0, 1, ... , (T2 n = 0, n = 0, 1, ... ) with generating function

oo

T(t) =

t2n+1

1_

e2t

~ T2n+1 (2n + 1)! = 1 + e 2 t

= -tanh t.

544

RUNS OF PERMUTATIONS AND EULERIAN NUMBERS

(a) Show that IT2n+ll = (-1)nT2n+l = A2n+l

1

where A 2n+l is the number of up-down permutations of the set {1, 2, ... , 2n + 1}. (b) Derive the expression y.

l 2n+l

I=

~(-1)n-k (k + 1)(2k)! R(2n 2k) L.J k ' , 2

k=l

where R(n, k) is the Carlitz-Riordan number of the second kind. 20*. (Continuation). Genocchi numbers. The sequence of Genocchi numbers Gn, n = 1, 2, ... , has generating function

G(t)

CXl

tn

2t

n=l

n.

+e

= LGn 1 = -1 - t

and so G 1 = 1, G 2n+I = 0, n = 1, 2, .... (a) Show that

where A 2n-l is the number of up-down permutations of the set { 1, 2, ... , 2n - 1}. (b) Derive the expression 2n-l IG2nl = 2n

kl

L (-1)n-k 2 ~ S(2n- 1, k),

k=l

where S(n, k) is the Stirling number of the second kind.

HINTS AND ANSWERS TO EXERCISES

CHAPTER I

= A 3 = {(t,t,t),

(t,t,h), (t,h,t), (h,t,t), (t,h,h), (h,t,h), (h,h,t), (h,h,h)}, F((t, t, t)) = 0, F((t, t, h)) = F((t, h, t)) = F((h, t, t)) = 1, F((t, h, h)) = F((h, t, h)) = F((h, h, t)) = 2, F((h, h, h)) = 3.

1.

s3

2. (a) N(S2) = 36, (b) A 2 = {(1, 1)}, A 3 = {(1, 2), (2, 1)}, A 4 = {(1, 3), (2, 2), (3, 1)}, A 5 = {(1,4), (2,3), (3,2), (4,1)}, A 6 = {(1,5), (2,4), (3,3), (4,2), (5,1)}, A 7 = {(1,6), (2,5), (3,4), (5,2), (6, 1)}, A 8 = {(2,6), (3,5), (4,4), (5,3), (6,2)}, A 9 = {(3,6), (4,5), (5,4), (6,3)}, Aw = {(4,6), (5,5), (6,4)}, Au= {(5,6), (6,5)}, A12 = {(6,6)}. 3. W = {1, 2, 3, 4, 5, 6}, S3 = W 3 , N(S3) = [N(W)j3 = 6 3 = 216, A= {(w,b,r) E S3: w+b+r > 10}, A'= {(w',b',r') E S3: w' +b' +r' :S 10}. The element (w, b, r) in A uniquely corresponds to the element (w', b', r') in A', with w' = 7- w, b' = 7- b, r' = 7- r. Indeed, w' + b' + r' = 21- (w + b + r) :S 10 if and only if w + b + r > 10.

4. N(L5 xR5)

= N(L5)N(R 5 ) = 25,

N(L5 xR4)

= N(L5)N(R4) = 20.

5. The set Bn of n-digit binary sequences (1, a1, a 2, ... , an-I) is equivalent to the Cartesian product A 1 x A2 x ··· x An-I, with Ai = {0,1}, i = 1, 2, ... , n - 1, and so N(Bn) = N(A1)N(A2) · · · N(An_I) = 2n-l, n = 2,3, ... , N(BI) = 2. Also, N(Tn) = L~=l N(Br) = 2 +I:~,:; 2r-l = 2n. Alternatively, the set Tn of binary sequences of at most n digits is equivalent to the Cartesian product A 1 x A 2 x · ·· x An, with Ai = {0, 1}, i = 1, 2, ... , nand so N(Tn) = 2n. 6. The set Bn of sequences of n symbols (a 1 , a 2 , ... , an) is equivalent to the Cartesian product A 1 x A2 x · · · x An, with Ai = {0, 1}, i = 1, 2, ... , n,

HINTS AND ANSWERS TO EXERCISES

546

where 0 corresponds to a "dot" and 1 to a "dash." Thus N(Bn) = 2n, n = 1,2, ... , and the required number is L~= 1 N(Br) = 2n+1. 7. (a)8+9=17,

(b)2·8·9+9·9=225,

(c) 1+17+225=243.

8. (a)9·5=45, (b)9·10·5=450, (c)5+45+450=500. 9.(a)n 3, (b)n(n-1)(n-2), (c)3·n 2. 10. (a) 4 · 3 · 2 = 24,

(b) 33 = 27,

(c) 3 · 22 = 12.

11. Note that any factor of the number N is of the form p~ 1 p;2 • • • p~n , where ir E Ar = {0, 1, ... , kr }, r = 1, 2, ... , n, and apply the multiplication principle. 12. 4n. 13. (a) 3 13 = 1,594,323, (b) 25 · 32 = 288. 14. 143 . 9 . 103 = 24,696,000.

15. kn. 16. Apply the multiplication principle (a) with Ar = {1, 2,} and (b) with Ar = {1, 2, ... , k} for r = 1, 2, ... , n. Then the number of divisions (a) in two subsets is 2n and (b) ink subsets is kn.

17. Note that a map f from X into Y corresponds to an ordered ntuple (Yit,Yh,··· ,Yjn) with Yir = f(xr), r = 1,2, ... ,nand apply the multiplication principle. 18. Suppose that each cell contains at most one object and conclude that this hypothesis leads to a contradiction. Use the fact that each integer k; E K can be written in the form ki = 2r; · s;, where r; is a nonnegative integer and s; is a positive odd integer less than 2n, and apply the pigeonhole principle.

19. Consider the partial sums s1 = k 1, s2 · · · + kn and apply the pigeonhole principle.

= k1

+ k2, ... , sn = k1 + k2 +

20. Each integer i from the set {1, 2, ... , 10} can be written in the form i = 2r; · s;, where r; is a nonnegative integer and s; belongs to the set

{1, 3, 5, 7, 9} of five positive odd integers. Apply the pigeonhole principle and conclude that between the six chosen numbers there are two having the same s.

CHAPTER2 1. (a) Let the four boys {bt, b:!, b3, b4 } seat first. Then the three girls {9 1, 92, 93} may take any three among the five permissible positions

CHAPTER2

547

{w 1,w2,w3,w4,w5 }, where Wi is the position before the i-th boy fori= 1, 2, 3, 4 and w5 is the position after fourth boy. Apply the multiplication principle and conclude that the required number is 4!(5)3 = 480. (b) 7! = 5040. 2. 16. 15 = (2. 15) . 8 = 240. 3. 4!(51. 3! . 1. 1) = 17,280. 4. 4 3 = 64, 3. 3 2 = 27. 5. (7)4 = 840. 6. Consider the set Aj that contains the permutations of {j,j+1,j+2}, j = 1, 2, 3,4, and conclude that the required number is N(A 1 ) + N(A2) + N(A3) + N(A4) = 4 · 3! = 24.

7. (a) 2 · 33 =54, (b) 9 · 102 · 5 = 4500, (c) 9 · 10 2 · 5 8. (a) (10)4 = 5040, (b) 104 = 10,000.

= 4500.

9. Consider the two like elements of each of the 2 kinds {w1 , w2} as two single elements and conclude that the required number is (2 . 3 + 2 )! = 8! = 7' = 5040 23 . 12 23 . . 10. 10!/2 2 = 907,200. 11. N(A) = 3 · 3! + 2 · 3 + 1 = 25, N(fl) = 63 = 216.

N(B) = 3 · 3! + 3 · 3 = 27,

12. Note that each circular permutation (i 1 , i2, ... , in) of the set {1, 2, ... , n} corresponds ton (linear) permutations of the same set and conclude the required number. 13. (a) 2 · (5)3 · 2 · 3 = 720, 3

14. (a) (8 + 3)! · 2

(b) (5)3 · 2 = 120

= 319,334,400,

(b) (8 + 3 - 1)! · 23

15. (a) N(A 4) = 42 = 16, (b) N(A3) = 32 = 9, (c) N(B4) = N(A 4 - A 3) = N(A 4)- N(A 3) 16. N(D4)

= N(C4- C5) = N(C4)- N(C5) 2 - (6- 5 + 1) = 5.

= (6- 4 + 1) 2

17.

(7)

18. 2

2 + 7=

(7 + 2- 1) 2

G) G)+(~)

19. (a)

G).=

= 28.

2

10, (b)

= 472.

G) =

10.

= 42 -

= 29,030,400 32

= 7.

HINTS AND ANSWERS TO EXERCISES

548

20. (a) (;) (;),

(b)

(~)2 5 ,

21. (a) 510 = 9,765,625,

22.

23. (a) c2°) 8!

C+ ~~-

(b)

G) G) + G) G)

C;).

(c)

1 ) = 1001.

= 420.

= ~! = 1,814,400, 1

(b) c3°) 7!

1

= 3~! = 604,800,

1 - "22 10! -- 907,200. (c) ( 10) (8) 6.2 2

10! 24. 1!2!3!4! = 12,600. 6! 25. (a) ( !) 3 = 90, 2 10! 26. (a) 25"

6! (b) 31 ( 2!) 3 = 15.

= 113,400,

(5!) 2

= 14,400,

(b ) 10! -- 945, 5.1 -- 120. 5125

11

27. (a) 3 11 = 177,147,

(b)

L 3 · 1i2ll-i = 3(2

6

-

1) = 189.

j=6

28. The required number is the number of paths from the point (0, 0) to the point (5, 3) and equals = 56.

m

29. Consider the inverse procedure starting with n one-element sets and, at each stage merging together any two subsets derive, by applying the multiplication principle, the required number. 30. (a) The least number of lockers needed is the number of different "restricted" lockers needed and equals an = (;), which is the number of k-combinations of the n generals, with k = [n/2] the integer part of nj2. (b) The number of keys a general should have equals bn = (n; 1 ), which is the number of k-combinations of n - 1 generals. 31. (a) The number of n-combinations of a set Wr+s, of r + s elements, which equals (r~•), may equivalently be evaluated by selecting k elements from a subset Ar ~ Wr+s, of r elements, and n - k elements from the complementary set Wr+s- Ar of s elements, fork= 0, 1, ... , n, and using the principles of multiplication and addition. (b) Similarly, evaluate the number of n-combinations of Wr+s with repetitions. 32. (a) Use the expression

(~)

=

k!(n~ k)!"

(b) The pair of sets (A, B), with A~ B ~ Wand N(A) = k, N(B) = s, N(W) = n, uniquely corresponds to the pair of sets (A, C), where C =

CHAPTER2

549

B - A, with A ~ fl and C ~ A' = W - A. Also, the same pair of sets (A, B) uniquely corresponds to the pair of sets (A, D), where D = B- A, with D ~ fl and A~ fl- D. Evaluate the pairs of sets (A, B), (A, C) and (A, D) and conclude the first two equalities. The other two equalities are similarly deduced with s = r + k. 33.

Multiply the expression

.

(n) k

and deduce the first relat10n. Express

n'

= k!(n ~ k)! by n = (n - k)

(n) (s+(n+s)) k

=

k

+ ·k

as a sum of

binomial coefficients, by using the first expression in Exercise 31; using the second part of Exercise 32, deduce the required formula. n) n! (n+1)k+(n-k) 34. Multiply the expression ( k = k!(n _ k)! by n = k+ 1 and deduce the first relation. Work as in the second part of Exercise 33. 35. Use Pascal's triangle and, splitting the sum into two sums, conclude the first formula. Using the first part of Exercise 32 and the first part of this exercise, derive the second formula. 36. The use of Pascal's triangle splits the sum into two sums, which reduce to the required expression.

37. Verify that each injective map f of X into Y, with f(xr) = Yir, r = 1, 2, ... , k, uniquely corresponds to a k-permutation (Yh, Yh, ... , Yik) of the set Y. 38. Verify that each map f of {1,2, ... ,k} into {1,2, ... ,n} uniquely corresponds to a k-combination (a) without repetition if f is strictly increasing and (b) with repetition if f is increasing.

39. Consider the set C of k-combinations of the set Wn+I in which the element w 0 appears at most s times and the subset Cj ~ C of these combinations in which the element w 0 appears exactly j times, for j 0, 1, ... , m, with m = min{k, s }, and apply the addition principle. 40. Consider the set E of k-combinations of n, with repetition, in which each element appears at most twice and the subset Cj ~ E of these combinations in which exactly j elements appear twice, for j = 0, 1, ... , m, with m = min{n, [k/2]} and apply the addition principle. 41. Consider the set A of k-combinations of n + r with repetition, in which each of n specified elements appears at most twice, while each of the other r elements appears at most once. Further, consider (a) the subset Ai ~ A of these combinations in which exactly j of the n specified elements appear twice, for j = 0, 1, ... , m, with m = min{n, [k/2]}, and apply the

550

HINTS AND ANSWERS TO EXERCISES

addition principle. Also, consider (b) the subset Bi ~A of these combinations in which exactly i of the r elements appear, fori = 0, 1, ... , s, with s = min {r, k}, and apply the addition principle. 42. Consider the set K of the k-combinations of n elements belonging in r kinds with k 1 , k2 , ... , kr elements, respectively. Further, consider the subset Ki ~ K of these combinations which contain exactly j of the k 1 elements of the first kind, for j = 0, 1, ... , k 1 and apply the addition principle. 43. (a) Use Theorem 2.10. (b) Consider an element w of the set Wn, of n elements, and enumerate the partitions of Wn in k subsets in which w belongs in a unit set and the partitions of Wn in k subsets in which w belongs in a subset that is not a unit set. Applying the addition principle, conclude the required recurrence relation. (c) Enumerate the partitions of Wn in k subsets in which w belong in a subset with a total of j elements, for j = 1, 2, ... , n and apply the addition principle. 44. (a) Show that the required number equals the product of the number of partitions of X ink subsets and the number of k-permutations ofY. (b) Use the result of Exercise 1.17. (c) Use the first part of Exercise 32. 45. Note that, to each partition of a set Wn in k (nonempty) subsets, there correspond k! divisions of Wn in k nonempty subsets, and use the result (c) of Exercise 44. 46. (a) Use Theorem 2.10. (b) Consider an element w of the set Wn, of n elements, and enumerate the partitions of Wn in which w belongs in a subset with a total of j elements, for j = 1, 2, ... , n, and apply the addition principle. 47. Consider the set P of partitions of the set Wn, of n elements, and the subset Pk ~ P of partitions of Wn in k subsets, for k = 1, 2, ... , n, and apply the addition principle and the result (a) of Exercise 43. Further, introduce the expression (c) of Exercise 44 into the preceding expression. 48. The required number equals (~:::~), the number of positive integer solutions of the linear equation x 1 + X2 + · · · + Xn = k. 49. Select first the s positions for the s runs of zeros among the n- k + 1 positions between the n - k ones or before the first and after the last one. Then (a) allocate the k zeros in the selected s positions, placing at least one zero in each of these positions. (b) Choose the sr positions of the runs of length r, for r = 1, 2, ... , k, among the s selected positions. 50. To each k-combination {i 1 , i 2 , ..• , ik} of the set {1, 2, ... , n} correspond the permutation (a 1 , a 2 , ... , an) of k zeros and n- k ones in which the element ai,, ai 2 , ••• , aik are zeros. Verify that this correspondence is one-to-one and use the result of Exercise 49.

CHAPTER 2

551

51. To each (circular) k-combination of the first n integral numbers displayed on a circle, correspond a circular permutation of k zeros and n- k ones in which one of the n elements is marked with a star corresponding to number 1.

52. (a) Use the one-to-one transformation Yi = Xi-s, i = 1, 2, ... , n, and conclude that the required numbers equals (n+z=:~- 1 ). (b) Use the one to one transformation Zi = m- xi, i = 1, 2, ... , n and conclude that the required number equals (n+:~=z- 1 ). 53. To each partial derivative of order k of an analytic function of n variables, correspond a nonnegative integer solutions of a linear equation 1 r1 + r2 + · · · + rn = k and conclude that the required number is ).

(n+z-

54. Verify that the number of monomials in the most general polynomial in n variables X1, x2, ... , Xn of degree k equals the number of nonnegative integer solutions of a linear inequality r 1 + r 2 + · · · + rn -::; k and conclude that an,k = (ntk). 55. Correspond to each k-combination of {1, 2, ... , n }, satisfying the required property, an integer solution of linear equation ji + h + · · · + ik + jk+ 1 = n, satisfying the restrictions j 1 ~ 1, h ~ s + 1, h ~ s + 1, ... , jk ~ S + 1, jk+1 ~ 0. 56. Using the result of Exercise 55 enumerate the k-combinations of {1, 2, ... , n }, displayed on a circle, which satisfy the required property and (a) do not contain the elements n- s + 1, n- s + 2, ... , n and (b) contain at least one of the s elements n- s + 1, n- s + 2, ... , n and apply the addition principle.

57. (a) The evaluation of the number C(n, k; sk-I) may be reduced to the enumeration ofthe k-combinations {j1 , h, ... , jk} of {1, 2, ... , n-sk-d by using the transformation j 1 = ii, im = im- Sm-1> m = 2, 3, ... , k. (b) Using the same transformation, the evaluation of the number B(n, k; sk-I, r) may be reduced to the enumeration of the k-combinations {j 1 ,h, ... ,jk} of the set {1, 2, ... , n- sk-d, which satisfy the restriction jk -::; n- sk-1 + (ii - r- 1). 58. The number Qn,k equals the number of ways of selecting k positions for the zeros among the (n-k-1)+2 = n-k+1 positions between the n-k ones or before the first and after the last one. Apply the addition principle to deduce Qn· Use Pascal's triangle to deduce the recurrence relation. 59. The required number is given by Cn+I = N(A-B) = N(A)-N(B), where A is the set of lattice paths from the point (0, 0) to the point (n, n) and B is the set of lattice paths from the point (0, 0) to the point (n, n) that do not touch or intersect the straight line x = y - 1.

HINTS AND ANSWERS TO EXERCISES

552

60. (a) Note that each lattice path from (0, 0) to (n, k) with r diagonal steps requires, in addition, k- r vertical and n- r horizontal steps. Select the r diagonal and k- r vertical steps among the total of n + k- r steps. (b) Exclude the r diagonal steps and enumerate the number of lattice paths from (0, 0) to (n - r, k - r) that do not touch or intersect the straight line x = y. Such a path passes through n + k - 2r points (not including the origin). Select the r starting points of the diagonal steps among the n + k - 2r points. 61. Use Laplace's classical definition of probability and the results of Exercise 60. 62. The probability that number r is drawn at the k-th drawing is given by Pn,k = (n- 1)k-t/(n)k· 63. Consider the set fh of possible outcomes of k drawings and the subset Ak of these outcomes in which a white ball is drawn for the first time at the k-th drawing. Then Pn,r,k = P(Ak)/ P(ilk), k = 1, 2, ... , r + 1. Use the fact that A 1 + A2 + · · · + Ar+l = ilk to conclude the required expression.

65. Use Laplace's classical definition of probability and the result of Exercise 58.

CHAPTER3 1. Use Vandermonde's formula to get Sn,r

= (n)r(a)r(a + b- r)n-r·

2. Express (x + y + n)n into factorials of x and y + n, using Vandermonde's formula, and then multiply both members by (Y)-n = 1/(y + n)n· 3. Express (Y)n = ( -1)n(x + (-x- y -1 + n))n into factorials of x and ( -x- y- 1 + n) and then divide both members by (x + y)n· 4. Rewrite the expression to be shown as

f.(~=

D(r; ~: j) = (r; s),

which follows from the expansion of the identity [tn(l- t)-n][tr-n(I- t)-r+n-1] = tr(l- t)-r-1 into powers oft.

CHAPTER3

553

5. Use the result of the first part of Exercise 4 to get sn = ns/(r+ 1)n+I and Sn,m = (n + m- 1)m(s)m/(r + m)n+m· 6. Use Newton's binomial formula to get sn,r = (n)rPr·

1. Use Newton's negative binomial formula to get Sn,r = (n+r-1)r}r· 8. Differentiate a suitable expression of Newton's binomial formula (see Example 3.4). 9. Integrate a suitable expression of Newton's binomial formula (see Example 3.5).

10. Use the result of Exercise 2.32 and Newton's binomial formula. 11. Use Pascal's triangle to split the sum and derive the recurrence relation. 12. Use Newton's binomial formula (3.10) with x = -t, y = 1 and formula l:::~= 1 uk- 1 = (1- u)- 1 (1- un) with u = 1- t. 13. Integrate, with respect to t, in the interval [0, u] the identity derived in the first part of Exercise 12 and then integrate, with respect to u, in the interval [0, 1] the resulting expression to deduce the required relation. 14. Use Pascal's triangle to derive the recurrence relation. 15. Use the result of Exercise 14 with z = 1/2 and z = -1/2. 16. Use the relation

1 - _1_ (1 +

r-k+1-r+1

k

)

r-k+1 to derive the recurrence relation and iterate it to get the required expression.

17. Express ('"!k) into binomials of x and k, using Cauchy's formula, and then use the result of Exercise 10. 18. Use Cauchy's formula with x = y = n = 2r and x to derive the first and the second sums, respectively.

= y = n = 2r + 1

19. Express (~!~) into binomials of n and r, using Cauchy's formula and then use the result of Exercise 10. 20. Use the relation kG) = r(~=:~) and evaluate the resulting expression by expanding the identity (x + 1r- 1 (x + 1) 8 = (x + 1r+s- 1 into powers of X.

21. Expand the identity (1- W(1-t)-s- 1 = (1-t)-s+r- 1 into powers of t and equate the coefficients of tn in both sides of the resulting expression. 22. Use the relation

(~)(n;r)-

1

(r:~~k)(n:r)-

1

HINTS AND ANSWERS TO EXERCISES

554

and then the result of Exercise 21. 23. Expand into powers oft the identity (1- t)-r- 1 (1- t)-(s-n)- 1 = (1- t)-(r+s-n+ 1l- 1 and equate the coefficients of tn in both sides of the resulting expression. 24. Using Newton's binomial formula, show that

tr(l- t)-r-1

r-s _ r-s-k ( r ~ k) ts(l- t)-s-k-1_ = 2) 1 k=D

Expand this identity into powers of t and equate the coefficients of tn in both sides of the resulting expression. 25. Expand into powers oft the identity (1 + tr(l + t)-s = (1 + w-s and equate the coefficients of tn in both sides of the resulting expression. 26. Use for part (a) the expression

X) X(X - 1) · ·k!· (X - k + 1) , and (k =

for parts (b) and (c) the "triangular" recurrence relation. 27. Expand into powers oft and u the function (1 + t + u + tu)"' = (1+[t(1+u)+u])"', using Newton's general binomial formula. Also, expand into powers oft and u the product of functions (1 + t)"' (1 + u)"'. Equate the coefficients of tnuk in the resulting expansion of the identity.

x)

x(x-1)···(x-k+1)

28. Use the expression ( k = k! , with x = -1/2, for the derivation of the first relation and expand into powers of u the identity (1- 4u)- 112 (1 - 4u)- 112 = (1 - 4u)- 1 to conclude the second relation. 29. Use Pascal's triangle to derive the relations

-X ) = (kX) (n-k

~(X- 1) ( n

k

-X ) _ n- nk + 1 (X1) ( -X ) k-1 n-k+1

n-k

and

Summing these relations for k = 0, 1, ... , r, deduce the required expres· sions. 30. Expand into powers oft the identity

and equate the coefficients of tn in both sides of the resulting expression.

CHAPTER 4

555

CHAPTER4

+ 3 · 84 -74 = 204. 2. N(A' B') = 1000- 31 - 10 + 3 = 962. 3. N(A~A~A;A~A~) = 25 5 - 25 · 24 4 + 10 · 20 · 23 3 + 5. 120. 21 - 120. 1. N(A~A~A;) = 10 4 -3 · 9 4

4. N(At u A2 u A3 u A4 u A5) =

s.

G) G) -G)

10 · 60 · 22 2

= 130.

G) -{G) + (~) + G) + G)} -{G) + G)} N5,2 = G)~( G) j)

= 20 .

3

6.

-1)j

(3-

4

= 360.

7. Apply the inclusion and exclusion principle with {l the set of positive integers less than or equal to 70n and Ai its subset that contains the integers divisible by the prime Si, i = 1, 2, 3, with s 1 = 2, s2 = 5 and s3 = 7.

8. Apply the inclusion and exclusion principle with {l the set of positive integers less than or equal to 100 and Ai its subset that contains the multiples Of i = 1, 2, 3, 4, with S1 = 2, S2 = 3, S3 = 5 and S4 = 7.

sr,

9. Apply the inclusion and exclusion principle with {l the set of positive integers less than or equal ton and Ai its subset that contains the integers divisible by the prime si, i = 1, 2, ... , r. 10. Consider the set {l = {2, 3, ... , r} and its subset Ai that contains the multiples of ai, i = 1, 2, ... , n, with n = E(y'r), and show that E(r)- E(y'r) = N(A~A~···A~). Apply the inclusion and exclusion principle to establish the required expression. 11. Apply the result of Exercise 10. 12. Consider the set {l of nonnegative integer solutions of the linear equation x1 + X2 + · · · + Xn = k, with k a nonnegative integer, and the set Ai ~ {l that contains the solutions for which xi 2: 2, i = 1, 2, ... , n. Evaluate the number N (A~ A~ · · · A~) (a) directly and (b) applying the inclusion and exclusion principle to establish the required identity. 13. Consider the set {l of nonnegative integer solutions of the linear equation x 1 + x 2 + · · · + Xn = k, with k a nonnegative integer, and the set Ai ~ {l that contains the solutions for which Xi = 0, i = 1, 2, ... , n. Evaluate the number N(A;A~ ···A~) (a) directly and (b) applying the inclusion and exclusion principle to establish the required identity.

HINTS AND ANSWERS TO EXERCISES

556

14. Consider the set n of positive integer solutions of the linear equation X} + X2 + ... + Xn = k, with k a positive integer, and the set Ai ~ n that contains the solutions for which Xi > 6, i = 1, 2, ... , n. Then apply the inclusion and exclusion principle to evaluate the required number N(A~A~ ···A~).

15. Note that the number U(n, k,r) is equal to the number of positive integer solutions (il, h, ... , ik) of the linear inequality ii + i+2+· · ·+ ik ::; r which satisfy the restrictions is ::; n, s = 1, 2, ... , k. Use the inclusion and exclusion principle to derive the required expression. 16. Note that the number C(n, k, s) is equal to the number of nonnegative integer solutions of the linear equation x 1 + x2 + · · · + Xn-k+l = k satisfying the restrictions Xi ::; s - 1, for i = 1, 2, ... , n. Use the inclusion and exclusion principle to derive the required expression.

17. Consider the number Bu (n, k, s) of (n- k )-combinations {h, h, ... , in-k} of {1,2, ... ,n}, 1::; i1 < h u and its subset Am that contains those combinations for which im+l- im > s, m = 1, 2, ... , n-k-1. Verify that Bu (n, k, s) = N (A~ A~ · · · A~-k-l) and use the inclusion and exclusion principle to evaluate this number. 18. Consider the set

n of k-combinations {i 1 ,i2, ...

,ik}, 1::; i 1

< i2
am, m = 1,2, ... ,k -1 and its subset Am that contains those combinations for which dm > bm, m = 1, 2, ... , k - 1. Verify that the required number equals N (A~ A~ · · · A~_ 1 )

and evaluate it by using the inclusion and exclusion principle and the result of Exercise 2.57. 19. Consider the number Bu(n,k;a 1 ,b 1 , ••• ,ak- 1,bk_ 1) of k-combinations {i1, i2, ... , ik}, 1 ::; i1 < i2 < · · · < ik ::; n, with am < dm < bm, m = 1, 2, ... , k - 1 and n - d > u, and show that

B(n, k; a1, b1, ... , ak. bk) = Bak (n, k; a1, b1, ... , ak-1, bk-d -Bbk(n,k;a1,b1, ... ,ak-1,bk-1)·

Further, consider the set n of k-combinations {i 1, i 2, ... , ik}, 1 ::; i1 < i2 < · · · < ik ::; n, with dm > am, m = 1, 2, ... , k-1, n-d > u and its subset Am that contains those combinations for which dm > bm, m = 1, 2, ... , k- 1. Verify that Bu(n,k;a1,b~, ... ,ak-1,bk-d = N(A~A~···Ak_ 1 ) and evaluate it by using the inclusion and exclusion principle and the result of Exercise 2.57.

CHAPTER4

557

20. Work as in Example 4.5 by considering the subsets A 1 , A 2 , ... , A2 n-l of the set D of the permutations of {1, 2, ... , n }. 21. Use the explicit expressions of Mn and Ln to express Mn in terms of Ln. Then express Mn and Ln in terms of the auxiliary numbers

Kn

=

i: x 2 > · · · < Xk ~ 1}, of partitions of n into k unequal parts, and correspond to each partition Yk the set P(Yk) of permutations of Yk. Since P(Yk) ~ Cn,k, conclude that k!q(n, k) :::; (~:i).

21. In the Gauss-Jacobi identity, replace (a) q by qr, r ~ 0 and x by q8 , s ~ 0 and (b) q by qr, r ~ 0 and x by -q8 , s ~ 0 and deduce the required identities. 22. Use the relation 00

00

00

n=O P., i=l

00

i=l k;=O

23. Use the result of Exercise 22 for a(n) and ui(k) = 1, i =j:. j.

=a(n; Uj), with Uj(k)

= ujk

24. Work as in the proof of the first part of Theorem 10.2. 25. Use the expression (1- q"')(l _ qx-1) ... (1 _ qx-k+I)

(1- q)(1- q2 ) .. ·(1- qk) 26. Use the expression

27. Use the triangular recurrence relation

to split the left-hand side sum into a difference of two sums.

28. Work as in Exercise 27. 29. In the generating functions Hr(t, u) and Hr,k (t) of Exercise 13, which are connected by Hr(t, u) = I:%"=o Hr,k(t)uk, replace t by q, ut by x and r by n to obtain the q-binomial formula. Also, in the generating functions Gr(t, u) and Gr,k(t) of Exercise 8, which are connected by Gr(t, u) = I:%"=o Gr,k (t)uk, replace t by q, ut by x, and r by n to obtain the q-negative binomial formula. These formulae may also be derived algebraically. For the derivation of the third formula, consider the function Fn(q,x) = q"'n and its expansion Fn(q, x) = I:~o Fn,k(q)[x]k,q and deduce the recurrence relation [k]qFn,k(q) = (q -1)qk-I [n- k+ 1]qFn,k-1 (q), k = 1, 2, ... , n, with Fn,o(q) = 1, which implies Fn,k(q) = qk(k-I}f 2(q- l)k [ ~



HINTS AND ANSWERS TO EXERCISES

578

30. Expand the identities r+8

r

8

i=l

i=1

j=1

II (1 + xqi-1) =II (1 + xqi-1) II (1 + xqr+j-1)

and

r+8

r

8

i=1

i=1

j=1

II (1- xqi-1 )-1 =II (1- xqi-1 )-1 II (1- xqr+j-1 )-1, using the q-binomial and the q-negative binomial formulae of Exercise 29, respectively, to derive the first two formulae. Show the third formula by induction on n. 31. Utilize the results of Exercise 26(b) together with the q-binomial and negative binomial formulae of Exercise 29.

32. (a) Note that n-1

n

II ([t]q- [i]q) = L s(n, klq)[t]~-

1

i=1 k=1 and work as in Theorem 8.1 to get the required expression. (b) Expand both members of the recurrence relation n n-1 ([tJq - [iJq) = ([tJq - [nJq) ([tJq - [iJq) i=1 i=l into powers of [t]q and conclude the required triangular recurrence relation. Further, use the triangular recurrence relation to obtain the vertical recurrence relation.

II

II

33. (a) Note first that n

[t]~ =

k-1

L S(n, klq) II ([t]q- [i]q)

k=O i=O and, using this expression, expand both members of the identity [t]~+ 1 = [t]q[t]~. Transform the resulting expression by introducing the expression

[t]q n~;~([t]q- [i]q) = n~=o([t]q- [i]q) + [r]q n~;~([t]q- [i]q) and conclude the triangular recurrence relation. Further, use the triangular recurrence relation to get the recurrence relation ¢k(ulq) = u(1 - [k]qu)- 11/lk-dulq), k = 1, 2, ... , ¢ 0 (ulq) = 1 and iterate it to obtain the required expression. (b) Expand both members of the recurrence relation for 1/Jk (u Iq) to get the vertical recurrence relation. Further, expand the generating function ¢k(ulq) into powers of u and equate the coefficients of un in the resulting expression. (c) Expand the n-th order q-factorial [t]n,q into powers of [t]q and, in the resulting expression, expand the powers [t]~ into q-factorials [t]k,q and equate the coefficients of [t]k,q to deduce the first orthogonal relation. The second relation may be similarly derived.

CHAPTER 11

579

34. Show first that k

k

j=O

r=O

IT (t- [j]q)-1 = :~:::>r. (t- [r]q)-1' where c; 1 =

! [U J-

= (-1)k-r qr(2k-r-1)/2[r]q![k _

(t _ [j]q)l

r]q!

t=[r] 0

and, using this formula, expand the generating function 4>k(uiq) into powers of u to find the required expression. 35. Using the last expression in Exercise 30, with x = n- 1 andy = t, expand the q-factorial (t + n - 1]n,q into a sum of q-factorial [t]t,q, and deduce the expression IL(n, kiq)i = q-n(n- 1 )1 2 +k(k- 1 )1 2

[

~] q [n- l]n-k,q,

which can be transformed into the required expression.

CHAPTER 11 1. Use the generating function of the exponential Bell partition polynomials.

2. For n > 0 and k1 , k2, . . . , kn nonnegative integers satisfying the equation k 1 + 2k 2 + · · · + nkn = n, consider the function

where the summation is extended over all Ti = 0, 1, ... , ki, i = 1, 2, ... , n and show that Ck,,k 2 , •.. ,kn (a)= 0. Multiply it by TI~ 1 (zi/i!)k• /ki! and sum for all nonnegative integer solutions of the equation k 1 + 2k2+ · · · + nkn = n, to get the relation

where, in the inner sums, the summation is extended over all nonnegative integer solutions of the equations TI + 2r2 + · · · + krk = k and m 1 +2m 2 + · · · + (n- k)mn-k = n - k, respectively, and thus conclude the required formula. Further, replace n by s, multiply both sides by Bn-s(Y1 - az1,

HINTS AND ANSWERS TO EXERCISES

580

Y2 - az2, ... , Yn-s - azn-s) and sum for s = 0, 1, ... , n to get the convolution formula. Finally, replace n - k by k, a by n - a and Yi - nzi by Xi. In the resulting expression, replace n by s, multiply both sides by Bn-s(Yt- az1,Y2- az2, ... ,Yn-s- azn-s) and sum for s = 0, 1, ... ,n to get the required expression.

3. Set x 1 = x, x 2 = 1, Xr = 0, r = 3, 4, ... , in the generating function of the exponential Bell partition polynomials to find the generating function of Bn(x, 1). Deduce from it the generating function of Hn(x) and conclude the required expression. Similarly, find the generating function of 1 Bn(1!, 2!x- 1, ... ,n!x-n+l) and deduce the generating function of £~ )( -x), which implies the required expression. 4. Set Xr = (s)raX 8 -r, r = 1,2, ... ,s, Xr = 0, r = s+ 1,s+2, ... , in the generating function of the exponential Bell partition polynomials to find the generating function of Hn(x; a, s). Deduce from it the required expressions. 5. Set x 1 = x, x 2 = 1 and Xr = 0, r = 3, 4, ... , in the generating function of the Logarithmic polynomials and find the generating function of Ln(x, 1), which, expanded into powers oft, yields the required expression. 6. Set x 1 = x, x 2 = 1 and Xr = 0, r = 3, 4, ... , in the generating function of the potential polynomials to find the generating function of Cn,-s(x,1) = a}:l(-x), which, expanded into powers oft, yields the required expression. 7. The vertical generating function of the partial Bell polynomials for Xi= 0, i = 1,2, ... ,r, is given by Bk,r+l(t) = c~=:r+lXitiji!)k jk!. Set Xi = (i)rYi-r, i = r + 1, r + 2, ... , and conclude the first relation. Use Newton's binomial formula to express the generating function Bk,r+l (t) in terms of the generating function Bk-j,r(t); expanding into powers oft both sides of the resulting expression, deduce the second relation. The third relation is similarly derived. 8. Set (a) Xr = r!, r = 1,2, ... , and (b) Xr = r, r = 1,2, ... , in the vertical generating function of the partial Bell partition polynomials and deduce the required expression. 9. Set (a) x 2j-l = 0, x 2j = (2j)!, j = 1, 2, ... , and (b) X2j-1 = (2j-1)!, x 2 j = 0, j = 1, 2, ... , in the vertical generating function of the partial Bell partition polynomials and deduce the required expressions. 10. Multiply both members of (11.34) by (n~s) and use the relation (n~s) (;) = (~t;) (n~r). 11. From the generating function of the potential polynomials, with

s

=

-1 and putting ar

=

Xr/r!, r

=

1, 2, ... , ao

=

1, derive the linear

CHAPTER 11

581

system of equations 2::7= 1 ak-iYi find the required expression.

=

-ak, k

=

1, 2, ... , n and solve it to

12. In order to evaluate the generating function h(t) = 2::~= 1 Ldln dtn, use the transformation k = d, r = njk, with inverse d = k, n = rk, and sum first for r = 1, 2, ... and then for k = 1, 2, .... Further, differentiate the function logG(t) and conclude that G'(t)jG(t) = h(t)jt. Finally, integrate this differential equation to get the required expression of G(t). 13. Work as in Example 11.8 and use the result of Example 11.7(b). 14. Set Xr = Yr = r!x-r+l, r = 1, 2, ... , in the generating function of the Touchard polynomials to find the generating function of these particular polynomials. Deduce from it the generating function of L~k- 1 ) (x), n = 1, 2, .... 15. Work as in Exercise 7. 16. Work as in Exercise 8. 17. Use Leibnitz formula for the derivatives of a product of functions and Faa di Bruno formula for the derivatives of a composite function. 18. Follow the steps of the derivation of the corresponding properties of the exponential partition polynomials in Section 11.2. 19. Take the partial derivatives of the generating functions A(t, u) and Ak(t, u) with respect to t and, expanding the resulting partial differential

equations, conclude the corresponding recurrence relations. 20. Follow the steps of the derivation of the corresponding properties of the general partition polynomials in Section 11.3. 21. Work as in Example 11.3, using the last part of Exercise 20. 22. In order to derive the recurrence relation, take the partial derivative of the generating function L(t, u) with respect tot and deduce the relation

aL(t,u) _ ag(t,u) _ [ ( ) _ at at g t, U

Xo,O

]aL(t,u) at .

23. Use the results of Exercise 22. 24. In order to derive the recurrence relation, take the partial derivative of the generating function C 8 (t, u) with respect tot and deduce the relation

aC8 (t,u)_ C( )ag(t,u)_[()at - S s t, U at gt

Xo,O

]aC 8 (t,u) at .

25. Use the generating functions of exponential, logarithmic and potential bipartitional polynomials (Exercises 18, 22, 24) and conclude the required expressions.

HINTS AND ANSWERS TO EXERCISES

582

CHAPTER12 1. Set x 1 = 0, Xj = 1, j = 2, 3,. . . in (12.9) to find the bivariate generating function of the required number of permutations and, expanding it into powers of u and t, conclude the required expression.

2. Set x 1 = 0, j = 1, 2, ... , r - i, Xj = 1, j = r, r + 1, ... into (12.9) to find the bivariate generating function of the required number of permutations and use the results of Exercise 8.11 to conclude the required expression. 3. Set Xj = 1, j = 1, 2, ... , j f- r and Xr = x in (12.8) to find the expression generating function C(x, t; r) = l::~=O Cn(x; r)tn /n!. Rewrite this expression as (1 - t)C(x, t; r) = exp[(x - 1)r /r] and expand it into powers oft to get the required recurrence relation. Further, expanding it into powers of x, deduce the recurrence relation for the numbers Cn(k; r). 4. Use the relation connecting the factorial moment generating function with the probability generating function. 5. Set x 1 = x, j = 1,2, ... , j f- rand Xr = 0 in (12.8) to get the generating function D(x, t; r) = l::~=O Dn(x; r)tn /n!. Differentiate it with respect to t and deduce the partial differential equation

(1- t) BD(~~ t; r) = xD(x, t; r)-

W- 1 -

nn(x, t; r),

which, expanded into powers oft, yields for Dn(x; r) the required recurrence relation. Further, expand it into powers of x to deduce the recurrence relation for the numbers dn(k; r). 6. Note that dn(r) = :L:l~~l dn(k; r) and from the expression of D(x, t; r) deduce the generating function D(t; r) = l::~=O dn(r)tn /n!, which, expanded into powers oft, yields the explicit expression of dn(t). Further, rewrite the expression of D(t; r) as (1- t)D(t; r) = exp( -r /r) and expand it into powers oft to find the recurrence relation for dn(r). 7. Set x 1 = x, x 2 = y and Xi = 1, i = 3,4, ... , in (12.8) to get the generating function Q(x, y, t) = l::~=O Qn(x, y)tn jn!. Multiply both members of this expression by (1- t) and, expanding it into powers oft, conclude the required recurrence relation. 8. Differentiate, with respect to t, the generating function Q(x, y, t), which is derived in Exercise 7, and then equate the coefficients of tn /n! in the resulting expression.

CHAPTER 12

583

9. Denote by Cn the multiple sum in the left-hand side of the required identity. Put xi = -1, 'i = 1, 2, ... , in (12.8) and deduce the generating function, L:~=O Cntn fn! = 1 - t, which implies Cn = 0, n = 2, 3, .... 10. Denote by Cn(x) the multiple sum in the left-hand side of the required identity. Set Xi = x, i = 1, 2, ... , in (12.8) and deduce the generating function L:~=O Cn(x)tn fn! = (1- t)-x, which, expanded into powers oft, yields the required expression for Cn(x). 11. Deduce from (12.13) the generating function A(t, u) = 2:: An(u)tn fn!. Similarly find the generating function B(t, u) = 2:: Bn(u)tn fn!. Differentiate these functions with respect to t and get the differential equations

aA(t,u) _ aB(t,u) _ A( ) aB(t,u) _ aA(t,u) _ B( ) at t at - u t, u , at t at - u t, u . Expand both sides of these equations into powers of t to establish the required recurrence relations. 12. Work as in Exercise 11. 13. (a) Use the results of Exercises 10 and 11 to show that

Gn(u)

= i)-1)i(~)uiAn-j(u), j=O J

Hn(u)

= i)-1)i(~)uiBn-j(u) j=O J

and conclude the required expressions. (b) Note that Gn = Gn(l) and Hn = Hn(1) and, from the first part of Exercise 12, conclude the generating functions L:~=O Gntn fn! and L:~=O Hntn fn!. Multiply each by (1 - t) and expand the resulting expression into powers of t to get the recurrence relations. For the derivation of Gn + Hn = Dn, use the generating function L:~=O Dntnfn! = (1- t)-le-t. 14. Set x 2 i-l = 0, x 2 i = 1, i = 1, 2, ... , in (12.9) to get the required generating function. Expand it into powers of t and conclude the generating function bn(2u), which implies the required expression for the number b(n,k). 15. Work as in Example 14. 16. Differentiate the generating functions L:~=O bn(u)tn fn! and L:~=O an(u)tn fn!, with respect to t, and multiply each of the resulting expressions by 1 - t 2 • Expand the final expressions into powers of t to deduce the recurrence relations. 17. Note that a(n) = an(1) and b(n) = bn(1) and, from the first part of Exercises 14 and 15, conclude the generating functions L::'=o a(n)tn fn! and L::'=o b(n)tn fn!. Use these generating functions to derive the required recurrence relations.

HINTS AND ANSWERS TO EXERCISES

584

18. Use the expression

where the summation is extended over all nonnegative integer solutions of the equations k1 + 2k2 + · · · + nkn = n and k1 + k2 + · · · + kn = k, with ki E {j : ai,j = 1}, for i = 1, 2, ... , n, and proceed as in Theorem 10.3. 19. Put ai,O = 1, i = 1,2, ... , ai,j = 1, i = 1,2, ... ,r, ai,j = 0, i = r+ 1, r+2, ... , j = 1, 2, ... and u = 1 in the universal generating function of Exercise 18 to deduce the generating function C(t; r) = L;~=O cn(r)tn fn!. Differentiate it to derive the differential equation C' (t; r) = C(t; r) I:~:~ ti, which implies the recurrence relation. 20. Set x 1 = 1, x 2 = x, xi = 0, i = 3, 4, ... , in (12.8) to deduce the generating function C(x, t) = L;~=O Tn(x)tn fn! = exp(t + xt 2/2). Differentiate it with respect to t to find the differential equation 8C(x, t)f8t = (1 + xt)C(x, t), which implies the required recurrence relation for Tn(x).

CHAPTER13 1. (a) 93

= {(1)(2)(3),

(1, 2, 3), (1, 3, 2), (1)(2, 3), (1, 3)(2), (1, 2)(3) }, 2 (b) K3,r = r(r + 3r + 2)/6.

2.

94

= { (1)(2)(3)( 4), (1, 2, 3, 4), (1, 3)(2, 4), (1, 4, 3, 2),

(1)(2,4)(3), (1,3)(2)(4), (1,4)(2,3), (1,2)(3,4)}. 3. (a) Use P6lya's theorem and the cycle indicator of Exercise 2 to I:;=O K 4(j)ti = 1 + t + 2t 2 + t 3 + t 4 and conclude that K 4(j) = 1, j = 0, 1, 3, 4 and K4(2) = 2. (b) K4,r = r(r 3 + 2r 2 + 3r + 2)/8.

get

4. (a)

(b)

= {(1)(2)(3)(4), (1)(2,3,4), K4,r = r 2 (r 2 + 2)/3.

94

(1)(2,4,3)},

5. (a) Use P6lya's theorem and the cycle indicator of Exercise 4 to get 2 3 4 0 K 4 (j)ti = 1+2t+2t +3t +t and conclude that K 4 (j) = 1,j = 0,4 and K 4 (j) = 2, j = 1, 2, 3. (b) Similarly K4(1, 1, 1) = 8.

L:;=

6.

94

= {(1)(2)(3)(4), (1)(2,3,4), (1)(2,4,3), (1,3,4)(2),

(1, 4, 3)(2), (1, 2, 4)(3), (1, 4, 2)(3), (1, 2, 3)(4), (1,3,2)(4), (1,2)(3,4), (1,3)(2,4), (1,4)(2,3)}.

CHAPTER13

585

7. (a) Use P6lya's theorem and the cycle indicator of Exercise 6 to find L~=O K4(j)ti = 1 + t + t 2 + t 3 + t 4 and conclude that K4(j) = 1, j = 0, 1, ... ,4. (b) K 4 ,j = r 2 (r 2 + 11)/4. 8. Consider the set W24 of the 4! = 24 colorings and the group 92 4 of the permutations that are induced by rotations of the corresponding colored tetrahedron around its axes of symmetry. Show that N(Q 24 ) = N(1l 4 ) = 12, where 1-£4 is the group 94 of Exercise 6, and apply Burnside's Theorem to conclude that the required number is N(T) = 24/12 = 2. This number may also by obtained by using the cycle indicator of Exercise 6 and applying P6lya's theorem. 9. 98={ (1 )(2)(3) (4) (5) (6) (7) (8), (1, 2, 3, 4) (5, 6, 7, 8), ( 1, 4, 3, 2)(5, 8, 7, 6), (1,4,8,5)(2,3, 7,6), (1,5,8,4)(2,6, 7,3), (1,5,6,2)(3,4,8, 7), (1, 2, 6, 5) (3, 7, 8, 4), (1, 3) (2, 4) (5, 7) (6, 8), (1, 8) (4, 5) (2, 7) (3, 6), (1, 6) (2, 5) (3, 8) (4, 7), (1, 2) (3, 5) (4, 6) (7, 8), (1, 4) (2, 8)(3, 5) (6, 7), (1, 5)(2, 8)(3, 7)(4, 6), (1, 7)(2, 3)(4, 6)(5, 8), (1, 7)(2, 6)(3, 5)(4, 8), (1, 7)(2,8)(3,4)(5,6), (1)(2,4,5)(3,8,6)(7),(1)(2,5,4)(3,6,8)(7), (1, 6, 3)(2)(4, 5, 7)(8), (1, 3, 6)(2)(4, 7, 5)(8), (1, 6, 8)(2, 7,4)(3)(5), (1,8,6)(2,4, 7)(3)(5), (1,3,8)(2, 7,5)(4)(6),(1,8,3)(2,5, 7)(4)(6)} 10. Use P6lya's theorem and the cycle indicator of Exercise 9 to get 98(t,u,w) = [(t + u + w) 8 + 8(t + u + w) 2 (t 3 + u 3 + w3) 2 +9(t2 + u 2 + w 2 ) 4 + 6(t 4 + u 4 + 24 )]/24 and conclude the required values. Further, N8,3 = 98,3(1, 1, 1) = (38 + 17 · 34 + 6 · 32 )/24.

11. The group 91 2 is {(1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)(12), (1, 8, 2, 5)(3, 6, 4, 7)(9, 10, 11, 12), (1, 2)(5, 8)(3, 4)(6, 7)(9, 11)(10, 12), (1, 5, 2, 8)(3, 7, 4, 6)(9, 12, 11, 10), (1, 9, 4, 11) (2, 12, 3, 11) (5, 6, 7, 8), ( 1, 4) (2, 3) (5, 7)(6, 8)(9, 10) (11, 12),

(1, 10, 4, 9)(2, 11, 3, 12)(5, 8, 7, 6), (1, 2, 3, 4)(5, 12, 6, 9)(7, 10, 8, 11), (1, 3) (2, 4) (5, 6) (7, 8) (9, 12) (10, 11 ), (1, 4, 3, 2) (5, 9, 6, 12) (7, 11, 8, 10)' (1)(2, 4)(3)(5, 10)(6, 11)(7, 12)(8, 9), (1, 3)(2)(4)(5, 11)(6, 10)(7, 9)(8, 12), (1, 12)(2, 9)(3, 10)(4, 11)(5)(6, 8)(7), (1, 11)(2, 10)(3, 9)(4, 12)(5, 7)(6)(8), (1, 6)(2, 7)(3, 8)(4, 5)(9)(10, 12)(11), (1, 7)(2, 6)(3, 5)(4, 8)(9, 11)(10)(12), (1, 5, 9)(2, 6, 10)(3, 7, 11)(4, 8, 12), (1, 9, 5) (2, 10, 6) (3, 11, 7)( 4, 12, 8), (1, 10, 8)(2, 9, 7)(3, 12, 6)( 4, 11, 5), (1, 8, 10)(2, 7, 9)(3, 6, 12)(4, 5, 11), (1, 7, 12)(2,8, 11)(3,5, 10)(4,6,9), (1, 12, 7)(2, 11,8)(3, 10,5)(4,9,6), (1, 11,6)(2, 12,5)(3,9,8)(4, 10, 7), (1,6, 11)(2,5, 12)(3,8,9)(4, 7, 10)}.

HINTS AND ANSWERS TO EXERCISES

586

12. (a) Use Polya's theorem and the cycle indicator of Exercise 11 to get '""' · · ... ,)12 · ) th ~ N 12 ()1,)2, 1 th 2 ... th2 12

1 12 2 2 2 2 5 =-[(t1+t2+···+tl2) +6(t1+t2+···+tl2) (t1+t2+···+tl2) 24 26 + 8(t13 + t23 + ... + td 34 4 +3(t12 + t22 + ... + td + 6(t14 + t24 + ... + td] and conclude that the required number is N12(1, 1, ... , 1) = 12!/24 = 19,958,400. (b) K12,r = r 3 (r 9 + 6r 4 + 3r 3 + 8r + 6)/24. 13.

~h

= {(1)(2)(3)(4)(5)(6), (1)(2, 3, 5, 4)(6), (1)(2, 5)(3, 4)(6), (1)(2, 4, 5, 3)(6), (1, 3, 6, 4)(2)(5), (1, 6)(2)(3, 4)(5), (1, 4, 6, 3)(2)(5), (1, 2, 6, 5)(3)(4), (1, 6)(2, 5)(3)(4), (1, 5, 6, 2)(3)(4), (1, 2)(3, 4)(5, 6), (1, 3)(2, 5)(4, 6), (1, 4)(2, 5)(3, 6), (1, 5)(2, 6)(3, 4), (1, 6)(2, 3)(4, 5), (1, 6)(2, 4)(3, 5), (1, 2, 3)(4, 5, 6), (1, 3, 2)(4, 5, 6), (1, 2, 4)(3, 6, 5), (1, 4, 2)(3, 5, 6), (1, 3, 5)(2, 6, 4), (1, 5, 3)(2, 4, 6), (1, 4, 5)(2, 6, 3), (1, 5, 4)(2, 3, 6)}.

14. (a) Use Polya's theorem and the cycle indicator of Exercise 13 to get = 1 + t + 2t 2 + 2t 3 + 2t 4 + t 5 + t 6 and conclude that K 6 (j) = 1, j = 0,1,5,6andK6(j) = 2,j = 2,3,4. (b) K 6 ,r = r 2(r 4 +3r 2 +12r+8)/24.

2:: K 6 (j)tJ

15. Use Polya's theorem and the cycle indicator of the symmetric group 9n of order n, derived in Example 13.4, to get

Kn r '

= ..!_n~ '""'cp(d)rnfd. din

16. Use Polya's theorem and the cycle indicator of the symmetric group 9n of order n, derived in Example 13.4, to get n

1

L Kn(j)tj = -;-; L cp(d)(1 + tdtfd j=O din and, expanding the right-hand side into powers of t, deduce the required expression of Kn(j). 17. Show that 9n = { t:, a, a 2, ... , an- 1 , T, TO", Ta 2 , ... , TO"n- 1 } for n = 2m + 1 and 9n = { t:, a, a 2, ... , an- 1 , p, pa, pa 2 , ... , pan- 1 } for n = 2m, where the permutations a, T and p are defined as follows: a(j) = j + 1, j = 2, 3, ... , n - 1, a(n) = 1 (rotation of the n-gon by 21r jn degrees), 7(1) = 1, T(j) =2m+ 3- j, j = 2, 3, ... , 2m+ 1 (reflection of the n-gon,

CHAPTER 14

587

for n = 2m+ 1, around the axis connecting vertex 1 and the middle of the side connecting vertices m + 1 and m + 2) and p(1) = 1, p(j) =2m+ 2- j, j = 2, 3, ... , 2m (reflection of the n-gon, for n = 2m, around the axis connecting vertices 1 and m + 1) . 18. Set Xi = r, i = 1, 2, ... , n, in the cycle indicator derived in Exercise 17 to get, according to P6lya's theorem,

+ ~2 r m+I ,

- _..!.._ Kn,rn ""' L...- 4>(d)r nfd 2 djn

for n

= 2m + 1 and Kn,r =

1 n L¢(d)rnfd

2

din

+

1

4(r + 1)rm

for n =2m. 19. (c) Show that the order k = k(ah) of the permutation ah in 9n equals the order k(h) of the element h in 1-ln and, since the orbit {hr, ah(hr), ... , a~-I (hr)} of any element hr in 1-ln under the permutation ah is of length k, conclude that ah is decomposed in n/k cycles of length k and so . _ 1 ""' nfk(h) C(xl, X2, ... , Xn, 9n) - ~ L...- Xk(h) · hE'Hn

Further, use the fact that 1-ln sion.

= L:;dln 1-ln;d to conclude the required expres-

20. Consider the set F of colorings of the set Wn = {1, 2, ... , k }, of the k parts of a composition (r 1 , r 2 , .•• , rk) in Cn,k, (zero parts are allowed) with colors from Zn+l = {0, 1, ... , n }. Show that the number Pk(jo, ii, ... , jn), j 0 + j 1 + · · · + jn = k, of partitions of n into at most k parts, in which j 8 2:: 0 parts are equal to s, s = 0, 1, ... , n, equals the number of models M.r, under the symmetric group Pk of Wk, in which j 8 2:: 0 elements of wk are painted with color Zs from Zn+l' s = 0, 1, ... 'n. For derivation of the required identity, use the vertical generating function of the number of partitions of n into at most k parts obtained in Corollary 10.3.

CHAPTER14 1. (a) Use the definition of the non-central Eulerian numbers to get the relation

1)

k-J . . ( -n(r+k-j)n=LA(n,i;r)(-1)k-J-• k - j - i , j=0,1, ... ,k.

•=0

HINTS AND ANSWERS TO EXERCISES

588

Multiply it by ( -1 )1 (nr) and sum for j = 0, 1, ... , k to deduce the expression of A(n, k; r). (b) Expand both members of the identity (t + r)n+ 1 = (t + r)(t + r)n into binomial coefficients of order n + 1 and conclude the recurrence relation. 2. Work as in Lemma 14.1 and Theorem 14.3.

3. Express the coefficients of the power series in the expression of An(t; r) (see Exercise 2) into factorials of i, using the non-central Stirling numbers of the second kind, and deduce the relation n

An(t;r) = Lj!S(n,j;r)tj(1- t)n-j. j=O

Expand both sides of it into powers oft and conclude the first expression. Also, set t = uj (1 + u) and expand the resulting relation into powers of u and conclude the second expression. 4. Work as in Exercise 1. 5. Work as in Lemma 14.2 and Theorem 14.7. 6. Work as in Theorem 14.9. 7. Work as in Theorem 14.8. 8. (a) Replace t by -tin the definition of q-Eulerian numbers and use the relations [-t]q = -q-t[t]q and [ -t +nn- k

L

= ( _ 1)nq-nt+n(n-k)-n(n-1)/2 [ t

+ ~-

1

L.

(b) Use the definition of the q-Eulerian numbers to get the relation

[k-

rJ;

=I:

qj(j- 1)/ 2A(n,jlq)

J=O

Multiply it by (-1tqr(r- 1 )/ 2

[n;

1

L,

[n; ~ ~ ~ j j] . q

sum for r

= 0,1, ...

,k and con-

clude the required expression for A(n, klq), since

~()k-j-r qr(r-1)/2 [n +r ~ 1

1] [n + k-: r]

r=O

= 6 ·. k,J

j-

k- J - r

q

q

The last relation may be deduced by using the q-binomial and q-negative binomial formulae (see Exercise 10.29). 9. Expand into q-binomial coefficients, using the q-Eulerian numbers, both members of the identity [t]~+ 1 = [t]q[t]~ and then use the relation [t

+ ~- k] q [t]q

= [k]q [ t

+~~~ +

1] q + qk[n _ k + 1]q [ t : : ~ k] q.

CHAPTER 14

589

10. Show first that the number of permutations (j 1, )2, ... , Jn) of the set {1, 2, ... , n} that have k records Jr, ,Jr2 , ••• ,jrk at the points r 1, r2, ... , rk, - 1 an d Jrk. - n 1S . g1ven . by (n- rk. )' i=O Jr;- ri r;+ 1 -r;-1· W1"th r1-

rrk-1 (.

)

Summing for 1 ~ Jr 1 < Jr 2 < · · · < Jrk-t < Jrk = n, derive the number of permutations of {1, 2, ... , n} that have k records at the points r 1, r 2, ... , rk as (n- 1)! (r 2 - 1)(r3 - 1) ... (rk- 1). Summing for 2 ~ r 2 < r 3 < · · · < rk :$ n and using (8.12), conclude that the number of permutations of the set { 1, 2, ... , n} that have k records equals is(n, k)j. 11. Consider the set Jl of permutations (]1,)2, ... ,jn) of {1,2, ... ,n} that have k inversions and its subset A; of the permutations in which j 1 = i, i = 1, 2, ... , n, and use the relation Jl = A1 + A2 +···+An to deduce the horizontal recurrence relation. 12. Use the horizontal recurrence relation of the numbers b(n, k), derived in Exercise 11, to get for the generating function cf>n(t) the recurrence relation cf>n(t) = (1 - t)- 1(1- tn)c/>n- 1(t), n = 1, 2, ... , ¢ 0 (t) = 1. Iterate it to deduce the required expression.

13. Note that the permutations of {1, 2, ... , n + 1} that have k local maxima can be deduced from the permutations of {1,2, ... ,n} that have k or k- 1 local maxima by placing the element n + 1 in one of the possible positions. Use it to derive the required recurrence relation. 14. Work as in Exercise 13. 15. (b) Multiply both members of the recurrence by tkun- 1 /(n- 1)! and sum for k = 0, 1, ... , n = 1, 2, ... , to deduce the partial differential equation

t(t 2 - 1) ag(t, u)

at

+ (1- t 2u) ag(t, u)

= (t 2 + 1)g(t u)

au ' ' the solution of which, with g(t, 0) = 1 + t, gives the required expression of g(t, u). 16. Work as in Exercise 13.

17. (a) Note that removing the element n + 1 from any up-down permutation (j 1,)2, ... ,Jn+d of {1,2, ... ,n + 1} then we get two up-down permutations (j1,]2, ... ,hr-1) and (hr+1,J2r+2, ... ,Jn+l) of two disjoint subsets of {1, 2, ... , n} with 2r- 1 and n- 2r + 1. Use it to derive the required recurrence relation. (b) Multiply the recurrence relation by tn jn! and sum for n = 0, 1, . . . to get the differential equation 2A' (t) = 1 + A 2(t), the solution of which gives the required expression of A(t).

590

HINTS AND ANSWERS TO EXERCISES

18. (a) Use the relation tan(t/2 + 7r/4) = (1/ cost)+ tan t to show that Ao(t) = L~=O A2nt 2n /(2n)! = 1/ cost and, since Ao(t) = E(it), i =A, conclude the required expression. (b) Use the result of Exercise 8.22 to derive the required expression. 19. Work as in Exercise 18. 20. (a) In the generating function of G 2 n, n = 1, 2, ... , replace t by 2it, i = J=T, to get the generating function L~=I ( -1)n2 2 n- 1 G 2 nt 2 n-I /(2n)! = tan t and, since L~=l A2n-l en- I /(2n- 1)! =tan t, conclude the required expression. (b) Rewrite the generating function of G 2 n, n = 1, 2, ... , as L~=l G2nt 2n /(2n)! = [(e-t - 1)/2]/[1 + (e-t - 1)/2] and expand it into powers of u = (e-t- 1)/2. Using the generating function (8.17) of the Stirling numbers of the second kind, deduce the required expression of the Genocchi numbers.

BIBLIOGRAPHY

Abel, N. H. (1826) Beweis eines Ausdruckes, von welchem die BinomialForme! ein einzelner Fall ist, Journal fiir die reine und angewandte Mathematik, 1, 159-160. Abramovitz, M. and Stegun, I. A. (1965) Handbook of Mathematical Functions, Dover, New York. Andersen, E. S. (1953) Two summation formulae for product sums of binomial coefficients, Math. Scand. 1, 261- 262. Andre, D. (1887) Solution directe du probleme resolu par M. Bertrand, Comptes Rendus del' Academie des Sciences, Paris, 105, 436-437. Andrews, G. E. ( 1976) The Theory of Partitions, Encyclopedia of Mathematics and its Applications, Vol. 2, Addison- Wesley, Reading, MA. Apostol, T. M. ( 1962) Calculus, Vol. II, Blaisdell, Publishing Company, New York. Barton, D. E. (1958) The matching distributions: Poisson limiting forms and derived methods of approximation, Journal of the Royal Statistical Society, Series B, 20, 73-92. Barton, D. E. and David, F.N. (1959) Contagious occupancy, Journal of the Royal Statistical Society, Series B, 21, 120- 133. Bell, E. T. (1927) Partition polynomials, Annals of Mathematics, 24, 3846. Bell, E. T. (1934a) Exponential numbers, American Mathematical Monthly, 41, 411-419.

592

BIBLIOGRAPHY

Bell, E. T. (1934b) Exponential polynomials, Annals of Mathematics, 35, 258-277. Bell, E. T. (1940) Postulational bases for the umbral calculus, American Journal of Mathematics, 62, 717-724. Berge, C. (1971) Principles of Combinatorics, Academic Press, New York. Bernoulli, Jacobus (1713) Ars Conjectandi, (Opus Posth.) Basileae. Bernstein, L. (1965) Rational approximations of algebraic irrationals by means of a modified Jacobi-Perron algorithm, Duke Mathematical Journal, 32, 161- 176. Bertrand, J. (1887) Solution d' un probleme, Comptes Rendus del' Academie des Sciences, Paris, 105, 369. Blissard, J. (1867) On the properties of ~non class numbers and of other analogous to them, as investigated by means of representative notation, Quarterly Journal of Pure and Applied Mathematics, 8, 85-110. Bonferroni, C. E. (1936) Teorie statistica delle classi e calcolo delle probabilita, Publicazioni del R. Instituto Superiore di Scienze Economiche e Commerciali di Firenze, 8, 1-62. Boole, G. (1860) A Treatise on the Calculus of Finite Differences, Stechert, New York. (Reprinted by Chelsea, New York, 1950.) Broder, A. Z. (1984) The r-Stirling numbers, Discrete Mathematics, 49, 241-259. Burnside, W. S. (1911) Theory of Groups of Finite Order, 2nd ed., Cambridge University Press, Cambridge (Reprinted by Dover, New York, 1955.) Carlitz, L. (1932) On arrays of numbers, American Journal of Mathematics, 54, 739-752. Carlitz, L. (1959) Eulerian numbers and polynomials, Mathematics Magazine, 32, 247-260. Carlitz, L. (1960) Note on Norlund's polynomials B~z), Proceedings of the American Mathematical Society, 11, 447-451. Carlitz, L. (1965) Note on a paper of L. Bernstein, Duke Mathematical Journal, 32, 177- 180. Carlitz, L. (1971) Note on the numbers of Jordan and Ward, Duke Mathematical Journal, 38, 783-790.

BIBLIOGRA.PHY

593

Carlitz, L. (1979) Degenerate Stirling, Bernoulli and Eulerian numbers, Utilitas Mathematica, 15, 51-88. Carlitz, L. (1980a) Weighted Stirling numbers of the first and second kind-I, Fibonacci Quarterly, 18, 147-162. Carlitz, L. (1980b) Weighted Stirling numbers of the first and second kind- II, Fibonacci Quarterly, 18, 242-257. Carlitz, L., Roselle, D. P., and Scoville, R. A. (1966) Permutations and sequences with repetition by number of increases, Journal of Combinatorial Theory, 1, 350-374. Cauchy, A. (1833) Resumes Analytiques, Turin. Cayley, A. (1878a) On a problem of arrangements, Proceedings of the Royal Society of Edinburgh, 9, 338- 342. Cayley, A. (1878b) Note on Mr. Muir's solution of a problem of arrangement, Proceedings of the Royal Society of Edinburgh, 9, 388- 391. Cayley, A. (1887) Note on a formula for .6.noi jni when n and i are very large numbers, Proceedings of the Royal Society of Edinburg, 14, 149153. Charalambides, Ch. A. (1974) The generalized Stirling and C-numbers, Sankhya, Series A, 36, 397- 418. Charalambides, Ch. A. (1976) The asymptotic normality of certain combinatorial distributions, Annals of Institute of Statistical Mathematics, 28, 499-506. Charalambides, Ch. A. (1977a) A new kind of numbers appearing in the n-fold convolution of truncated binomial and negative binomial distributions, SIAM Journal on Applied Mathematics, 33, 279-288. Charalambides, Ch. A. ( 1977b) On the generalized discrete distributions and the Bell polynomials, Sankhya, Series B, 39, 36-44. Charalambides, Ch. A. (1979a) Some properties and applications of the differences of the generalized factorial, SIAM Journal on Applied Mathematics, 36, 273-280. Charalambides, Ch. A. (1979b) Bernoulli related polynomials and numbers, Mathematics of Computation, 33, 794-804. Charalambides, Ch. A. (1981) Bipartitional polynomials and their applications in combinatorics and statistics, Discrete Mathematics, 34, 81-84.

594

BIBLIOGRAPHY

Charalambides, Ch. A. (1982) On the enumeration of certain compositions and related sequences of numbers, Fibonacci Quarterly, 20, 132-146. Charalambides, Ch. A. (2002) The rook numbers of Ferrers boards and the related restricted permutation numbers, Journal of Statistical Planning and Inference, 101, 33-48. Charalambides, Ch. A. and Koutras, M. (1983) On the differences of the generalized factorials at an arbitrary point and their combinatorial applications, Discrete Mathematics, 47, 183-201. Charalambides, Ch. A. and Singh, J. (1988) A review of the Stirling numbers, their generalizations and statistical applications, Communications in Statistics- Theory and Methods, 17, 2533- 2595. Chung, K. L. (1941) On the probability of the occurrence of at least m events among n arbitrary events, Annals of Mathematical Statistics, 12, 328-338. Chung, K. L. (1943a) Generalization of Poincare's formula in the theory of probability, Annals of Mathematical Statistics, 14, 63-65. Chung, K. L. ( 1943b) On fundamental systems of probabilities of a finite number of events, Annals of Mathematical Statistics, 14, 123- 133. Chung, K. L. (1943c) Further results on probabilities of a finite number of events, Annals of Mathematical Statistics, 14, 234-237. Comtet, L. (1968) Polynomes de Bell et formule explicite de derivees successives d' une fontion implicite, Comptes Rendus de l' Academie des Sciences, Paris, 267, 457-460. Comtet, L. (1973) Une formule explicite pour les puissances successives de l' operateur de derivation de Lie, Comptes Rendus de l' Academie des Sciences, Paris, 276, 165- 168. Comtet, L. (1974) Advanced Combinatorics, Reidel, Dordrecht-Holland. David, F. N. (1962) Games, God, and Gambling, Hafner Press, New York. David, F. N. and Barton, D. E. (1962) Combinatorial Chance, Griffins, London. David, F. N., Kendall, M. G., and Barton, D. E. (1966) Symmetric Functions and Allied Tables, Cambridge University Press, Cambridge. De Moivre, A. (1718) The Doctrine of Chances, Pearson, London (2nd ed. 1738 and 3rd ed. 1756).

BIBLIOGRAPHY

595

De Moivre, A. (1730) Miscellanea Analytica de Seriebus et Quadraturis, J. Tonson and J. Watts, London. DeBruijn, N. G. (1964) Polya's theory of counting, in Applied Combinatorics as Chapter 5, E. F. Beckenbach (ed.), John Wiley & Sons, New York. Dickson, L. E. (1920) History of the Theory of Numbers, Vol. II, Carnegie Institute, Washington. (Reprinted by Chelsea, New York, 1952.) Dillon, J. F. and Roselle, D.P. (1969) Simon Newcomb's problem, SIAM Journal on Applied Mathematics, 17, 1086- 1093. Dwyer, P. S. (1938) The calculation of moments with the use of cumulative totals, Annals of Mathematical Statistics, 9, 288-304. Dwyer, P. S. (1940) The cumulative numbers and their polynomials, Annals of Mathematical Statistics, 11, 66- 71. Euler, L. (1746) Introductio in analysin infinitorum. Euler, L. (1751) Calcul de Ia probabilite dans le jeu de rencontre, Memoires de l' Academie des Sciences de Berlin, 7, 255- 270 (Opera Omnia 1-7, 11- 25.) Euler, L. (1760) Theoremata arithmetica nova methodo demonstrata, Novi Commentarii Academiae Petropolitanae, 8, 74-104 (Opera Omnia 1-2, 531- 535.) Faa di Bruno, F. (1855), Sullo sviluppo delle funzioni, Annali di Scienze Mathematiche et Fisiche di Tortolini, 6, 479-480. Faa di Bruno, F. (1857), Note sur un nouvelle formule de calcul differentiel, Quarterly Journal of Mathematics, 1, 359-60. Feller, W. (1968) An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. John Wiley & Sons, New York. Fisher, R. A. and Yates, F. (1953) Statistical Tables, Oliver Boyd, London. Franklin, F. (1881) Sur le developpement du produit infini (1-x)(1-x 2 ) (1- x 3 ) · · ·, Comptes Rendus de l' Academie des Sciences, Paris, 92, 448-450. Frechet, M. (1940) Le Probabilites associees a un systeme d' evenements compatibles et dependants, I: Evenements en nombre fini fixe, Actualites Scientifiques et Industrielles, No. 859, Hermann, Paris.

596

BIBLIOGRAPHY

Frechet, M. (1943) Le Probabilites associees a un systeme d' evenements compatibles et dependants II: Cas particuliers et applications, Actualites Scientifiques et Industrielles, No. 942, Hermann, Paris. Frucht, R. (1969) A combinatorial approach to the Bell polynomials and their generalizations, in Recent Progress in Combinatorics, pp. 6974, Academic Press. Gould, H. W. (1956) Some generalizations of Vandermonde's convolution, American Mathematical Monthly, 63, 84-91. Gould, H. W. (1958) A theorem concerning the Bernstein polynomial, Mathematics Magazine, 31, 259-264. Gould, H. W. (1964) The operator (ax D)n and the Stirling numbers of the first kind, American Mathematical Monthly, 71, 850-858. Grunert, J. A. (1822) Mathematische Abhandlungen, Altona. Grunert, J. A. (1843) Ueber die Summirung der Reihen von der Form Ao¢(0), A 1 ¢(1)x, A2 ¢(2)x 2 , •.. , An¢(n)xn, ... wo A eine beliebige constante Grofse, An eine beliebige und ¢( n) eine ganze rationale algebraische Function der positiven ganzen Zahl n bezeichnet, Journal fUr die reine und angewandte Mathematik, 25, 240-279. Gupta, H. (1950) Tables of distributions, Research Bulletin of East Panjab University, 13-44. Hardy, G. H. and Rarnanujan, S. (1917) Une formule asymptotique pour le nombre des partitions den, Comptes Rendus de l' Academie des Sciences, Paris, 164, 35-38. Hardy, G. H. and Rarnanujan, S. (1918) Asymptotic formulae in combinatory analysis, Proceedings of the London Mathematical Society, Series 2, 17, 75- 115. Heselden, G. P. M. (1973) A convolution involving Bell polynomials, Proceedings of the Cambridge Philosophical Society, 7 4, 97- 106. Hoggat, V. E. (1969) Fibonacci and Lucas numbers, Houghton Mifflin, Boston, MA. Johnson, N. L. and Kotz, S. (1977) Urn Models and Their Application, Wiley, New York. Jordan, C. (1867) De quelques formules de probabilite, Comptes Rendus de l' Academie des Sciences, 65, 993- 994.

BIBLIOGRAPHY

597

Jordan, Ch. (1926) Sur la probabilite des epreuves repetees, le theoreme de Bernoulli et son inversion, Bulletin de la Societe Mathematique de France, 54, 101-137. Jordan, Ch. (1927a) Sur un cas generalise de la probabilite des epreuves repetees, Comptes Rendus de l' Academie des Sciences, Paris, 184, 315-317. Jordan, Ch. (1927b) Sur un cas generalise de la probabilite des epreuves repetees, Acta Scientiarum Mathematicarum, Szeged, 3, 193-210. Jordan, Ch. (1933) On Stirling numbers, Tohoku Mathematical Journal, 37, 254-278. Jordan, Ch. (1934) Le theorem de probabilite de Poincare generalise au cas de plusiers variables independantes, Acta Scientiarum Mathematicarum, Szeged 7, 103-111. Jordan, Ch. (1939a) Calculus of Finite Differences, Rotting and Romwalter, Sorron, Hungary. (Reprinted Chelsea, New York, 1947, 1960, 1965.) Jordan, Ch. (1939b) Problemes de la probabilite des epreuves repetees dans le cas general, Bulletin de la Societe Mathematique de France, 67, 223-242. Koutras, M. (1982) Non-central Stirling numbers and some applications, Discrete Mathematics, 42, 73- 89. Lagrange, L. (1770) Nouvelle methode pour resoudre les equations litterales par le moyen de series, Mem. Acad. Roy. Sci. Belles-Lettres de Berlin, 24. Lah, I. (1955) Eine neue Art von Zahlen, ihre Eigenschaften und Anwendung in der mathematischen Statistik, Mitteilungsbl. Math. Statist., 7, 203-212. Laplace, P. S. (1812) Theorie Analytique des Probabilites, Courvier, Paris. Lucas, E. (1891) Theorie de nombres, Paris. Lukacs, E. (1955) Applications of Faa di Bruno's formula in mathematical statistics, American Mathematical Monthly, 62, 340-349. MacMahon, P. A. (1902) The problem of derangement in the theory of permutations, Transactions of the Cambridge Philosophical Society, 21,467-481.

598

BIBLIOGRAPHY

MacMahon, P. A. (1915) Combinatory Analysis, Vol. 1, Cambridge University Press, London, (Reprinted by Chelsea, New York, 1960.) MacMahon, P. A. (1916) Combinatory Analysis, Vol. 2, Cambridge University Press, London. (Reprinted by Chelsea, New York, 1960.) Milne-Thomson, L. M. (1933) The Calculus of Finite Differences, MacMillan, London. Mohanty, S. G. (1979) Lattice Path Counting and Applications, Academic Press, New York. Montmort, P. R. (1708) Essai d' Analyse sur les Jeux de Hazards, Paris. Muir, T. (1878) On Professor Tait's problem of arrangement, Proceedings of the Royal Society of Edinburgh, 9, 382- 387. Narayana, T. V. (1979) Lattice Path Combinatorics with Statistical Applications, University of Toronto Press, Toronto. Netto, E. (1927) Lehrbuch der Kombinatorik, 2nd ed., Teubner. (Reprinted by Chelsea, 1958.) Nielsen, N. (1906) Hambuch der Theorie des Gammafunktion, Leipsig. (Reprinted by Chelsea, 1966.) Nielsen, N. (1923) Traite Elementaire des Nombres de Bernoulli, GauthierVillars, Paris. Norlund, N. E. (1924) Vorlesungen iiber Differenzenrechnung, Berlin. (Reprinted by Chelsea, 1954.) Polya, G. (1937) Kombinatorische Anzahlbestimmungen fiir Gruppen, Graphen und chemische Verbindungen, Acta Mathematica, 68, 145254. Poincare, H. (1896) Calcul des Probabilites, Gauthier-Villars, Paris. Raabe, J. L. (1851) Journal fur reine und angewandte Mathematik 42, 350. Rademacher, H. (1937a) On the partition function p(n), Proceedings of the London Mathematical Society, Series 2, 43, 241- 254. Rademacher, H. (1937b) A convergent series for the partition function, Proceedings of the National Academy of Sciences, U.S.A., 23, 78-84. Rademacher, H. (1940) Fourier expansions of modular forms and problems of partition, Bulletin of the American Mathematical Society, 46, 59-73.

BIBLIOGRAPHY

599

Rademacher, H. (1943) On the expansion of the partition function in a series, Annals of Mathematics, 44, 416-422. Read, R. C. (1987) P6lya's theorem and its progeny, Mathematics Magazine, 60, 275-282. Riordan, J. (1937) Moment recurrence relations for binomial, Poisson and hypergeometric frequency distributions, Annals of Mathematical Statistics, 8, 103- 111. Riordan, J. (1958). An Introduction to Combinatorial Analysis, John Wiley & Sons, New York. Riordan, J. (1968) Combinatorial Identities, John Wiley & Sons, New York. Roman, S. (1980) The formula of Faa di Bruno, American Mathematical Monthly, 87, 805-809. Schlafli, L. (1867) Erganzung der abhandlung uber die entwickelung des products, Journal fUr die reine und angewandte Mathematik, 67, 179182. Schlomilch, 0. (1852) Recherches sur les coefficients des faculties analytiques, Journal fur die reine und angewandte Mathematik, 44, 344355. Schlomilch, 0. (1895) Compendium der Hoheren Analysis, Braunschweig. Seal, H. L. (1949) The historical development of the use of generating functions in probability theory, Bulletin de l' Association des Actuaires Suisses, 49, 209- 228. Shanmugan, R. (1984) On central versus factorial moments, South African Statistical Journal, 18, 97- 110. Shumway, R. and Gurland, J. (1960) A fitting procedure for some generalized Poisson distributions, Skandinavisk Aktuarietidskrift, 43, 87108. Spitzer, F. (1964) Principles of Random Walks, Van Nostrand, New York. Stanley, R. P. (1978) Generating functions, in Studies in Combinatorics, Vol. 17, G.-C. Rota (ed.), pp. 100-141, Mathematical Association of America, Washington, D.C. Steffensen, J. F. (1927) Interpolation, Williams and Wilkins, Baltimore. (Reprinted by Chelsea, New York, 1950.)

600

BIBLIOGRAPHY

Stirling, J. (1730) Methodulus Differentialis sine Tractatus de Summatione et Interpolatione Serierum Infinitarum, Londini. (English translation by F. Holliday with title: The Differential Method, London, 1749.) Sylvester, J. (1883) Note sur le theorem de Legendre cite dans une Note inseree dans les Comptes Rendus, Comptes Rendus de l' Academie des Sciences, Paris, 96, 463- 465. Takacs, L. (1967a) Combinatorial Methods in the Theory of Stochastic Processes, John Wiley & Sons, New York. Takacs, L. (1967b) On the method of inclusion and exclusion, Journal of the American Statistical Association, 62, 102-113. Takacs, L. (1991) A moment convergence theorem, American Mathematical Monthly, 98, 742-746. Touchard, J. (1934) Sur un probleme de permutations, Comptes Rendus de l' Academie des Sciences, Paris, 198, 631-633. Touchard, J. (1939) Sur les cycles des substitutions, Acta Mathematica, 70, 243-279. Touchard, J. (1953) Permutations discordant with two given permutations, Scripta Mathematica, 19, 108-119. Tucker, A. (1974) P6lya's enumeration formula by example, Mathematics Magazine, 47, 248-256. Vandermonde, N. (1772) Memoire sur des Irrationneles de differens ordres avec application au cercle, Histoire de l' Academie Royale des Sciences, Part 1, 489-498. Vilenkin, N. Y. (1971) Combinatorics, Academic Press, New York. Ward, W. (1934) The representation of the Stirling's numbers and the Stirling's polynomials as sums of factorials, American Journal of Mathematics, 56, 87-95. Whitworth, W. A. (1867) Choice and Chance, Hafner Press, New York. Worpitzky, J. (1883) Studien iiber die Bernoullischen and Eulerschen Zahlen, Journal fiir die reine und angewandte Mathematik, 94, 203232.

Index

Abel polynomials, 206 Abel's formula, 207 Addition principle, 16 Arithmetic progression, sum of terms of, 31, 194 Ballot numbers, 81, 230, 274 Ballot problem, 80, 85, 100 Banach matchbox problem, 85 Bell numbers, 97, 199, 342, 474, 477 exponential, 199 Beneficial bet, 82 Bernoulli numbers, 328, 329 Binary number system, 19, 54 Binary sequences, enumeration of, 19, 36, 54 Binomial coefficient(s), 110 cycles of, 231 definition of, 112 monotonicity of, 115 orthogonality relation, 126 recurrence relation of, 55, 56, 59, 129 table of, 56 q-binomial coefficient( s) defined, 404 orthogonality relation, 406 recurrence relation of, 404, 405 Binomial convolution formula, 115 q-binomial convolution formula, 406 q-binomial formula, 406

Binomial generating function, 216 Binomial moments of a sequence, 215 Bipartitional polynomials exponential, 454 general, 455 logarithmic, 457 partial, 454 potential, 458 Birthday problem, 88 Bonferroni inequalities, 154 Booking tickets, 20 Boole inequality, 155 Boolean algebra, 12 Burnside theorem, 494 Caravan in the desert, 180 Cardinal of a set, 14 Carlitz numbers, 537 definition of, 523 explicit expression of, 523 expressed by the generalized factorial coefficients, 528 generating function of, 527 limiting expression of, 529 non-central, 539 recurrence relation of, 524 table of, 526 Carlitz polynomial, 525 Carlitz-Riordan numbers of the first kind, 329

601

602

Carlitz-Riordan numbers of the second kind, 330, 543, 544 Cartesian product, 5 Cashier problem, 81 Catalan numbers, 81, 100, 196, 229 convolution of, 229 generating function of, 197 recurrence relation of, 196 table of, 196 Cauchy identity, 465, 481 Cauchy numbers, 327, 329 Cauchy's binomial convolution formula, 115 Cayley identity, 481 Characteristic equation, 239 Chebyshev polynomials of the first kind, 449 of the second kind, 450 Circular permutation(s), 92, 462 enumeration by successions, 181, 183 succession of, 181 Coefficients of the generalized factorials, 345 associated, 367 Coincidence numbers, 173 generating function of, 219, 222 table of, 173 Coincidences double, 186 generalized problem, 188 multiple, 187 number of, 173 problem, 173 Coloring(s) of a cube, 496, 506 a roulette, 510 the elements of a set, 499 enumeration of, 500 model of, 499 weight of, 501 Combination (s)

INDEX

definition of, 51 enumeration of, 52 general generating function for the number of, 209 generating function for the number of, 193 recurrence relation for the number of, 55, 56 with limited repetition generating function for the number of, 211 with repetition definition of, 51 enumeration of, 58 generating function for the number of, 210 recurrence relation for the number of, 59 with restricted repetition enumeration of, 139, 144, 164, 504 Compositions of integers, 401, 511 Compound bivariate discrete distributions, 456 Compound discrete distributions, 422 Connection of cumulants and moments, 426, 457 Connection of ordinary and factorial moments, 285 Convolution of a logarithmic distribution, 287 Convolution of sequences, 194 Correspondence, 7 Coupon collector's problem, 151, 313 Cycles of binomial coefficients, 231 De Morgan's formulae, 12 Decomposition of a product of primes into factors, 34 7 Delannoy numbers, 274 Derangement(s) definition of, 170

INDEX

number of, 170 recurrence relation for the number of, 171 Derivatives of a composite function, 420, 453 Difference equation, 22 Dinner choices in a Chinese restaurant, 418 Display of flags on poles, 60 Distribution of shares, 83, 262 Distributions of balls of general · specification into distinguish. ordered urns enumeration of, 348, 349 into distinguishable urns enumeration of, 350-352 generating function of the number of, 356 Distributions of distinguishable balls into distinguishable urns enumeration of, 48, 340, 341 generating function of the number of, 354 into indistinguishable urns enumeration of, 68, 342 Distributions of indistinguish. balls into distinguishable urns, 60 connection with integer solutions of a linear equation, 71 enumeration of, 54, 343345 generating function of the number of, 355 Distributions of students in sections, 67 Division(s) of a finite set definition of, 13 enumeration of, 62, 97, 124, 149 recurrence relation for the number of, 64 Double coincidences, 186 Down-up permutations, 543

603

Duration of a series of drawings, 175 Elementary symmetric functions, 192, 427, 432, 458 Elements in a given number of exchangeable sets, enumeration of, 143, 147, 148 Elements in a given number of sets, enumeration of, 137, 145, 148 Elements in a union of exchangeable sets, enumeration of, 142 Elements in a union of sets, enumeration of, 132, 134 Elements of a given rank, 156 enumeration of, 156, 157 Elevator passengers' discharge, 67, 91, 133 Equivalence class, 493 Equivalence relation, 7 Equivalent sets, 9 Euler numbers, 514, 543 Euler's function, 140, 491, 497, 498, 506, 510, 511 table of, 140 Euler's identity, 393, 402 Euler's pentagonal theorem, 389 Euler's recurrence relation for subfactorials, 171 Eulerian numbers, 530 definition of, 514 explicit expression of, 515 expressed by Stirling numbers of the second kind, 519 expressing sample moments, 521 generating function of, 518 non-central, 538 expressed by non-central Stirling numbers of the second kind, 539 recurrence relation of, 516

604

symmetric, 514 table of, 517 q-Eulerian numbers, 540 Eulerian polynomial, 516 expressing power series, 520 Exchangeable sets, 142 Faa di Bruno formula, 420 generalization, 434 Factorial, 43, 104 central, 329 falling, 105 rising, 105 q-factorial, 404 Factorial convolution formula, 105 q-factorial convolution formula, 406 Factorial generating function, 216 Factorial moments of a sequence, 215 Factors of a positive integer, enumeration of, 19, 37 Family of elements, 8 Fibonacci numbers, 74, 100, 101, 253, 269, 401 convolution of, 271 generalized, 270 generating function of, 254 of order s, 269 table of, 254 Formation of committees, 352, 353 Frechet inequality, 166 Function, 7 Galilei problem, 92, 161 Gambler's ruin, 242 expected time to, 246 Gauss-Jacobi identity, 394, 402 Gegenbauer polynomials, 450 Generalized factorial coefficients, 152, 165, 307, 312, 344, 345, 347 associated, 166, 326, 327, 366 asymptotic expression of, 323 definition of, 302

INDEX

explicit expression of, 306 generating function of, 305 in terms of Stirling numbers, 304 limiting expression of, 307 non-central, 318, 319, 334, 540 orthogonality relation, 308 recurrence relation of, 309, 310 table of, 311 Generating function binomial, 201, 216 exponential, 194 factorial, 201, 216 for the number of combinations, 193, 209 for the number of permutations, 193, 210 general form of, 200 moment, 216 multivariate, 219 ordinary, 194 Genocchi numbers, 544 Geometric progression, sum of terms of, 21, 33 Gould polynomials, 207 Gould's formula, 208 Gould-Hopper numbers, 318 Group of permutations, 489 alternating, 490 cycle indicator of, 489 cyclic, 491 identity, 489 symmetric, 489, 490 Gumbel inequality, 166 Hanoi tower, transfer of, 238 Hermite polynomials, 449 generalized, 449 Homogeneous product sum symmetric functions, 432, 458 q-identity, 392 Inclusion and exclusion principle, 134, 136

INDEX

general expression of, 145 Inequalities of Bonferroni, 154 Inequality of Boole, 155 Frechet, 166 Gumbel, 166 Integer solutions of a linear equation, 68 connection with distributions of indistinguish. balls into distinguishable urns, 71 enumeration of, 69-71,98, 138 Inverse map, 8 Inverse relation, 7 Inverse relations, 284 Inversion of power series, 437, 438 Inversions of permutations, 541 Lagrange inversion formula, 435 Lagrange series, 205, 439 Laguerre polynomials, 449, 452 Lah numbers, 302 non-central, 335 signless, 302 q-Lah numbers, 409 signless, 409 Lattice paths, 75 enumeration of, 76-78 figure, 77 with diagonal steps, 100 Leibnitz numbers, 127, 275 Lucas numbers, 75, 270 generalized, 271 of order s, 270 Maclaurin power series, 202 Magic squares, 1 Map, 7 bijective, 7 identity, 8 injective, 7 inverse, 8 surjective, 7

605

Mean of a sequence, 215 Menages numbers, reduced, 142 table of, 142 Menages problem, 140 modified, 163 straight table, 163 Mobius function, 166 Mobius inversion formula, 167 Models of necklaces, 498, 511 Moment generating function, 216 Moments of a sequence, 215 Money-changing problem, 383 Monomials in a polynomial, enumeration of, 99 Morse code, 36, 346 Multinomial coefficient(s), 123 generating function of, 222 recurrence relation of, 64 sum of, 150, 165, 400 Multinomial formula, 123 Multiple coincidences, 187 Multiplication principle, 20 Multivariate generating function, 219 q-negative binomial formula, 406 Newcomb's problem, 513 Newton factorial series, 204 Newton's formula binomial, 111 general binomial, 115 negative binomial, 112 Norlund-Bernoulli numbers, 328 Null set, 3 q-number, 404 Number system binary, 19, 54 of base 5, 159 quaternary, 224 ternary, 47 Occupancy problem, 339 classical, 340 Operator IP = tLl, 286

INDEX

606

e

Operator = tD, 286 Orbit, 493 enumeration of the elements of, 494 Order relation, 7 Ordered n-tuple, 5 Ordered pair, 5 Parcelling out procedures, 228 Partial derivatives of a function, number of, 99 Partial sums, generating function of, 255 Partition polynomial(s) exponential Bell, 412, 452, 466, 473, 490, 505 convolution of, 448 generating function of, 414 of an arithmetical function, 416 recurrence relation of, 415 general, 419 generating function of, 420 recurrence relation of, 420 logarithmic, 424 generating function of, 424 recurrence relation of, 425 partial Bell, 412, 466, 473 generating function of, 413 recurrence relation of, 415 table of, 417 potential, 428, 431, 451 expressed by partial Bell, 430 generating function of, 428 recurrence relation of, 429 Partition(s) of a finite set definition of, 14 enumeration of, 66, 273, 274 Partition(s) of integers conjugate, 386 definition of, 370 Ferrers diagram of, 386

generating function for the numbers of, 374, 375, 511 interrelations among partition numbers, 383-385, 387 into even number of parts, 381 into even number of unequal parts, 381, 389 into even parts, 379 into even unequal parts, 398 into odd number of parts, 381 into odd number of unequal parts, 381, 389 into odd parts, 379 into odd unequal parts, 398 into parts of restricted size, 380, 396, 398 into specified parts, 382 into unequal parts, 378 into unequal parts of restricted size, 400 perfect, 401 recurrence relation for the number of, 371, 373 self-conjugate, 386 table for the numbers of, 372, 373 universal generating function for the numbers of, 377, 378 Partitions of ordered pairs of integers, 403 Pascal's triangle, 55 Perfect partitions, 401 Permutation(s) ascending runs of, 530 cycle decomposition of, 463 cyclic with restricted repetition, 505 definition of, 40 enumeration of, 42 by ascending runs, 530 by cycles, 464, 465 by fixed points, 170, 172 by inversions, 541

INDEX

by partially ordered cycles, 472, 473, 475 by peaks, 541 by ranks, 175 by records, 540 by successions, 177, 179 by transpositions, 189 even, 469 falls of, 531 fixed points of, 169 general generating function for the number of, 210 generating function by number of cycles, 466, 467 generating function by number of partially ordered cycles, 474, 477 generating function for the number of, 193 odd, 469 order of, 491 rank of, 174 recurrence relation for the number of, 45, 46 restricted enumeration by cycles, 465 enumeration by ordered cycles, 474 rises of, 531 succession of, 176 universal generating function by number of cycles, 484 with limited repetition generating function for the number of, 214 with repetition generating function for the number of, 213 definition of, 40 enumeration of, 47, 49 generating function by the number of non-descending runs, 537 non-descending runs of, 533

607

with restricted repetition enumeration of, 164 Pigeonhole principle, 38 P6lya counting theorem, 502 Population, 86 Power set, 4 Power sum symmetric functions, 427, 432, 458 Principle of addition, 16 inclusion and exclusion, 134, 136 multiplication, 20 pigeonhole, 38 reflection, 78 the want of sufficient reason, 24 Priority lists, 349 Probability, 26 classical, 24 Probability distribution binomial, 88, 218 binomial moments of, 218 mean of, 111 moments of, 125 geometric, 217 factorial moments of, 217 moments of, 520 hypergeometric, 87 mean of, 106 moments of, 124 logarithmic distribution convolution of, 287 negative binomial moments of, 126 negative hypergeometric, 87 mean of, 125 moments of, 125 Product, 30 Rank numbers, 176, 185 table of, 176 Rank of a permutation, 174 Recurrence relation

608

definition of, 22 linear, 233 linear complete, 233 general solution of, 235 particular solution of, 235, 244 solution by generating function, 256 solution by iteration, 235 linear homogeneous, 233 solution by method of characteristic roots, 239 linear with constant coefficients general solution of, 248 particular solution of, 248 solution by generating function, 250 solution of, 237 solution of, 234 Reflection principle, 78 figure, 79 Regions of a plane enumeration of, 237,265,272 Relation, 7 equivalence, 7 inverse or reciprocal, 7 Round table conference, 183 Runs in combinations, 98, 161 Runs in permutations, 97 Sample, 86 Sample points, 24 Sample space, 24 Schlomilch's formula, 290 Selection of a central committee, 347 Sequence of elements, 8 Set, 3 cardinal of, 14 complement of, 10 countable, 9 division of, 13 empty or null, 3 finite, 9

INDEX

infinite, 9 infinitely countable, 9 partition of, 14 uncountable, 9 universal, 3 Sets difference of, 10 disjoint, 13 equivalent, 9, 14 exchangeable, 142 intersection of, 10 union of, 9 Sieve of Eratosthenes, 160 Soccer's results foresight, 37 Spread of rumors, 101 Stabilizer, 493 Statistical mechanics model Bose-Einstein, 89 Fermi-Dirac, 90 Maxwell-Boltzman, 89 Stirling numbers of the first kind, 204, 291, 299, 328, 329 Schlomilch's formula for, 290 associated, 323, 324 asymptotic expression of, 323 definition of, 278 explicit expression of, 291 expressed in terms of the Stirling numbers of the second kind, 290 generating function of, 282 in non-identical Bernoulli trials, 283 non-central, 314 non-central signless, 315, 331, 332, 466 recurrence relation, 321 recurrence relation of, 293, 295 signless, 279, 280, 322, 465, 471, 477, 478, 483 generating function of, 283 recurrence relation of, 294 signless associated, 478 table of, 294

INDEX

q-Stirling numbers of the first kind, 407, 408 Stirling numbers of the second kind, 96,97, 150,151,165,202, 291, 298, 299, 328, 329, 340, 342, 347, 368, 474, 519, 533, 544 associated, 165, 324, 325, 365 asymptotic expression of, 323 definition of, 278 explicit expression of, 289 generating function of, 282, 298 in a Markov chain, 300 non-central, 188, 314, 332, 341, 347, 475 recurrence relation, 321 recurrence relation of, 293, 297 table of, 295 q-Stirling numbers of the second kind, 407, 408 Stirling numbers, orthogonality relations, 281 Stirling's formula, 109 Stochastic model, 24 Subfactorials, 178, 182, 185 defined, 172 generating function of, 199 table of, 172 Subset, 4 Subsets of a finite set number of, 21, 116 recurrence relation for the number of, 23 Succession numbers, 179, 230 generating function of, 230 table of, 180 Succession of a circular permutation, 181 Succession of a permutation, 176 Sum, 27 Sum of multinomial coefficients, 150, 165, 400

609

Summation, changing the order of, 29 Sums of sums, generating function of, 261 Symbolic calculus, 198 Symmetric functions elementary, 192, 427, 432, 458 homogeneous product sum, 432, 458 power sum, 427, 432, 458 Tangent coefficients, 543 Tennis tournament problem, 237 Ternary number system, 47 Ternary sequences enumeration of, 47, 93 Touchard polynomial(s), 442,452, 475 expressed by Bell polynomials, 445 generating function of, 444 recurrence relation of, 446 Transportation of products, 73 Transposition, 189, 462 Triangulation of convex polygons, 229 Universal set, 3 Up-down permutations, 543 Vandermonde's formula, 105 Variance of a sequence, 216 Venn diagrams, 4 Wallis formula, 107 Wronski determinant, 234