Random Variables, Expectation, Variance

Review of Module 3, Introduction to Probability

Now that we know a bit about probability distributions, we can discuss the concepts of a random variables, expectation, and variance. While these concepts apply to all probability distributions, we will discuss each one in the context of the Bernoulli coin flip example, where we win 1 point for flipping heads and 0 points for flipping tails on a fair coin.

Random variable

A random variable represents the outcome of drawing once from the probability distribution upon which it is defined.

In our example, let the number of points we win from a fair coin flip be represented by the random variable, X. X is equal to 1 point with 0.5 chance and 0 points with 0.5 chance. Random variables are denoted by capital letters.

Expectation

The expectation of a random variable is the mean (or average) value the random variable takes, according to its probability distribution. In other words, it is a weighted average of the possible values of a random variable, where each value is weighted by its probability. Here is the expectation of a Bernoulli random variable.

E(X)=0(1p)+1p=pE(X) = 0*(1-p) + 1*p = p

In our example, we win 1 point if we flip heads and 0 points if we flip tails on our fair coin. What is the expected number of points won in our coin flip example?

Variance

The variance of a random variable is a measurement of how much the outcomes of the random variable differ from its expectation. It is defined as the expectation over the squared differences of each outcome from the mean. Written mathematically, the definition of variance for a Bernoulli random variable is:

var(X)=(1p)(0E(X))2+p(1E(X))2var(X) = (1-p)*(0 - E(X))^2 + p*(1-E(X))^2

What is the variance of points won in our coin flip example?

Standard Deviation

The standard deviation is the square root of the variance. Note that calculating the variance involves squaring the values of the random variable; this means that the variance is in the squared units of the random variable. We use the standard deviation to discuss variance in the same units as the random variable.

Last updated