stochastic selection of examples