# How many ways are there to select five unordered elements from a set with three elements when repetition is allowed?

Am I doing this correctly?

$C(r+n-1,n-1) = C(5+3-1,2) = \frac{7\times6}{1\times2} = 21$

Thanks!

-
Yes.${}{}{}{}{}{}{}{}$ –  André Nicolas Mar 2 '13 at 22:58

## 1 Answer

When dealing with combinations (order doesn't matter) with repetition, you use this formula (where n = things to choose from and r = number of choices):

$\frac{(n+r-1)!}{r!(n-1)!}$

In your example problem you would then have n = 3, r = 5:

$\frac{(3+5-1)!}{5!(3-1)!} = \frac{7!}{5!2!} = \frac{7*6}{2*1} = 21$, so yes you are doing it right!

-