I understand how to generate a random sequence of binary variables where 1 occurs with probability p and 0 occurs with probability 1-p. Namely, at each step you choose 1 if some random number is less than p and otherwise you choose 0.
How does this generalize to more than two alternatives?
If I have three mutually exclusive choices {0,1,2}. How do I proceed? I found an explanation here. It says to generate the random number from a sequence of binary tosses that represents the binary approximation of probabilities. However, this only works if the events have sufficiently different probabilities and all have decimal expansions of the same length.
Is there another way?