>>106360770
Just calculate the inverse CMF of a categorical distribution and compute its value for X ~ U(0, 1)