The problem of how animals keep track of unpredictable changes in the profitability of foraging sites was studied. An optimality model was used to predict the frequency with which a forager should sample a foraging site in which the probability of reward fluctuates randomly between high and low. The alternative foraging site is stable and offers an intermediate probability of reward. The model was tested with pigeons in a shuttle-box the two ends of which represented the two foraging sites. The pigeons succeeded in tracking the changes in the fluctuating site and the payoff attained was close to the optimum. Variations in the frequency of sampling between experimental treatments were in qualitative agreement with the model for some treatments but not others. The quantitative details of sampling behaviour were not as predicted by the optimality model, but many features could be accounted for by a mechanistic model of choice. The pigeons' choice rule, although different from that of the optimality model, is one that produces near-optimal payoffs under the conditions of this experiment.