-1

Iam not sure how to solve this question because the word MAMMA has 3 M and 2 A. Thanks in advance

Isaac Ren
  • 1,446
Meos
  • 3

1 Answers1

1

The important property that we will use is that there are exactly $n\choose k$ words in $\{A,M\}^*$ of length $n$ with $k$ $A$'s, i.e. $$\#\big\{w\in\{A,M\}^*: |w|=n,|w|_A=k\big\}={n\choose k}.$$ In addition, if $|w|=n$ and $|w|_A=k$, then $|w|_M=n-k$.

The words that can be made from the letters of MAMMA are exactly the words in $\{A,M\}^*$ with at most 2 $A$'s and 3 $M$'s. Therefore, we are looking for the cardinality of the set $$\big\{w\in\{A,M\}^*:|w|_A\leq2,|w|_M\leq3\big\}$$ We can separate this set into a disjoint union $$\begin{aligned} &\coprod_{n=0}^5\big\{w\in\{A,M\}^*:|w|=n,|w|_A\leq2,|w|_M\leq3\big\} \\ = &\coprod_{n=0}^5\coprod_{k=0}^n\big\{w\in\{A,M\}^*:|w|=n,|w|_A=k\leq2,|w|_M=n-k\leq3\big\} \\ = &\coprod_{n=0}^5\coprod_{\substack{k=0\\k\leq 2\\n-k\leq 3}}^n\big\{w\in\{A,M\}^*: |w|=n,|w|_A=k\big\} \end{aligned}$$ In this last expression, we find a set whose cardinality is known; it's equal to $n\choose k$. Therefore $$\#\big\{w\in\{A,M\}^*:|w|_A\leq2,|w|_M\leq3\big\}=\sum_{n=0}^5\sum_{\substack{k=0\\k\leq 2\\n-k\leq 3}}^n{n\choose k},$$ and we can calculate that this is equal to $$(1+1)+(1+2+1)+(3+3+1)+(4+6)+(10)=33.$$

Isaac Ren
  • 1,446