This is the variant question of Generate Nonuniform Random Numbers
Given a random number generator that produces values in [0, 1] uniformly, how would you generate a value X from T according to a continuous probability distribution, such as the exponential distribution.
I was thinking our data range would be between 0 and 1, and the exponential PDF takes a mean value (in our case it would be 0.5) in the format of lambda^(-1) = 1/lambda, the PDF formula would be:
lambda * e^(-x * lambda)
= 1/mean * e^(-x * 1/mean)
= 1/0,5 * e^(-x * 1/0.5)
= 2 * e^(-2x)
where X is the uniformly generated random number between 0 and 1.
Is this solution correct?