I am preparing for interviews and I was told to try and answer as many problems in the Mark Joshi book as possible.
Suppose an asset takes values from a discrete set $v_j$ and the probabilities of $v_j$ is $p_j$. Write an algorithm that produces the random variable for this asset from a uniformly distributed random variable
I am not sure if I understand the question posed here. Any suggestions or clarification is greatly appreciated.