>>12499253The gamblers fallacy is actually not a fallacy under certain conditions. Usually when people invoke gamblers fallacy, they are giving you complete prior information about the nature of the game that you presumably trust.
If you flipped a coin and got heads 100 times in a row, you might start to doubt it’s a fair coin and correctly believe heads is more likely next. But if you were given proof beyond a shadow of a doubt that the coin is fair, then that would counter the evidence from the 100 heads. In both cases you are using prior information.