Combinations with Repetition Calculator
Count combinations when repeats are allowed.
Result
How it is calculated
This counts the ways to choose r items from n types when an item may be picked more than once and the order of picking does not matter: C(n + r − 1, r) = (n + r − 1)! / (r! × (n − 1)!). It is the classic "stars and bars" count. Both inputs are rounded to whole numbers; n must be at least 1 and r at least 0 (choosing none gives 1 way); if the smaller of r and n − 1 is above 1,000,000 the tool returns no result. The tool multiplies and divides step by step instead of using full factorials, which keeps larger inputs workable, but very large results lose exact precision because they are held as decimal numbers.
Worked example
An ice cream shop has n = 5 flavours and you pick r = 3 scoops, repeats allowed, order ignored. Substitute: C(5 + 3 − 1, 3) = C(7, 3). Then 7! / (3! × 4!) = (7 × 6 × 5) / (3 × 2 × 1) = 210 / 6 = 35. So there are 35 different combinations of three scoops.
Common mistakes
- Using the ordinary combinations formula C(n, r), which forbids repeats. Here C(5, 3) would give 10, not 35.
- Using it when order matters. A sequence like vanilla then mint differs from mint then vanilla, and that needs nr instead.
- Swapping n and r. n is the number of types available, r is how many you pick.
- Entering the total number of physical items instead of the number of distinct types.
- Using it when each type has a limited stock; the formula assumes unlimited copies of every type.
About this calculator
This calculator counts combinations with repetition (also called multiset coefficients) — the number of ways to choose r items from n types when repeats are allowed and order doesn't matter — using the formula C(n+r−1, r) = (n+r−1)! / (r!·(n−1)!). The formula comes from the “stars and bars” technique: representing each selection as a row of r stars split into n groups by n−1 bars, which turns the counting problem into an ordinary combination C(n+r−1, r).
Students and instructors in combinatorics and discrete math courses use it to work through classic examples like choosing r scoops from n ice cream flavors with repeats allowed, or distributing identical objects into distinguishable bins; computer scientists use the same math to count multisets and evaluate generating functions; and statisticians use it when analyzing sampling schemes done with replacement.
Was this helpful?
You can pick up to 3 reactions.
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
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Dice make a good test case. Three six-sided dice give 216 ordered rolls, but if you only care which faces appear and not which die shows which, there are C(6+3-1, 3) = 56 distinct outcomes: enter 6 for n and 3 for r. The same idea counts ways to hand identical items to different people. Remember that very large results are shown approximately, with trailing zeros. What are you counting?