Counting · Definition
Combinations with repetition
Before you start you need to know
It answers how many ways there are to choose when objects of the same type are indistinguishable and several may be alike.
Definition
A combination with repetition of size \(k\) from \(n\) types of object is an unordered selection of \(k\) objects in which each type may be chosen several times.
The number of such selections is \(\binom{n+k-1}{k}\). To see it, represent each selection with \(k\) stars and \(n-1\) bars separating the types. For example, with 3 types and 5 objects, \(\star\star|\star|\star\star\) means 2 of the first, 1 of the second and 2 of the third. Each selection is a row of \(k+n-1\) symbols in which the \(k\) star positions are chosen, which gives \(\binom{n+k-1}{k}\).
The same count solves equations: the nonnegative integer solutions of \(x_1+\dots+x_n=k\) are the selections of \(k\) objects from \(n\) types, where \(x_i\) counts how many of type \(i\) there are. With lower bounds, subtract first: for \(x_i\ge 1\) substitute \(y_i=x_i-1\), leaving \(k-n\) units to distribute. If the condition is an inequality \(\le\), add a slack variable.
It helps to compare with the other counts: ordered with repetition gives \(n^k\); ordered without repetition, \(n!/(n-k)!\); unordered without repetition, \(\binom{n}{k}\); and unordered with repetition, \(\binom{n+k-1}{k}\). Typical mistake: using \(\binom{n}{k}\) when elements may repeat, or \(n^k\) when order does not matter.
Think about it
Why is \(\binom{n+k-1}{k}=\binom{n+k-1}{n-1}\)?
It is the symmetry of the binomial coefficient: one may choose the positions of the \(k\) stars or those of the \(n-1\) bars.
How many selections of 2 objects are there if there is only 1 type?
\(\binom{1+2-1}{2}=1\): that type can only be taken twice.
Exercises 10
- An ice cream shop has 3 flavors. In how many ways can 5 scoops be ordered, repeating flavors if desired and ignoring order?
- 3 donuts are chosen from 5 available types, with repetition and without order. How many selections are there?
- How many nonnegative integer solutions does \(x_1+x_2+x_3=7\) have?
- How many positive integer solutions does \(x_1+x_2+x_3=7\) have?
- 6 objects are chosen from 4 types, with repetition and without order. How many selections are there?
- 2 items are chosen from 4 types, ignoring order. How many more selections are there if repetition is allowed than if it is not?
- How many distinct monomials of degree 3 are there in the variables \(x,y,z\)?
- In how many ways can 10 identical marbles be distributed into 4 distinct boxes, allowing empty boxes?
- How many nonnegative integer solutions does \(x_1+x_2+x_3+x_4\le 5\) have?
- How many integer solutions does \(x_1+x_2+x_3+x_4=9\) have with each \(x_i\ge 1\)?
References
- Kenneth H. Rosen, Discrete Mathematics and Its Applications, 8th edition, McGraw-Hill, 2019. §6.5
- Susanna S. Epp, Discrete Mathematics with Applications, 5th edition, Cengage, 2019. §9.6
- Ralph P. Grimaldi, Discrete and Combinatorial Mathematics: An Applied Introduction, 5th edition, Pearson, 2003. §1.4