Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. x = round(rnorm(10^6,4,1)); x[x<1]=1; x[x>7]= 7; table(x)
  2. x
  3. 1 2 3 4 5 6 7
  4. 6189 60309 241098 383199 242159 60808 6238
  5. sd(x)
  6. ## 1.039021 # reasonably close to 1
  7. mean(x)
  8. ## 4.002206 # reasonably close to 4
  9.  
  10. s = replicate( 10^6, sum(rnorm(4, 4, 1)) )
  11. mean(s > 13.5 & s < 18.5)
  12. ## 0.788404
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement