# Expectancy value of sale of fishballs

I am doing some elementary statistics and the following problem stumpled me a bit.

A merchant receives two batches of fish cakes from two different factories, but with the same produces. Thus one can not determine witch batch came from which factory. The batches are labeled $A$ and $B$, and they have the following contents \begin{align*} \textbf{Batch A:} & 100 \text{ boxes, whereof } 10 \text{ with mushy cakes, labeled } F_1 \\ \textbf{Batch B:} & 100 \text{ boxes, whereof } 5 \text{ with mushy cakes, labeled } F_1; \\ & \text{and in addition } 10 \text{ with foul smell and taste, labeled } F_2 \text{ , whereof } \\ & 1 \text{ with both } F_2 \text{ and } F_2 \,. \end{align*} Consider the errors mushy cakes and foul smell and taste to be impossible to detect from the outside, and can only be detected by destroying the inspected box.

b) Given that the merchant picked two boxes without error and one with only $F_1$ error, what is the probability that the boxes came from $A$?

I deduced that $$\overbrace{3 \left( \frac{90}{100}\right)\left( \frac{10}{99}\right) \left( \frac{89}{98}\right)}^{\large P(E\,\cup\,F\,\cup\,E\,\mid\,A)} = \frac{267}{1078}\,,\quad \overbrace{3 \left( \frac{85}{100}\right)\left( \frac{4}{99}\right) \left( \frac{84}{98}\right)}^{\large P(E\,\cup\,F\,\cup\,E\,\mid\,B)} = \frac{34}{385}$$ This is not the same as in the solution manual, (is this still correct?) Thus the probability that the cake came from Batch A is $$P(A\,\mid\,E\,\cup\,F\,\cup\,E) = \frac{267/1078}{34/385 + 267/1078} = \frac{1335}{1811} \approx 73.7 \%$$ Is this correct? This is needed for part c) which I am unsure about =)

The merchant leaves the batches in his warehouse and forget which batch is which. He then pulls 3 cakes from one of the batches and observes he obtained two error-free cakes and one mushy cake ($F_1$).

The merchant then wishes to sell the fish cakes for $1\$$, but is worried about the foul cakes. All the boxes will be sold, and he decides on the following. • Mushy cakes, only error F_1, the money is refunded. • Error F_2 or F_2+F_1 the money is refunded + 15\$$ in compensation. c) The merchant wants to maximize his income, and has now four options> • Sell all the remaining boxes. • Sell the rest of the boxes in the unit of the three observed boxes came from. • sell all the boxes of the other unit. • Not sell any of the boxes at all. what is the expected income in each case? Which option should the merchant choose? My question is does the probability of which batch he did pick, affect the expectancy value? I deduced the following for the three cases 1.$E(x) = (90 + 85 - 2) \cdot 10 - 10 \cdot 15 = 23$2. ???$E(x) = \cfrac{1335}{1811} \cdot \Bigl[ (88) \cdot 1 - 0 \cdot 9 \Bigr] + \cfrac{476}{1811} \cdot \Bigl[ (83) \cdot 1 - 0 \cdot 3 - 9 \cdot 15 \Bigr] \approx 51.203$3. ??? 4. 0 I am really clueless as to how to calculate the expectency value of$2$and$3$. Any help or hints would be much appreciated. ## 1 Answer I assume that Batch$B$contains$86$good boxes,$4$that are$F_1$only,$9$that are$F_2$only, and one that is$F_1$and$F_2$. The question is badly worded and could also be interpreted as saying that there are$85$good boxes,$5$that are$F_1$only,$9$that are$F_2$only, and one that is$F_1$and$F_2$; that appears to be the interpretation that you used. In Batch$A$there are$10\binom{90}2=40,050$samples of$3$boxes, two of which are good and one of which is$F_1$; in Batch$B$there are$4\binom{86}2=14,620$such samples. The probability that such a sample is from Batch$A$is therefore$\frac{40050}{40050+14620}=\frac{40050}{54670}\approx0.0.73258$. Had I done the calculation by your method, which is also correct, I’d have had $$\frac{\frac{3\cdot90\cdot89\cdot10}{100\cdot99\cdot98}}{\frac{3\cdot90\cdot89\cdot10}{100\cdot99\cdot98}+\frac{3\cdot86\cdot85\cdot4}{100\cdot99\cdot98}}=\frac{90\cdot89\cdot10}{90\cdot89\cdot10+86\cdot85\cdot4}=\frac{80100}{109340}=\frac{40050}{54670}\;,$$ clearly the same as the answer that I got by the other approach. On my interpretation of the wording he still has$174$good boxes,$13F_1$boxes, and$10$boxes that are$F_2$and possibly also$F_1$, so if he sells them all, he makes $$197-23-10\cdot15=24\;.$$ On your interpretation he has one good box fewer and one more$F_1$box, so he makes only$23$. (I could also, and more simply, have calculated it as$174-10\cdot15=24$.) Suppose that he sells the rest of the boxes in the tested batch. If that is Batch$A$, he’s selling$88$good boxes and$9F_1$boxes, making an income of$88$. If it’s Batch$B$, on my interpretation he’s selling$84$good boxes,$3F_1$boxes, and$10$boxes that are$F_2$and possibly also$F_1$, so his income is$84-10\cdot15=-66$. His expected income is the weighted sum of these two possibilities, the weights being their respective probabilities of occurrence. The probability that this is Batch$A$is known from the earlier part of the question, and the expected income is $$\frac{4005}{5467}(88)+\frac{1462}{5467}(-66)=\frac{255,948}{5467}\approx46.82\;.$$ You can use the same approach to calculate the expected income if he sells the boxes in the untested batch. • Okay, so I had the right idea for both parts just that I was slightly off with the numbers. (Silly to miscount the number of boxes). So if he sells the untested batch the probability would be $$\frac{4005}{5467}(-66)+\frac{1462}{5467}(88)$$? I was unsure if one had to weigh the expectancy value, thank you for clearing that up. – N3buchadnezzar Sep 16 '13 at 5:51 • @N3buchadnezzar: The incomes won’t be$88$and$-66$, because he’ll be selling the whole batch. If the untested batch is Batch$A$, his income will be$90$; if it’s Batch$B$, it will be$86-15\cdot10=64$. You want $$\frac{4005}{5467}(-64)+\frac{1462}{5467}(90)\;.$$ Yes, the expectation is always the sum of the possible values, each weighted by its probability. You’re welcome! – Brian M. Scott Sep 16 '13 at 5:56 • I might post this as a follow up question. But our teacher asked us the following: Assume the merchant start selling from the Batch he took the samples from. As soon as a customer complains about a fish cake with$F_2$fallacy, he switches batches. If he sells 4 cakes, then one with a fault. He will no longer sell any cakes. What is now the expectancy value? I really just want to know how to deal with the fact that I do not know when a$F_2\$ deficiency shows up. Do i sum up all the probabilities? =) – N3buchadnezzar Sep 16 '13 at 8:09
• @N3buchadnezzar: That looks as if it could get a bit ugly; you should probably post it as a separate question. – Brian M. Scott Sep 16 '13 at 16:36