The gambler’s fallacy has been a notorious showcase of humanirrationality in probabilistic reasoning. Recent studies suggestthe neural basis of this fallacy might have originated from thepredictive learning by neuron populations over the latent tem-poral structures of random sequences, particularly due to thestatistics of pattern times and the precedence odds betweenpatterns. Here we present a biologically-motivated minimalneural network model with only eight neurons. Through unsu-pervised training, the model naturally develops a bias towardalternation patterns over repetition patterns, even when bothpatterns are equally likely presented to the model. Our analysessuggest that the way the neocortex integrates information overtime makes the neuron populations not only sensitive to thefrequency signals but also relational structures embedded overtime. Moreover, we offer an explanation for how higher-levelcognitive biases may have an early start at the level of sensoryprocessing.