set.seed(720); n = 10^4
x2 = rnorm(n, 50, 2); x1 = exp(x2); x3 = log(x2)
mean(x1); mean(x2); mean(x3)
[1] 3.686093e+22
[1] 50.01289 # aprx E(X2) = 50
[1] 3.911481
sd(x1); sd(x2); sd(x3)
[1] 2.308712e+23
[1] 1.997261 # aprx SD(X2) = 2
[1] 0.04004551
set.seed(720); n = 10^4
x2 = rnorm(n, 50, 2); x1 = exp(x2); x3 = log(x2)
mean(x1); mean(x2); mean(x3)
[1] 3.686093e+22
[1] 50.01289 # aprx E(X2) = 50
[1] 3.911481
sd(x1); sd(x2); sd(x3)
[1] 2.308712e+23
[1] 1.997261 # aprx SD(X2) = 2
[1] 0.04004551
[![enter image description here][1]][1]
par(mfrow=c(1,3))
hist(x1, prob=T, br=50, col="skyblue2")
hist(x2, prob=T, col="skyblue2")
curve(dnorm(x,50,2), add=T, col="red")
hist(x3, prob=T, col="skyblue2")
par(mfrow=c(1,1))
par(mfrow=c(1,3))
hist(x1, prob=TRUE, br=50, col="skyblue2")
hist(x2, prob=TRUE, col="skyblue2")
curve(dnorm(x,50,2), add=TRUE, col="red")
hist(x3, prob=T, col="skyblue2")
par(mfrow=c(1,1))
set.seed(720); n = 10^5
x2 = runif(n); x1 = exp(x2); x3 = log(x2)
var(x1); var(x2); var(x3)
[1] 0.2411124
[1] 0.08316279 # aprx V(X2) = 1/12
[1] 1.01091
set.seed(720); n = 10^5
x2 = runif(n); x1 = exp(x2); x3 = log(x2)
var(x1); var(x2); var(x3)
[1] 0.2411124
[1] 0.08316279 # aprx V(X2) = 1/12
[1] 1.01091
```r
[![enter image description here][3]][3]
[1]: https://i.sstatic.net/ICW5Y.png
[2]: https://i.sstatic.net/h4Wm4.png
[3]: https://i.sstatic.net/Trosu.png