Answered step by step
Verified Expert Solution
Link Copied!

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);

image text in transcribed

image text in transcribedimage text in transcribed

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

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

Step: 3

blur-text-image

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

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

Define Management by exception

Answered: 1 week ago

Question

Explain the importance of staffing in business organisations

Answered: 1 week ago

Question

What are the types of forms of communication ?

Answered: 1 week ago