## Generate uniform data on (0,1). The expected value is 1/2. X = runif(1e4) ## Simulate the exact result for the log transform. L1 = var(log(X)) ## The mathematical approximation for the log function. L2 = 1/3 ## Simulate the exact result for the squaring transform. S1 = var(X^2) ## The mathematical approximation for the squaring function. S2 = 1/12