<s>[INST] How do I calculate the number of permutations of the list $(6, 6 ,5, 4)$? I have the list $l = (6, 6, 5, 4)$ and want to how to calculate the possible number of permutations.
By using brute force I know that there are 12 possible permutations:
$$\{(6, 5, 6, 4),
 (6, 6, 5, 4),
 (5, 6, 6, 4),
 (6, 4, 5, 6),
 (6, 5, 4, 6),
 (4, 6, 6, 5),
 (4, 5, 6, 6),
 (4, 6, 5, 6),
 (6, 4, 6, 5),
 (6, 6, 4, 5),
 (5, 4, 6, 6),
 (5, 6, 4, 6)\}$$
But how would I calculate this?
I know we talk about permutation as order matters also I know that repetition is allowed (at least for $x = 6$).
 [/INST] Here is another way of thinking about the problem:  There are four positions to fill.  We can fill two of them with a $6$ in $\binom{4}{2}$ ways.  Once those two positions have been filled, we fill one of the remaining two positions with a $5$ in $\binom{2}{1}$ ways.  Once those three positions have been filled, we can fill the remaining position with a $4$ in $\binom{1}{1}$ way.  Thus, the number of ways we can fill four positions with two sixes, one five, and a four is 
$$\binom{4}{2}\binom{2}{1}\binom{1}{1} = \frac{4!}{2!2!} \cdot \frac{2!}{1!1!} \cdot \frac{1!}{0!1!} = \frac{4!}{2!1!1!} = 12$$
</s>