Arbitrary discrete distribution helper, 1D Sobol and some utils.