# homework 7 class egre 337 1

Create a MATLAB script file, call it “hw7.m”. Write code to perform the following tasks:

• Task 1: (15%) Generate N=10000 values of a continuous random variable X that has a uniform distribution (PDF) between 0.0 and 1.0. Display the histogram of X. Hint: rand(), hist().
• Task 2: (25%) Create a mapping function that takes a value of X and calculates a value of a new random variable Y. The function should be chosen such that Y has a Gaussian (aka normal) distribution (PDF) with a mean of zero and a variance of 0.25. You will find this function with pencil and paper using a method similar to the method seen in the attached examples. Hint: norminv().
• Task 3: (15%) Apply the function from the previous task to the values of X and obtain N values of Y. Display the histogram of Y.
• Task 4: (25%) Create a mapping function that takes a value of X and calculates a value of a new random variable Z. The function should be chosen such that Z has a triangular distribution (PDF) extending from y=0.0 to y=2.0 and with a peak at z=1.0. You will find this function with pencil and paper using a method similar to the method seen in the attached examples.
• Task 5: (15%) Apply the function from the previous task to the values of X and obtain N values of Z. Display the histogram of Z.