# There are 50 similar Red balls, 50 similar blue balls, and exactly 2 similar jars with
# infinite capacity.
# How can we distribute the balls in 2 jars, so as to maximize the probability that when a
# ball is picked randomly it is Red ball.
# infinite capacity.
# How can we distribute the balls in 2 jars, so as to maximize the probability that when a
# ball is picked randomly it is Red ball.
library(plotly)
calc_prob <- function(R , B){
0.5 * (R/(R+B)) + (0.5* (50-R) /(100-R-B))
}
r <- c(1:50)
b <-c(1:50)
p <- outer(r,b,FUN = "calc_prob")
p[is.na(p)] <- 0.5
max(p)
calc_prob(49,50)
plotz

No comments:
Post a Comment