Question: A discrete random variable X has the probability mass function X 1 2 3 4 5 f(x) 0.1 0.2 0.4 0.1 0.2 a) Write R

 A discrete random variable X has the probability mass function X

A discrete random variable X has the probability mass function X 1 2 3 4 5 f(x) 0.1 0.2 0.4 0.1 0.2 a) Write R code for an inversion sampler to generate a sample of 1000 random numbers from the distribution of X. Use the generated CNRG pseudo-random numbers of Question 1 (do not use any functions, which directly implement the sampler like rbinom () ) b) Show the probability mass function of the sample of simulated random numbers. Include the true probability mass function in the plot for a comparison

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!