In: Mechanical Engineering
Suppose that z = xy, where x and y are independent and normally distributed random variables. The mean and variance of x are µx = 10 and σ2x = 2. The mean and variance of y are µy = 15 and σ2y = 3. Find the mean and variance of z by simulation. Does µz = µxµy? Does σ2z = σ2x σ2y? Do this for 100, 1000, and 5000 trials.
Two normally distributed variables x and y are given with their mean and variance. For x, mean µx = 10 and variance is σ2x = 2. And for y, mean is µy = 15 and variance is σ2y = 3. Here, one need to simulate the two variables and generate new variable by the equation z = xy.
Once the new variable is generated, one needs to verify that if the mean of new variable generated is equal to the sum of the means of variable x, y and the variance of new variable is equal to the sum of variance of x, y.
In MATLAB, function ‘randn(m,n)’ generates normally distributed pseudorandom numbers matrix m by n with mean of zero with standard deviation of 1. To generate a new variable with standard deviation and a mean of use the following equation.
σy + µ, where y is the generated random numbers.
MATLAB code:
MATLAB Output:
From the results obtained, one can see that mean of variable z is the product of mean of variables x, y but the variance of z is not equal to product of variance of x, y.
The simulated results are summarized in the following table.
From the results obtained, one can see that mean of variable z is the product of mean of variables x, y but the variance of z is not equal to product of variance of x, y.
From the results obtained, one can see that mean of variable z is the product of mean of variables x, y but the variance of z is not equal to product of variance of x, y.