powered by
rchisq
test1
test2(Nsim = 10^4, df = 6)
rchisq(Nsim,df)
mean(test2()) # produces [1] 5.955972
Run the code above in your browser using DataLab