# How do I calculate the number of unique permutations in a list with repeated elements? [duplicate]

I know that I can get the number of permutations of items in a list without repetition using

(n!)


How would I calculate the number of unique permutations when a given number of elements in n are repeated.

For example

ABCABD

I want the number of unique permutations of those 6 letters (using all 6 letters).

## marked as duplicate by hardmath, Community♦Apr 26 '16 at 17:53

• Funny, I just made a code golf challenge with this exact premise! – qwr Apr 26 '16 at 17:16
• @qwr Someone asked about it on stackoverflow, but they were trying to brute force it and ran out of memory. I thought surely there would be a question on math I could forward them to, but I couldn't find one. – Brendan Abel Apr 26 '16 at 17:18
• How many are there for $AABB$? – Mambo Apr 26 '16 at 17:18
• Searching questions tagged permutations with keyword repetition will find many other related posts. The Mississippi problem is something of a classic. – hardmath Apr 26 '16 at 17:23

$\dfrac{6!}{2!2!}$