[Math] Number of permutations of a string

combinatoricspermutations

Calculate the number of permutations that is created by picking 4 letters from the string 'HARD CORD' (2 duplicates)

I know that if the string had 8 distinct letters, I can use $_8$P$_4$ to get the required answer. But how do things change when there are duplicates in the given string like the one given above?

Best Answer

I think the easiest way to do this is to count the words with all letters different, then the other cases.

The number of words with all letters different is ${}^6\mathrm P_4=360$, since there are $6$ different letters to choose from.

The number of words with two Rs and other letters all different is ${}^4\mathrm C_2\times {}^5\mathrm P_2=120$, since there are ${}^4\mathrm C_2$ ways to choose the positions of the Rs and then ${}^5\mathrm P_2$ ways to pick two different letters from the remaining five, in order. Similarly there are $120$ words with two Ds and all other letters different.

Finally, the number of words with two Rs and two Ds is ${}^4\mathrm C_2=6$: once we choose two places for the Rs, we know where the Ds have to go.

This gives a total of $606$ words.

Related Question