Mathematics — Probability · variance-discrete-random-variables
Problem
Let X be the outcome of a chance experiment with E(X)=μ and V(X)=σ2. When μ and σ2 are unknown, the statistician often estimates them by repeating the experiment n times with outcomes x1,x2,…,xn, estimating μ by the sample mean
xˉ=n1i=1∑nxi,
and σ2 by the sample variance
s2=n1i=1∑n(xi−xˉ)2.
Then s is the sample standard deviation. (Many statisticians define the sample variance with the coefficient 1/n replaced by 1/(n−1). If this alternative definition is used, the expected value of s2 is equal to σ2. See Exercise 18, part (d).)
Write a computer program that will roll a die n times and compute the sample mean and sample variance. Repeat this experiment several times for n=10 and n=1000. How well do the sample mean and sample variance estimate the true mean 7/2 and variance 35/12?