Probability distributions

Eleven distributions with the same functions you use in R: dbinom, pnorm, qt and friends. You choose the distribution and the question, and you see the area each call computes, the result and how to read it. It runs in your browser, on your phone too.

How to use it

  1. Start with a lesson (guessing a test, messages per hour, the exam mark, waiting for the bus or the sampling ones) and move on with Next step; before some steps it asks what you think happens.
  2. Touch any control whenever you like: the distribution, its parameters with the same names as in R (size, prob, lambda, mean, sd, df…) and the question: P(X ≤ a), P(X > a), P(X ≥ a), a piece, a point or a quantile.
  3. At the top you have the exact R call with its result; below the plot, the mean, the variance and how to read the number.

What it works out

The d function gives the point probability for a discrete variable and the height of the curve for a continuous one; the p, the cumulative probability F(x) (or the right tail with lower.tail = FALSE); the q, the quantile: for a discrete variable, the smallest x with F(x) ≥ p, as in R.

The rules it follows

  • Parameters in R’s order and with R’s names: the geometric counts the failures before the first success and the exponential uses rate = 1/mean.
  • For discrete variables, P(X ≥ a) = 1 − F(a − 1) and P(a ≤ X ≤ b) = F(b) − F(a − 1); for continuous ones, < and ≤ give the same.
  • The calculations were checked with more than 35,000 cases against SciPy.

For the exam

In the ME1 continuous assessments you work by hand and with R: set out on paper which probability you are asked for, write the call and check it here. The challenge below gives you new probabilities.