Combinations with Replacement Calculator counts selections of r items from n available options when repeats are allowed and order does not matter. The formula it applies is C(n + r − 1, r), commonly called stars and bars, and the tool shows the shifted combination alongside the final count.
Count selections that allow repeats
Ordinary combinations forbid picking the same item twice; combinations with replacement lift that restriction. Choosing 3 scoops of ice cream from 5 available flavors, where any flavor can repeat, is a combinations-with-replacement problem, not a plain combinations problem, because a customer can order three scoops of the same flavor.
The count is C(5 + 3 − 1, 3), which is C(7, 3), equal to 35 distinct orders.
Understand the stars and bars method
The stars and bars method converts a with-replacement selection into an ordinary combination by inserting n − 1 dividers among r selected items. Picture r stars representing the chosen items and n − 1 bars separating them into n bins, one bin per option.
Arranging r stars and n − 1 bars in a row has C(r + n − 1, r) total arrangements, since choosing which of the r + n − 1 positions hold stars determines the whole layout.
Work through the flavor example step by step
With n = 5 flavors and r = 3 scoops, the shifted combination is C(5 + 3 − 1, 3) = C(7, 3). Expand C(7, 3) as 7! / (3! × 4!), which is (7 × 6 × 5) / (3 × 2 × 1), equal to 210 / 6, or 35.
Combinations with Replacement Calculator prints this exact expansion, so the shift from n and r to the working combination C(7, 3) is never a hidden step.
Compare with ordinary combinations
Ordinary combinations without replacement for the same n = 5 and r = 3 would be C(5, 3), equal to 10, since each flavor can only be picked once.
The with-replacement count of 35 is always at least as large as the without-replacement count for the same n and r, because allowing repeats only adds more valid selections, never removes any.
Work through a larger selection example
Choosing 4 toppings from 6 available options, where the same topping can be selected more than once and order does not matter, uses n = 6 and r = 4: C(6 + 4 − 1, 4) = C(9, 4).
Expand C(9, 4) as 9! / (4! × 5!), which is (9 × 8 × 7 × 6) / (4 × 3 × 2 × 1), equal to 3024 / 24, or 126. Combinations with Replacement Calculator shows this same shift-and-expand sequence for any n and r entered.
Recognize with-replacement language in a word problem
Word problems that allow repeats typically use phrases like "with repetition," "may repeat," "with replacement," or describe a scenario like ordering food where the same item can be chosen more than once.
Spotting this language before choosing a formula avoids reaching for the plain combination formula by default, since the plain formula silently assumes every item can be picked at most once.
Avoid this common mistake
The most common error applies the plain combination formula C(n, r) to a with-replacement problem, undercounting the true number of selections.
Another frequent mistake shifts n and r the wrong way, computing C(n + r − 1, n) instead of C(n + r − 1, r); both expressions are numerically equal by the symmetry of combinations, so this particular slip happens to still work, but confusing which value goes in the top position (r or n − 1) does not.
Frequently asked questions
What is the formula for combinations with replacement?
The formula for combinations with replacement is C(n + r − 1, r), where n is the number of available options and r is the number of items selected, with repeats allowed and order not mattering.
How many ways can you choose 3 scoops from 5 flavors with repeats allowed?
Choosing 3 scoops from 5 flavors with repeats allowed gives C(5 + 3 − 1, 3) = C(7, 3), which equals 35 distinct combinations.
What is the difference between combinations with and without replacement?
Combinations without replacement forbid selecting the same item twice and use C(n, r), while combinations with replacement allow repeats and use the shifted formula C(n + r − 1, r), which always returns a result at least as large.
What is the stars and bars method?
The stars and bars method models a with-replacement selection as r stars split into n groups by n − 1 bars, converting the counting problem into an ordinary combination C(n + r − 1, r) of star-and-bar positions.
Does order matter in combinations with replacement?
Order does not matter in combinations with replacement; selecting 2 apples and 1 banana counts as one outcome regardless of the order the items were chosen in. When order does matter and repeats are allowed, the count instead uses n raised to the power r.
Can r be larger than n in combinations with replacement?
R can be larger than n in combinations with replacement, unlike ordinary combinations, because repeats make it possible to select more items than there are distinct options. Choosing 10 scoops from 3 flavors is valid and computes as C(3 + 10 − 1, 10) = C(12, 10) = 66.
How many ways can you choose 4 toppings from 6 with repeats allowed?
Choosing 4 toppings from 6 with repeats allowed gives C(6 + 4 − 1, 4) = C(9, 4), which equals 126 distinct combinations.
What phrases in a word problem signal combinations with replacement?
Phrases like "may repeat," "with replacement," "repetition allowed," or a scenario describing selecting the same option multiple times, such as ordering multiple scoops of the same ice cream flavor, all signal that combinations with replacement, not the plain combination formula, is needed.
Summary
Combinations with Replacement Calculator applies C(n + r − 1, r) to count selections that allow repeated items when order does not matter, using the stars and bars method to justify the shifted formula.
Enter the number of options n and the selection size r to get the exact count, with the shift to C(n + r − 1, r) and its factorial expansion both shown in the work panel.