# Number of combinations where a, b, c, and d appear?

I have 4 "containers", each with elements a, b, c, d, e. Each step, I randomly choose one element from each container and write them together. For example, I could have an outcome of "aacd" and "eead". How many of the combinations have a, b, c, or d for at least 3 of the 4 slots? (for example, "aabb" would count but "adee" would not)

From my calculations, I know there are 625 possible combinations.

How do I solve this from here?

• Your description has a mismatch; how many draws do you take? Note that you could simplify the problem by having one container having each of the listed elements in it. – abiessu Mar 2 at 20:46
• @abiessu yes I noticed I made a mistake. Just edited thanks for catching it :) – user890453 Mar 2 at 20:51
• @BrianM.Scott just made the edit I got confused typing it out – user890453 Mar 2 at 20:53
• You can solve this by considering cases based on how many times $e$ can appear. There should only be two cases to consider, and those should be easy to count. Also, "combinations" is not the right word to use here, as that suggests that the order that the letters appears in does not matter. That would mean that you consider $aabb$ and $bbaa$ as the same word, but it sounds like you would count them as different. You can just call these "strings" or "words". – Kevin Long Mar 2 at 20:55

There are $$4^4$$ strings that have $$a,b,c$$, or $$d$$ for every slot. The other ‘good’ strings have $$e$$ in exactly one slot. There are $$4$$ ways to choose that slot and $$4^3$$ ways to fill the remaining $$4$$ slots with $$a,b,c$$, or $$d$$, so there are altogether $$4\cdot4^3=4^4$$ strings with exactly one $$e$$. Thus, there are $$2\cdot4^4=512$$ strings with at most one $$e$$. The numbers are small enough that it’s easy to check this by counting the ‘bad’ strings.

• There is one string with $$4$$ $$e$$s.
• There are $$16$$ strings with $$3$$ $$e$$s: there are $$4$$ ways to choose the non-$$e$$ slot and $$4$$ ways to fill that slot.
• There are $$96$$ strings with $$2$$ $$e$$s: there are $$\binom42=6$$ ways to choose the $$2$$ non-$$e$$ slots and $$4^2=16$$ ways to fill them.

Thus, there are $$1+16+96=113$$ ‘bad’ strings, and $$113=625-512$$, as it should.

• I really do wonder what the downvoter was thinking. – Brian M. Scott Mar 13 at 22:30

Let's count how many possibilities of words made without $$e$$s are possible (you can only use $$a$$, $$b$$, $$c$$ and $$d$$).

• $$4 \cdot 4 \cdot 4 \cdot 4 = 4^4=256$$

Let's count how many words made with exactly one $$e$$ are possible. First choose the position of the $$e$$, then put the other letters in the remaining positions.

• $$\binom{4}{1} \cdot 4^3=256$$

Then, the desired number is $$512$$.

All arrangements with either no $$e$$ or one $$e$$ are acceptable. Probability of getting an $$e$$ in any container is $$\frac{1}{5}$$ and getting any letter other than $$e$$ is $$\frac{4}{5}$$.

So probability of no $$e$$ is simply $$\displaystyle \bigg(\frac{4}{5}\bigg)^4$$

Probability of one $$e$$ is $$\ \displaystyle {4 \choose 1} \cdot \bigg(\frac{4}{5}\bigg)^3 \cdot \frac{1}{5} = \bigg(\frac{4}{5}\bigg)^4$$

Adding them, the desired probability is $$\displaystyle = \frac{512}{625}$$