What is the expected number of apples that will be left in the basket?

3.2k Views Asked by At

Hi stumbled upon this interview question: There are 4 green and 50 red apples in a basket. They are removed one-by-one, without replacement, until all 4 green ones are extracted. What is the expected number of apples that will be left in the basket?

At first I thought it was 0, because there is always a chance for a green apple to be left in the basket, however since they are asking for the expected number of apples left, it actually makes sense that the number is positive. I found out that the answers is most likely 10, from various websites, however there is no solution anywhere. I have been trying to approach it with probabilities and with combination, however no luck so far. Some hints or a solution will be much appreciated.

1

There are 1 best solutions below

4
On BEST ANSWER

So we're looking for an average over all possible orders to pull the apples out in. (We'll include the ones after the last green one goes.) Here's one way to choose the order; I hope it's clear that it generates all orders with equal probability.

First, decide what order to take the green ones in.

Then, successively for each red apple, decide its position relative to the apples already placed.

Note that each red apple is then equally likely to lie in each of the five regions "before first green apple", "between first and second green apples", ..., "after fourth green apple".

This means that for a given red apple Pr(this apple is still there after the last green one is taken) = 1/5.

So the expected number of red apples left after the last green one is taken is $50\times\frac{1}{5}$ = 10.