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
Introduction To Programming In Java An Interdisciplinary Approach
ISBN: 9780672337840
2nd Edition
Authors: Robert Sedgewick, Kevin Wayne
Question Posted: