This project is the final project from Developing Data Products course and the main objective is to write a Shiny application.
Here it was built an application simulating the probability of a ten-faced die rolled n times.
9/12/2020
This project is the final project from Developing Data Products course and the main objective is to write a Shiny application.
Here it was built an application simulating the probability of a ten-faced die rolled n times.
The following code calculates the probability of a ten-faced die rolled n times.
set.seed(1986)
n <- 5000
die <- 1:10
vec.n <- n
sum.n <- n
r <- 1
for(i in 1:vec.n){
vec.n[i] <- roll <- sample(die, size = 1, replace = TRUE)
sum.n[i] <- sum(vec.n[1:i]==r)/i
}
The application can be found on GitHub repository: CarolineRepository