Thread replies: 14
Thread images: 8
Anonymous
2016-01-11 08:37:08 Post No. 7775690
[Report]
Image search:
[Google]
Anonymous
2016-01-11 08:37:08
Post No. 7775690
[Report]
Earlier I was working on this question
"How many distinct anagrams are there of the word SLEEPLESSNESS?"
The answer is [math]\frac{13!}{2!4!5!} = 1081080[/math]
since there are 13P13 (13!) possible permutations of 13 letters, and every one will have 4! repeats for reshuffling e's, of which each will have 5! repeats for reshuffling s's, and 2! repeats for l's, dividing through by this gives the answer.
However, how would you go about doing something like distinct three letter words? The first method works because every anagram uses every letter and as a result in the 13P13 permutations, there will always be the same about of each repeating anagram. However, for three letter words the word NPL will only be repeated twice, yet the word SSS for example, will be repeated 5P3 (60) times, and as such there is no trivial way to divide through to the answer.
How is it done, and can a general function be built? a function with 27 inputs, the occurence of each letter in the alphabet and the length of each distinct anagram?