You are on page 1of 6

Combinations with repetitions allowed

Red, green and blue cubes are given. There are at least five cubes of each of the above colors. In how many ways can a selection of five cubes be made, such that selecting zero or more cubes of the same color is allowed? This is the problem of combinations with repetitions allowed.

There are n distinct types of objects. In how many ways can r objects be selected, such that each object is of one of the above n types, and zero or more objects of each of the above types may be selected? Solution: Write down a line of n-1 bars. (For example if n=3, the line will be: | | ). Those bars create n spaces from left to right: the space to the left of the leftmost bar, followed by the space between the first and the second bar, etc., and finally the space to the right of the rightmost bar.

Then write zero or more stars in each space, such that the total number of stars is r, Thus creating a row of n-1 bars and r stars. Each combination as described above can be uniquely represented by such a row: Number the n spaces 1,, n from left to right. Then the number of stars in the jth space represents the number of objects of type j selected. Example: n=3, r=5, | | 1 object of type 1, 1 of type 2, 3 of type 3 | | zero objects of type 1, 1 object of type 2, 4 objects of type 3.

So the number of combinations described above is equal to the number of rows of n-1 bars and r stars. Such a row has n+r-1 characters, and is specified by selecting the locations of the r stars out of the n+r-1 locations. Therefore, the number of such rows is C(n+r-1,r), and this is also the number of combinations with repetitions allowed. In the above problem about red, green, and blue cubes, n=3 and r=5. The solution is C(n+r-1,r)=C(7,5)=21.

The problem of combinations with repetitions allowed with given n and r is equivalent to the following problem: How many solutions are there to the equation x1+ + xn = r such that each xi is a non negative integer? xi represents the number of objects of type i selected.

Example: How many solutions does the equation x1+x2+x3 = 5 have such that x1, x2, x3 are non negative integers. Solution: Here n=3 and r=5, so the answer is C(n+r-1,r)=C(7,5)=21. Example: How many solutions does the equation x1+x2+x3 = 8 have such that x1, x2, x3 are integers, x11, x2 0, x3 2 ? Solution: Use the above correspondence between solutions of the equation and selecting r objects given n types of objects. Since 3 objects (one of type 1 and two of type 3 were already selected, 5 more have to be selected. So r=5, and the answer is C(n+r-1,r)=C(7,5)=21.

You might also like