Expected number of different colours when randomly selecting n balls from a box of mixed colours

129 Views Asked by At

I'm not a mathematician but I have some applied statistics background. I have some data for which I want to calculate some expected values.

I have a box with 20 balls of 5 different colours, of varying frequencies (say 1 red, 2 blue, 4 yellow, 6 orange, 7 green). If I select 1 ball, I will have one colour. I'd like to know how many colours I should expect to have, on average, as I then pick out successive balls, i.e. how many colours would I expect to have if I pick another ball, and another ball, all the way up to 20 when I will obviously have 5 colours. I imagine the values from 2 - 19 will be fractions, as this is average expectation.

Either this has a really simple answer, or it's really complicated. I'd like to be able to generalise the solution to a box of any number of balls with any number of colours.

1

There are 1 best solutions below

2
On BEST ANSWER

By linearity of expectation, the expected number of colours is the sum of the probabilities of each colour being selected. If you have $n_i$ balls of colour $i$ and a total of $n$ balls and you draw $k$ balls without replacement, this is

$$ \sum_i\left(1-\frac{\binom{n-n_i}k}{\binom nk}\right)\;. $$