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$).

For a list of $n$ distinct elements the number of permutations if $n!$. If you have $4$ distinct elements, the number of permutations is $24$.
However in this case we have the number $6$ appearing twice. For every ordering of the four numbers $6,6',5,4$ there is another ordering switching the $6$ and the $6'$, so you need to divide $24$ by $2$ which gives $12$ as you've got. 
