Question: Find the distinct number of permutations of four letters of the word MATHEMATICS.
The answer is 11P4/(2!)^3 = 990
Is this correct? This question along with the answer is from a module from my course, so this is all the details that I am able to provide.
My understanding of this question is how many distinct 4 letter words can be formed from the word 'MATHEMATICS'. Therefore, a word like 'MAME' is valid. I know that using 11P4 alone will not suffice because it will say that there are 4 ways to create the 4 letter word MAME from the word 'MATHEMATICS'. So, we I will need to adjust the output of 11P4, and this is where I am stuck. The answer divides 11P4 by (2!)^3. I think this represents the 3 non-distinct letters in the word 'MATHEMATICS' (i.e. M,A,T) which have two copies each. Using Sage, the answer I have is 2,454 which is not the same as the answer provided. Here is the code I wrote:
#Input according to question inputQ='M A T H E M A T I C S'.split(' ') #Same input, but each letter in input is distinct inputTest='M1 A1 T1 H E M2 A2 T2 I C S'.split(' ') print inputQ print inputTest #Number of letters to form from the given input choice=4 ansQ=Permutations(inputQ,choice).list() ansTest=Permutations(inputTest,choice).list() print 'Total distinct permutations of ' + str(choice) + ' letter word(s) from the word ' + ''.join(inputQ) +':' ,len(ansQ) print 'If each letter in '+ ''.join(inputQ) + ' were distinct: ', len(ansTest)
What if I only want 1 letter? Then the answer would be 8, which I got by manually listing down all possibilities. But what it the general formula for this sort of problem?