01 / 20

Combinations with
Repetition

Learn how to count selections when items can be chosen more than once. Master the stars and bars technique and the multiset coefficient formula.

Finite Mathematics

What Are Combinations with Repetition?

A combination with repetition (also called a multiset) is a way of choosing \( k \) items from \( n \) types where each type can be selected more than once, and the order does not matter.

Why Repetition Changes Everything

Without Repetition
Each item can be chosen at most once. Selecting {A, B, C} means A, B, and C are each used up.
With Repetition
Items can be chosen multiple times. Selecting {A, A, B} is perfectly valid: two copies of A plus one B.

The Stars and Bars Idea

Imagine choosing \( k = 3 \) scoops from \( n = 3 \) flavours (Vanilla, Chocolate, Strawberry). Represent each scoop as a star ★ and separate flavour bins with bars |.

Selection: {V, V, C} ★ ★ ★ (empty) Vanilla Choc Straw Selection: {V, C, S} ★ ★ ★ Vanilla Choc Straw Key Insight We have
\( k = 3 \) stars
and
\( n - 1 = 2 \) bars
Total symbols:
\( n + k - 1 = 5 \)

The Multiset Coefficient Formula

The number of ways to choose \( k \) items from \( n \) types with repetition allowed is:

This is equivalent to choosing which \( k \) of the \( n + k - 1 \) positions are stars (the remaining positions become bars).

Stars and Bars: Visualised

With \( n = 3 \) types and \( k = 3 \) items, we arrange \( 3 + 3 - 1 = 5 \) symbols total: choose 3 positions for stars.

5 positions: choose 3 for ★ 1 2 3 4 5 Example: positions 1, 2, 4 are ★ ★ ★ | ★ | Type 1: ★★ (2) Type 2: ★ (1) Type 3: (0)
Total arrangements: \( \binom{5}{3} = 10 \)

With vs Without Repetition

With Repetition Without Repetition
Order matters? No No
Repeat allowed? Yes No
Formula \( \binom{n+k-1}{k} \) \( \binom{n}{k} \)
\( n = 5,\; k = 3 \) \( \binom{7}{3} = 35 \) \( \binom{5}{3} = 10 \)
Constraint \( k \) can exceed \( n \) \( k \leq n \)

Step-by-Step Method

1
Identify \( n \): How many types (categories) are available?
2
Identify \( k \): How many items are you choosing in total?
3
Confirm repetition and order: Can the same type be chosen again? Does the order of selection not matter?
4
Apply the formula: Compute \( \binom{n + k - 1}{k} \).
5
Simplify: Evaluate the factorial expression or use Pascal's Triangle for small values.

Example 1: Doughnut Shop

A doughnut shop offers 4 types of doughnuts. You want to buy a box of 6 doughnuts. Repetition is allowed. How many different boxes are possible?

1
\( n = 4 \) types, \( k = 6 \) doughnuts
2
Formula: \( \displaystyle\binom{n+k-1}{k} = \binom{4+6-1}{6} = \binom{9}{6} \)
3
Compute: \( \displaystyle\binom{9}{6} = \binom{9}{3} = \frac{9 \times 8 \times 7}{3 \times 2 \times 1} = \frac{504}{6} = 84 \)

Example 2: Distributing Coins

Distribute 10 identical coins among 3 children. Each child can receive any number of coins (including zero). How many distributions are possible?

1
\( n = 3 \), \( k = 10 \)
2
\( \displaystyle\binom{3+10-1}{10} = \binom{12}{10} = \binom{12}{2} = \frac{12 \times 11}{2} = 66 \)

Example 3: Equation Solutions

How many non-negative integer solutions does the equation \( x_1 + x_2 + x_3 + x_4 = 7 \) have?

1
\( n = 4 \) variables (types), \( k = 7 \) (total sum)
2
\( \displaystyle\binom{4+7-1}{7} = \binom{10}{7} = \binom{10}{3} \)
3
\( \displaystyle\frac{10 \times 9 \times 8}{3 \times 2 \times 1} = \frac{720}{6} = 120 \)

Application: Multisets in Practice

Inventory
Ordering items from a catalogue where each product can be ordered multiple times.
Resource Allocation
Distributing identical resources (budget dollars, tasks) to departments.
Polynomial Expansion
Counting monomials of a given degree in \( n \) variables.

Note: \( k \) Can Exceed \( n \)

Unlike ordinary combinations where \( k \leq n \), combinations with repetition work even when you choose more items than there are types.

Without Repetition
\( \binom{3}{5} \) is undefined (cannot choose 5 from 3 without repeating).
With Repetition
\( \binom{3+5-1}{5} = \binom{7}{5} = 21 \). Perfectly valid!

Common Mistakes to Avoid

✕ Swapping \( n \) and \( k \)
Using \( \binom{k + n - 1}{n} \) instead of \( \binom{n + k - 1}{k} \). The correct identity is \( \binom{n+k-1}{k} = \binom{n+k-1}{n-1} \), not \( \binom{n+k-1}{n} \).
✕ Using the wrong formula
Applying \( \binom{n}{k} \) (no repetition) when the problem says items can repeat. Always check: can you pick the same type twice?
✕ Forgetting the \( -1 \)
Writing \( \binom{n + k}{k} \) instead of \( \binom{n + k - 1}{k} \). The bars are \( n - 1 \), not \( n \), because \( n \) bins need only \( n - 1 \) dividers.

Counting Cheat Sheet

Order Matters Order Doesn't Matter
No Repetition Permutation: \( \frac{n!}{(n-k)!} \) Combination: \( \binom{n}{k} \)
Repetition Allowed \( n^k \) \( \binom{n+k-1}{k} \)

Question 1 of 5

A candy store has 6 types of candy. You buy 4 pieces, and repetition is allowed. How many selections are possible?

Question 2 of 5

How many non-negative integer solutions does
\( x_1 + x_2 + x_3 = 5 \) have?

Question 3 of 5

In the stars and bars model for choosing \( k \) items from \( n \) types, how many bars are needed?

Question 4 of 5

A pizza shop offers 8 toppings. You order a pizza with 3 toppings (repetition allowed). How many different pizzas are possible?

Question 5 of 5

You have 2 types of fruit (apples and oranges) and want to choose 5 pieces. How many multisets are possible?