nruns <- 1000000 # one million runs
probability of getting a perfect wild pokemon without weather boosting
minIV <- 0
maxIV <- 15
perfects <- 0
for(i in 1:nruns){
pokemon <- sample(x = minIV:maxIV, size = 3, replace = TRUE)
if(all(pokemon == c(15, 15, 15))){
perfects <- perfects + 1
}
}
perfects/nruns
## [1] 0.00024
probability of getting a perfect wild pokemon with weather boosting
minIV <- 4
maxIV <- 15
perfects <- 0
for(i in 1:nruns){
pokemon <- sample(x = minIV:maxIV, size = 3, replace = TRUE)
if(all(pokemon == c(15, 15, 15))){
perfects <- perfects + 1
}
}
perfects/nruns
## [1] 0.000535
probability of getting a perfect purified former-shadow pokemon (no weather boosting)
minIV <- 1
maxIV <- 15
purify <- function(x){
min(x+2, 15)
}
perfects <- 0
for(i in 1:nruns){
shadowPokemon <- sample(x = minIV:maxIV, size = 3, replace = TRUE)
pokemon <- purify(shadowPokemon)
if(all(pokemon == c(15, 15, 15))){
perfects <- perfects + 1
}
}
perfects/nruns
## [1] 0.007866
probability of getting a perfect purified former-shadow pokemon (Weather boosted)
minIV <- 4
maxIV <- 15
purify <- function(x){
min(x+2, 15)
}
perfects <- 0
for(i in 1:nruns){
shadowPokemon <- sample(x = minIV:maxIV, size = 3, replace = TRUE)
pokemon <- purify(shadowPokemon)
if(all(pokemon == c(15, 15, 15))){
perfects <- perfects + 1
}
}
perfects/nruns
## [1] 0.015625
probability of getting a perfect from a lucky trade
minIV <- 12
maxIV <- 15
perfects <- 0
for(i in 1:nruns){
pokemon <- sample(x = minIV:maxIV, size = 3, replace = TRUE)
if(all(pokemon == c(15, 15, 15))){
perfects <- perfects + 1
}
}
perfects/nruns
## [1] 0.015623