Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
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
Chev-nodes
31-08-2020-Exemplo AjusteNaoL
Ass2 q2
Why is height normal
Call option formula for Laplace distributed outcomes
24-09-2020Def-função
R multiplication
Multiple linear regression modals
EulerEx2
Efeito-Runge-18-03-2021