Data Science, Computer Science, Python, Probability, Machine Learning.
[0, 1] from the Unirofrm distribution. Find the first index where the CDF value is ≥ to the random float. Return the element of the original collection at this index. To understand why it works, we can do a simple visual experiment. We can think about values in the CDF array being the right borders