# Something Terrible is Happening - But When Is it Likely to have Happened?

We live in continuous time $t$ and something terrible is happening at a poisson rate of $r(t)$.

How can I compute the length $T$ such that with a probability of $P$ (for example, 0.99), at least one terrible thing has happened?

I know that for a constant rate $r(t) = \bar r$, the expected value is $1/\bar r$. How can I go on?

I assume that $r(t)$ is continuous.
The idea is that, this Poisson process with time-varying parameter $r(t)$, as the limit of Bernoulli trial with time-varying probability of success, is memoryless:
For a generic finite partition $\mathscr{P}$ of $[0, T]$ as $\{[0,t_1),[t_1,t_2),[t_2,t_3) \ldots,[t_{n-1},T]\}$, let the $n$th cell following a Poisson distribution with a fixed parameter $r(t_n)$, so $$P_{\mathscr{P}} = 1 - \underbrace{e^{\sum_{k=1}^n-r(t_k)(t_k-t_{k-1})}}_{\text{Probability of no accidents}}$$. So $P = 1 - e^{-\int_0^Tr(t)dt}$. Notice that the Riemann integral $\int_0^Tr(t)dt$ is the limit of a net indexed by the set of all finite partitions of $[0,T]$ with vanishing maximal length of cell with respect to number of cells. $f(x)=1-e^{-x}$ is continuous, so this limit preserves.