Combinations With Repetition Calculator

Written by Thierno Sadou Diallo, formula verified per our methodology • Last checked on 9/10/2026

The number of combinations with repetition is calculated with C(n+r−1, r) = (n+r−1)! ÷ (r! × (n−1)!), where n is the number of available types and r the number of choices made. For 3 ice cream flavors and 2 scoops chosen (the same flavor can be repeated), there are exactly 6 possible combinations.

Explanation

This calculator directly complements our combinations and permutations calculator, which handles the case WITHOUT repetition (each element can be chosen only once, like drawing distinct cards from a deck). Here, by contrast, the same type can be chosen several times: it is exactly the situation of choosing r scoops of ice cream from n available flavors, where nothing prevents taking two scoops of the same flavor. This difference completely changes the count: with 3 flavors and 2 scoops, there are 6 possible combinations with repetition (including the three "doubles": two scoops of the same flavor), versus only 3 without repetition (no double allowed). The formula C(n+r−1, r) may seem surprising at first, but it is explained by a classic combinatorial argument called "stars and bars": choosing r elements with repetition from n types amounts exactly to distributing r stars (the choices) among n compartments (the types) separated by (n−1) bars, that is, to choosing the position of r stars among (n+r−1) symbols in total — hence the formula. This kind of counting arises in many concrete situations beyond playful examples: distributing identical resources among several categories, or counting the number of ways to form a multiset from a given set of types — a count that often serves as a first step before applying our simple probability calculator, once the total number of possible cases is thus established.

Example: 3 ice cream flavors, 2 scoops chosen

Inputs

Number of types (n): 3. Number of choices (r): 2.

Calculation

C(3+2−1, 2) = C(4, 2) = 4! ÷ (2! × 2!) = 24 ÷ 4 = 6.

Result

There are exactly 6 ways to choose 2 scoops of ice cream from 3 flavors, with repetition allowed.

Frequently asked questions

What is the difference from combinations without repetition?

In combinations without repetition (our combinations and permutations calculator), each element can be chosen only once — like drawing distinct cards from a deck. With repetition, the same element can be chosen several times, which always increases the total number of possible combinations, since all combinations without repetition remain valid, plus those that repeat at least one element.

Why does the formula use (n+r−1) rather than n directly?

Because the formula rests on an equivalent combinatorial argument (the "stars and bars" method): distributing r choices among n types amounts to positioning r symbols among (n+r−1) possible slots, once the (n−1) separators between types are accounted for. This mathematical detour reduces a repetition problem to a classic combination problem, already well known.

What happens if r is 0?

Choosing 0 elements leaves only one possibility (choosing nothing at all), whatever the number of available types n — a result the formula recovers automatically, since C(n−1, 0) is always 1 for any n greater than or equal to 1.

Related resources

Similar calculators