# Coin toss strategy [duplicate]

If we a sequence of 5 heads or 5 tails was unlikely, and given a strategy to wait for a sequence of 4 (e.g., 4H), and then bet on the opposite outcome on the 5th flip (e.g., T), is this a flawed strategy and why?

In the more general case where the coin might be unfair (i.e., it might have different long-run proportions of heads and tails), the outcomes are generally positively correlated (see O'Neill 2012). It turns out that betting on an outcome because it has not come up very often is the worst possible strategy in these cases. In the event that the coin is biased towards one of the faces, the observed outcomes of flips will give you information on the direction of the bias. Using a Bayesian analysis, O'Neill and Puza (2005) have proved that if there is some non-zero probability of bias in the coin, and the direction of bias is unknown,$$^\dagger$$ then the posterior probability of an outcome is higher for the outcome that has already been observed the most. This implies that the optimal prediction method is to choose the outcome that has been observed most (the frequent-outcome approach). Later papers on this topic have proven that the probability of correct prediction under this prediction method converges to the maximum of the proportions of the different outcomes (see O'Neill 2012), which is the probability of correct prediction that would prevail if you were able to make predictions with perfect knowledge of the level of bias in the coin.
$$^\dagger$$ Represented as a symmetric prior density for the true long-run proportion of heads/tails.