[1] 1.5
STAT 200 – Introductory Statistics
January 19, 2026
After today’s lecture, you should:
A random variable is a variable whose numeric value is determined by the outcome of a probability experiment.
Examples:
Random variables have (or follow) probability distributions. This fact allows us to understand the randomness of a random variable… and of our sample.
It might sound counter-intuitive, but remember that probability is predictable in the long run.
I can’t tell you what will happen on the next coin flip, but I can tell you approximately what proportion of 1000 coin flips will land heads.
Misunderstanding this distinction can lead to all kinds of incorrect reasoning.
The Gambler’s Fallacy is the mistaken belief that a random event is more likely to happen because it has not happened multiple times in a row.
If you haven’t had a good hand all night, you’re not any more likely to get a good hand this round than any other.
At their core, random variables are just functions, sending the set of possible outcomes to their probabilities.
There are three requirements for a function to be a probability mass function, which defines a random variable.
\[ 0 \le \mathbb{P}[X = x] \le 1 \]
At their core, random variables are just functions, sending the set of possible outcomes to their probabilities.
There are three requirements for a function to be a probability mass function, which defines a random variable.
\[ \sum_{x \in S} \mathbb{P}[X = x] = 1 \]
At their core, random variables are just functions, sending the set of possible outcomes to their probabilities.
There are three requirements for a function to be a probability mass function, which defines a random variable.
\[ \mathbb{P}[A \cup B] \le \mathbb{P}[A] + \mathbb{P}[B] \]
Let us create a probability mass function for this experiment:
Flip a coin three times and count the number of heads flipped.
Solution: The first step is to determine the set of possible outcomes, the sample space, \(S\). From the description of the experiment, these are the only outcomes possible:
\[ S = \{ 0, 1, 2, 3 \} \]
Let us create a probability mass function for this experiment:
Flip a coin three times and count the number of heads flipped.
Solution:
The second step is to determine the probability of each of the elements of the sample space.
To do this, we will rely on two assumptions:
A graphic is one way of showing the probability mass function. This is a graphic of the probability mass function for this problem.
A formula is another way of showing the probability mass function. This becomes more handy when the sample space becomes much larger.
\[ \mathbb{P}[X = x] = \begin{cases} 0.125 & \textrm{if } x = 0 \\ 0.375 & \textrm{if } x = 1 \\ 0.375 & \textrm{if } x = 2 \\ 0.125 & \textrm{if } x = 3 \\ 0 & \textrm{otherwise} \end{cases} \]
Note: You need the last line in there to fully define the function.
The formula isn’t necessarily unique either. This also defines the same probability mass function:
\[ \mathbb{P}[X = x] = \binom{3}{x} 0.5^x (1 - 0.5)^{3-x}, \quad x \in {0,1,2,3} \]
The expected value of a distribution (or of a random variable) is the “long-run” average of the distribution’s outcomes.
The expected value of a discrete random variable \(X\) is equal to the mean of the probability distribution of \(X\) and is given by
\[ \mathbb{E}[X] = \sum_{x \in S} x\,\mathbb{P}[X = x] \]
The variance of a distribution (or of a random variable) is a measure of uncertainty in each outcome. It has the opposite meaning of precision.
The variance of a discrete random variable \(X\) is given by
\[ \mathbb{V}[X] = \sum_{x \in S} (x - \mu)^2\,\mathbb{P}[X = x] \]
The median of a distribution (or of a random variable) is an \(x\)-value such that at least half is no more than it, and at least half is no less than it.
The median** of a discrete random variable \(X\) is given by
\[ \tilde{X} = \left\{ x \,\vert\, \mathbb{P}[X \le x] \ge 0.50 \textrm{ and } \mathbb{P}[X \ge x] \ge 0.50 \right\} \]
Note that the actual definition:
Let us return to our original example, flipping a coin three times. The probability mass function is:
\[ \mathbb{P}[X = x] = \begin{cases} 0.125 & \textrm{if } x = 0 \\ 0.375 & \textrm{if } x = 1 \\ 0.375 & \textrm{if } x = 2 \\ 0.125 & \textrm{if } x = 3 \\ 0 & \textrm{otherwise} \end{cases} \]
With this probability mass function, let us calculate the mean, variance and median.
First, here is the probability mass function as a graphic:
From the graphic, what do we expect the mean and median to be?
The mean is defined as:
\[ \mathbb{E}[X] = \sum_{x \in S} x\,\mathbb{P}[X = x] \]
Since \(S = \{0, 1, 2, 3\}\), the expected number of heads is:
\[ \begin{aligned} \mathbb{E}[X] &= \sum_{x \in S} x\,\mathbb{P}[X = x] \\ &= 0(0.125) + 1(0.375) + 2(0.375) + 3(0.125) \\ &= 0 + 0.375 + 0.750 + 0.375 \\ &= 1.500 \end{aligned} \]
Thus, the expected number of heads of three flips of a fair coin is \(1.5\).
The variance is defined as:
\[ \mathbb{V}[X] = \sum_{x \in S} (x - \mu)^2\,\mathbb{P}[X = x] \]
Since \(S = \{0, 1, 2, 3\}\), the variance of the number of heads is:
\[ \begin{aligned} \mathbb{V}[X] &= \sum_{x \in S} (x - \mu)^2\,\mathbb{P}[X = x] \\ &= (0-1.5)^2(0.125) + (1-1.5)^2(0.375) \\ &\qquad\qquad + (2-1.5)^2(0.375) + (3-1.5)^2(0.125) \\ &= 2.25(0.125) + 0.25(0.375) + 0.25(0.375) + 1.25(0.125) \\ &= 0.75 \end{aligned} \]
Thus, the variance of the heads of three flips of a fair coin is \(0.75\), and the standard deviation is \(\sqrt{0.75} \approx 0.866\).
The median is defined as:
\[ \tilde{X} = \left\{ x \,\vert\, \mathbb{P}[X \le x] \ge 0.50 \textrm{ and } \mathbb{P}[X \ge x] \ge 0.50 \right\} \]
How do we use this formula? Start low and keep adding until you first get to/over \(0.500\):
\[ \begin{aligned} X = 0 &: 0.125 \not\ge 0.500 \\ X = 1 &: 0.125 + 0.375 \ge 0.500 \end{aligned} \]
We have the cumulative probabilities at least \(0.500\), and we are done with the calculations. Because the cumulative probabilities equal \(0.500\), both \(1\) and \(2\) are medians.
Technically, the medians are all numbers in the set \(1 \le \tilde{X} \le 2\). For the sake of convenience, we will state \(\tilde{X} = 1.5\).
If we understand discrete distributions and how R works, we could use R to get these answers, or at least help us get the answers.
If we understand discrete distributions and how R works, we could use R to get these answers, or at least help us get the answers.
If we understand discrete distributions and how R works, we could use R to get these answers, or at least help us get the answers.
A STAT 225 course project had students predict the outcome of an ice hockey game between the Portland Winterhawks and the Prince George Cougars. Together (averaged), they determined that the following was the probability mass function for the number of points scored by the Winterhawks:
| Score | \(0\) | \(1\) | \(2\) | \(3\) | \(4\) | \(5\) |
|---|---|---|---|---|---|---|
| Probability | \(0.1\) | \(0.1\) | \(0.2\) | \(0.4\) | \(0.1\) | \(0.1\) |
With this information, let us calculate the expected number of goals, the variance, and the median.
First, here is the probability mass function as a graphic:
From the graphic, what do we expect the mean and median to be?
Since \(S = \{0, 1, 2, 3, 4, 5\}\), the expected number of goals is:
\[ \begin{aligned} \mathbb{E}[X] &= \sum_{x \in S} x\,\mathbb{P}[X = x] \\ &= 0(0.1) + 1(0.1) + 2(0.2) + 3(0.4) + 4(0.1) + 5(0.1) \\ &= 2.6 \end{aligned} \]
Thus, the expected number of goals to be made by the Winterhawks is \(2.6\).
Since \(S = \{0, 1, 2, 3\}\), the variance of the number of goals is:
\[ \begin{aligned} \mathbb{V}[X] &= \sum_{x \in S} (x - \mu)^2\,\mathbb{P}[X = x] \\ &= (0-2.6)^2(0.1) + (1-2.6)^2(0.1) + (2 - 2.6)^2(0.2) \\ &\qquad\qquad + (3-2.6)^2(0.4) + (4-2.6)^2(0.1) + (5-2.6)^2(0.1) \\ &= 6.76(0.1) + 2.56(0.1) + 0.36(0.2) \\ &\qquad\qquad + 0.16(0.4) + 1.96(0.1) + 5.76(0.1) \\ &= 1.84 \end{aligned} \]
Aside: The Empirical Rule: Recall the Empirical Rule. Since the standard deviation is \(\sqrt{1.84} \approx 1.356\), we can estimate the probability of the Winterhawks scoring between \(\mu - \sigma = 1.244\) and \(\mu + \sigma = 3.956\) is about 68%.
Again, remember that the Empirical Rule is only an approximation. Since we have the entire probability mass function, we know that the probability of the Winterhawks scoring between \(1.244\) and \(3.956\) goals is \(0.2 + 0.4 = 60\%\) (not \(68\%\)).
Still, this is a rather close estimate, right?
Again, start low and keep adding until you first get to/over \(0.500\):
\[ \begin{aligned} x = 0 &: 0.1 \not\ge 0.500 \\ x = 1 &: 0.1 + 0.1 = 0.2 \not\ge 0.500 \\ x = 2 &: 0.1 + 0.1 + 0.2 = 0.4 \not\ge 0.500 \\ x = 3 &: 0.1 + 0.1 + 0.2 + 0.4 = 0.8 \ge 0.500 \end{aligned} \]
Thus, a median is \(3\).
Note: since the cumulative sum does not equal 0.500, the only median is 3.
If we understand discrete distributions and how R works, we could use R to get these answers, or at least help us get the answers.
If we understand discrete distributions and how R works, we could use R to get these answers, or at least help us get the answers.
If we understand discrete distributions and how R works, we could use R to get these answers, or at least help us get the answers.