Answered step by step
Verified Expert Solution
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...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started