Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = round(rnorm(10^6,4,1)); x[x<1]=1; x[x>7]= 7; table(x)
- x
- 1 2 3 4 5 6 7
- 6189 60309 241098 383199 242159 60808 6238
- sd(x)
- ## 1.039021 # reasonably close to 1
- mean(x)
- ## 4.002206 # reasonably close to 4
- s = replicate( 10^6, sum(rnorm(4, 4, 1)) )
- mean(s > 13.5 & s < 18.5)
- ## 0.788404
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement