# Counting Technique [closed]

Words with 6 letters are to be formed from the word "MEDICALOUS". If repetition is allowed, find the number of possible 6-letter words that can be formed if there is at least one letter being repeated.

• I’m voting to close this question because it's just off-topic. Jan 1 at 7:39
• Welcome to the Mathematica Stack Exchange. If you have tried out Mathematica code and seek help resolving a specific issue, then please edit your post to include the code that you have tried out so far. As posed, this is an off-topic question on this stack. You can (improve the quality of your question and) get more responses over at the Mathematics Stack Exchange.
– Syed
Jan 1 at 7:47

letters = Characters@"MEDICALOUS"
(*    {"M", "E", "D", "I", "C", "A", "L", "O", "U", "S"}    *)

combinations =
StringJoin /@ Union @@ (Tuples[#, 6] & /@ Subsets[letters, {5}])
(*    {"AAAAAA", "AAAAAC", "AAAAAD", "AAAAAE",
"AAAAAI", "AAAAAL", "AAAAAM", "AAAAAO",
...
"UUUUUM", "UUUUUO", "UUUUUS", "UUUUUU"}    *)

Length[combinations]
(*    848800    *)

words = Select[combinations, DictionaryWordQ]
(*    {"ACACIA", "ACADIA", "ACCEDE", "ACCESS",
"ACCUSE", "ACEDIA", "ACIDIC", "ACULEA",
...
"SULIDS", "SUMMED", "SUSSED", "SUSSES"}    *)

Length[words]
(*    436    *)