A computer routine called rand(a,b) returns a uniform random number between a and
b. if you want to generate a mean zero, unit variance uniform random number, what values of a and b would you use in the function call?

Respuesta :

With a symmetric distribution (uniform is symmetric), mean zero means a=-b where b>0, ex. a=-4, b=4 will give a mean zero.

A uniform random variable with domain (a,b) as given has a variance of
variance = sigma^2 = (1/12)(b-a)^2.

If we use the domain (a,b), the variance must equal 1.0, or
(1/12)(b-a)^2 = 1
Solving for (b-a) gives (b-a)=sqrt(12)=2sqrt(3).
Since a=-b (see first paragraph), (b-a)=2b=2sqrt(3), or b=sqrt(3).

Hence the values of a and b are (-sqrt(3), sqrt(3), and the function call should be rand(-sqrt(3), sqrt(3)).