**Exegetic Analytics » R**, and kindly contributed to R-bloggers)

So… the Hypergeometric distribution (as used in one of my previous posts). That was a bit of overkill, wasn’t it?

To recap the problem: we have an urn filled with a selection of white and black balls. We want to calculate the probability that all of the white balls and all but one of the black balls are removed from the urn.

Obviously I was just looking for a *really* big hammer to hit a *really* small nail. That hammer was the Hypergeometric distribution.

If you think about this (for anything more than a moment, which in retrospect, I wish I had!) then it might become apparent that we can reverse the situation and consider putting the balls back into the urn at random. What is the probability of a black ball going in first?

> P1 = NBLACK / NBALLS > P1 [1] 0.1525424

The same result we got out of the Hypergeometric distribution but much simpler.

The post Bags, Balls and the Hypergeometric Distribution: Update appeared first on Exegetic Analytics.

**leave a comment**for the author, please follow the link and comment on their blog:

**Exegetic Analytics » R**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...