[SPARK-3250] Implement Gap Sampling optimization for random sampling

More efficient sampling, based on Gap Sampling optimization:
http://erikerlandson.github.io/blog/2014/09/11/faster-random-samples-with-gap-sampling/

0.5 is what I recommend as an initial guess if one is using a new RNG.  (0.4 is what I got by experimenting with the current RNG)