TITLE: How to compute combinations when there is a repetition
QUESTION [0 upvotes]: I want to find out the combination for question below:
If I have numbers 1 1 2 3 4, I have three slot for each number, I want to find out the combinations. Below are the possible combinations
(1 1 2), (1 1 3), (1 1 4), (1 2 3), (1 2 4), (1 3 4), (2 3 4)
What is a mathematical way of computing such questions?

REPLY [1 votes]: Alternate approach:
First, you have to recognize, that if you were selecting 3 numbers from the group {1,2,3,4,5}, the number of ways would be
$$\frac{n!}{k! (n-k)!} ~: ~n = 5, k = 3.$$
This is normally symbolized by $$\binom{n}{k}$$
In this instance, you have the complication that the first two elements are identical, so $\binom{5}{3}$ is not the final answer.
To get the final answer, you have to recognize that of all the ways there are of selecting one # from the two $1$'s, and two #'s from
the other three, exactly 1/2 of them must be deducted from $\binom{5}{3}$.
This is because (for example) otherwise you would end up counting twice the combination (1,3,4) -- (1,3,4).  One of these selections would represent when the first $1$ was selected, and the other would represent when the second $1$ was selected.
The total number of ways of having one # from the $1$'s and two #'s from the other 3 is
$$\binom{2}{1} \times \binom{3}{2}$$
Thus the final answer is
$$\binom{5}{3} - \left[\frac{1}{2} \times \binom{2}{1} \times \binom{3}{2}\right]$$
{"set_name": "stack_exchange", "score": 0, "question_id": 3853338}