Solution (source code)

= Solution

If $U\sim\operatorname{Uniform}(0,1)$, the <inverse transform sampling> formula
$$
T=-\frac1\lambda\log U
$$
has survival function $\mathbb P(T>t)=e^{-\lambda t}$ and hence the required <exponential distribution>.