Skip to main content

Section A.5 Chapter 5: Random Variables

Subsection A.5.1 Exercise 5.1

  1. The Binomial distribution is a reasonable model for the number of people that develop high fever as result of the vaccination. Let \(X\) be the number of people that do so in a give day. Hence, \(X \sim \mbox{Binomial}(500,0.09)\text{.}\) According to the formula for the expectation in the Binomial distribution, since \(n=500\) and \(p=0.09\text{,}\) we get that:
    \begin{equation*} \Expec(X) = n p = 500 \times 0.09 = 45\;. \end{equation*}
  2. Let \(X \sim \mbox{Binomial}(500,0.09)\text{.}\) Using the formula for the variance for the Binomial distribution we get that:
    \begin{equation*} \Var(X) = n p(1-p) = 500 \times 0.09\times 0.91 = 40.95\;. \end{equation*}
    Hence, since \(\sqrt{Var(X)} = \sqrt{40.95} = 6.3992\text{,}\) the standard deviation is 6.3992.
  3. Let \(X \sim \mbox{Binomial}(500,0.09)\text{.}\) The probability that more than 40 people will develop a reaction may be computed as the difference between 1 and the probability that 40 people or less will develop a reaction:
    \begin{equation*} \Prob(X > 40) = 1- \Prob(X \leq 40)\;. \end{equation*}
    The probability can be computes with the aid of the function โ€œpbinom" that produces the cumulative probability of the Binomial distribution:
    1 - pbinom(40,500,0.09)
    
    ## [1] 0.7556474
    
  4. The probability that the number of people that will develop a reaction is between 50 and 45 (inclusive) is the difference between \(\Prob(X\leq 50)\) and \(\Prob(X < 45) = \Prob(X \leq 44)\text{.}\) Apply the function โ€œpbinom" to get:
    pbinom(50,500,0.09) - pbinom(44,500,0.09)
    
    ## [1] 0.3292321
    

Subsection A.5.2 Exercise 5.2

  1. The plots can be produced with the following code, which should be run one line at a time:
    x <- 0:15
    plot(x,dnbinom(x,2,0.5),type="h")
    plot(x,dnbinom(x,4,0.5),type="h")
    plot(x,dnbinom(x,8,0.8),type="h")
    
    The first plot, that corresponds to \(X_1 \sim \mbox{Negative-Binomial}(2,0.5)\text{,}\) fits Barplotย 3. Notice that the distribution tends to obtain smaller values and that the probability of the value โ€œ0" is equal to the probability of the value โ€œ1".
    The second plot, the one that corresponds to \(X_2 \sim \mbox{Negative-Binomial}(4,0.5)\text{,}\) is associated with Barplotย 1. Notice that the distribution tends to obtain larger values. For example, the probability of the value โ€œ10" is substantially larger than zero, where for the other two plots this is not the case.
    The third plot, the one that corresponds to \(X_3 \sim \mbox{Negative-Binomial}(8,0.8)\text{,}\) matches Barplotย 2. Observe that this distribution tends to produce smaller probabilities for the small values as well as for the larger values. Overall, it is more concentrated than the other two.
  2. Barplotย 1 corresponds to a distribution that tends to obtain larger values than the other two distributions. Consequently, the expectation of this distribution should be larger. The conclusion is that the pair \(\Expec(X) = 4\text{,}\) \(\Var(X) = 8\) should be associated with this distribution.
    Barplotย 2 describes a distribution that produce smaller probabilities for the small values as well as for the larger values and is more concentrated than the other two. The expectations of the two remaining distributions are equal to each other and the variance of the pair \(\Expec(X) = 2\text{,}\) \(\Var(X) = 2.5\) is smaller. Consequently, this is the pair that should be matched with this box plot.
    This leaves only Barplotย 3, that should be matched with the pair \(\Expec(X) = 2\text{,}\) \(\Var(X) = 4\text{.}\)