Sample a CDF.