Study Blog: Poke here
Test instructions: There is an n-sided dice, ask at least see all the faces at once the desired number of times to roll the dice;
The first face of the first occurrence of the probability is P1 n/n;
The probability of the first occurrence of the second face is P2 (n-1)/n;
The probability of the first occurrence of the third face is P3 (n-2)/n;
...
The first occurrence probability is pi (n-i+1)/n;
First look at what the geometric distribution is:
Geometric distribution: In the nth-time Bernoulli test, the probability of the first success was obtained by the test K . In detail: The first k-1 times all failed, the probability of K -times success is p.
Expectation of the geometrical distribution E (X) = 1/p;
So the expectation is ∑1/PI = n * (1+1/2+1/3+1/4+1/5+...+1/n);
"Non-original" Lightoj 1248-dice (III) "Geometric distribution + expectation"