Combinations with Replacement Calculator

Combinations with Replacement Calculator | CR(n,r) Formula
Discrete Mathematics Tool

Combinations with Replacement Calculator

Find CR(n,r) instantly. Enter the population size n and sample size r to count multiset selections where repetition is allowed and order does not matter.

CR(n, r) = (n + r − 1)! ÷ [ r! × (n − 1)! ]
CR(n, r) Result
Notation
Step-by-step breakdown
Step Value

CR(n,r) Quick Reference Table

The combinations with replacement reference table below lists common CR(n,r) values for n from 1 to 6 and r from 0 to 5. Use it to cross-check your result or spot patterns.

n \ r r = 0 r = 1 r = 2 r = 3 r = 4 r = 5
n = 1111111
n = 2123456
n = 3136101521
n = 41410203556
n = 515153570126
n = 6162156126252

What Is Combinations with Replacement?

Combinations with replacement counts the number of ways to select r items from a set of n distinct types when the same type can appear more than once and order does not matter. It is also called a multiset coefficient or multichoose.

The key difference from standard combinations is that you are drawing from the full set each time. If you choose an apple from a basket of fruit, it goes back before the next draw, so you could choose apple again.

Standard Combination C(n,r)

Choose r from n, no repeats, order does not matter. Each item can only appear once in a selection.

Combination with Replacement CR(n,r)

Choose r from n, repeats allowed, order does not matter. An item can be selected multiple times in one set.

Permutation P(n,r)

Choose r from n, no repeats, order matters. Different arrangements of the same items count separately.

Permutation with Replacement n^r

Choose r from n, repeats allowed, order matters. Each slot independently picks from all n types.

How to Use This Calculator

This combinations with replacement calculator requires just two inputs to produce a complete result with a step-by-step factorial breakdown.

  • Enter n, the total number of distinct object types in your set.
  • Enter r, the number of items you want to select (r can exceed n).
  • Press Calculate CR(n, r) or hit Enter to compute.
  • Read the result and review each factorial step in the table below.
  • Press Clear to reset and try a new calculation.

Worked Example

A pizza shop offers 5 toppings and you choose 3 toppings where repeats are allowed. Order does not matter, so extra cheese counted once is the same as extra cheese counted last.

n = 5 toppings, r = 3 selections
CR(5,3) = (5 + 3 − 1)! ÷ (3! × 4!) = 7! ÷ (6 × 24) = 5040 ÷ 144 = 35

There are 35 distinct topping combinations when repeats are allowed.

Combinations with Replacement Formula

The combinations with replacement formula is derived from the standard binomial coefficient by substituting n + r − 1 for the upper parameter.

CR(n, r) = C(n + r − 1, r) = (n + r − 1)! ÷ [ r! × (n − 1)! ]

Why This Formula Works

Imagine placing r identical balls into n labeled boxes. Every such arrangement maps one-to-one onto a multiset of size r from n types. The number of ways to do this is equivalent to choosing r positions from n + r − 1 total slots, which is the standard formula above.

Special Cases

  • When r = 0, CR(n,0) = 1 for any n. There is exactly one empty selection.
  • When n = 1, CR(1,r) = 1 for any r. Only one type exists so all r items are identical.
  • When n = 0 and r = 0, CR(0,0) = 1 by convention.
  • When n = 0 and r is greater than 0, CR(0,r) = 0. No objects means no selection.

Relationship to Pascal Triangle

Because CR(n,r) = C(n+r-1, r), every value in the combinations with replacement table appears somewhere in Pascal’s Triangle at row n+r-1 and column r. This connection provides a fast manual check for small values.

Real-World Uses of CR(n,r)

Combinations with replacement appears across many fields wherever repeated selection from a fixed set of options must be counted without regard to order.

Food and Consumer Choices

Choosing r scoops of ice cream from n flavors, selecting r toppings from n menu items, or filling r slots in a gift box from n product types. All involve multiset counting.

Probability and Statistics

Sampling with replacement from a finite population, computing multinomial coefficients, or setting up Bayesian update tables where category counts can repeat across draws.

Computer Science

Counting the number of non-decreasing sequences of length r over an alphabet of size n, allocating identical tokens across categories, and analyzing hash collision probabilities in data structures.

Chemistry and Physics

Distributing r indistinguishable particles across n energy states (Bose-Einstein statistics), counting the number of monomers in polymer chains, and enumerating molecular isomers.

Game Design

Computing hand sizes from a deck where cards can repeat, counting possible item loadouts when duplicates are allowed, or enumerating tile combinations in board games.

Frequently Asked Questions

  • Combinations with replacement is a counting method that finds the number of ways to choose r items from a set of n distinct objects when order does not matter and each object can be chosen more than once. It is also called a multiset or multichoose.

  • The formula for combinations with replacement is CR(n,r) = (n + r − 1)! divided by (r! times (n − 1)!). This is equivalent to C(n+r-1, r), the standard binomial coefficient applied to n+r-1 and r.

  • C(n,r) counts combinations without replacement, meaning each item can only be chosen once. CR(n,r) counts combinations with replacement, meaning items can repeat. CR(n,r) always produces a result greater than or equal to C(n,r) for the same n and r values.

  • In the combinations with replacement formula, n is the total number of distinct objects or types to choose from (the population size), and r is the number of items you select (the sample size or subset size). Both n and r must be non-negative integers.

  • Yes. Because replacements are allowed, r can be larger than n. For example, if n = 3 flavors of ice cream and r = 5 scoops, you can still compute CR(3,5) = 21 valid combinations even though you are choosing more scoops than there are flavors.

  • Suppose a candy shop has 4 types of sweets (n = 4) and you pick 3 pieces (r = 3), allowing duplicates. The number of distinct selections is CR(4,3) = (4+3-1)! divided by (3! times 3!) = 6! divided by (6 times 6) = 720 divided by 36 = 20 different combinations.

  • Permutations with replacement count ordered arrangements where repetition is allowed, giving n^r outcomes. Combinations with replacement count unordered selections where repetition is allowed, giving CR(n,r) outcomes. Combinations always produce fewer results because different orderings of the same items are treated as one selection.

  • When r = 0, there is exactly 1 combination (the empty selection), so CR(n,0) = 1 for any n. When n = 0 and r = 0, CR(0,0) = 1 by convention. When n = 0 and r is greater than 0, CR(0,r) = 0 because there are no objects to choose from.