random and uncertainty sampling, java doc