We have random variable $T$ exponentially distributed with mean $\mu$. Assume that set $\mathbb R$ is divided by intervals of length L. Therefore, our variable $T$ falls into one of the following intervals: $(0;L],(L ; 2L], (2L,3L],\dots,(iL,(i+1)L],\dots$
Question: Find average distance between $T$ and the right bound of interval where it fell.
for example, if L = 0,05 and in one moment T = 0.17 then this distance equals 0.03, but I want to find average of those distances if T is distributed with exponential law.
My solution: Exponential law: $$\mathbb P(T\leq x)=F_{exp}(x) =\begin{cases} 1-e^{-\frac{x}{\mu}} ,\, x\geq 0;\\0,\ otherwise.\end{cases}$$
So our intervals correspond to the following probability of falling into them respectively: $$ \mathbb P(0 \leq T\leq L) = F_{exp} (L) - F_{exp}(0),\ldots, \mathbb P(iL \leq T \leq (i+1) L) = F_{exp} ((i+1)L) - F_{exp}(iL)\dots $$
I think that my desirable thing is: $$ \mathbb E T =\sum_{i=0}^{+\infty} \mathbb E (T\,|\, iL\leq T \leq (i+1)L) \cdot \mathbb P(iL \leq T \leq (i+1) L), $$ where $(T\,|\, iL\leq T \leq (i+1)L)$ --- average distance to the right bound of interval with number $i$ : $(iL;(i+1)L)$ with condition of falling in this $i$ interval. we have already found the second multiplier of every summand, So.
How to find the first conditional expectation?
I think that it is $$ \mathbb E (T\,|\, iL\leq T \leq (i+1)L) = L-\int_{iL}^{(i+1)L} x\cdot \frac{\frac{1}{\mu} e^{-\frac{x}{\mu}}}{\mathbb P(iL \leq T \leq (i+1) L)}\, dx $$ But it is wrong, I guess, because I don't like it :)
Update: Is this right? $$ \mathbb E ((i+1)L-T\,|\, iL\leq T \leq (i+1)L) = \int_{iL}^{(i+1)L} ((i+1)L-x)\cdot \frac{\frac{1}{\mu} e^{-\frac{x}{\mu}}}{\mathbb P(iL \leq T \leq (i+1) L)}\, dx $$
The random variable of interest is $$T^* = L\lceil T/L \rceil - T = (i+1)L - T, \quad T \in (iL, (i+1)L], \quad i = 0, 1, 2, \ldots,$$ where $L > 0$ is a known and fixed quantity representing the width of the intervals that partition the support of $T$. Therefore, $$\begin{align*} \operatorname{E}[T^*] &= \int_{t=0}^\infty (L \lceil t/L \rceil - t) f_T(t) \, dt \\ &= \sum_{i=0}^\infty \int_{t=iL}^{(i+1)L} ((i+1)L - t)\cdot \frac{e^{-t/\mu}}{\mu} \, dt \\ &= \left(\mu + (L-\mu) e^{L/\mu}\right)\sum_{i=0}^\infty e^{-(i+1)L/\mu} \\ &= \frac{\mu + (L - \mu) e^{L/\mu}}{e^{L/\mu} - 1}. \end{align*}$$ Note that this expression satisfies $$0 < \operatorname{E}[T^*] < L$$ for all $\mu > 0$, with $\operatorname{E}[T^*] \to L$ as $\mu \to 0^+$.