# 中心極限定理による正規乱数 # 乱数の個数 n <- 1000 # 正規乱数の発生 r <- replicate(n, sum(runif(12)) - 6) print(r) # ヒストグラム(相対度数) hist(r, freq = FALSE, main = "正規乱数") # N(0,1)の曲線との比較 curve(dnorm, add = TRUE, col = "red")