with random sampling