5

I am trying to calculate the number of unique combinations for a 7 element set with repetition allowed where order doesn't matter.

For example:

S = {a, b, c, d, e, f, g}

3 items per set

aaa: valid
aab: valid
aab = aba = baa (these three outputs should only count as 1 combination)

I've started with the total number of possible combinations (7^n) and tried remove the ones that are duplicates by nature, however I cannot figure out how to do this. Any help or pointers in the right direction is greatly appreciated.

  • 1
    I hope you are familiar with Stars and Bars (please see Wikipedia). With choosing $3$ from $7$, the answer is the number of solutions of $x_1+x_2+\cdots+x_7=3$ in non-negative integers. Stars and Bars solves this. – André Nicolas Jul 10 '15 at 21:46
  • This question addresses something I have wondered about too! See here: http://math.stackexchange.com/questions/474741/formula-for-combinations-with-replacement – Xoque55 Jul 10 '15 at 23:03

2 Answers2

5

This is known as multichoose; explicitly, the number you're after is "$7$ multichoose $3$." The basic theorem to keep in mind is that "$n$ multichoose $k$" equals $[n-1,k],$ where $$[-,-] : \mathbb{N} \times \mathbb{N} \rightarrow \mathbb{N}$$ is the "symmetric binomial coefficient" defined by $$[a,b] = \frac{(a+b)!}{a!b!}.$$

So "$7$ multichoose $3$" equals $$[7-1,3]$$ which equals $$\frac{9!}{6!3!}$$ which equals $$84.$$

goblin GONE
  • 69,385
2

As André Nicolas points out this can be solved via stars and bars. There are $3$ letters (stars) and $7$ options, which convert into $6$ bars.

So we have $3$ stars and $6$ bars, this gives us $\binom{6+3}{6}=\binom{9}{6}=84$ possibilities.

If instead of wanting $3$ items per set you want $n$ the solution is $\binom{6+n}{6}$.

In general if instead of $3$ items we want $n$ and instead of $7$ options we have $k$ the answer is $\binom{n+k-1}{k-1}$

Asinomás
  • 107,565