Basic Probability

This unit is an introduction to the basic concepts of probability theory.

Chance Events


Randomness is all around us. Probability theory is the mathematical framework that allows us to analyze chance events in a logically sound manner. The probability of an event is a number indicating how likely that event will occur. This number is always between 0 and 1, where 0 indicates impossibility and 1 indicates certainty. A classic example of a random experiment is a fair coin toss, in which the two possible outcomes are heads or tails. In this case, the probability of flipping a head or a tail is 1/2. In an actual series of coin tosses, however, we may get more or less than exactly 50% heads.

Flip the Coin
Flip 100 times

For an unfair or weighted coin, the two outcomes are not equally likely. You can change the weight of the coin by dragging the true probability bars (on the right in blue) up or down.

Expectation


The expectation is a statistic that attempts to summarize the average of a random experiment. It can be interpreted as the long term average outcome of repeating the experiment many times. Mathematically, it is defined as the probability weighted sum of all outcomes in the sample space, denoted,

$$E[X] = \sum_{x \in \Omega}xP(x)$$

Consider the random experiment of rolling a fair die and watch as the running average converges to the expectation of 3.5.

Roll the Die
Roll 100 times

Make the die unfair by adjusting the blue bars below and observe how this changes the expectation.

Variance


The variance is a statistic that summarizes the spread of an experiment. Mathematically, it is defined in terms of an expectation. It is the average value of the squared difference between the outcome and the mean, denoted,

$$Var(X) = E[(X - E[X])^2] = E[X^2] - E[X]^2$$

Draw cards randomly from a deck of ten cards. As you continue drawing cards, observe that the running average of squared differences (in green) begins to resemble the true average squared difference (in blue).

Draw a Card
Draw 100 times

Toggle which cards you want to include in the deck by clicking on them below.