SMMATH Handout Distributions Solutions
SMMATH Handout Distributions Solutions
James Rowan
1 Problem Set
Here are the solutions to the problem set and the answer to the note on Example 7. Don’t just
immediately go to these if you haven’t thought hard about the problems and asked for hints.
Example 7, sans casework: We’ll proceed by stars and bars. We lay out the 8 pieces of candy
in a row to be our “stars.” Our “bars” will be used to denote which pieces are grouped together into
piles. There are clearly 8 − 1 spaces in between the piles where we could put bars, and to get an
We now consider the seven-element set of places we could put our bars. This set has 27 subsets.
We want to know how many subsets have an odd number of elements. I claim this is exactly half of
For each subset A of, say, S = {1, 2, 3, 4, 5, 6, 7} with an odd number of elements, we consider the
subset of S given by S − A. S − A must have an even number of elements. This gives us a bijection
from the set of subsets of S with an even number of elements to the set of subsets of S with an odd
number of elements. Since these two sets together make up all of the subsets of S and both have
the same cardinality, they must each contain half of 27 elements, or 64 elements.
Since the number of ways to divide the 8 candies into an even number of piles is the same as the
number of ways to make a subset of a seven-element set with an odd number of elements, our final
answer is 64 .
Problem 1: There are four types of donuts at the donut store: jelly, glazed, chocolate, and
cake. You need to buy six donuts, but you must get at least one of each type. How many ways can
you do this?
A constructive counting “solution” to this problem was once given by an anonymous student
Take one of each type; there is only one way to do this. Now you have to pick 2 donuts, and you
have 4 choices of type for each donut, so you have 42 = 16 ways to pick your remaining two donuts
and thus there are 16 ways to pick six donuts with at least one of each type.
Where does this solution break down? Can you use non-distributions techniques to fix it? Then
1
solve the problem with distributions. Which method is easier?
Answer: 10
Solution: The student’s method overcounts. There is no difference between the pick “jelly,
glazed, chocolate, cake, cake, jelly” and the pick “jelly, glazed, chocolate, cake, jelly, cake,” but the
student’s method claims there is a difference because it assumes both picks are independent. On all
4
2 = 6 pairs of two donuts, the student’s method counts twice depending on the order of picking of
We have to buy one of each. Now we have two cases: both of the last two donuts are the same,
or both are different. If both are the same, there are 4 ways to pick a flavor and get two donuts of
that flavor. If both are different, there are 42 = 6 ways to pick two flavors and get one donut of
Distributions, though, is easier. There are 4 distinguishable urns: the four flavors of donut.
There are 6 indistinguishable balls: the six donuts we buy. We need to put the 6 balls in 4 urns, so
than or equal to −4, a and c are positive integers, and d is a nonnegative integer?
Answer: 884
for b a negative integer greater than or equal to −4. We break the problem into cases based on b.
We’ll do the first case explicitly, then leave the details to you on the other three.
Case 1: b = −4.
884 .
Problem 3: Macbeth is paying three witches a total sum of 12 gold pieces for telling him the
future. If the oldest witch wants to earn at least as much gold as the other two witches combined,
and all witches want a positive number of gold pieces, in how many ways can Macbeth pay the three
witches?
Answer: 15.
Solution: We’ll proceed by casework. He can pay the oldest witch anywhere from 6 to 10 gold
2
pieces, leaving anywhere from 6 to 2 gold pieces for the remaining two witches. Since each gets a
positive number of gold pieces, there are a total of 5 + 4 + 3 + 2 + 1 = 15 ways to distribute the
coins.
Problem 4: (classic) When (x + y + z)100 is expanded out, how many distinct terms are there?
For example, xyz 98 and x2 y 2 z 96 are distinct, while two different occurences of xy 50 z 49 are not
distinct; in (x + y)2 = x2 + xy + xy + y 2 = x2 + 2xy + y 2 , there are 3 distinct terms since the two
Answer: 5151
a + b + c = 100 and a, b, c are all nonnegative integers. The number of distinct terms is then just
Problem 5: How many solutions (a, b, c, d, e) in the Gaussian integers located in the first
quadrant of the complex plane exist for the equation a + b + c + d + e = 12 + 7i? By “Gaussian
integers in the first quadrant of the complex plane” we mean that all of are complex numbers
(a, b, c, d, e) can be written in the form x + yi where x and y are positive integers.
Answer: 4950
where all the xi and yi are all positive integers. Clearly the real and imaginary parts of a Gaussian
integer are independent, so we need to multiply the number of ways for the real parts to sum to 12
Problem 6: How many ordered triples of positive integers (a, b, c) exist such that abc = 5184?
Answer: 420
Solution: At first glance, this problem might not look like a distributions problem, since it is an
equation with multiplication not addition. However, we can remedy this. 5184 = 4·1296 = 26 34 , and
so we can write a = 2x1 3y1 , b = 2x2 3y2 , and c = 2x3 3y3 for x1 , x2 , x3 and y1 , y2 , y3 all nonnegative
integers. We can extract a distribution problem from this, since exponents add when we multiply
terms.
nonnegative integers. We can solve the two independently, then multiply the results. We have
6+3−1
= 82 solutions to the equation in xi and 4+3−1 = 62 solutions to the equation in yi .
3−1 3−1
3
Problem 7: How many ordered 4-tuples (w, x, y, z) of positive integers satisfy the equation
Answer: 450
Solution: We’ll proceed by casework and then work as we did in example 10. We have three
Case 1: x ≡ 0 (mod 3)
In this case, we write w = 3a, x = 3b, y = 3c, and z = 3d. We have 3a + 3b + 3c + 3d = 33, or
Case 2: x ≡ 1 (mod 3)
In this case, we write w = 3a, x = 3b−2, y = 3c−1, and z = 3d. We have 3a+3b−2+3c−1+3d =
Case 3: x ≡ 2 (mod 3)
In this case, we write w = 3a, x = 3b − 1, y = 3c − 2, and z = 3d. This case is exactly the same
as the case above, except with x and y swapped. There are also 165 solutions to this equation.
Problem 8: (AoPS Intermediate Counting and Probability) How many degree 6 polynomials
f (x) with positive integer coefficients are there such that f (1) = 30 and f (−1) = 12?
Answer: 31920
Solution: We let our polynomial be f (x) = ax6 + bx5 + cx4 + dx3 + ex2 + f x + g. f (1) =
all of a, b, ..., g are positive integers. The key now is to extract a distribution problem or some
distributions problems out of this knowledge, as neither one alone gets us the right answer because
second equation from the first equation to get 2b + 2d + 2f = 18, or b + d + f = 9. Each of these two
equations is not influenced by the other, as they both contain different variables. Now we can count
the number of solutions to each equation in positive integers, then multiply our two results for our
Note that we could also think of the polynomial f (x) as the sum of an even polynomial g(x) and
4
Problem 9: (Mandelbrot) In a certain lottery, 7 balls are drawn at random from n balls
numbered 1 through n. If the probability that no pair of consecutive numbers is drawn equals the
Answer: 54
Solution: It might not be immediately obvious how this is a distributions problem, but remem-
ber example 9 from the handout? This problem is of a similar flavor. It might be a good idea to
In a certain lottery, 7 balls are drawn at random from n balls numbered 1 through n. If the
number of ways to draw the seven balls such that that no pair of consecutive numbers is drawn
equals the number of ways of drawing exactly one pair of consecutive numbers, find n.
Now that we have a counting problem, we need to find how to apply distributions. First, let’s
count the number of ways to draw seven balls such that no two are consecutive. We lay the n balls
out in a line, and we denote by | a picked ball, by a nonnegative-length run of non-picked balls,
| | | | | | |
This picture indicates that we can not draw zero or more balls, then we draw a ball, don’t
draw one or more balls, and so on until we draw the seventh ball. We then have zero or more
balls we don’t draw. Finding the number of ways to do this is equivalent to solving the equation
are seven balls drawn in the lottery and a balls in the first group, b in the second, and so on for a
substitutions to deal with a and h and then moving all nonvariable terms to the right hand side).
Now we count the number of ways we can draw seven balls such that exactly one pair of
consecutive numbers is drawn. In the same vein as our picture above, we’ll have six vertical
bars, five nonempty gaps between them, and the two possibly empty gaps at the end. We have
solutions. However, we need to multiply this result by 6 becaues there are six ways to pick when we
draw the two consecutive balls: balls one and two, two and three, three and four, four and five, five
5
n−6 n−6
So now our problem reduces to finding n such that 6 6 = 7 . We expand:
Problem 10: Prove the “hockey stick identity” using distributions. That is, prove the following
n
X i n+1
= .
k k+1
i=k
Solution: Consider the problem of putting n+2 indistinguishable balls into k +2 distinguishable
urns such that each urn has at least one ball in it. The right hand side of the identity clearly counts
the number of ways to do this, so we need to figure out what the left hand side counts.
i
k counts the number of ways to put i + 1 indistinguishable balls into k + 1 distinguishable urns,
as long as i ≥ k. I claim that the left hand side of our identity also counts the number of ways to
put n + 2 indistinguishable balls into k + 2 distinguishable urns. Take one of our k + 2 urns and
set it aside. We’ll call it the trash can. We can put anywhere from 1 to (n + 2) − (k + 1) balls in
the trash can, since each urn must get at least one ball. If we put j balls in the trash can, we have
n + 2 − j balls to distribute among k + 1 other urns. The number of ways to do this, summing across
n−k+1
X n
n+1−j X i
=
j=1
k k
i=k
when we let i = n + 1 − j. Since the left hand side of the identity and the right hand side of
the identity count the same thing (the number of ways to distribute n + 2 indistinguishable balls
into k + 2 distinguishable urns) in different ways (putting some in one urn first, then counting the
number of ways to distribute the rest or directly counting the number of distributions), the two