Artificial intelligent assistant

Verifying on my probability approach Three different wooden case that contains rotten apple. The case $A$ has a rotten rate of $5\%$, the case $B$ a rate of $3\%$ and the case $C$ $2\%$. Each of the cases has different volumes, with $A$ having $20\%$ of the apples, $B$ having $20\%$ and $C$ having $60\%$. If an apple is selected at random and found to be rotten, what is the prob that the apple came from the $C$ case? Let me explain how I think : Assume a number of total apples : $1000$ $A$ has $200$ total apples and $10$ of them are rotten $B$ has $200$ total apples and $6$ of them are rotten $C$ has $600$ total apples and $12$ of them are rotten Since we know that the found apple is rotten, $$\text{nCr-rotten-all} = \binom{28}1$$ $$\text{nCr-rotten-C} = \binom{12}1$$ $$\text{result} = \frac{\text{nCr-rotten-C}}{nCr-rotten-all}$$ Is this the right formulation? Thank you for your clear explanation in advance

Use Bayes' rule to make your working more readable, let's use $R$ to denote the event that an apple is rotten.

$$P( C | R) = \frac{P(C)P(R|C)}{P(R)}=\frac{P(C)P(R|C)}{\sum_{i \in \\{ A,B,C\\}}P(i)P(R|i)}$$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 0ea55ceeaa8d865793ab860e1f1fb3c8