Skip to content
Other

Combinations with Repetition Calculator

Enter the pool size (n) and the sample size (r) to find how many ways you can choose r items from n distinct types when the same type can be chosen more than once and order does not matter. The result comes from the stars-and-bars formula C(n+r-1, r). You also get the standard no-repetition count for comparison, the ratio between the two, and a full list of every combination when n and r are small enough.

Your details

The number of distinct item types to choose from. For example, 10 flavors of ice cream means n = 10.
How many items to select in each combination. Repetition is allowed, so r can exceed n.
Combinations with repetition
35

C(n+r-1, r) - how many ways to choose r items from n types, repeats allowed

Combinations without repetition10
Repetition multiplier3.5
Total sample combinations listed35
With repetition35
Without repetition10
0165330047
Sample size (r)
Number of combinations
Sample size (r)With repetitionWithout repetition
011
155
21510
33510
4705
51261
6210
7330
  • With repetition
  • Without repetition

35 combinations with repetition allowed

  • Selecting 3 items from 5 types with repetition gives 35 distinct combinations.
  • Without repetition the count drops to 10, so allowing repeats multiplies the possibilities by 3.50.

Next stepScroll down to the combination schedule to see every individual combination listed.

All Combinations with Repetition

#Combination (item numbers)
11, 1, 1
21, 1, 2
31, 1, 3
41, 1, 4
51, 1, 5
61, 2, 2
71, 2, 3
81, 2, 4
91, 2, 5
101, 3, 3
111, 3, 4
121, 3, 5

Each row is one unique combination. Item numbers 1 through 5 represent your 5 distinct types. Choosing the same number twice means that type was repeated.

Formula

C′(n,r)=C(n+r−1,r)=(n+r−1)!r! (n−1)!C'(n, r) = C(n+r-1, r) = \frac{(n+r-1)!}{r!\,(n-1)!}

Worked example

An ice-cream shop has 5 flavors (n=5) and you choose 3 scoops (r=3), repeats allowed. C(5+3-1, 3) = C(7, 3) = 7! / (3! x 4!) = 5040 / (6 x 24) = 35 distinct orders.

What are combinations with repetition?

A combination counts selections where order does not matter. Standard combinations require every item to be distinct. Combinations with repetition - also called multiset combinations - relax that rule and allow the same item type to be chosen more than once. If you are scooping three flavors of ice cream from a menu of five, you can pick chocolate twice and vanilla once. That selection is different from picking three distinct flavors. The formula that counts all such selections is C(n+r-1, r), where n is the number of distinct types and r is the number of items you choose.

The stars and bars formula explained

Imagine r stars (your chosen items) and n-1 bars (dividers between the n types). Every arrangement of those r stars and n-1 bars corresponds to exactly one way of distributing r items among n types. The total number of arrangements is C(r + n - 1, r) = (r+n-1)! / [r! x (n-1)!]. This is often called the stars-and-bars method and is one of the core techniques in combinatorics. For example, with 3 stars and 2 bars you can write ooo||, o|o|o, ||ooo, and so on - each arrangement is a unique multiset selection from 3 types.

Combinations with repetition vs. without repetition

Standard combinations without repetition use C(n, r) = n! / [r! x (n-r)!] and require r to be at most n. Combinations with repetition use C(n+r-1, r) and allow r to exceed n. When r is small relative to n, the two counts are close together. As r grows, the with-repetition count grows much faster because there are many more ways to pick items once repeats are allowed. The ratio output on this calculator shows the exact multiplier for your inputs.

When to use this formula

Use combinations with repetition whenever you are counting selections where the same type can appear multiple times and order does not matter. Common examples include: distributing identical objects into labeled bins, counting the number of multisets of a given size from a fixed alphabet, choosing toppings for a pizza when you can double or triple any topping, selecting playing card ranks for a hand when suits are ignored, or counting how many ways to spend a fixed number of tokens across several categories. If order does matter and repeats are allowed, use permutations with repetition instead (n^r).

Common combinations with repetition examples

Pool size nSample size rWith repetitionWithout repetitionRatio
32632.00x
421061.67x
5335103.50x
6356202.80x
10255451.22x
1032201201.83x
10520022527.94x
2623513251.08x
525347876125989601.34x

Quick-reference counts for typical values of n (pool size) and r (sample size). Results use C(n+r-1, r).

Frequently asked questions

What is the formula for combinations with repetition?

The formula is C'(n, r) = C(n+r-1, r) = (n+r-1)! / [r! x (n-1)!]. Here n is the number of distinct item types and r is the sample size. It is also written as the binomial coefficient C(n+r-1, r), meaning you choose r positions from n+r-1 total slots.

Can r be larger than n in combinations with repetition?

Yes. Because repeats are allowed, you can choose more items than there are types. For example, you can pick 5 scoops from 3 flavors (r=5 > n=3). The standard no-repetition formula breaks down in this case, but C(n+r-1, r) handles it correctly. In this example the answer is C(7, 5) = 21.

How does this differ from permutations with repetition?

Permutations with repetition count ordered sequences where repeats are allowed, and the count is n^r. Combinations with repetition count unordered selections where repeats are allowed, and the count is C(n+r-1, r). For n=3, r=2: permutations with repetition give 9 (AA, AB, AC, BA, BB, BC, CA, CB, CC), but combinations with repetition give only 6 (AA, AB, AC, BB, BC, CC) because BA counts as the same selection as AB.

What does the combination listing show?

When n is at most 20 and r is at most 20 and the total count does not exceed 5,000, this calculator lists every distinct combination. Each combination is shown as a sequence of item numbers (1 through n). A repeated number means that item type was chosen more than once.

What is the stars and bars method?

Stars and bars is a visual way to count combinations with repetition. Place r stars in a row representing r chosen items. Insert n-1 bars to divide the stars into n groups, one per item type. Every arrangement of r stars and n-1 bars is a unique selection. The number of such arrangements is C(r + n - 1, r), which is the same formula this calculator uses.

Why does the calculator show "ratio" as an output?

The ratio tells you how many times more combinations exist when repetition is allowed compared to when it is not. A ratio of 3.5 means there are 3.5 times as many selections possible with repetition. This is useful when deciding whether the stricter no-repetition model or the more flexible repetition model better matches your real-world problem.

Sources

Written by Grace Mbeki, MSc Data Scientist & Educator · Nairobi, Kenya

Turning everyday numbers into clear, actionable answers for the decisions that matter most.

Search 3,500+ calculators

Loading search…