Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Matlab/Python code to generate N continuous uniform, exponential, Bernoulli random variables, and N random variables from the following discrete distribution: P{X=1}=0.1, P{X=2}=0.3,

 

Write a Matlab/Python code to generate N continuous uniform, exponential, Bernoulli random variables, and N random variables from the following discrete distribution: P{X=1}=0.1, P{X=2}=0.3, P{X=3}=0.4, P{X=4}=0.2. Foll all distributions above your input should be the distribution parameters (by user choice). You should use the Inverse transform method, that is, you are allowed to use built-in functions to generate random numbers (uniform on (0,1)) but you have to write the code to realize the Inverse transform method. Don't use built- in functions for the Inverse transform method. For N=1,000 and the parameters of your choice provide histograms of the random variables generated along with the actual pdf (pmf).

Step by Step Solution

3.46 Rating (159 Votes )

There are 3 Steps involved in it

Step: 1

Solution Assuming Python import numpy as np For the Continuous Uniform a floatinputEnte... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

John E Freunds Mathematical Statistics With Applications

Authors: Irwin Miller, Marylees Miller

8th Edition

978-0321807090, 032180709X, 978-0134995373

More Books

Students also viewed these Programming questions