-5
$\begingroup$

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.

$\endgroup$
2
  • 5
    $\begingroup$ I’m voting to close this question because it's just off-topic. $\endgroup$ Jan 1 at 7:39
  • $\begingroup$ 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. $\endgroup$
    – Syed
    Jan 1 at 7:47
5
$\begingroup$
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    *)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.