SECTION 1
Historical Context & Motivation
The problem of counting selections from a collection of objects—where the same object may be chosen more than once—has roots stretching back centuries. Ancient Indian mathematicians encountered such questions in the context of prosody, where Pingala and later scholars studied the number of ways to arrange syllabic patterns of fixed total length drawn from a small alphabet. The essential question is deceptively simple: if you have n types of items and wish to select k items where repetitions are allowed and order does not matter, how many distinct selections exist?
This question arises naturally in resource allocation, distributing identical objects into labeled bins, and polynomial enumeration. Although the ordinary binomial coefficient C(n, k) counts selections without repetition, the multiset coefficient generalizes this idea by permitting each type to be chosen any number of times. Understanding the historical evolution of this concept reveals how combinatorics matured from ad hoc counting arguments into a rigorous algebraic framework.
c. 200 BCE • Indian Prosodic Counting
1713 • Ars Conjectandi
1756 • Euler's Partitions
1852 • Stars and Bars Formalized
20th C. • Modern Enumerative Combinatorics
The central gap that combinations with repetition address is this: classical combinations C(n, k) require that each element be selected at most once, which models sampling without replacement. But many real-world problems—choosing scoops of ice cream from n flavors, distributing k identical scholarships among n departments, or enumerating monomials of a given degree—demand a counting tool that allows repetition. The multiset coefficient provides exactly this.
SECTION 2
Core Principles & Definitions
Before diving into formulas, it is essential to anchor the concept in precise definitions. A multiset (sometimes called a bag) is a generalization of a set in which elements may appear more than once. The multiplicity of each element is recorded, but—crucially—the order of selection does not matter. When we speak of combinations with repetition, we are counting the number of distinct multisets of size k drawn from a universe of n types.
Selection with Replacement
Order Does Not Matter
Stars-and-Bars Bijection
Equivalent to Integer Solutions
KEY TAKEAWAY
SECTION 3
Visual Explanation — Stars and Bars
The stars-and-bars method provides a powerful visual and bijective approach to counting combinations with repetition. Suppose we want to choose k = 5 items from n = 3 types. We represent the chosen items as 5 stars (★) and separate the types using n − 1 = 2 bars (|). Each arrangement of these 7 symbols encodes a unique multiset. The diagram below illustrates several such arrangements and their corresponding multisets.
Each row in the diagram above represents a single binary string of length k + n − 1 = 7, composed of exactly 5 stars and 2 bars. The stars to the left of the first bar indicate how many items of Type A are chosen; stars between the two bars count Type B; and stars to the right of the second bar count Type C. Because every such binary string yields a distinct multiset and vice versa, the problem reduces to choosing which k of the k + n − 1 positions will hold stars. This is the stars-and-bars bijection, and it converts a seemingly complex multiset-counting problem into an ordinary combination.
SECTION 4
Mathematical Framework
The stars-and-bars argument leads directly to a closed-form expression for the number of combinations with repetition. We formalize this via the multiset coefficient, which counts the number of multisets of cardinality k from a set of n types.
MULTISET COEFFICIENT
n = number of distinct types available; k = number of items to select (with repetition allowed); n + k − 1 = total positions in the stars-and-bars string; the notation ((n choose k)) denotes the multiset coefficient, read as 'n multichoose k.'
To derive this, observe that each multiset of size k from n types corresponds to a non-negative integer solution of x₁ + x₂ + ⋯ + xₙ = k. We encode each solution as a binary string of k stars and n − 1 bars, yielding a string of total length k + n − 1. The number of such strings is C(k + n − 1, k), which equivalently equals C(k + n − 1, n − 1) by symmetry of the binomial coefficient.
EQUIVALENT FORMS
Choosing which positions are stars is equivalent to choosing which positions are bars. Both expressions count the same set of multisets.
GENERATING FUNCTION
The ordinary generating function for the multiset coefficients with n types is the n-th power of the geometric series 1/(1 − x). Each factor (1 + x + x² + ⋯) corresponds to one type contributing 0, 1, 2, … copies.
Connection to Negative Binomial Coefficients
SECTION 5
Taxonomy of Counting Problems
Combinations with repetition occupy one cell in a broader 2 × 2 taxonomy of counting problems defined by two binary choices: is order relevant, and is repetition allowed? Understanding where each counting formula lives in this taxonomy prevents one of the most common errors in combinatorics—applying the wrong formula. The diagram and table below classify the four fundamental counting paradigms and their formulas.
| Order? | Repetition? | Name | Formula | Example (n=5, k=3) |
|---|---|---|---|---|
| Yes | No | Permutation | P(n, k) = n!/(n−k)! | 60 |
| Yes | Yes | Perm. w/ Rep. | nᵏ | 125 |
| No | No | Combination | C(n, k) = n!/(k!(n−k)!) | 10 |
| No | Yes | Combination w/ Rep. | C(n+k−1, k) | 35 |
The four fundamental counting formulas with computed values for n = 5, k = 3.
Notice that for a fixed n and k, the combination with repetition count (35) exceeds the ordinary combination count (10) because repetition expands the pool of available selections. Conversely, it is smaller than the permutation with repetition count (125) because ignoring order collapses many arrangements into a single multiset. Keeping this ordering of magnitudes in mind—C(n, k) ≤ C(n + k − 1, k) ≤ nk—serves as a useful sanity check when solving problems.
SECTION 6
Worked Example
A coffee shop offers 4 varieties of muffin: blueberry, chocolate, cranberry, and lemon poppy seed. A customer wants to buy 6 muffins and may choose the same variety more than once. How many distinct selections are possible?
Selecting 6 Muffins from 4 Varieties
- 1
Step 1 — Identify the Counting Model
The customer cares only about how many of each variety they get, not the order in which the clerk bags them. Repetition is allowed (they may buy 6 blueberry if they wish). This matches the combination with repetition model with n = 4 types and k = 6 items.n = 4, k = 6 - 2
Step 2 — Write the Stars-and-Bars Setup
We need a string of 6 stars (one per muffin selected) and n − 1 = 3 bars (to separate 4 varieties). The total string length is 6 + 3 = 9. For example, ★★|★★★||★ encodes {2 blueberry, 3 chocolate, 0 cranberry, 1 lemon poppy seed}.String length = k + n − 1 = 9 - 3
Step 3 — Apply the Formula
The number of such strings is C(9, 6), since we choose 6 of the 9 positions for stars (or equivalently, 3 positions for bars). We compute:C(9, 6) = C(9, 3) - 4
Step 4 — Evaluate the Binomial Coefficient
C(9, 3) = 9! / (3! × 6!) = (9 × 8 × 7) / (3 × 2 × 1) = 504 / 6 = 84. Using the symmetry C(9, 6) = C(9, 3) simplifies the arithmetic, since 3 < 6.84 distinct selections - 5
Step 5 — Verify with a Sanity Check
As a sanity check, the ordinary combination C(4, 6) is undefined (you can't choose 6 distinct items from 4 without repetition), confirming that the classical combination formula does not apply here. Meanwhile, permutations with repetition would yield 4⁶ = 4096, which is much larger because it counts ordered sequences—far more than our unordered multisets. Our answer of 84 sits in a plausible range.✓ Answer is reasonable: C(4, 6) undefined < 84 < 4⁶ = 4096
SECTION 7
Strengths, Limitations & Common Pitfalls
The multiset coefficient formula is elegant and powerful, but its correct application hinges on verifying that the problem's assumptions genuinely match the model. The table below summarizes the strengths of the formula alongside its inherent limitations and the most frequent student errors.
| Strengths | Limitations / Pitfalls |
|---|---|
| Closed-form formula: C(n + k − 1, k) gives an exact count efficiently even for large n and k. | Assumes unlimited supply: if the number of copies of each type is bounded, a constrained version (inclusion–exclusion or generating functions) is required instead. |
| Bijective proof via stars-and-bars makes the formula intuitive and easy to remember. | Students often confuse n and k: n is the number of types (bins), not the total items selected. |
| Naturally extends to generating functions and polynomial coefficient extraction, unifying many counting problems. | Does not apply when items within a type are distinguishable—that scenario requires a different model (e.g., labeled distributions). |
| Equivalent to counting lattice paths and non-negative integer solutions, providing cross-topic connections. | Forgetting the '−1' in n − 1 bars is a common arithmetic error that produces an off-by-one mistake in the formula. |
Strengths and common pitfalls of the multiset coefficient formula.
DECISION CHECKLIST
SECTION 8
Connections to Advanced Theory
The multiset coefficient is not an isolated formula; it is a gateway to several advanced topics in algebra and combinatorics. Understanding these connections deepens your mathematical fluency and equips you to tackle more complex enumeration problems. The table below contrasts the introductory version of the concept with its more advanced generalizations.
| Introductory Concept | Advanced Generalization |
|---|---|
| C(n + k − 1, k) counts multisets of size k from n unlimited types. | Restricted compositions: when each type has a maximum count cᵢ, use inclusion–exclusion or the coefficient of xᵏ in ∏(1 + x + ⋯ + ). |
| Stars-and-bars encodes solutions to x₁ + ⋯ + xₙ = k with xᵢ ≥ 0. | For xᵢ ≥ aᵢ (positive lower bounds), substitute yᵢ = xᵢ − aᵢ to reduce to the standard form, then apply the multiset coefficient to the transformed equation. |
| Generating function 1/(1 − x)ⁿ enumerates multisets. | Pólya enumeration theory uses cycle index polynomials and Burnside's lemma to count multisets up to symmetry (e.g., necklaces of beads). |
| Multiset coefficient equals a single binomial coefficient. | The multinomial coefficient n!/(k₁!k₂!⋯kₘ!) generalizes to distributing distinguishable objects into groups, connecting to the multinomial theorem. |
How combinations with repetition connect to more advanced counting techniques.
In abstract algebra, the multiset coefficient appears as the dimension of the space of homogeneous polynomials of degree k in n variables: each monomial x₁a₁x₂a₂⋯xₙaₙ with a₁ + a₂ + ⋯ + aₙ = k corresponds to a multiset of exponent choices. This perspective links combinatorics to commutative algebra, algebraic geometry (Hilbert functions), and representation theory (symmetric tensors). If you continue into graduate-level combinatorics, you will encounter the theory of symmetric functions, where the complete homogeneous symmetric polynomial hₖ is precisely the generating function for multisets.
SECTION 9
Practice Problems
Question 1: CONCEPTUAL
Show answer
Question 2: BASIC CALCULATION
Show answer
Question 3: INTERMEDIATE
Show answer
Question 4: APPLIED
Show answer
Question 5: CRITICAL THINKING
Show answer
SUMMARY
Lesson Summary
Summary
Combinations with repetition count the number of multisets of size k drawn from n types, where order does not matter and each type may be selected any number of times. The stars-and-bars bijection reduces this to counting binary strings of k stars and n − 1 bars, yielding the multiset coefficient formula: C(n + k − 1, k). This formula is equivalently the number of non-negative integer solutions to x₁ + x₂ + ⋯ + xₙ = k.
Key applications include resource allocation, counting monomials in polynomial rings, and distributing identical objects into labeled bins. Remember the three prerequisites for applying the formula: selections must be unordered, types must have unlimited supply, and items of the same type must be indistinguishable. When lower bounds are imposed, a simple variable substitution reduces the constrained problem to the standard form. The generating function viewpoint—expanding 1/(1 − x)n—provides a unifying algebraic perspective that connects to symmetric functions and Pólya enumeration theory in more advanced courses.