Stars and Bars Calculator
Enter the items and groups to count the distributions.
Result
How to use
- Enter your values in the fields above.
- Press Calculate to see your result instantly.
- Use the Share button to copy a link to your result.
About this calculator
The stars and bars theorem, a classic result in combinatorics popularized by William Feller, counts the number of ways to partition n identical items among k distinct groups. With empty groups allowed, the count is the binomial coefficient C(n + k − 1, k − 1) — visualized as arranging n stars and k − 1 bars in a row; without empty groups permitted, it becomes C(n − 1, k − 1), since each group must first receive one item before the rest are distributed freely.
This calculator takes your item and group counts, applies the correct binomial coefficient for whichever variant you choose, and returns the number of distinct distributions. Combinatorics students, competitive programmers, and instructors teaching discrete mathematics use it to check homework and contest problems that reduce to "how many ways can identical objects be split among distinct bins" — a pattern that also underlies counting problems in probability, such as distributing indistinguishable balls into labeled urns.
Was this helpful?
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)