# Yet another question about permutations and probability

Dear Stack Mathematicians,

I'm new to the site and I joined to ask a few math questions. I did some research regarding the topic, but I still have doubts.

Let's say I have a $4$-letters alphabet: {a, b, c ,d}, and I want to know the probability of getting a specific 5 digit string, e.g. 'aabcc'. Now, the possible combinations are $4^5$ , i.e. $1,024$. That means, if I pick up $5$ random letters (with replacement), I have 1/1024 chances of getting 'aabcc' (the order does matter). This means $\frac{1}{1024}$ $\approx0.001$ chance.

Now, I'm going to change things, let's say 'a' and 'b' have each $0.4$ chance to be chosen, while 'c' and 'd' have each $0.1$ chance to be chosen. The chance now to get 'aabcc' in that specific order will be: $0.4\cdot 0.4\cdot 0.4\cdot 0.1\cdot 0.1 = 0.00064$. Thus, if I generate $1500$ random $5$-letters words, I would expect (on average) one of them to be 'aabcc'. Is that correct?

I am looking forward to your feedback! :)

• Yes, that is correct. – Théophile Jan 22 '18 at 16:02

Yes, you're right, but I suggest you to use the words "events" and "permutations" to make your question more concise and clearer, say "the chance now to get the permutation $aabcc$ will be ...", or even $$\Bbb{P}\{aabcc\} = \frac25 \cdot \frac25 \cdot \frac25 \cdot \frac{1}{10} \cdot \frac{1}{10} = \frac{2}{5^5} = \frac{2}{3125}.$$ To express the expected number of occurrences of the event $\{aabcc\}$ under 1500 independent trials, you may write $$\Bbb{E}\left[1500 \cdot 1_{\{aabcc\}}\right] = 1500\, \Bbb{E}\left[1_{\{aabcc\}}\right]=1500 \, \Bbb{P}\{aabcc\} = \frac{3000}{3125} = 0.96.$$ N.B.: The indicator function $1_A$ counts the number of occurrence of the event $A$ in one single trial.
Think about the probability that you never obtain 'aabcc' sequence; it is $$(1-0.00064)^{1500}\approx 0.38$$ so the probability to obtain 'aabcc' at least once is $$1-0.38=0.62$$ which is greater than $0.5$