Let X be a continuous random variable with probability density function:
f(x;theta) = 1/theta if 0<= x <=2 ;
or 0, otherwise.
a. Generate 6 random numbers drawn from [0, 2]. Let this set by a random sample of size n=6.
b. Determine the first moment of X.
c. Determine the second moment of X.
d. Use the method of moments to obtain an estimator of theta, and then compute the estimate for the data.