[Math] Probability that a string of $5$ characters from set$\{a,b,c,d,e,f\}$ contains exactly one ‘$a$’, given that it contains at least one vowel

combinatoricsdiscrete mathematicsprobability

This is a past paper exam question.
It doesn't have a mark scheme, so I was hoping somebody could check this answer for me. It's non-calculator, but I don't expect that affects the method used.

My solution is based on the accepted answer here: Combinatorics question about english letters (with consonants and vowels)

Let P(A) be the probability that the string contains exactly one '$a$'
Let P(B) be the probability that the string contains at least one vowel.

Need to find $P(A|B) = \frac {P(B|A) \cdot P(A)} {P(B)}$

Total combinations of $5$ letters from the set of $5 = 6^5$

$P(A)$ can be satisfied by a single 'a' being in any of 5 places – $5 \choose 1$ , and the other 4 places in the string can be any of 5 characters – $4^5$. Then $P(A) = \frac {5 \cdot 4^5} {6^5}$

$P(B)$ :
There are $6^5$ total combinations, as above.
Of these, There are $4^5$ with no vowels.
Then, $P(B) = \frac {6^5 – 4^5} {6^5}$

Now, $P(B|A) = 1$, since $A$ is sufficient for $B$ – there must be a vowel if there is an 'a'

So, $P(A|B) = \frac {P(B|A) \cdot P(A)} {P(B)} = \frac {P(A)} {P(B)} = \frac {\frac {5 \cdot 4^5} {6^5}} {\frac {6^5 – 4^5} {6^5}}$

This seems to make sense, but I'm not completely convinced about my calculations, particularly for $P(A)$.

Would anybody be able to either confirm my solution or point out where I went wrong?

Best Answer

The analysis looks good. I would like to suggest exactly the same thing, in a marginally different style.

In the notation that you use, we want $\dfrac{\Pr(A\cap B)}{\Pr(B)}$. This is a more basic formula, and does not prejudge how we will compute the top. A "Bayes formula" approach to the computation may not be optimal. And several conditional probabilities in one expression can lead to confusion. (They didn't in your case.)

Note that $A\cap B$ says exactly one $a$ and at least one vowel. So it says exactly one $a$. The location of the $a$ can be chosen in $\dbinom{5}{1}$ ways. For each way, the remaining $4$ places can be filled in $5^4$ ways. Thus $$\Pr(A\cap B)=\frac{\binom{5}{1}5^4}{6^5}.$$