20.1k views
5 votes
You generate random variable Wh W by typing W-sum (4*randn (1,2)) in a MATLAB Command window. What is Var[W]?

User Han Bing
by
7.5k points

1 Answer

4 votes

Final answer:

The variance Var[W] of the random variable W generated in MATLAB by summing two scaled standard normal variables is 32.

Step-by-step explanation:

The question involves calculating the variance of a random variable W generated in MATLAB through a specific command.

The command W-sum(4*randn(1,2)) indicates that W is the sum of two normally distributed random variables, each multiplied by a factor of 4. Since randn(1,2) in MATLAB generates two independent standard normal random variables (N(0,1)), the variance of each is 1. When scaled by a factor of 4, the variance becomes 4² or 16 for each term. As they are independent, the variances of the two terms sum, leading to a variance Var[W] = 16 + 16 = 32 for the random variable W.

User Shef
by
7.5k points