# Proportion of correct guesses knowing the true probabilities [duplicate]

In an example, suppose we have a hypothetital infinite population of objects of two colors: red and blue, and we know the true proportions of each: $P(red)=0.3$ and $P(blue)=0.7$

Now, suppose I blindly draw objects at random and try to guess their color by using a random number generator which predicts red 30% of the time and blue 70% of the time.

What proportion of guesses are expected to be correct in a theoretical infinite sample? Intuition tells me 50%. If that is correct, why?

• Hint: What's the joint probability of two independent events?
– Sycorax
Dec 6 '17 at 17:01
• Also think about the most extreme version of this scenario, where $P(blue)=1$ and you predict blue 100% of the time. What would happen then and how does this relate to your example where the imbalance between red and blue is less drastic? Dec 7 '17 at 10:15
• @RubenvanBergen in this extreme case the guesses would be correct 100% of the time. But as $P(blue)$ decreases and I adjust the frequency with which I call "blue", surely the proportion of correct guesses has to go down. There must be some function that relates one to another, but I just can't wrap my head around it. Dec 7 '17 at 18:00

This is not a theoretical anwswer I am looking for, but a solution to the question using the simulation approach.

library(data.table)

R <- data.table()

for (i in seq(0, 1, by=0.01)) {

set.seed(123)

sim_size <- 100000

DT <- data.table(Col = c(rep("blue", sim_size*i), rep("red", sim_size*(1-i))))

DT[, Guess_num := runif(.N, min=0, max=1)]

DT[, Guess_col := ifelse(Guess_num<=i, "blue", "red")]

DT[Col==Guess_col, .N/sim_size]

Result <- data.table(P_blue = i, Prop_of_correct_guesses = DT[Col==Guess_col, .N/sim_size])

R <- rbind(R, Result)

}

library(ggplot2)

ggplot(R, aes(P_blue, Prop_of_correct_guesses)) + geom_line()


So, when the proportions of red/blue are 50/50, the proportion of correct guesses will also be 50%. As $$P(blue)$$ increases, so does the proportion of correct guesses, but parabolically, not linearly. At $$P(blue)=0.7$$, the proportion of correct guesses is $$\approx0.58$$

I am still looking for an answer based on theory.