[0; 1]
This is also known as the "Alias Method" or "Squaring off the histogram"
Based on https://stats.stackexchange.com/questions/67911/how-to-sample-from-a-discrete-distribution/68041#68041
Example implementation https://github.com/pema99/rust-path-tracer/blob/master/src/light_pick.rs#L24
#math #probability
Setup - O(n)
Sampling - O(1)