With the probability of $1/3$, exactly one of eight identical-looking envelopes contains a bill (conditional probability question) With the probability of $\frac13$, exactly one of eight identical-looking envelopes contains a bill (and with the probability of $\frac23$, all the eight envelopes are empty). We are opening one envelope. Let $A$ be the event that there is a bill in this envelope. Let $B$ be the event that the other seven envelopes have already been opened and turned out to be empty.
$$P(A\mid B)=?$$
I tried conditional probability formula $$P(A\mid B) = P(B\mid A)\times \frac{P(A)}{P(B)}$$
$$P(A) = \frac13 \times \frac18 = \frac1{24}$$
However, I'm not sure how to determine $P(B\mid A)$ and $P(B)$. I'm not even sure if $A$ and $B$ are independent to each other. My intuitive sense is that they are dependent on each other. Any help is appreciated.
Thanks
 A: This is a long answer, but I believe it is highly illustrative, so please bear this in mind.
Let's consider a simpler example.  Suppose there are only two envelopes.  With probability $1/3$, exactly one envelope has money, and the other is empty.  With probability $2/3$, both envelopes are empty.
You pick an envelope at random, open it, and find it is empty.  What is the probability that the unopened envelope has money?  Or if you prefer to phrase it differently, say your friend has already come along and opened one envelope and found it is empty.  You pick the remaining envelope to open.  What is the probability that your envelope has money?
If you say $1/3$, this is not correct, because the action of opening one envelope and observing it is empty has changed the posterior probability of the unopened envelope containing money.
To understand why, consider the following interpretation.  Instead of a single pair of envelopes, think of three pairs of envelopes, like this:
$$\begin{array}{cc}
\text{Pair Number} & \text{Contents} \\
\hline
1 & \{1, 0\} \\
2 & \{0, 0\} \\
3 & \{0, 0\} 
\end{array}$$
where "Contents" is a set of two elements where $1$ represents an envelope with money, and $0$ represents an envelope without money.  Now if we pick one of the pairs at random, and then pick one of the envelopes in that pair, we effectively replicate the property that with probability $1/3$, the contents of the envelopes is one with money and one without.
Also note that there are six possible envelopes to choose here, and each is equiprobable, since you pick one of the pairs with equal probability $1/3$, and one of envelopes in that pair with probability $1/2$.  So there are $5$ outcomes in which we pick an envelope and find it is empty.
Of these $5$ outcomes, if we open the other envelope, what is the chance that envelope has money?  Well, there is only one of the five cases such that the other envelope has money.  In all of the other cases, if you open the other envelope in the pair, it will be empty.  So, given that your first opened envelope is empty, the posterior probability the other envelope will have money is only $1/5$.
Now that we understand this example, it is not too difficult to extend this reasoning to the case where there are eight envelopes.  Since the prior probabilities are still $1/3$ and $2/3$ respectively, what this means is that the table we showed above now looks like this:
$$\begin{array}{cc}
\text{Group Number} & \text{Contents} \\
\hline
1 & \{1, 0, 0, 0, 0, 0, 0, 0 \} \\
2 & \{0, 0, 0, 0, 0, 0, 0, 0 \} \\
3 & \{0, 0, 0, 0, 0, 0, 0, 0 \} \\
\end{array}$$
And as before, we simulate the prior probabilities by first choosing one of the three rows at random, then deciding to open seven of the eight envelopes for that row.  There is a slight twist, however.  How do we count the outcomes where $7$ envelopes are opened and they are all empty?
Well, if you had chosen group number $1$, there is only one way to do this, since there are only $7$ empty envelopes in that group.  But if you had chosen group number $2$ or $3$, there are $8$ ways to pick $7$ empty envelopes, because there are $\binom{8}{7} = 8$ ways to pick $7$ envelopes from a group of $8$.  Thus there are $1 + 8 + 8 = 17$ total ways to pick a group and then open $7$ empty envelopes from that group.  And in only one of those outcomes is it the case that the remaining unopened envelope has any money.  Therefore, the posterior probability is $1/17$.
Now, this should all be quite understandable, but given that this is a Bayesian probability exercise, how could we have done this using more formal notation?  Let us use the events as described:  $A$ is the event that the unopened envelope contains money, and let $B$ be the event that seven envelopes are opened and are empty.  We are asked for $\Pr[A \mid B]$.  The issue is that there are other events in play that have not been defined.  For example, how do we define the event that the envelopes are not all empty--i.e., one of the envelopes contains money?  Let this event be called $M$.  Then before any envelopes are opened, $\Pr[M] = 1/3$, and the complement $\Pr[\bar M] = 2/3$.  Maybe this will help us proceed further.
A natural question to ask (and one that may be elicited from our earlier discussion) is, what is $\Pr[B \mid M]$?  That is to say, given there is money in one of the envelopes, what is the probability we open seven of them and see they are all empty?  This is equivalent to identifying the envelope with money and choosing not to open it, hence $$\Pr[B \mid M] = \frac{1}{8}$$ because you have a $1$ in $8$ chance of correctly guessing which envelope has money, given there is such an envelope.
It also seems natural to ask, what is $\Pr[B \mid \bar M]$?  That is, if all of the envelopes are empty, what is the chance of picking $7$ that are empty?  Well, of course this is just $$\Pr[B \mid \bar M] = 1.$$  It's guaranteed because none of the envelopes have money.
So we can calculate through the law of total probability $$\Pr[B] = \Pr[B \mid M] \Pr[M] + \Pr[B \mid \bar M] \Pr[\bar M] = \frac{1}{8} \cdot \frac{1}{3} + 1 \cdot \frac{2}{3} = \frac{17}{24}.$$
How do we get $\Pr[A \mid B]$?  Bayes' theorem doesn't seem to help.  But maybe we can use $$\Pr[A \mid B] = \frac{\Pr[A \cap B]}{\Pr[B]}.$$  We have the denominator now.  But the numerator, which is the joint probability that the final envelope contains money, and the first seven do not, is something we haven't computed yet.  Or is it?  Earlier, we reasoned that if there was an envelope with money, the chance we leave it to be opened last is $1/8$.  And since the chance the last envelope has money if none of the envelopes contain money is obviously $0$, what we can assert is that $$\Pr[A \cap B] = \frac{1}{8} \cdot \frac{1}{3} = \frac{1}{24},$$ because there is only a $1/3$ probability of even having the possibility of the last envelope containing money in the first place, and then on top of that, we must leave that envelope for last with $1/8$ probability.
Therefore, $$\Pr[A \mid B] = \frac{1/24}{17/24} = \frac{1}{17}.$$
Which method of reasoning do you prefer?
A: We are going to open the eighth envelope. Let $A$ be the event that it contains a bill. On the other hand there is the event $B$ that the other seven envelopes contain no bill. We know that the event $B$ has happened, and are asked to compute the conditional probability $P(A|B)$.
With probability ${2\over3}$ all envelopes are empty, and with probability ${1\over3}\cdot{1\over8}$ a bill is present, but not in the first seven envelopes. This makes $P(B)={2\over3}+{1\over3}\cdot{1\over8}={17\over24}$. We therefore obtain
$$P(A|B)={P(A\cap B)\over P(B)}={{1\over3}\cdot{1\over8}\over{17\over24}}={1\over17}\ .$$
