Often times we will want to perform computations to identify features of a probability distribution. As an abstract example, given a process or experiment where various outcomes are numbers occurring according to a probability distribution, we may wish to compute the squares of those numbers. Or, as a more concrete example, we may have different payouts according to various outcomes of a Las Vegas table game and want to consider all of those possible payouts at once for the purposes of determining a betting strategy. Since we don’t know up front what the result of the experiment is going to be, we want to perform these computations while leaving the outcome variable. The language for such is that of random variables.
Definition: A random variable is a real valued function defined on a sample space. Since a sample space is the collection of possible outcomes for an experiment, another way to think of this is as a function whose result is determined by the outcome of the experiment.
That is, for each possible outcome of our process/experiment we have a value. For example, consider the sample space of results on rolling two dice. There are thirty-six possible outcomes for this experiment. The sum of the values on the two dice is a function associating a number with each of the possible outcomes, and these numbers are integers from
The two examples above are examples of discrete random variables, as they have a finite (or countably infinite – as will be discussed in a moment) number of possible values. We take this as the definition of a discrete random variable. For an example of a discrete random variable which can take on any of infinite number of possible values, consider the game where one flips a coin repeatedly until it lands heads-up. Count the number of flips it takes for this to happen. The value of this random variable is one of the infinitely many values
There are other random variables which can take on values throughout an interval. These are called continuous random variables. As an example, suppose a dart is thrown at a dartboard of radius ten inches. The function which assigns to the throw the distance of the dart from the center of the board is a random variable which can take any value between
Functions of a Random Variable Since we can post-compose any function
For example, consider the following lottery game: we pay two dollars to roll a die. If the die comes up
With this, we see that we will pay no taxes with probability
Sometimes two different processes can give rise to random variables assuming the same points in
If we have a continuous random variable, the definition of a random variable must be slightly different. In this case, no value is assigned to individual points of our subset of
For these to make sense, we need to ensure that the rules of probability are respected. Thus we need to make sure that for no point (discrete case) or interval (continuous case) is the probability ever negative, and that the total probability is
Test for Random Variable There is a simple way to determine if a function
-
If
(discrete) takes values , , … with probabilities ,
, … , we need-
for each
, , and -
that
.
-
for each
-
If
(continuous), then we need-
for each interval
that , and -
that
.
-
for each interval
In the above example, we saw that it was important to understand what values can be assumed by a random variable, and with what probabilities those values can be assumed. The following discussion is about precisely this: how we keep track of the possible values of a random variable and the probabilities with which those values can be attained.
Density and Distribution
Given a random variable, we wish to keep track of what values it can assume and with what probability. Two tools are commonly used here: density and distribution. We will discuss these one at a time, and describe the relationship between the two.
Given a finite sample space, each of the possible outcomes has a specific probability. Thus, denoting our random variable by
But there are only eleven possible outcomes for the sum of their two values. The possible sums are
We see that five out of the thirty-six equally likely rolls yield a sum of
For a discrete random variable
The term “density” apparently comes from the way one records such information for continuous random variables. Given a continuous random variable
That
With this in mind, one might consider discrete probability densities as a sort of coagulation of continuous probability at specific values.
Examples: Compatibility Condition for Discrete and Continuous Probability Densities
Consider the following two problems.
Discrete Problem Suppose that we have a process that takes as many steps as necessary to finish – i.e. the process could finish after one step, or after two, or after three, etc. Suppose we further know that the process must eventually finish, and that the probability of finishing after
One way to approach this is to observe that we do not know the probability that the process ends after the first step. Letting
We compute
which we can identify as
But this sum is a geometric series, whose sum is well understood. In fact, here
so that our compatibility condition becomes
and we see that
Continuous Problem Suppose that we have an experiment that gives outcomes between

plot of
The compatibility condition tells us that we need
But
so we need
There is another notion of how probability is apportioned to the values of a random variable. This is called the probability distribution.
Probability Distribution
The distribution of a random variable
-
If
is discrete, taking values , , … , with probabilities , , … , then the distribution function is
-
and if
is continuous with density function , then its distribution function is
That is, the distribution function
as the probability is
By way of examples, we construct the distribution functions
-
Discrete Example: We had the density function
Thus the distribution function is
with the following graph.graph of distribution function
-
Continuous Example: We had the density function
Thus the distribution function is
with the following graph.graph of distribution function
We note that the density function
-
If
is discrete then . -
If
is continuous then .
The language here is sometimes a bit confusing, as different groups of people came at these ideas
from different points of view. Sometimes our notion of probability density is called “probabilty distribution”, and our notion of probability distribution is then called “cumulative probability distribution”. Neither is right or wrong. The choice of terminology is a convention, and in any setting the attentive participant must clarify what the words being used mean. We will use the language presented here, because it is more common in mathematics and natural sciences.