Skip to main content
Statistics LibreTexts

4.1: Discrete Random Variables

  • Page ID
    51646
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)

    Wordle is a popular puzzle game that was created by the New York Times in October of 2021. To play the game, a player tries to guess the five letter word of the day. Each player has a total of six tries to guess the word. After each guess, the colors of tiles will change to indicate how close the guess was to the word. If a tile turns green, the letter is in the correct spot. If a tile turns yellow, the letter is in the word but not in the correct spot. If a letter turns gray, it is not a letter in the word. According to twitter, on April 28, 2022, 98,967 individuals played Wordle.

    AD_4nXflHyW-r5o0An6Pb2xOL6whiNfKWvqDrUANtl_3yI11EG24FWTta24ome3muDzHvi5Zvt_WO057TP8ZVADFZ2CJa8GOZDwcuJNvhylPEnGWAsaxMj3J0V5CRrFYk7vp3gSI39NOMLf5TXQ3kBgRJUdBLd8keyi1XJeTDlU718V25snr3PRQ

    Adapted from "Wordle Emoji Screenshot" by Levi OP is licensed under CC BY-SA 4.0.

    The following table sorts the number of people who played by the number of guesses taken to solve the puzzle.

    1. Complete the table by computing the relative frequencies (rounded to three decimal places) for each value of x. Recall that n is the total number of people in the table.

    Number of Guesses, xi

    Number of people, fi

    Relative Frequency, fi/n

    1

    494

    2

    5938

    3

    25731

    4

    35628

    5

    21772

    6

    7917

    More than 6

    1487

    The number of guesses is an example of a discrete random variable. We can list the values of a discrete random variable in order. In other words, we can count the values of the variable. In this example, the variable x can take on the values {1, 2, 3, 4, 5, 6, 7} (if an individual takes 7 guesses, they have lost the game because they have run out of tries). If we randomly select a game from this population, the probability that it was won in a certain number of tries is equal to the relative frequency of the chosen number of guesses.

    A discrete probability distribution assigns a probability to all possible values of a discrete random variable. Each probability is between 0 and 1, and the sum of all probabilities is 1.

    Finding Probability from a Discrete Probability Distribution

    The discrete probability distribution in the Wordle example above can be represented with a histogram.

    AD_4nXfr1N1AqvrG7G0yabD-t6eGb8WkSdICY7UNHHjg7XuYnCbypdZjWUGFetJbjj1t9he2iLFTRz-73D8xjaCEesSrLQdGitcDkw5lf2G1zj7YsdPm5FhRHOxMPeq5qPQYFT_gzJvHmjrCa-0p28U8rEa1Xpeckeyi1XJeTDlU718V25snr3PRQ

    1. What is the shape of the histogram? What does the shape suggest to you about the number of guesses taken to win Wordle?
    2. Imagine that we randomly select a Wordle game. Use the probability distribution above to answer the following questions.
      1. Find the probability that the game is won in more than 5 guesses. Using probability notation, we would denote this probability as P(x>5). (Hint: we are asking what the probability is that the word was guessed on the sixth try OR the word was not guessed).
      2. Find the probability that the game is won in at most 4 guesses. Use probability notation in your answer.
      3. Find the probability that the game is won between 3 and 6 guesses. Use probability notation in your answer.
      4. Find the probability that the game is won (in other words, the number of guesses is not 7). Use probability notation in your answer.
      5. Three friends are competing with each other through Wordle. What is the probability that all three individuals guess in less than 3 tries? Assume guesses are independent. Use probability notation in your answer. Round your answer to five decimal places.
      6. You want to know how you compare to other Wordle players. You want to know the average number of guesses it takes to win Wordle. Use the histogram to estimate the mean number of guesses.

    Finding the Mean of a Discrete Probability Distribution

    The mean of a probability distribution is the mean of a distribution of relative frequencies. If the probabilities are exact, the mean is a population mean. We have seen that the symbol used to denote a population mean is (read as “mew”) and the symbol used to denote a sample mean is \(\bar{x}\) (read as “x bar”). In a previous exercise, you were tasked with computing a mean from a frequency distribution table. The formula used was

    \[\text { mean }=\frac{\sum x_i\cdot f_i}{n}\nonumber\]

    where \(n=\sum f_i\). We can use algebra to write an equivalent equation,

    \[\text { mean }=\sum \frac{f_i}{n} \cdot x_i\nonumber\]

    Noting that \(f_i / n\) is a relative frequency, and knowing that relative frequencies are regarded as probabilities in a discrete probability distribution, we can say,

    \[\text { population mean }=\mu=\sum x_i \cdot P\left(x_i\right)\nonnumber\]

    In summary, the mean or expected value (denoted E(x)) of a discrete probability distribution is found using

    \[\mu=E(x)=\sum x_i \cdot P\left(x_i\right).\nonumber\]

    The mean of a probability distribution represents both the average value of the random variable and the center of the distribution.

    1. Compute the expected number of guesses it takes to win Wordle. Compare this to the estimation you made in 3f.

    Finding the Standard Deviation of a Discrete Probability Distribution

    The population standard deviation of a probability distribution is denoted by the Greek letter (read “sigma”). It is computed by adding all square deviations, dividing by the total frequencies, and square rooting. Using algebra, we can manipulate the inside of the square root:

    \[\text { population standard deviation }=\sqrt{\frac{\Sigma\left(x_i-\mu\right)^2}{n}}=\sqrt{\frac{f_1\left(x_1-\mu\right)^2+f_2\left(x_2-\mu\right)^2+\ldots+f_n\left(x_n-\mu\right)^2}{n}}=\sqrt{\sum \frac{f_i}{n} \cdot\left(x_i-\mu\right)^2}\nonumber\]

    where \(n=\sum f_i\). Notice that \(f_i/n\) is the same as the probability. Therefore, we can find the standard deviation of a probability distribution using the following formula:

    \[\text { population standard deviation }=\sigma=\sqrt{\sum P\left(x_i\right) \cdot\left(x_i-\mu\right)^2}\nonumber\]

    1. For the number of guesses in the game of Wordle, the population standard deviation is =1.1 guesses. Interpret the standard deviation in context.

    Area and Probability

    AD_4nXfr1N1AqvrG7G0yabD-t6eGb8WkSdICY7UNHHjg7XuYnCbypdZjWUGFetJbjj1t9he2iLFTRz-73D8xjaCEesSrLQdGitcDkw5lf2G1zj7YsdPm5FhRHOxMPeq5qPQYFT_gzJvHmjrCa-0p28U8rEa1Xpeckeyi1XJeTDlU718V25snr3PRQ_586z

    1. In the Wordle histogram, the width of each bar is 1. Recall, the area of a rectangle is found using the width times the length.
      1. What is the area of the bar centered at 1?
      2. What is the area of the bar centered at 2?
      3. What is the relationship between a value’s area and its probability?
      4. What is the total area of all the bars?

    Apply it!

    1. Finn is purchasing a new car from Ford. Ford offers buyers a maintenance plan which will cost an additional $35 per month. It will cover oil changes, routine maintenance, and any major repairs. The maintenance plan provides coverage for the first 6 years of ownership. On average, Finn drives 10,000 miles per year. He will get his car serviced every 5,000 miles. The average cost of service is $150.
      1. What is the cost of services for the first six years if Finn does not purchase the maintenance plan?
      2. Below is a probability distribution where you can see the potential cost of routine maintenance and possible major repairs in the first six years of car ownership. Standard services are not included in the costs. What is the expected cost of routine maintenance and possible major repairs for the first 6 years?

        Annual Maintenance and Repair Costs for the First Six Years, x

        0

        $500

        $1,000

        $1,500

        $2,000

        $2,500

        Probability, P(x)

        0.02

        0.52

        0.21

        0.14

        0.08

        0.03

      3. Compute the total expected cost for services, routine maintenance, and repairs for the first six years.
      4. What would Finn pay if he purchases the maintenance plan?
      5. Should Finn purchase the maintenance plan? Support your answer.

    This page titled 4.1: Discrete Random Variables is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Hannah Seidler-Wright.

    • Was this article helpful?