Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Pi estimation
pi.est <- function(n){ x <- runif(n, -1, 1) y <- runif(n, -1, 1) z <- x^2 + y^2 f = c() for(i in 1:n){ if( abs(z[i]) <= 1){ f[i] <- 1 }else{ f[i] <- 0 } } qt1 = sum(f[f==1]) pi.est = qt1/n return(4*pi.est) } pi.est(1000000)
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Condição de alinhamento entre três pontos
1
helloworld
calc
Chi-squared tests of independence [m musculoskeletal injuries treated]
Ex15-12-20
Chapter 5: Sample from N(0,1)
19-08-2020-JacobiSistema-menos-calc
Die sim
Gab1A(resumido)
Please log in to post a comment.