I can't solve the following exercise:
A random number generator generates random values $U \sim \text{U}(0,1)$ from the standard uniform distribution. Use $U$ to generate a random variable $P \sim \text{Pois}(\lambda = 5)$ from a Poisson distribution with rate parameter equal to five.
Comment: In previous tasks I was asked to use $U$ to generate an exponential random variable $E \sim \text{Exp}(\lambda)$. The solution was to take $E \equiv -\tfrac{1}{\lambda} \ln(1-U)$. I think that this can be helpful because of the relation between Poisson distributions and exponential, but I'm not sure.