Bayes' Theorem Question, with a twist I have a very old past high school exam question I am trying to solve (for interest only). It's a straightforward application of Bayes' Theorem, with the last part of the question containing a slight twist. It's the last part I would like help with. The full question is:
A retailer obtains apples from four different sources A, B, C and D. Suppose 4%, 2%, 1% and 3% of the apples from A, B, C and D respectively are infested with pests and 2%, 3%, 3% and 2% of A, B, C and D respectively are frosted. 96% of each of A, B, C and D are known to be undamaged. The retailer has in his shop a large lot of apples that is made up of 40%, 30%, 20% and 10% from A, B, C and D respectively.
(a) What is the probability that an apple form A is both pest infested and frosted?
(b) What is the probability that an apple drawn at random is both frosted and infested?
(c) If an apple drawn at random is found to be frosted and infected, what is the probability that it is from source A.
(d) An apple was randomly drawn, inspected and replaced. Another random draw of an apple was then made. The first apple had no defects whatsoever but the second was both infested and frosted. What is the probability that they were both apples from source A? How would your answer be affected if the first apple was not replaced?
My attempted solution is shown below. I think I have everything correct up until the final part of (d) [any confirmation would be appreciated]. For the last part of (d) I could not completely see how the result would be affected. Also, if we had 1000 apples in the store (say) how would the calculations for the last part of (d) be performed in order to demonstrate how the result would be affected?

 A: Your answers for (a), (b), (c) and (d)(i) look right. The last part of (d): the answer should not be affected if the first apple was not replaced.
Let's label some events. For $i=1,2$:
\begin{eqnarray*}
A_i &=& \text{"Apple $i$ is from supplier $A$"} \\
U_i &=& \text{"Apple $i$ is undamaged"} \\
D_i &=& \text{"Apple $i$ is infested and frosted".}
\end{eqnarray*}
Once you know the first apple is undamaged and the second one isn't then whether or not the first apple was replaced no longer matters for calculating the probability of the second apple being from $A$: that only now depends on the number of infested and frosted apples from $A$ compared to the total of such apples from all the suppliers.
To see how there is no effect on the value of $P(A_1\cap A_2 \mid U_1\cap D_2)$ we can take a numerical example and simplify to two suppliers and condition either damaged or undamaged:
\begin{array}{c|ccc}
\text{Supplier} & \text{Damaged} & \text{Undamaged} & \text{Total} \\
\hline
A & 5 & 7 & 12 \\
B & 2 & 3 & 5 \\
\text{Total} & 7 & 10 & 17
\end{array}
Without replacement we have:
\begin{eqnarray*}
P(A_1\cap A_2 \mid U_1\cap D_2) &=& P(A_1\cap A_2\cap U_1\cap D_2)/P(U_1\cap D_2) \\
&=& \dfrac{7\times 5}{17\times 16} \bigg/ \dfrac{10\times 7}{17\times 16} \\
&=& \dfrac{1}{2}.
\end{eqnarray*}
With replacement we have:
\begin{eqnarray*}
P(A_1\cap A_2 \mid U_1\cap D_2) &=& P(A_1\cap A_2\cap U_1\cap D_2)/P(U_1\cap D_2) \\
&=& \dfrac{7\times 5}{17^2} \bigg/ \dfrac{10\times 7}{17^2} \\
&=& \dfrac{1}{2}.
\end{eqnarray*}
Note: If instead the first apple was also infested and frosted then it would make a difference whether it was replaced or not.
Without replacement:
\begin{eqnarray*}
P(A_1\cap A_2 \mid D_1\cap D_2) &=& P(A_1\cap A_2\cap D_1\cap D_2)/P(D_1\cap D_2) \\
&=& \dfrac{5\times 4}{17\times 16} \bigg/ \dfrac{7\times 6}{17\times 16} \\
&=& \dfrac{10}{21}.
\end{eqnarray*}
With replacement:
\begin{eqnarray*}
P(A_1\cap A_2 \mid D_1\cap D_2) &=& P(A_1\cap A_2\cap D_1\cap D_2)/P(D_1\cap D_2) \\
&=& \dfrac{5\times 5}{17^2} \bigg/ \dfrac{7\times 7}{17^2} \\
&=& \dfrac{25}{49}.
\end{eqnarray*}
