Guest User

Untitled

a guest
Apr 14th, 2014
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. f=function(n){
  2. x=rnorm(n)
  3. g=exp(-x^2)
  4. f=mean(g)
  5. f
  6. }
  7. f(10000)
  8.  
  9. [1] 0.5800912
  10.  
  11.  
  12. f <- function(x) {exp(-x^2)}
  13. integrate(f,-Inf,Inf)
  14.  
  15. 1.772454 with absolute error < 4.3e-06
RAW Paste Data