I'm working on a quant interview question from the book called Quant Job Interview Questions And Answers (by Mark Joshi and other authors). I cannot understand the following question(not the answer, but the question itself):
Question 5.2: Suppose an asset takes values from a discrete set $v(j)$ and the probability of $v(j)$ is $p(j)$. Write an algorithm that produces the random variable for this asset from a uniformly distributed random variable.
What is the meaning of "produces the random variable for this asset from a uniformly distributed random variable", can any expert give an example to show what it means? Really appreciate your help!