4.2 Discrete Random Variables

A student takes a ten-question, true-false quiz. Because of the student’s busy schedule, they could not study and guesses randomly at each answer. What is the probability of the student passing the test with at least a 70%?

Small companies might be interested in the number of long-distance phone calls their employees make during the peak time of the day. Suppose the average is 20 calls. What is the probability that the employees make more than 20 long-distance phone calls during peak hours?

These two examples illustrate two different types of probability problems involving discrete random variables. Recall that discrete data are data that you can count. A random variable describes the outcomes of a statistical experiment in words. The values of a random variable can vary with each repetition of an experiment.

Discrete Random Variables

We have previously seen the word discrete associated with types of data. Discrete means we have a countable number of outcomes, so a discrete random variable is an RV that models a process or experiment that produces discrete data.

For instance, let X stand for the number of heads you get when you toss three fair coins. The sample space for the toss of three fair coins is TTT, THH, HTH, HHT, HTT, THT, TTH, HHH. Then, x = 0, 1, 2, 3. X is given in words, while x is given in numbers. Notice that for this example, the x values are countable outcomes. Because you can count the possible values that X can take on and the outcomes are random (the x values 0, 1, 2, and 3), X is a discrete random variable.

Example

A child psychologist is interested in the number of times a newborn baby’s crying wakes its mother after midnight. For a random sample of 50 mothers, the following information was obtained. Let X represent the number of times per week a newborn baby’s crying wakes its mother after midnight. For this example, x = 0, 1, 2, 3, 4, 5.

P(x) = probability that X takes on a value x.

 x  P(x)
0  P(x=0) = \frac{2}{50}
1  P(x=1) = \frac{11}{50}
2  P(x=2) = \frac{23}{50}
3  P(x=3) = \frac{9}{50}
4  P(x=4) = \frac{4}{50}
5  P(x=5) = \frac{1}{50}

Figure 4.2: Newborn baby crying

Is this a valid discrete probability distribution?

 

Solution

X takes on the values 0, 1, 2, 3, 4, 5. This is a valid discrete PDF because:

Each P(x) is between zero and one, inclusive.

The sum of the probabilities is one, that is,

\frac{2}{50} + \frac{11}{50} + \frac{23}{50} + \frac{9}{50} + \frac{4}{50} + \frac{1}{50} = 1

Your Turn!

A hospital researcher is interested in the number of times the average post-op patient will ring the nurse during a 12-hour shift. For a random sample of 50 patients, the following information was obtained. Let X represent the number of times a patient rings the nurse during a 12-hour shift. For this exercise, x = 0, 1, 2, 3, 4, 5. P(x) = the probability that X takes on value x. Is this a discrete probability distribution function? If so, provide two reasons why this is or is not the case.

 X  P(x)
0  P(x=0) = \frac{4}{50}
1  P(x=1) = \frac{8}{50}
2  P(x=2) = \frac{16}{50}
3  P(x=3) = \frac{14}{50}
4  P(x=4) = \frac{6}{50}
5  P(x=5) = \frac{2}{50}

Figure 4.3: Post-op patients

Characteristics and Notation

The distribution of a discrete random variable is often pictured in a table, but it may also be represented by a graph or formula. There are two main characteristics it should exhibit:

  1. Each probability is between zero and one, inclusive.
  2. The sum of the probabilities is one.

The probability mass function (PMF) of a DRV tells you the probability of a single value. Notation-wise, this means P(X = x). This is also sometimes (erroneously) called probability distribution function (PDF).

The cumulative distribution function (CDF) of a DRV tells you the probability of being less than or equal to a value. Notation-wise, this means P(X ≤ x).

A probability distribution function is a pattern. You try to fit a probability problem into a pattern or distribution in order to perform the necessary calculations. These distributions are tools that make it easier to solve probability problems. Each distribution has its own special characteristics. Learning the characteristics enables you to distinguish among the different distributions.

Example

Suppose Nancy has classes three days a week. She attends all three days 80% of the time, two days 15% of the time, one day 4% of the time, and no days 1% of the time. Suppose one week is randomly selected.

Let X represent the number of days Nancy             .

Solution

attends class per week

 

X takes on what values?

Solution

0, 1, 2, and 3

 

Construct a probability distribution table (called a PDF table) like the one below for the week chosen at random. The table should have two columns labeled x and P(x). What does the P(x) column sum to?

 x  P(x)
0
1
2
3

Figure 4.4: Blank PDF

 

Solution
x f(x)
0 0.01
1 0.04
2 0.15
3 0.80

Figure 4.5: Blank table

 

Construct the cumulative probability distribution function.

Solution
x f(x) F(x)
0 0.01 0.01
1 0.04 0.05
2 0.15 0.20
3 0.80 1

Figure 4.6: Cumulative PDF

Your Turn!

Jeremiah has basketball practice two days a week. Ninety percent of the time, he attends both practices. Eight percent of the time, he attends one practice. Two percent of the time, he does not attend either practice. What is X, and what values does it take on?

Measures of Discrete Random Variables

Once we know how to work with discrete random variables, we may be interested in some other measures of the data, such as the mean, variance, and standard deviation. These ideas resurface here, but in the slightly different context of random variables.

The Expected Value (Mean) of a Discrete Random Variable

Recall the law of large numbers, which states as the number of trials in a probability experiment increases, our results become closer to what we expect. When evaluating the long-term results of statistical experiments, we often want to know the “average” outcome. This long-term average is known as the mean or expected value of the random variable and is denoted by the Greek letter μ or E[X] in the context of random variables. In other words, this is the average value you would expect after conducting many trials of an experiment.

To find the expected value or long-term average, we simply multiply each value of the random variable by its probability and add the products. It is essentially a probability weighted average of the values of the random variable.

Mean or expected value:

\mu=\underset{x\in X}{{\sum }^{\text{​}}}xP\left(x\right)

Example

A men’s soccer team plays soccer zero, one, or two days a week. The probability that they play zero days is 0.2, the probability that they play one day is 0.5, and the probability that they play two days is 0.3. Find the long-term average or expected value, μ, of the number of days per week the men’s soccer team plays soccer.

To do the problem, first let the random variable X represent the number of days the men’s soccer team plays soccer per week. X takes on the values 0, 1, 2. Construct a PDF table, adding a column x*P(x). In this column, you will multiply each x value by its probability. This table is called an expected value table. The table helps you calculate the expected value, or long-term average.

 x  P(x)  x*P(x)
0 0.2 (0)(0.2) = 0
1 0.5 (1)(0.5) = 0.5
2 0.3 (2)(0.3) = 0.6

Figure 4.7: Expected value table

What is the expected value?

 

Solution

Add the last column x*P(x) to find the long term average or expected value: (0)(0.2) + (1)(0.5) + (2)(0.3) = 0 + 0.5 + 0.6 = 1.1.

The expected value is 1.1. The men’s soccer team would, on the average, expect to play soccer 1.1 days per week. The number 1.1 is the long-term average or expected value if the men’s soccer team plays soccer week after week after week. We say μ = 1.1.

Your Turn!

A hospital researcher is interested in the number of times the average post-op patient will ring the nurse during a 12-hour shift. For a random sample of 50 patients, the following information was obtained. What is the expected value?

 x  P(x)
0  P(x = 0) = \frac{4}{50}
1  P(x = 1) = \frac{8}{50}
2  P(x = 2) = \frac{16}{50}
3  P(x = 3) = \frac{14}{50}
4  P(x = 4) = \frac{6}{50}
5  P(x = 5) = \frac{2}{50}

Figure 4.8: Post-op patients

The Variance and Standard Deviation of a Discrete Random Variable

Like data, probability distributions have standard deviations. To calculate the standard deviation (σ) of a probability distribution, find each deviation from its expected value, square it, multiply it by its probability, add the products, and take the square root.

Finding the variance (σ² or V[X]) and standard deviation (σ or SD[X]) of a random variable starts similarly to finding these measures for a data sample, which we have seen before. However, the process differs at its fourth step and looks more like a probability weighted average of the squared deviations similar to the method used to calculate an expected value:

  1. Find the mean.
  2. Subtract the mean from each value of x to get your deviations.
  3. Square each deviation.
  4. Multiply each squared deviation by its probability, P(x).
  5. Sum each of the products.

At this point, we now have the variance and can take the square root of the variance to get our standard deviation. The formula looks like this:

\sigma = \sqrt{\underset{x\in X}{{\sum }^{\text{​}}}{\left(x-\mu \right)}^{2}P\left(x\right)}

Example

Find the expected value of the number of times a newborn baby’s crying wakes its mother after midnight. Calculate the standard deviation of the variable as well.

 x  P(x)  x*P(x)  (x - \mu)^2 \cdot P(x)
0  P(x = 0) = \frac{2}{50}  (0)(\frac{2}{50} ) = 0  (0 - 2.1)^2 \cdot 0.04 = 0.1764
1  P(x = 1) = \frac{11}{50}  (1)(\frac{11}{50} ) = \frac{11}{50}  (1 - 2.1)^2 \cdot 0.22 = 0.2662
2  P(x = 2) = \frac{23}{50}  (2)(\frac{23}{50} ) =  \frac{46}{50}  (2 - 2.1)^2 \cdot 0.46 = 0.0046
3  P(x = 3) = \frac{9}{50}  (3)(\frac{9}{50} ) =  \frac{27}{50}  (3 - 2.1)^2 \cdot 0.18 = 0.1458
4  P(x = 4) = \frac{4}{50}  (4)(\frac{4}{50} ) =  \frac{16}{50}  (4 - 2.1)^2 \cdot 0.08 = 0.2888
5  P(x = 5) = \frac{1}{50}  (5)(\frac{1}{50} ) =  \frac{5}{50}  (5 - 2.1)^2 \cdot 0.02 = 0.1682

Figure 4.9: Newborn baby crying

You expect a newborn to wake its mother after midnight 2.1 times per week on the average.

Add the values in the third column of the table to find the expected value of X.

Solution

μ = expected value = \frac{105}{50} = 2.1

 

Use μ to complete the table. The fourth column of this table will provide the values you need to calculate the standard deviation. For each value x, multiply the square of its deviation by its probability. Each deviation has the format xμ.

Add the values in the fourth column of the table.

Solution

0.1764 + 0.2662 + 0.0046 + 0.1458 + 0.2888 + 0.1682 = 1.05

 

The standard deviation of X is the square root of this sum.

Solution

σ = \sqrt{1.05} ≈ 1.0247

 

The mean, μ, of a discrete probability function is the expected value.

Solution

μ = Σ(𝑥∙𝑃(𝑥))

 

The standard deviation, Σ, of the PDF is the square root of the variance.

Solution

σ = \sqrt{\Sigma\left[(x-\mu)^2 \cdot \mathrm{P}(x)\right]}

 

When all outcomes in the probability distribution are equally likely, these formulas coincide with the mean and standard deviation of the set of possible outcomes.

Your Turn!

On May 11, 2013, at 9:30 PM, the probability that moderate seismic activity (one moderate earthquake) would occur in the next 48 hours in Japan was about 1.08%. You bet that a moderate earthquake will occur in Japan during this period. If you win the bet, you win $100. If you lose the bet, you pay $10. If X is the amount of profit from a bet, find the mean and standard deviation of X.

Note on Calculations

For probability distributions, we generally use a calculator or a computer to calculate μ and σ to reduce roundoff error. For many special cases of probability distributions, there are shortcut formulas for calculating μ, σ, and associated probabilities. We will see some of these in the future.

definition

License

Icon for the Creative Commons Attribution-ShareAlike 4.0 International License

Significant Statistics Copyright © 2024 by John Morgan Russell, OpenStaxCollege, OpenIntro is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book