Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

5 colors, so:

   P(color) = 0.2 = p
Expected number of, say, blue, in N = 55 skittles is:

  E(N_blue) = Np = 11
Standard deviation:

  Sdev(N_blue) = sqrt(N p (1-p)) = 2.95
So you would expect to see 11 +/- 3 skittles.

(If you take the largest discrepancy of the 5 colors, it's harder to compute.)

If you want to look at a large deviation from the expected:

  P(Nblue < 7) ~= P(Nblue = 6) = choose(55,6) p^6 (1-p)^49 = 3.3%
which is pretty significant, especially considering you were looking at large deviations over any of five colors. In the other direction:

  P(Nblue > 17) ~= P(Nblue = 18) = choose(55,18) p^18 (1-p)^37 = 0.98%
which is still pretty significant. With probabilities this small, and events like these that are lightly-correlated, the second-order terms in the relevant Bonferroni inequality will be pretty small, so

  P(any color = 18) ~= 5 * P(Nblue = 18) ~= 5%
(You could do all these calculations more exactly, but they are within a factor of 2.)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: