Assume that there are five independent events, and the probability of each event is known, shown as follows,
$P(x_i) = p_i, i=0,1,2,3,4$
There is one event in each time slot, while $T$ is the maximum of time slots. I want to randomly generate a sequence of events in $T$ time slots. I wonder if there are methods to generate numbers based on the probability distribution of events. Moreover, I know Roulette Whell algorithm is used for fitness selection, which can be used to generate a sequence of numbers. I am not sure if Roulette Whell is a common method in generating numbers.