Distributions & Stars and Bars
Distributing objects into bins, integer partitions, compositions
What you need to know
- Stars and bars (also called balls and urns). The equation has solutions in whole numbers that are zero or positive, and if every is at least . Why: line up stars and bars. The bars cut the stars into groups ( means ), so you choose which of the spots are bars. Example: has solutions, or with each at least .
- Identical objects to different people (or boxes) is the same count: is what person gets. If person must get at least , give them first. (In symbols, use , which only has to be zero or positive.) Example: identical candies to kids, at least each: hand out , then share the other in ways.
- Upper limits ( at most ) need inclusion-exclusion (PIE): subtract the solutions with some variable over , then add back the overlaps. See the worked example.
- Different objects into different boxes is not stars and bars. Each of the objects picks a box: ways. Example: different books to kids: ways.
- Identical objects into identical boxes (partitions) have no formula; list them, largest part first. Example: splits into parts in ways: , , , , , , .
- Ordered sums. can be written as an ordered sum of positive whole numbers (any number of parts) in ways. Why: in , each of the plus signs either stays or is erased. Example: has , such as , , and .
How AMC 10 tests it
- Problems 10–18: "How many ways can identical candies be given to children if each gets at least one?"
- Equations in disguise: numbers whose digits add up to a given total, the number of terms in an expansion, ways to pay an amount with coins.
- Problems 18–24: a cap ("no child receives more than ") that forces PIE, or a twist about identical versus different objects.
- Often the top or bottom of a probability fraction.
Standard approaches
- Sort first: identical or different objects? Identical or different boxes? Only identical objects into different boxes is stars and bars.
- Shift variables to remove lower limits, then use .
- For upper limits, count all, subtract the cases with one variable too big, add back the cases with two, subtract the cases with three, and so on. Stop when that many variables cannot all be too big at once.
- For small or identical boxes, list the partitions from the largest part down.
- Check on a tiny case you can list.
Worked example
How many ordered triples of nonnegative integers satisfy with , , and ?
(A) (B) (C) (D) (E)
Solution. "Nonnegative" means zero or positive.
Step 1: ignore the limits. With stars and bars: solutions.
Step 2: subtract the too-big cases. If , write , with zero or positive. Then , which has solutions. The same holds for and for , so subtract .
Step 3: add back the overlaps. A solution with two variables at least was subtracted twice. If and , then and : one solution for each of the pairs, so add back . All three is impossible.
Step 4: combine. .
Check. The triples are the orderings of , , and : .
The answer is .
Pitfalls
- Using when the objects are different (the answer is ) or the boxes are identical (list the partitions).
- Mixing up (every part at least ) with (parts can be ): versus for .
- Forgetting to add back the double overlaps after subtracting the over-the-limit cases (here that gives , choice (A)).
- Miscounting bars: boxes need bars, not .
Traps that recur
- Distributing the five 2's without requiring every factor to exceed 1, which counts factors equal to 1 and overcounts badly. (2020 AMC 10B #25)
- Forgetting that dice cannot show 0 and counting solutions to a sum of 10 over 7 nonnegative variables, or worrying about the upper bound 6 when it cannot bind. (2018 AMC 10A #11)
- Dropping the constant 1 from the count (treating the exponents as summing to exactly N with no slack), which gives C(N-1, 3) and no matching choice. (2016 AMC 10A #20)
- Treating the six cookies as distinguishable and answering 3^6 = 729, choice (E). (2003 AMC 10A #21)
- 1.2018 AMC 10A #11
When fair standard -sided dice are thrown, the probability that the sum of the numbers on the top faces is can be written as where is a positive integer. What is ?
- A)
- B)
- C)
- D)
- E)
- 2.2016 AMC 10A #20
For some particular value of , when is expanded and like terms are combined, the resulting expression contains exactly terms that include all four variables and , each to some positive power. What is ?
- A)
- B)
- C)
- D)
- E)
- 3.2003 AMC 10A #21
Pat is to select six cookies from a tray containing only chocolate chip, oatmeal, and peanut butter cookies. There are at least six of each of these three kinds of cookies on the tray. How many different assortments of six cookies can be selected?
- A)
- B)
- C)
- D)
- E)
- 4.2001 AMC 10 #19
Pat wants to buy four donuts from an ample supply of three types of donuts: glazed, chocolate, and powdered. How many different selections are possible?
- A)
- B)
- C)
- D)
- E)
- 5.2020 AMC 10B #25
Let denote the number of ways of writing the positive integer as a product
where , the are integers strictly greater than , and the order in which the factors are listed matters (that is, two representations that differ only in the order of the factors are counted as distinct). For example, the number can be written as , , and , so . What is ?
- A)
- B)
- C)
- D)
- E)
Problems © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. The topic note, tags and key insights are original to this site.