6  Discrete Random Variables

Table 6.1: Two rolls of a fair four-sided die
First roll Second roll X Y
1 1
1 2
1 3
1 4
2 1
2 2
2 3
2 4
3 1
3 2
3 3
3 4
4 1
4 2
4 3
4 4

Example 6.1 Roll a four-sided die twice, and record the result of each roll in sequence. Let \(X\) be the sum of the two dice, and let \(Y\) be the larger of the two rolls (or the common value if both rolls are the same). Table 6.1 represents the possible outcomes. Assume the die is fair and the rolls are independent.

  1. Fill in the values of \(X\) and \(Y\) for each outcome in the table.




  2. Identify the event \(\{X = 4\}\) and compute its probability. Then interpret the probability both as a long relative frequency and as a relative likelihood.




  3. Construct a table and plot of \(\text{P}(X = x)\) for each possible value \(x\) of \(X\).




  4. Construct a table and plot of \(\text{P}(Y = y)\) for each possible value \(y\) of \(Y\).




Figure 6.1: The marginal distribution of \(X\), the sum of two rolls of a fair four-sided die.
Figure 6.2: The marginal distribution of \(Y\), the larger of two rolls of a fair four-sided die.

Example 6.2 Recall the batch testing scenarios from Example 5.2 and Example 5.3. Let \(X\) be the total number of tests required when we test all 8 people in a single batch first, and let \(Y\) be the total number of tests when we split into two batches of 4 people first.

  1. Identify the distribution of \(X\).




  2. Identify the distribution of \(Y\).




Example 6.3 The “matching problem” involves \(n\) distincts objects labeled \(1, \ldots, n\) which are placed in \(n\) distinct boxes labeled \(1, \ldots, n\), with exactly one object placed in each box. Suppose the objects are placed in the boxes uniformly at random, so that any possible arrangement is equally likely. Let \(X\) be the number of matches, that is, the number of objects for which their label matches the label of the box in which they are placed.

For example, suppose \(n\) people have a secret Santa gift exchange. Each person puts their name in a hat, the names are well shuffled, and everyone draws a name from the hat (to then purchase a gift for the selected person). Let \(X\) represent the number of people who draw their own name.

Consider the matching problem with \(n=3\). Specify the distribution of \(X\), and interpret it.




6.1 Exercises

Exercise 6.1 Five individuals are interviewing for a single job opening, but only two are qualified for the position. Suppose the individuals are interviewed in a random order, and each individual is only interviewed once, until one of the qualified candidates is interviewed, and then no more candidates are interviewed. Let \(X\) count the number of interviews conducted.

Make a table to represent the distribution of \(X\).












Exercise 6.2 Continuing Example 6.1.

  1. Describe how you could simulate a single value of \(Y\).




  2. Construct a spinner (like from a kids game) to represent the distribution of \(Y\).




  3. Describe another way to simulate a single value of \(Y\).




  4. Describe how you could use simulation to approximate the distribution of \(Y\).




  • Don’t 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.
  • Any marginal distribution can be represented by a single spinner (like from a kids game).
  • In principle, there are always two ways of simulating a value \(x\) of a random variable \(X\).
    1. Simulate from the probability space. Simulate an outcome \(\omega\) from the underlying probability space and set \(x = X(\omega)\).
    2. Simulate from the distribution. Construct a spinner corresponding to the distribution of \(X\) and spin it once to generate \(x\).
  • The second method requires 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.