We have a system in which events happen after each other. Events are i.i.d. An event, shown by random variable $X$, follows exponential distribution with $E(X)=\frac{1}{\lambda}$. We suppose the system runs as long as no interval-time between two events is larger than $\tau$.
So, we can show the time-arrival between events as follows:
$t_1,t_2,t_3,\dots,t_{n-1},t_n$
in which $t_i < \tau\ 1\le i \le (n-1)$ and $t_n > \tau$
Now, the question is how we can find the distribution density function for the time-interval between the beginning and end of the system over $t$ as $t=\sum^{n-1}_{i=1}t_i + t_n$
I know that such as distribution density functions is like: $f(t) = \sum^{\infty}_{n=1}f(t|n)P(t<\tau)^{(n-1)}(1-p(t<\tau))$
in which $p(t<\tau) = 1 - e^{-\lambda\tau}$
In this regard, what $f(t|n)$ would be?
Let $$\sigma = \inf\{n>0:T_n>\tau \}, $$ then $$\mathbb P(\sigma = 1) = \mathbb P(T_1>\tau)=e^{-\lambda\tau}$$ and $$\mathbb P(\sigma = n) = \mathbb P(T_n>\tau,T_{n-1}\leqslant\tau,\ldots,T_1\leqslant\tau)=\left(1-e^{-\lambda\tau}\right)^{n-1}e^{-\lambda\tau},\ n\geqslant 1. $$ Let $S_n=\sum_{k=1}^n T_k$, then the lifetime of the system is given by $S_\sigma$ - a geometric sum of exponential random variables. By conditioning on $\sigma$ we may show that $S_\sigma\sim\mathsf{Exp}(\lambda e^{-\lambda\tau})$, and so $S_\sigma$ has density $$ f_{S_\sigma}(t) = \lambda e^{-\lambda\tau}e^{-\lambda e^{-\lambda\tau}t}\ \mathsf1_{(0,\infty)}(t). $$