In the last exercise, we found that the frequentist solution heavily underpredicted Becky’s chances of winning the table game. This time, we will see how much that depended on the sample size. So, they continued the game but played 80 matches in total—Annie winning 50 to Becky’s 30. What are Becky’s chances of winning the next three games?
Frequentist solution
This is not different from the previous: Based on the results, with 30 wins in 80 matches, Beck’s probability of winning a game is (3/8). That means the probability of Becky winning the next three games is (3/8)3 = 0.053.
Bayesian solution
Run the R program we developed last time:
library(DescTools)
x <- seq(0,1,0.01)
AUC(x, choose(80,30)*x^33*(1-x)^50, from = min(x, na.rm = TRUE), to = max(x, na.rm = TRUE)) /
AUC(x, choose(80,30)*x^30*(1-x)^50, from = min(x, na.rm = TRUE), to = max(x, na.rm = TRUE))
0.057
And the Simulations
itr <- 1000000
beck_win <- replicate(itr, {
beck_pro <- runif(1)
p_5_3 <- dbinom(30, 80, beck_pro)
if(runif(1) < p_5_3){
game_5_3 <- 1
}else{
game_5_3 <- 0
}
if(game_5_3 == 1){
beck_3_0 <- beck_pro^3
} else{
beck_3_0 <- 0
}
if(beck_3_0 == 0){
win_beck <- "no"
}else if(runif(1) < beck_3_0){
win_beck <- "Becky"
}else{
win_beck <- "Annie"
}
})
sum(beck_win == "Becky")/(sum(beck_win == "Becky") + sum(beck_win == "Annie"))
0.058
Well, when the number of data points is large, the frequentist solution reaches what was simulated.