problem-6.7

problem-6.7  The central limit theorem says that the sampling distribution of the sample average of a large number of independent, identically distributed random numbers is approximately normal. This indicates that the chi-squared distribution should become bell-shaped for large values of n. The following simulation shows that this happens by n=100 or so.
> res = c()
> n = 4;   for(i in 1:500) res[i] = sum(rnorm(n)^2); qqnorm(res)
> n = 10;  for(i in 1:500) res[i] = sum(rnorm(n)^2); qqnorm(res)
> n = 25;  for(i in 1:500) res[i] = sum(rnorm(n)^2); qqnorm(res)
> n = 50;  for(i in 1:500) res[i] = sum(rnorm(n)^2); qqnorm(res)
> n = 100; for(i in 1:500) res[i] = sum(rnorm(n)^2); qqnorm(res)