The accumulation of a neutral marker in a bacterial population under balanced growth in a chemostat follows a jagged curve as adaptive variants continuously appear and sweep the population. Such periodic selection curves are simulated in the present work using deterministic equations that, in contrast to previous models, take full account of the stochastic character of the process. The uncertainties due to the appearance time, the survival probability, and the extent of early growth at small numbers are included as stochastic initial conditions for every new variant--adaptive or neutral--that appears. The model is used to calculate the substitution rate via hitchhiking where a neutral or weakly selected mutation is carried along when a new adaptive one takes over the population. The expected ratio for the probabilities of the presence or absence of a weakly selected or counterselected mutation in the population is also calculated. This can be related to the standard result without hitchhiking if the average time between adaptive shifts is interpreted as an effective population size.