Add a method (exp ()) to StdRandom that takes an argument (lambda) and returns a random number

Question:

Add a method \(\exp ()\) to StdRandom that takes an argument \(\lambda\) and returns a random number drawn from the exponential distribution with rate \(\lambda\). If \(x\) is a random number uniformly distributed between 0 and 1 , then \(-\ln x / \lambda\) is a random number from the exponential distribution with rate \(\lambda\).

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: