16 Discrete Random Variables: Probability Mass Functions
- Roughly, a random variable assigns a number measuring some quantity of interest to each outcome of a random phenomenon.
- The (probability) distribution of a random variable specifies the possible values of the random variable and a way of determining corresponding probabilities.
- We will see many ways of describing a distribution, depending on how many random variables are involved and their types (discrete or continuous)
- A discrete random variable can take on only countably many isolated points on a number line. These are often counting type variables.
- Note that “countably many” includes the case of countably infinite, such as \(\{0, 1, 2, \ldots\}\).
- The probability mass function (pmf) of a discrete RV \(X\), defined on a probability space with probability measure \(\text{P}\), is a function \(p_X:\mathbb{R}\mapsto[0,1]\) which specifies each possible value of the RV and the probability that the RV takes that particular value: \(p_X(x)=\text{P}(X=x)\) for each possible value of \(x\).
- Certain common distributions have special names and properties. We often specify a distribution by name along with values of relevant parameters.
Example 16.1 Roll a fair four-sided die twice and let \(X\) be the sum and \(Y\) the larger of the two rolls.
- Verify that the pmf of \(X\) is \[
p_X(x) = \frac{4 - |x - 5|}{16}, \qquad x = 2, 3, \ldots, 8
\]
- Is the following the pmf of \(Y\)? Discuss. \[
p_Y(u) = \frac{2u - 1}{16}
\]
- In a sequence of Bernoulli(\(p\)) trials
- There are only two possible outcomes, “success” (1) or not (0, “failure”), on each trial.
- The unconditional/marginal probability of success is the same on every trial, and equal to \(p\).
- The trials are independent.
Example 16.2 Recall the “lookaway challenge of Example 8.4.
The game consists of possibly multiple rounds. In the first round, you point in one of four directions: up, down, left or right. At the exact same time, your friend also looks in one of those four directions. If your friend looks in the same direction you’re pointing, you win! Otherwise, you switch roles and the game continues to the next round — now your friend points in a direction and you try to look away. As long as no one wins, you keep switching off who points and who looks. The game ends, and the current “pointer” wins, whenever the “looker” looks in the same direction as the pointer.
Suppose that each player is equally likely to point/look in each of the four directions, independently from round to round.
Let \(X\) be the number of rounds until the game ends.
- Can the rounds be considered Bernoulli trials?
- What are the possible values that \(X\) can take? Is \(X\) discrete or continuous?
- Compute and interpret \(\text{P}(X=1)\).
- Compute and interpret \(\text{P}(X=2)\).
- Compute and interpret \(\text{P}(X=3)\).
- Find the probability mass function of \(X\).
- Construct a table, plot, and spinner representing the distribution of \(X\).
- How can you use the distribution of \(X\) to compute the probability that the player who starts as the pointer wins the game? (In Example 8.4 we computed this to be 4/7 using the law of total probability.)
- Compute and interpret \(\text{P}(X>3)\). Can you think of a way to do this without summing several terms?
- Compute and interpret \(\text{P}(X>5|X > 2)\). Compare to the previous part. What do you notice? Does this make sense?
- What seems like a reasonable shortcut formula for \(\text{E}(X)\) in terms of \(p\)? Consider the case \(p=0.25\) first and then general \(p\).
- Compute \(\text{E}(X)\) using the pmf of \(X\). Did the shortcut work?
- Interpret \(\text{E}(X)\) in context.
- Compute \(\text{Var}(X)\).
- Would \(\text{Var}(X)\) be bigger or smaller if \(p=0.9\)? If \(p=0.1\)?
- Perform Bernoulli(\(p\)) trials until a success occurs and then stop. Let \(X\) count the total number of trials, including the single success. The distribution of \(X\) is defined to be the Geometric(\(p\)) distribution.
- The Geometric(\(p\)) probability mass function follows from the fact that if \(X\) has a Geometric distribution, then \(X = x\) if and only if
- the first \(x-1\) trials are failures, and
- the \(x\)th (last) trial results in success.
- A discrete random variable \(X\) has a Geometric(\(p\)) distribution if and only if its probability mass function is \[\begin{align*} p_{X}(x) & = p (1-p)^{x-1}, & x=1, 2, 3, \ldots \end{align*}\]
- If \(X\) has a Geometric(\(p\)) distribution then \[\begin{align*} \text{P}(X > x) & = (1-p)^x, \qquad x = 1, 2, 3, \ldots\\ \text{E}(X) & = \frac{1}{p}\\ \text{Var}(X) & = \frac{1-p}{p^2} \end{align*}\]
Example 16.3 Continuing Example 16.2.
- Specify how you could simulate a value of \(X\) using the “simulate from the probability space” method.
- Specify how you could simulate a value of \(X\) using the “simulate from the distribution” method.
- Explain how you could use simulation to approximate the distribution of \(X\) and its expected value.
- There are two basic methods for simulating a value \(x\) of a random variable \(X\).
- Simulate from the probability space. Simulate an outcome \(\omega\) from the underlying probability space and set \(x = X(\omega)\).
- Simulate from the distribution. Simulate a value \(x\) directly from the distribution of \(X\).
- The “simulate from the distribution” method corresponds to constructing a spinner representing the marginal distribution of \(X\) and spinning it once to generate \(x\). This method does require that the distribution of \(X\) is known. However, as we will see in many examples, it is common to specify the distribution of a random variable directly without defining the underlying probability space.
Example 16.4 Donny Dont is thoroughly confused about the distinction between a random variable and its distribution. Help him understand by by providing a simple concrete example of two different random variables \(X\) and \(Y\) that have the same distribution. Can you think of \(X\) and \(Y\) for which \(\text{P}(X = Y) = 0\)?
- Do not confuse a random variable with its distribution!
- A random variable measures a numerical quantity which depends on the outcome of a random phenomenon
- The distribution of a random variable specifies the long run pattern of variation of values of the random variable over many repetitions of the underlying random phenomenon.