Matlab codes need to be included. simulate the following random variables: expon
ID: 3878498 • Letter: M
Question
Matlab codes need to be included.
simulate the following random variables: exponential, normal, binomial, geometric, and Poisson. Specifically, for each type of distributions, write a program to generate a sequence of numbers that follow the distribution. In addition, plot the distribution of each random variable based on your simulation results. Below is a sample of what the simulations should look like.
uniform 0.2 Simulated distribution Real distribution - 0.15 0 6 uniform 0.8 0.6 0.4 +Simulated distribution Real distribution 0.2 4 6 8 9 10 2Explanation / Answer
Below is the code to generate the specific distribution random numbers and plot those distribution.
% Binomial Distribution
n = 10:10:60; % Generating numbers
r1 = binornd(n,1./n); $ Generating binomial distibution numbers
y = binopdf(r1,10,0.5); % Generating the binomial pdf
plot(n,y); % plotting the binomial distribution
% Exponential distribution
% Normal distribution