In this post, I want to talk about the equation for the variance of a random variable use this to get a geometric intuition behind some properties of random variables. First, let’s define what a random variable is.
A random variable is a function that takes in a set of possible outcomes and outputs the probability of that particular outcome. For example, we could define a random variable that takes the value
with probability
and takes the value
with probability
.
Once you have a random variable, there are some things you might want to know about it. For example, you might be curious what its expected value is. This is like an average, but it extends to random variables that take on a continuous set of values as well. To find the expected value in this case, we calculate . For a discrete random variable, the expected value is really a weighted average of the possible values of the random variable (weighted by the probability of occurring).
The expected value of random variable is often written as
. Once you know how to calculate this, you might ask what happens if you transform the values that
can take and then recalculate expected values. In particular, you might ask what happens if you calculate
, or in general,
for some
. For any value of
, these are called “moments of a distribution,” and they tell you about properties of the distribution.
In our example above, to calculate , we just calculate
. In this case, since the possible values of the random variable were
and
, we get the same answer if we square them and recompute the expression. So,
in this case, but that won’t always be true.
The variance of a random variable, which tells you about how much the values of the random variable are spread out, is defined as , where
is the standard deviation of
.
Now let’s do something kind of fun and rearrange that equation a little bit. If we add to both sides, we get that
.
Looking at it like this, we can imagine a right triangle with legs of length and
and hypotenuse of length
.
If we let be a moment generating function for
, then we can replace
with
and
with
. That’s kind of fun!
I hope this helped you care more about triangles and probability!