Combination with Repetition Calculator

Count ways to choose k items from n types when each type can be chosen more than once.

Math and PercentUpdated 2026-11-192 min read
Combination with Repetition Calculator
How many different kinds of item are available.
How many items are chosen, with repetition allowed.
Number of combinations
...
Binomial form...
Types used...
Items chosen...

What it does

A combination with repetition counts how many ways you can choose k items from n types when each type may be chosen repeatedly. Order does not matter, only how many of each type you take.

This tool applies the stars and bars formula C(n plus k minus 1, k). The page opens with five donut varieties and a order of eight donuts, giving 495 possible orders.

The name comes from representing the choice as a row of k stars separated by n minus one bars. Choosing where the stars go among the total positions determines how many items of each type are taken.

The same formula counts the nonnegative integer solutions of x1 plus x2 and so on up to xn equals k, and the number of ways to place k identical objects into n labelled boxes.

Without repetition the answer would be C(n, k), which is smaller. The repetition version is sometimes called a multiset coefficient.

How to use

  1. Enter the number of distinct types available.
  2. Enter how many items are chosen.
  3. Read the number of combinations as the main result.
  4. Check the binomial form to see the formula applied.
  5. Try n = 3 and k = 2 to see six possibilities.
  6. Set k to zero to confirm there is exactly one empty choice.

Formula

Number of combinations = C(n + k - 1, k) = C(n + k - 1, n - 1)
n
Number of distinct types available.
k
Number of items chosen, with repetition allowed.
C
The ordinary binomial coefficient.

Represent the choice as k stars and n minus one bars, for a total of n plus k minus one positions. Choosing which k positions hold stars uniquely determines the counts of each type. This establishes the bijection behind the formula.

Worked example

Example: eight donuts from five varieties

The page opens with n = 5 types and k = 8 chosen items.

  1. Add n plus k minus 1, which is 5 plus 8 minus 1, giving 12.
  2. Choose k positions, so the expression is C(12, 8), equivalently C(12, 4).
  3. Evaluate C(12, 4) as 12 times 11 times 10 times 9 divided by 24.
  4. That product is 11,880 divided by 24, which is 495.
  5. The tool reports combinations 495 and formula C(12, 4).
  6. Each of the 495 outcomes is a different multiset of eight donuts.

Reference table

Combination with repetition examples
Types nChosen kBinomial formCombinations
58C(12, 4)495
32C(4, 2)6

Limits

  • Types must be whole numbers from 1 to 100.
  • Chosen items must be whole numbers from 0 to 100.
  • The sum of types and chosen items is limited to 200.
  • Items of the same type are treated as identical.

Common mistakes

  • Using C(n, k), which forbids repetition.
  • Adding one instead of subtracting one in n plus k minus 1.
  • Confusing types with the number of items chosen.
  • Counting order as significant when it should not be.
  • Forgetting that k = 0 gives one valid empty selection.

Try it yourself

Quick checks. Answers sit tucked under each question.

Three types, choose two with repetition. How many?

6, from C(4, 2).

Five varieties, eight donuts. How many orders?

495, from C(12, 4).

What equation has the same count?

The nonnegative integer solutions of x1 plus x2 up to xn equal k.

Questions

What does repetition mean here?

The same type may be chosen more than once.

What is the formula?

C(n plus k minus 1, k).

Why stars and bars?

Stars represent chosen items and bars separate the types, giving a bijection with the selections.

Does order matter?

No. Only the count of each type matters.

How is this different from permutations with repetition?

Permutations count order, while combinations do not.

What if each type can be chosen at most once?

Then the answer is the ordinary combination C(n, k).

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.