Stars and bars is a counting method for distributing identical objects into distinct boxes. It helps students count solutions to equations without listing every possibility. This cheat sheet is useful for combinations problems, integer solutions, and probability questions involving repeated choices.
It gives quick formulas and decision rules for common cases in grades 11-12.
The core idea is to represent objects as stars and dividers between groups as bars. The number of nonnegative integer solutions to is . For positive integer solutions, first give each variable , then count the remaining objects.
Problems with upper bounds often need subtraction, cases, or inclusion-exclusion.
Key Facts
- The number of nonnegative integer solutions to is .
- The number of positive integer solutions to is when .
- Stars and bars counts distributions of identical objects into distinct boxes using stars and bars.
- The binomial coefficient formula is .
- If each variable must satisfy , substitute so that .
- If a variable has an upper bound such as , count all solutions and subtract the solutions with .
- The number of ways to choose items from types with repetition allowed is .
- Stars and bars does not apply directly when the objects are distinct or when the boxes are identical.
Vocabulary
- Stars and bars
- A counting method that uses stars for identical objects and bars for dividers between distinct groups.
- Nonnegative integer solution
- A solution in which every variable is an integer greater than or equal to .
- Positive integer solution
- A solution in which every variable is an integer greater than or equal to .
- Binomial coefficient
- The value , which counts the number of ways to choose items from items.
- Upper bound
- A maximum allowed value for a variable, such as .
- Inclusion-exclusion
- A counting strategy that subtracts forbidden cases and adds back cases that were subtracted more than once.
Common Mistakes to Avoid
- Using for positive solutions is wrong because that formula allows variables to equal . For positive solutions, use .
- Treating distinct objects as identical is wrong because stars and bars assumes the objects being distributed are identical. If the objects are distinct, use a different counting method.
- Forgetting that the boxes are distinct is wrong because stars and bars counts different assignments to labeled categories. Swapping values between two named variables usually creates a different solution.
- Ignoring upper bounds is wrong because the basic formula only handles lower bounds. When restrictions like appear, subtract invalid cases or use inclusion-exclusion.
- Choosing the wrong number of bars is wrong because groups require exactly dividers. Using bars overcounts the number of groups.
Practice Questions
- 1 How many nonnegative integer solutions are there to ?
- 2 How many positive integer solutions are there to ?
- 3 How many ways can identical pencils be distributed among students if each student receives at most pencils?
- 4 Explain why stars and bars can count the number of ways to buy donuts from flavors, but cannot directly count the number of ways to assign different books to students.