Topics / Counting & Probability
Distributions & Stars and Bars
Distributing objects into bins, integer partitions, compositions
## What you need to know
- Stars and bars: nonnegative integer solutions of number ; positive solutions number .
- Distributing identical objects into distinct boxes is the same count; a lower bound is removed by substituting .
- Upper bounds () are handled by inclusion-exclusion over which variables exceed .
- Distinct objects into distinct boxes: , not stars and bars.
- Identical objects into identical boxes (partitions) have no formula; list them.
- Compositions of into positive parts, any number of parts: .
## 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: digit sums equal to , number of terms in an expansion, ways to pay a total with coins.
- Problems 18–24: a cap ("no child receives more than ") forcing inclusion-exclusion, or an identical-versus-distinct twist.
- Often the numerator or denominator of a probability.
## Standard approaches
1. Classify first (objects identical or distinct, boxes identical or distinct); only identical-into-distinct is stars and bars.
2. Shift variables to remove lower bounds, then apply .
3. For upper bounds, count all, subtract cases with one variable too big, add back cases with two.
4. For small or identical boxes, list partitions from the largest part downward.
5. Verify with a tiny case you can enumerate.
## Worked example
How many ordered triples of nonnegative integers satisfy with , , and ?
(A) (B) (C) (D) (E)
Solution. Without caps there are solutions. If , put ; then has solutions, and likewise for and : . If two variables are at least , they already sum to and the third is : solutions. All three is impossible. Inclusion-exclusion gives . Check: the valid triples are permutations of , , , that is . Answer .
## Pitfalls
- Using when the objects are distinct (should be ) or the boxes are identical.
- Mixing up (positive parts) with (nonnegative parts).
- Forgetting to add back the double overlaps after subtracting over-cap cases.
- Miscounting bars: boxes need bars.
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)
Problems, easiest first
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 ?
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 ?
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?
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?
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 …