If a machine is correctly set up, it produces $90\%$ acceptable items. If it is incorrectly set up, it produces only $40\%$ acceptable items. Past experience shows that $80\%$ of the set ups are correctly done. If after a certain set up, the machine produces $2$ acceptable items, find the probability that the machine is correctly setup.
This is solved in my reference as
$A:$ machine produces acceptable item, $B:$ machine is correctly setup, $C:$ machine produces $2$ acceptable items $$ P(B)=80/100=\frac{4}{5},\;\;P(B')=\frac{1}{5}\\ P(C|B)=90\%.90\%=\frac{9}{10}.\frac{9}{10}\\ P(C|B')=40\%.40\%=\frac{2}{5}.\frac{2}{5}\\ P(C)=P(C|B)P(B)+P(C|B')P(B')=\frac{9}{10}\frac{9}{10}\frac{4}{5}+\frac{2}{5}\frac{2}{5}\frac{1}{5}=\frac{85}{125}=\frac{17}{25}\\P(B|C)=\frac{P(B)P(C|B)}{P(C)}=\frac{\frac{4}{5}.\frac{9}{10}\frac{9}{10}}{\frac{17}{25}}=\frac{4.9.9}{17.20}=\frac{81}{85}=0.95 $$
Why not $P(C)=P(AA)=P(A).P(A)$ where $P(A)=P(A|B)P(B)+P(A|B')P(B')$ ?.
How come we define $P(C|B)=P(AA|B)=P(A|B).P(A|B)$ ?. How do I prove it and where does this come from ?
The problem is with $P(C) = P(A).P(A)$ since two acceptable items being produced are not independent of each other, but only conditionally independent if we know $B$, which we don't here.
Two acceptable items being produced given that we know whether the machine is correctly setup or not are independent events, so their joint probability $P(C | B)$ equals the product of the individual events $P(A|B).P(A|B)$.
So $$P(C | B) = P(A | B).P(A | B)$$ and $$P(C | B') = P(A | B').P(A | B')$$ but $$\begin{align} P(C) &= P(C | B).P(B) + P(C | B').P(B') \\ &= P(A | B).P(A | B).P(B) + P(A | B').P(A|B').P(B') \\ &\ne P(A).P(A) \end{align}$$
In terms of where $P(C | B) = P(A|B).P(A|B)$ comes from, this statement assumes that producing two acceptable items on a correctly setup machine happen independently. This assumption would be incorrect, for example, if one failure to produce an item had a knock-on effect and made it more likely that the next item would also fail to be acceptable.
If we assume that this is not the case — that there is no correlation / dependence between whether or not two consecutively produced items are acceptable — we can derive $P(C | B) = P(A|B) P(A|B)$ like below. Note that for clarity, we distinguish between the two $A$s, labelling them $A_1$ (the first item is acceptable) and $A_2$ (the second item is acceptable).
$$\begin{align} P(C | B) &= P(A_1, A_2 | B)\\ &= P(A_1 | A_2, B).P(A_2 | B) \qquad\text{(chain rule)}\\ &= P(A_1 | B).P(A_2 | B) \qquad\text{(assumption: $A_1$ and $A_2$ independent)}\\ &= P(A | B).P(A | B) \end{align}$$