In MO, we are often concerned with the number of ways to distribute a certain number of objects into a certain number of boxes. Many SMO round 1 problems are modelled after specific cases of distribution problem. We will discuss the 4 main types of distribution problems in this post. Sticking to conventions, let be the number of boxes while be the number of objects throughout this post. Also, a multi-set is a set with repeated terms, such as
Case 1: n distinct boxes, r distinct objects
We assume that each box has infinite capacity and can contain contain any amount of objects. For each object, you have choices of boxes where you can place the object. Hence, by multiplication principle, we have possible ways to put distinct objects in distinct boxes.
Of course, this is a very simple computation which does not utilise the concept of permutation and combination at all. What is more likely to be asked in competitions is the number of ways of distributing the objects if the ordering of the objects in each boxes matters. If this is the case, let us label each object as respectively. Now consider the set where there are 1s in the set. We shall treat these “1”s as partitions i.e. the objects between 2 “1”s represent the objects in a box. Essentially, we want to find the number of ways to arrange the items in the set. Since the partitions are identical, the number of ways is equal to:
Case 2: n distinct boxes, r identical objects
This is the kind of situation that is most commonly modelled in SMO problems. The number of ways to place identical objects into distinct boxes is
To see this, let us consider a binary sequence with 0s representing the objects and 1s representing the partitions of the boxes. The problem is equivalent to finding the number of possible binary sequences with 0s and 1s, hence we obtain the above formula.
A popular corollary to this observation concerns the number of integer solutions to equations in the form . We can treat each variables as a box and the value at the right hand side of the equation as the number of identical objects. This problem is equivalent to distributing the amount of objects at the right hand side of the equation into the variables on the left of the equation, and hence the number of solution is .
More formally, we indicate that . The symbol represents the number of -element multi-subset of a multi-set with distinct objects.
I think it’s sufficient to familiarise with the above two scenarios for SMO(J) problems (or perhaps even SMO(S)). For people taking part in SMO(O), you may be interested in the following two cases as well:
Case 3: n identical boxes, r distinct objects
We denote the number of ways to place distinct objects into identical boxes such that no box is empty as , also known as the Stirling’s Number of Second Kind. Unfortunately, there is no general formula which relates with the number of objects and number of boxes. However, we can compute using some recurrence relations.
Now, here are some results for certain useful cases:
- (Use binomial theorem to obtain this)
- (Use multinomial theorem and inclusion-exclusion principle to derive this)
The most important tool to evaluate Stirling’s Number of Second Kind is the following recurrence relationship:
This is derived from discussing the situations when one of the objects is isolated and when it is mixed with other objects. If it is isolated, the other objects can be distributed in ways. If it is mixed, after the other objects are being distributed, it can be placed in any other boxes, which amounts to the expression . Hence these two situations add up to . With this recurrence relationship and some principle values, we can derive other Stirling’s Number of Second Kind.
FYI 1: There’s actually a general formula for Stirling’s Number of Second Kind (damn I hate typing this long name) which can be derived using the multinomial theorem and inclusion-exclusion principle. It is
FYI 2: Stirling’s Number of First Kind is the coefficient of in the expansion
Case 4: n identical boxes, r identical objects
ALERT: Knowledge of generating functions required
The partition number of an integer refers to the number of ways that a positive integer can be written as the sum of smaller positive integers. For example, since . The problem of finding the number of ways to distribute identical objects into identical boxes such that no box is empty can be rephrased as finding the number of partitions of into parts. In order to proceed, we require the following theorem by Leonhard Euler:
The number of ways to partition an integer r into n parts is equivalent to the number of ways to partition r into parts such that the part with the largest size is n.
So for example, the number of ways to distribute 4 identical objects into 2 identical boxes is 2, since there are 2 ways to write 4 as partition of integers such the largest term is 2 (2+2, 1+1+2). The ways to partition are (2,2), (3,1).
The theorem can be explained with the use of Ferrer’s diagram. I am lazy so I will just refer you to the explanation on Wikipedia (which surprisingly doesn’t look too daunting).
OK so now the problem sorta “simplifies” into finding the number of ways to partition a number into parts in which the parts with the largest size is (regardless of the number of parts). This can be achieved by inspecting the coefficient of the following generating function:
The coefficient of is the number of ways to place identical objects into identical boxes such that no box is empty.
People usually use computers to evaluate large partition numbers… If this really comes out in SMO, good luck then.
So in summary, here’s are the approaches to find the number of distributions in different cases:
References:
Chee, C.C., Koh, K.M. (2007) Principles and Techniques in Combinatorics (1st ed p.298) World Scientific.
Cheers,
ksj