A random variable (RV) is a numeric outcome of a chance experiment.
For example, suppose we toss 2 coins and record the number of tails. Let X = the number of tails. X is a random variable that can take on the values 0, 1, and 2. Below we list the sample space along with the corresponding values for X:
| Sample Space | HH | HT | TH | TT |
|---|---|---|---|---|
| Values for X | X=0 | X=1 | X=1 | X=2 |
There are two types of random variables: discrete and continuous. A discrete random variable has possible values that are isolated points on a number line (usually a count). A continuous random variable has possible values that correspond to points on an interval (usually a measurement).
For example, the number of registered voters who plan to vote next month is a discrete random variable. And the time for a randomly selected student to finish an exam is a continuous random variable.
For the rest of this lesson and the next we will only consider discrete random variables.
The probability distribution of a discrete random variable \(X\) is a list of all the values that \(X\) can take on and the probabilities with which it takes on those values.
The probability that \(X\) takes on the value \(x\) is denoted by \(p(x)=P(X=x)\) where \(p(x)\) is called the probability distribution function of \(X\).
Example 1: Suppose we roll 2 3-sided dice and record the sum of the up faces. Define X to be the sum of the up faces. Find the probability distribution of X
Click For Answer| Sample Space | 1,1 | 1,2 | 1,3 | 2,1 | 2,2 | 2,3 | 3,1 | 3,2 | 3,3 |
|---|---|---|---|---|---|---|---|---|---|
| X | 2 | 3 | 4 | 3 | 4 | 5 | 4 | 5 | 6 |
| p(x) | \(\frac{1}{9}\) | \(\frac{1}{9}\) | \(\frac{1}{9}\) | \(\frac{1}{9}\) | \(\frac{1}{9}\) | \(\frac{1}{9}\) | \(\frac{1}{9}\) | \(\frac{1}{9}\) | \(\frac{1}{9}\) |
Next, we combine the common values of X into the probability distribution:
| X | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|
| p(x) | \(\frac{1}{9}\) | \(\frac{2}{9}\) | \(\frac{3}{9}\) | \(\frac{2}{9}\) | \(\frac{1}{9}\) |
or, equivalently, \(p(x) = \frac{x-1}{9} \text{ for } x = 2,3,4\) and \(p(x) = \frac{7-x}{9} \text{ for } x = 5,6\).
The probability distribution function of a discrete random variable must satisfy the following two properties:
\(0 \le p(x) \le 1\) for any value \(x\)
the probabilities sum to 1, \(\sum p(x) = 1\)
Example 2: Which of the following is a valid probability distribution?
The cumulative distribution function (cdf) for a discrete random variable \(X\) is the probability that \(X\) does not exceed the value \(x_0\) and is denoted by \(F(x_0)\)
\[F(x_0) = P(X \le x_0) = \sum_{x=-\infty}^{x_0} p(x)\]
Example 3: Find the cumulative distribution function of the distribution from Example 1 and use it to find the probability of getting a sum
The probability distribution of X along with its cumulative distribution function is
| X | 2 | 3 | 4 | 5 | 6 | |
|---|---|---|---|---|---|---|
| p(x) | \(\frac{1}{9}\) | \(\frac{2}{9}\) | \(\frac{3}{9}\) | \(\frac{2}{9}\) | \(\frac{1}{9}\) | |
| F(x) | \(\frac{1}{9}\) | \(\frac{3}{9}\) | \(\frac{6}{9}\) | \(\frac{8}{9}\) | \(1\) |
Notice that we used the complement rule to solve the last two problems. Also notice that the endpoints matter, i.e. \(P(X \ge 4) \ne P(X>4)\)