7 Population Models

7.2 Discrete Random Variables

If the possible values of a random variable X are discrete, then the X is a discrete random variable. The populations in Examples 6.2.1, 6.2.2, and 6.2.2 are all discrete.

If the values possible values of a discrete random variable X are x1,x2,x3,, then we will write

X={x1,x2,x3,}.

For example, if X is the outcome of rolling a standard 6-sided die, then we could write X={1,2,3,4,5,6}. The notation X=2 would denote the event that the outcome of a roll is 2.

With a discrete random variable X the manner in which probabilities of outcomes is described works as follows: for each possible value x of X, the probability of observing X=x is denoted by px, i.e.,

P(X=x)=px. (7.1)

The function in Equation 7.1 is called a probability mass function (pmf), and Equation 7.1 can be read as “the probability of observing the value x is px.

For the function to be a proper pmf, the following must hold:

  • For each possible value x of X, px0.

  • The sum of all of the probabilities must be exactly 1, i.e., if X={x1,x2,x3,}, then

    px1+px2+px3+=1.

For example, suppose X is the outcome of rolling a fair 6-sided die. Then P(X=1)=1/6, P(X=2)=1/6, etc. Discrete random variables and their corresponding pmf’s can be displayed nicely with a table. With this X, for example, this table completely describes the random variable:

X P(X=x)
1 1/6
2 1/6
3 1/6
4 1/6
5 1/6
6 1/6

Additionally, a discrete random variable distribution can be graphed as follows: at each location xi along the horizontal axis, draw a stick with height equal to pxi. In Excel, the table and graph will could look like Figure 7.1.

Figure 7.1: Discrete Random Variable

Lastly, the probability notation introduced is handy. For example, suppose X is the outcome of rolling a fair 6-sided die. The symbol P(X3) denotes the probability that a roll results in a 3 or less, i.e., it is the probability of rolling a 1, 2, or 3. In this case, we would have

P(X3)=P(X=1)+P(X=2)+P(X=3)=16+16+16=12.

Concepts Check 1. A fair coin is flipped 4 times, and let X be the proportion of heads observed. What are the possible values of X? Answer: X={0,1/4,1/2,3/4,1} 2. A fair 4-sided die has faces marked as 1, 3, 7 and 9, respectively. Let X be the outcome of a single roll of the die. What is P(X=9)=? Answer: 1/4 3. Using X={1,3,7,9} in the prior problem, compute P(X>3). Answer: 1/2

7.2.1 Exercises

  1. 1.

    A fair coin is flipped 4 times, and let X be the proportion of heads observed. Use a simulation to estimate P(X=3).

  2. 2.

    A fair 4-sided die has faces marked as 1, 3, 7 and 9, respectively. Let X denote the outcome of a single roll. In Excel, enter the distribution of X as a table, and then create a graph that displays the distribution.

  3. 3.

    A fair 4-sided die has faces marked as 1, 3, 7 and 9, respectively. The die is rolled twice, and X represents the sum of the two rolls. Use a simulation to estimate P(X3).

7.2.2 Mean of a Discrete Random Variable - Optional

We will use discrete random variables principally for simulating taking samples from known populations. However, if you are studying a discrete random variable and if you happen to know exactly the corresponding pmf, then you can calculate the mean μ of the population as follows. Suppose X={x1,x2,x3,} and P(X=x)=px. Then

μ=i=1xipxi=x1px1+x2px2+x3px3+ (7.2)

In words, here’s what you do: for each possible value x, multiply it by its corresponding probability px, and then add up all of those products. That gives the mean μ.2727If the number of possible values of X is infinite, then the sum 7.2 (and hence the mean) might not exist. Tackling infinite sums is a problem introduced in calculus.

Example 7.2.1.

Consider the discrete random variable X which is the outcome of rolling a fair 6-sided die:

Figure 7.2: Discrete Random Variable X

To compute μ, for each x compute xpx in the adjacent column:

Figure 7.3: Intermediate Step

Then compute the sum of the entries:

Figure 7.4: The Mean of X

As expected, the average roll of a fair 6-sided die is 3.5.

The upshot is that there are a number of simulations in this text where you can calculate the exact value of a population mean μ directly, namely those that use a random variable that has only finitely many values.

7.2.3 Standard Deviation of a Discrete Random Variable - Optional

The variance σ2 of a discrete random variable is computed similarly. The most computationally friendly formula is follows. If random variable X={x1,x2,x3,} has pmf P(X=x)=px, then

σ2=(i=1xi2pxi)-μ2=(x12px1+x22px2+x32px3+)-μ2 (7.3)

Taking the square-root of Equation 7.3 gives the standard deviation.

The calculation is demonstrated in Figure 7.3.

Figure 7.5: Computing σ