<s>[INST] Drawing chips from a bag A bag with contains $5$ chips that are either red or blue chips. The number of red chips is a random variable $X$ where $X$ can be either $2, 3$ or $4$ with equal probability. Given that when $5$ chips are drawn with replacement, the result is: $3$ of the draws are red and $2$ are blue, what is the conditional probability that $X = 4$?
My attempt:
Consider Bayes Theorem: $P(X = 4 | 3 red, 2 blue) = \frac{P(X = 4 \land 3 red, 2 blue)}{P(3 red, 2 blue)} = \frac{P(3 red, 2 blue | X = 4) \cdot P(X = 4)}{P(3 red, 2 blue)}$.
Assume $X = 4$ (then there are 4 reds and 1 blue) and let $Y$ be the number of red chips drawn. $Y$ is binomial with $n = 5$ and $p = \frac{4}{5}$. So $P(Y = 3) = 0.2048$ (by applying the binomial function). So $P(3 red, 2 blue | X = 4) = 0.2048)$.
Clearly $P(X = 4)$ = $\frac{1}{3}$.
All that remains in to determine $P(3 red, 2 blue)$. I tried this:
If $X = 2$ let $Z$ be the number of red chips drawn ($Z$ is binomial with $n = 5$ and $p = \frac{2}{5}$) and then $P(Z = 3) = 0.2304$
If $X = 3$ let $Z$ be the number of red chips drawn ($Z$ is binomial with $n = 5$ and $p = \frac{3}{5}$) and then $P(Z = 3) = 0.3456$
If $X = 4$, we already saw that $P(Z = 3) = 0.2048$.
So $P(3 red, 2 blue) = 0.2304 + 0.3456 + 0.2048 = 0.7808$
Plugging in the appropriate probabilities shows that $P(X = 4 | 3 red, 2 blue) = \frac{0.2048 \cdot \frac{1}{3}}{0.7808} \approx 0.0874$
Did I do this correctly? This is practice for an upcoming examination and no solutions are available. Whatever help I can get is appreciated.
 [/INST] Your approach is correct but you made a mistake in calculation. Also I will suggest that your working should be using fractions instead of converting into decimals.
If $Y$ is the event of $3$ red and $2$ blue in $5$ draws with replacement,
$\small P(X = 4 | Y) = \displaystyle \frac{P(X = 4 \ \cap \ Y)}{P(Y)}$
$\small P(Y) = P(X=2 \cap Y) + P(X=3 \cap Y) + P(X=4 \cap Y)$
$ = \displaystyle \small \frac{1}{3} \cdot {5 \choose 3} \cdot \big[\big(\frac{2}{5}\big)^3 \big(\frac{3}{5}\big)^2 + \big(\frac{3}{5}\big)^3 \big(\frac{2}{5}\big)^2 + \big(\frac{4}{5}\big)^3 \big(\frac{1}{5}\big)^2\big]$
$\small P(X=4 \cap Y) = \displaystyle \frac{1}{3} \cdot {5 \choose 3} \cdot \big(\frac{4}{5}\big)^3 \big(\frac{1}{5}\big)^2$
$\small P(X = 4 | Y) = \displaystyle \frac{16}{61}$
</s>