Transitive inference (the ability to infer that "B > D" given that "B > C" and "C > D") is a widespread characteristic of serial learning, observed in dozens of species. Despite these robust behavioral effects, reinforcement learning models reliant on reward prediction error or associative strength routinely fail to perform these inferences. We propose an algorithm called betasort, inspired by cognitive processes, which performs transitive inference at low computational cost. This is accomplished by (1) representing stimulus positions along a unit span using beta distributions, (2) treating positive and negative feedback asymmetrically, and (3) updating the position of every stimulus during every trial, whether that stimulus was visible or not. Performance was compared for rhesus macaques, humans, the betasort algorithm, and Q-learning (an established RPE model). Of these, only Q-learning failed to respond above chance during critical test trials. Implications for cognitive/associative rivalries, as well as for the model-based/model-free dichotomy, are discussed.