There are many processes in nature that while totally random

There are many processes in nature that while totally random, can be characterized by the probability of the outcome or value of the event. For example, the probability of rolling any number between 1 and 6 with a fair die is equal. That is to say, it is equally likely that any value will occur. This type of process is said to have a Uniform Distribution. In communication channels, the naturally occurring noise (referred to as white noise) is modeled as a uniformly distributed process. Another commonly observed distribution is the Normal or Gaussian distribution. The graph of this distribution is the well known \"Bell Curve\". Frequently samples of characteristics of populations like the height or the age of a population will follow a Gaussian distribution. Matlab has functions rand and randn generate sequences of random values that model these distributions. Part a) Generate the following Uniform distributions: a. Generate 30 samples of a uniformly distributed sequence and plot a histogram with 30 bins. b. Generate 100 samples of a uniformly distributed sequence and plot a histogram with 30 bins. c. Generate 1000 samples of a uniformly distributed sequence and plot a histogram with 30 bins. d. Generate 10000 samples of a uniformly distributed sequence and plot a histogram with 30 bins. Use the subplot feature to display each of these four histograms in the same figure window. Part b) Repeat Part a using a Gaussian distribution with an average value of 50 and a standard deviation of 10.

Solution

//Following is the script which generate 30 samples of uniform distributed sequence and plot a histogram with 30 bins

ran=30   % Change the value here 30 to 100,1000,10000 for question b,c,d respectively.
bins=30
r=rand(1,ran) % generates random numbers
h=hist(r,bins) % generate histogram
plot(h,r)

 There are many processes in nature that while totally random, can be characterized by the probability of the outcome or value of the event. For example, the pr

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site