Combinations with Repetition Calculator

Calculate multiset combinations C(n+r-1, r). Stars and bars visualization, full enumeration for small cases, distribution patterns, and reference tables.

About the Combinations with Repetition Calculator

Combinations with repetition (multiset coefficients) count the number of ways to choose r items from n types when each type can be selected multiple times and order doesn't matter. The formula is C(n+r−1, r) = (n+r−1)! / (r!(n−1)!), also written as ((n multichoose r)).

This is equivalent to the "stars and bars" problem: distributing r identical objects into n distinct bins. The calculator visualizes this interpretation, enumerates all combinations for small cases, and shows the distribution patterns of how items spread across types.

Common applications include selecting scoops of ice cream (same flavor allowed), distributing identical tasks among workers, counting non-negative integer solutions to equations, and polynomial coefficient counting. That makes the tool useful both for classroom combinatorics and for practical counting problems where repeats are allowed but order is irrelevant. It is also a quick way to connect an abstract formula to real allocation problems that would be tedious to count by hand.

Why Use This Combinations with Repetition Calculator?

Combinations with repetition are less intuitive than standard combinations but appear in many real problems. This calculator provides the stars-and-bars visualization, full enumeration for small cases, comparison with without-repetition counts, and a reference table for quick lookups. It is useful when you need to show not just the final count, but why repeated selections change the counting logic.

How to Use This Calculator

  1. Enter n (number of types or categories to choose from).
  2. Enter r (number of items to select, repetition allowed).
  3. Or click a preset for common examples.
  4. Review the count and the stars-and-bars representation.
  5. For small cases, examine all enumerated combinations.
  6. Check distribution patterns to see how items spread across types.
  7. Use the reference table for nearby values.

Formula

Combinations with Repetition: C(n+r−1, r) = (n+r−1)! / (r! × (n−1)!) Also called the multiset coefficient ((n multichoose r)). Equivalent to: - Number of ways to place r identical balls in n distinct bins - Number of non-negative integer solutions to x₁+x₂+...+xₙ = r - Coefficient count in (n+r−1)-choose-r lattice paths

Example Calculation

Result: C(7,3) = 35

Choosing 3 items from 5 types with repetition: C(5+3−1, 3) = C(7, 3) = 35. Without repetition it would be C(5,3) = 10, so repetition allows 3.5× more combinations. Example: choosing 3 scoops from 5 ice cream flavors.

Tips & Best Practices

Stars and Bars: A Powerful Counting Technique

The stars and bars (also called balls and urns) method transforms a distribution problem into a sequence-counting problem. To distribute r identical items among n groups, imagine r stars (★) and n−1 bars (|) arranged in a row. Each arrangement uniquely represents a distribution. The total is C(r+n−1, n−1) = C(n+r−1, r).

Connection to Integer Partitions

Combinations with repetition are closely related to weak compositions of integers. C(n+r−1, r) counts the number of ways to write r as an ordered sum of n non-negative integers. For unordered sums (integer partitions), the counting is more complex and doesn't have a simple closed-form formula.

Practical Applications Beyond Textbooks

In inventory management, C(n+r−1, r) counts the number of distinct orders of r items from n suppliers. In genetics, it counts genotype possibilities with multiple alleles. In finance, it counts the number of ways to allocate a fixed budget across n investment categories in fixed increments.

Frequently Asked Questions

What is the difference between combinations with and without repetition?

Without repetition, each item can be chosen at most once: C(n,r). With repetition, items can be reused: C(n+r−1,r). With repetition always gives at least as many combinations, and often many more.

What is the stars and bars method?

Arrange r stars (items) and n−1 bars (dividers) in a line. The stars between consecutive bars represent items assigned to that bin. The total arrangements are C(r+n−1, n−1) = C(n+r−1, r).

When do I use combinations with repetition?

When selecting from categories where repeats are allowed and order doesn't matter. Examples: choosing scoops of ice cream, distributing prizes, counting coin denominations totaling a value, polynomial term counting.

How fast does C(n+r−1, r) grow?

It grows polynomially in r for fixed n (like rⁿ⁻¹/(n−1)!) and polynomially in n for fixed r. It's much slower growth than exponential (nʳ) or factorial.

Can r be larger than n?

Yes! Unlike without-repetition combinations where r ≤ n, with repetition r can be any non-negative integer regardless of n. You can choose 100 scoops from 3 flavors.

How is this related to polynomial expansion?

The number of terms in the expansion of (x₁ + x₂ + ... + xₙ)ʳ equals C(n+r−1, r). Each term corresponds to selecting r variables (with repetition) to multiply.

Related Pages