added documentation to random_sampling