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).
Linear Algebra: A Modern Introduction
4th Edition
ISBN:9781285463247
Author:David Poole
Publisher:David Poole
Chapter2: Systems Of Linear Equations
Section2.4: Applications
Problem 28EQ
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
Linear Algebra: A Modern Introduction
Algebra
ISBN:
9781285463247
Author:
David Poole
Publisher:
Cengage Learning
Algebra: Structure And Method, Book 1
Algebra
ISBN:
9780395977224
Author:
Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:
McDougal Littell
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
Linear Algebra: A Modern Introduction
Algebra
ISBN:
9781285463247
Author:
David Poole
Publisher:
Cengage Learning
Algebra: Structure And Method, Book 1
Algebra
ISBN:
9780395977224
Author:
Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:
McDougal Littell
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:
9781133382119
Author:
Swokowski
Publisher:
Cengage
Elements Of Modern Algebra
Algebra
ISBN:
9781285463230
Author:
Gilbert, Linda, Jimmie
Publisher:
Cengage Learning,