Question: Run the following code in RStudio to find the probability distribution for X, a binomial random variable with 72 trials and success probability 0.12345. n=72
Run the following code in RStudio to find the probability distribution for X, a binomial random variable with 72 trials and success probability 0.12345.
n=72
p=.12345
xvals <- 0:n
xprobs <- dbinom(0:n, n, p)
What is P(X=8)? Round your answer to 4 decimal places after "undoing" scientific notation. Hints: the numbers in brackets on the left indicate which term in the sequence starts that row. For example, 7.095432e-02 is the 13th number inxprobs, which corresponds to P(X=12) (since the 1st number, 7.584413e-05, corresponds to zero successes). Also, a refresher on scientific notation: the 7.095432e-02 is scientific notation for the number 0.07095432 (by moving the decimal to the left 2 spaces... left because of the negative sign and 2 spaces because of the 2).
Use the R code on page 173 (after installing and librarying the package Weighted.Desc.Stat), to find the mean of X from the previous problem, rounded to 4 decimal places.
R Code is w.mean(x,p)
Consider X from above. Multiply its number of trials by its probability of success. What number do you get?
Use the R code on page 173 (after installing and librarying the package Weighted.Desc.Stat), to find the variance of X from above, rounded to 4 decimal places.
R code is w.var(x,p)
Consider X from above. Multiply its number of trials by its probability of success and probability of failure (hint: failure is the complement of success, so it happens with "opposite" probability). What number do you get, rounded to 4 decimal places?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
