something about random trials and stopping criteria