The twelve fold way

Question

How many ways to place balls in boxes?

Unrestricted

BallsBoxes#
LabeledLabeled
UnlabeledLabeled1
LabeledUnlabeled. See LEC DMAT 6.
UnlabeledUnlabeled, where = number of partitions of into parts. No closed form.

Let . Then, the generating function for is

Let be the number of ways to place unlabelled balls in labelled boxes. Then, the generating function of is

Injective

BallsBoxes#
LabeledLabeled
UnlabeledLabeled
LabeledUnlabeled or
UnlabeledUnlabeled or

Surjective

BallsBoxes#
LabeledLabeled
UnlabeledLabeled
LabeledUnlabeled
UnlabeledUnlabeled

Solving Linear Recurrence relations

Remark 206.1.

For linear recurrence relations, if we can find any solutions, we can take linear combinations of them to generate new solutions. For example, If and satisfy a recurrence relation, also satisfies it.

Number of subsets

Let number of subsets of .

for all .
.

Let . This is called a generating function.

so,

Observe that has a radius of convergence of , so our manipulations are justified by analysis. This does not always need to be the case.

The Fibonacci sequence

Let be the Fibonacci sequence. There are several methods to solve for the explicit formula.

Method 1: Exponential ansatz

Try a solution of the form . This gives us the characteristic equation , the roots of which are . Thus, a general solution would be of the form

Use the initial conditions of and to solve for and .

Solving general linear recurrence relations with constant coefficients using exponential ansatz

Consider the recurrence

We try a solution of the form ; we find that must be a root of the polynomial

If this characteristic equation has all its roots distinct, then we obtain independent solutions of the recurrence relation. Taking a linear combination of these, and fitting the initial values of , we get linear equations in unknowns; these equations have a unique solution. However, if the characteristic polynomial has repeated roots, then we don’t obtain enough solutions. In this case, suppose that is a root of the characteristic equation with multiplicity . Then it can be verified that the functions are all solutions of the recurrence relation. Doing this for every root, we again find enough independent solutions that initial values can be fitted.

The justification of this is the fact that the solutions claimed can be substituted in the recurrence relation and its truth verified.

Method 2: Matrix diagonalization 2

Express the recurrence as a matrix product:

Let be the coefficient matrix of the recurrence. Then,

It would be beneficial to diagonalize , since powers of a diagonal matrix are easy to compute. The characteristic polynomial of is the same as the characteristic equation we obtained in the previous method, so are the eigenvalues of . We can find and normalize the eigenvectors corresponding to these eigenvalues to obtain the change of basis matrix

and since is an orthogonal matrix, . This gives us

Method 3: Generating function

Let .

So, .

Let

where and .

We know and .
We can solve for and : , .
Thus, we have .

Remark 206.2.

Once we have found the power series above, we can use the theory of power series to show that converges for , so our manipulations are justified analytically. However, there exists a theory of formal power series, according to which it is legitimate to do such manipulations without any regard to questions of convergence. If the sequence specified by a recurrence relation grows no faster than exponentially, its generating function will have non-zero radius of convergence, and analytical techniques can be used on it. However, if the growth is faster than exponential, the series must be treated formally. See Cameron (2001, p. 54).

Derangements

is the number of derangements of size .

, , , .

Note that .

Thus, , .

Thus,

Note

In general, a linear recurrence relation
given , , …, has a unique solution. could be functions of .

show me why , , …, are solutions of the recurrence relation if is a root of the characteristic equation with multiplicity .

Footnotes

  1. Here’s how you can think about this: split the pool you are choosing from into two pools of size and . Say you choose from pool and from pool . Think of the choices from pool 1 determining the placement of dividers on a “tape” of balls. We have undrawn positions form pool : think of these blank positions as dividers, distributing the dividers among the dividers on the tape of balls.

  2. Rochford (2014)


References

Cameron, P. J. (2001). Combinatorics: Topics, Techniques, Algorithms (Transferred to digital printing). Cambridge Univ. Press.
Rochford, A. (2014). Matrix Diagonalization and the Fibonacci Numbers. In Austin Rochford. https://austinrochford.com/posts/2014-04-23-diagonalization-fibonacci.html