Slippy:
Breakfast:
The expected number of binomial trials is:
1/(4/4) +1/(3/4) + 1/(2/4) + 1/(1/4)
First; if the probability of an event happening is p then the mean number of trials to obtain a success is 1/p.
Code:
Number Probability
of of
Trials Success
------ -----------
1 p
2 pq
3 pq2
4 pq3
. .
. .
. .
Since there must eventually be a success the sum of probabilities is:
p + pq + pq^2 + pq^3 + ... = 1.
The mean number of trials (m) is: m = p + 2pq + 3pq^2 + 4pq^3 + ...
mq = pq + 2pq^2 + 3pq^3 + ...
m-qm= p + pq + pq^2 + pq^3 + ...
m(1-q) = 1.
m = 1/(1-q) = 1/p.
Second, the answer to the problem can be express as the sum of the following:
Number of trials to get a first toy
Number of trials to get a second toy once you have one toy
Number of trials to get a third toy once you have two toys
Number of trials to get the final toy once you have three toys
The number of trials to get one toy is obviously one.
Once you have one the probability of getting a different toy in the next box is 3/4, thus the expected number of trials is 1/(3/4) = 4/3 to get the second toy.
By the same logic the number of trials to get the third is 1/(1/2)=2 and 1/(1/4)=4 for the final toy.
Summing these yields 1 + 4/3 + 2 + 4 = 25/3 = ~ 8.333 .
Slippy continues:
"
Guilty as charged
Take the p below