Answered step by step
Verified Expert Solution
Question
1 Approved Answer
MATLAB Code* %% generating streams of random numbers a 0: b 5; % random numbers in the range (0,5) N-20000 n-1:20000 r1- a(b-a).rand(N,1); r2-a(b-a).rand(N,1); r3-a(b-a).*rand(N,1);
MATLAB Code* %% generating streams of random numbers a 0: b 5; % random numbers in the range (0,5) N-20000 n-1:20000 r1- a(b-a).rand(N,1); r2-a(b-a).rand(N,1); r3-a(b-a).*rand(N,1); subplot(3,1,1); scatter(n,rl); xlabel(X); ylabel(Y); title(R1'); subplot(3,1,2); scatter(n,r2); xlabel(X); ylabel(Y); title(R2); subplot(3,1,3); scatter(n,r3); xlabel(X); ylabel(Y); title(R3'); figure; subplot(3,1,1); histogram(r1,Normalization"pdf); title(Histogram of R1); subplot(3,1,2); histogram(r2,Normalization"pdf) title(Histogram of R2); subplot(3,1,3); histogram(r3,Normalization"pdf) title(Histogram of R3); Output** Histogram of R1 0.4 0.2 0 0 0.5 15 2 2.5 3 3.5 44.5 5 Histogram of R2 0.4 0.2 0 0 0.5 5 2 2.5 3 3.5 4 4.5 5 Histogram of R3 0.4 0.2 0 0 0.5 15 2 2.5 3 3.5 4 4.5 5 Task 2: use the streams generated in task 1 to do the following, (a) Convert the generated streams to a (b) Visualize the data samples. Are they normally distributed with mean 0 and unit variance? (c) Compute the normalized histogram (pdf's) of the data samples from (a) and visualize the distribution, comment. (d) Generate a realization from Y~N(-1,4); i.e., E(Y)--1 and r-2. (e) Plot the histogram of (d) vs. frexsing 20,000 samples. How similar are the two plots? You may use a small bin size in the histogram and more samples MATLAB Code* %% generating streams of random numbers a 0: b 5; % random numbers in the range (0,5) N-20000 n-1:20000 r1- a(b-a).rand(N,1); r2-a(b-a).rand(N,1); r3-a(b-a).*rand(N,1); subplot(3,1,1); scatter(n,rl); xlabel(X); ylabel(Y); title(R1'); subplot(3,1,2); scatter(n,r2); xlabel(X); ylabel(Y); title(R2); subplot(3,1,3); scatter(n,r3); xlabel(X); ylabel(Y); title(R3'); figure; subplot(3,1,1); histogram(r1,Normalization"pdf); title(Histogram of R1); subplot(3,1,2); histogram(r2,Normalization"pdf) title(Histogram of R2); subplot(3,1,3); histogram(r3,Normalization"pdf) title(Histogram of R3); Output** Histogram of R1 0.4 0.2 0 0 0.5 15 2 2.5 3 3.5 44.5 5 Histogram of R2 0.4 0.2 0 0 0.5 5 2 2.5 3 3.5 4 4.5 5 Histogram of R3 0.4 0.2 0 0 0.5 15 2 2.5 3 3.5 4 4.5 5 Task 2: use the streams generated in task 1 to do the following, (a) Convert the generated streams to a (b) Visualize the data samples. Are they normally distributed with mean 0 and unit variance? (c) Compute the normalized histogram (pdf's) of the data samples from (a) and visualize the distribution, comment. (d) Generate a realization from Y~N(-1,4); i.e., E(Y)--1 and r-2. (e) Plot the histogram of (d) vs. frexsing 20,000 samples. How similar are the two plots? You may use a small bin size in the histogram and more samples
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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