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
Sqrt - Bisection
juntar dos filas de data frame h
16-09-2020ExVitorb
21-09-2020Intpoli
24-09-2020Def-função
Paired t-test [Access Medical Information]
Linear regression Model [The spring constant]
Data Transformation
Ques5.
R