##Suppose you want to learn about the Standard Normal Distibution and you currently know nothing about it.  
##For example, you don't know it's mean or variance
##Use the command rnorm as a black box simulator!

test1 = rnorm(1000)
summary(test1); sd(test1)

test2 = rnorm(1000)
test3 = rnorm(1000)
summary(test2); summary(test3); sd(test2); sd(test3)

par(mfrow=c(3,3))
plot(ts(test1)); acf(test1); hist(test1, prob=TRUE)
plot(ts(test2)); acf(test2); hist(test2, prob=TRUE)
plot(ts(test3)); acf(test3); hist(test3, prob=TRUE)

blackbox = function(n){
	output = matrix(0, 100, 2)
	for(i in 1:100){
		test = rnorm(n)
		output[i,1] = mean(test)
		output[i,2] = sd(test)
	}
	return(output)}

try100 = blackbox(100)
try1000 = blackbox(1000)
try10000 = blackbox(10000)

par(mfrow=c(1,3))
hist(try100[,1],xlab="mean of 100 samples of size 100", prob=TRUE,main="n=100")
hist(try1000[,1],xlab="mean of 100 samples of size 1000", xlim=c(-0.3, 0.3),prob=TRUE,main="n=1000")
hist(try10000[,1],xlab="mean of 100 samples of size 10000", xlim=c(-0.3, 0.3),prob=TRUE,main="n=10000")
