I had bought an unfair coin. The probability of getting a tail is 75% P(T) = 3/4 and the probability of getting a head is 25% P(H) = 1/4
I decided to do the following experiment: I programmed a computer to generate a random boolean.
TRUE means Head and FALSE means Tails
. Then I toss the coin and I check if the result is the same as the computer random guess.
var random_boolean = Math.random() >= 0.5;
if (random_boolean) {
save(Heads_count++)
console.log('I guess: HEAD!!!!!!!!!!!!!!!!!!!!!!')
} else {
save(Tails_count++)
console.log('I guess: TAIL!!!!!!!!!!!!!!!!!!!!!!!!')
}
I call it SUCCESS if the two results match. It repeat the same experience several time (N) and I count the number of success.
Weirdly, I get a success rate tending toward 50% . Why is that? Is it normal assuming that the computer generate a fair random boolean and knowing that the coin is unfair?