隨著x的累加,(x = 連續均勻分配),機率密度分配會越來越像一個鐘形曲線。

n <- 100000
x1 <- runif(n, 0, 1)
hist(x1, freq = FALSE, breaks = 20)

d1 <- density(x1)
plot(d1)
polygon(d1, col = "red", border = "blue" )

x2 <- x1 + runif(n, 0, 1)
hist(x2, freq= FALSE, breaks = 20)

d2 <- density(x2)
plot(d2)
polygon(d2, col = "red", border = "blue" )

x3 <- x2 + runif(n, 0, 1)
hist(x3, freq= FALSE, breaks = 20)

d3 <- density(x3)
plot(d3)
polygon(d3, col = "red", border = "blue" )

x4 <- x3 + runif(n, 0, 1)
hist(x4, freq= FALSE, breaks = 20)

d4 <- density(x4)
plot(d4)
polygon(d4, col = "red", border = "blue" )

x5 <- x4 + runif(n, 0, 1)
hist(x5, freq= FALSE, breaks = 20)

d5 <- density(x5)
plot(d5)
polygon(d5, col = "red", border = "blue" )