Question 1 Your lecturer loves chocolate and has two boxes of chocolates in her office, one in the upper drawer and one in the lower drawer of her desk. Whenever she craves for a chocolate, she selects a drawer at random and takes a chocolate from the box in that drawer. We assume that each of the boxes originally contained 20 chocolates. Suppose your lecturer opens a drawer and discovers for the first time that the box in that drawer is empty. We let X denote the number of chocolates left in the other box. It can be shown that the pmf of X is P(X = x) = 40- x 20 22-40, x = 0, 1, 2,..., 20. (a) Define the pmf of X as a function in R, then plot this pmf over its range. (b) Find the probability P(X≥ 5) using the function you defined in (a). (c) Use the sample(...) function to generate 10000 observations from the pmf of X. Assign the results to a variable. (d) Use the observations generated in (c) to obtain an estimate of P(X ≥ 5), and compare your answer with what you found in (b). My answer: (e) Find the mean of X, E(X), using the function you defined in (a).
Question 1 Your lecturer loves chocolate and has two boxes of chocolates in her office, one in the upper drawer and one in the lower drawer of her desk. Whenever she craves for a chocolate, she selects a drawer at random and takes a chocolate from the box in that drawer. We assume that each of the boxes originally contained 20 chocolates. Suppose your lecturer opens a drawer and discovers for the first time that the box in that drawer is empty. We let X denote the number of chocolates left in the other box. It can be shown that the pmf of X is P(X = x) = 40- x 20 22-40, x = 0, 1, 2,..., 20. (a) Define the pmf of X as a function in R, then plot this pmf over its range. (b) Find the probability P(X≥ 5) using the function you defined in (a). (c) Use the sample(...) function to generate 10000 observations from the pmf of X. Assign the results to a variable. (d) Use the observations generated in (c) to obtain an estimate of P(X ≥ 5), and compare your answer with what you found in (b). My answer: (e) Find the mean of X, E(X), using the function you defined in (a).
A First Course in Probability (10th Edition)
10th Edition
ISBN:9780134753119
Author:Sheldon Ross
Publisher:Sheldon Ross
Chapter1: Combinatorial Analysis
Section: Chapter Questions
Problem 1.1P: a. How many different 7-place license plates are possible if the first 2 places are for letters and...
Related questions
Question
need to do with R studio
The 1st question please
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 5 steps with 1 images
Recommended textbooks for you
A First Course in Probability (10th Edition)
Probability
ISBN:
9780134753119
Author:
Sheldon Ross
Publisher:
PEARSON
A First Course in Probability (10th Edition)
Probability
ISBN:
9780134753119
Author:
Sheldon Ross
Publisher:
PEARSON