リプレース

n <- 50
n.iter <- 100000
N <- 40
r.with.replace <- r.without.replace <- matrix(0,n.iter,N)
for(i in 1:n.iter){
	x <- rnorm(n)

	r.with.replace[i,] <- sample(x,N,replace=TRUE)
	r.without.replace[i,] <- sample(x,N,replace=FALSE)
}

m.with <- apply(r.with.replace,1,mean)
m.without <- apply(r.without.replace,1,mean)

v.with <- apply(r.with.replace,1,var)
v.without <- apply(r.without.replace,1,var)

par(mfcol=c(1,2))

matplot(cbind(sort(m.with),sort(m.without)),type="l")
abline(h=0)
matplot(cbind(sort(v.with),sort(v.without)),type="l")
abline(h=1)
par(mfcol=c(1,1))


mean(m.with)
mean(m.without)

mean(v.with)
mean(v.without)