H
H
Hello World2019-09-02 18:06:57
Mathematics
Hello World, 2019-09-02 18:06:57

How many words of length 1-10 can be formed from the word MATHEMATICS?

Obviously, words with length 1 - 6. With length 10 - 151200 = 10!/2!3!2!
But how many words of length 2...9 can be formed from the word MATHEMATICS?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2019-09-02
@hello-world00

Look: there are only 2**10-1 different non-empty combinations of letter spaces, but repeated letters spoil everything: for example, the combination MA is achieved in 5 ways:

  1. MA topics
    Considering it handles is troublesome, it's easier to write a one-liner:
    from itertools import combinations
    
    print(len(set(s for le in range(1, 11) for s in combinations('МАТЕМАТИКА', le))))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question