Premium problem106. Waiting Between a and b

Easy Locked

The wait until the next event is Exponential(rate)\mathrm{Exponential}(\text{rate}). Return the probability it falls between a and b.

P(a≤T≤b)=e−λa−e−λbP(a \leq T \leq b) = e^{-\lambda a} - e^{-\lambda b}

Input

rate = 2.0
a = 0.5
b = 1.5

Output

0.3180923728035784

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)