The book is really hard to understand, could someone, please, explain this part from Example 2:
The Bayes classifier decides $1$ if $T + B + E < 7$ and $0$ otherwise. $E$ and $B$ are intangible, and not available to the observer, we have access only to $T$. Let us assume that $T, B$ and $E$ are i.i.d exponential random variables (thus, they have density $e^{-u}$ on $[0, \infty)$).
Could you please explain how we derive this part:
\begin{equation} P(Y=1\mid T) = P(E + B < 7 - T\mid T) = \max\left(0, 1 - (1 + 7 - T)e^{-(7-T)}\right) \end{equation}
I am interested in $\max\left(0, 1 - (1 + 7 - T)e^{-(7-T)}\right)$. I understand that there is an integration of $E + B$ which are exponentially distributed, but how is it calculated? What are the steps and over what are we integrating ?
If $T$, $E$ and $B$ are i.i.d. $\sim \exp(1)$ random variables, the derivation of $\mathbb{P}(Y=1|T)$ can be done in different ways. For instance, conditioning on $T=t$ :
$\begin{align} \mathbb{P}(E + B\le 7 - t) &= \int_0^\infty \mathbb{P}(E+B\le 7-t|B=b)f_{B}(b)db \\ &= \int_0^{7-t}\mathbb{P}(E+B\le 7-t|B=b)\text{e}^{-b}db \\ &= \int_0^{7-t} \mathbb{P}(E\le 7-t-b)\text{e}^{-b}db \\ &= \int_0^{7-t}\left(1-\text{e}^{-(7-t-b)}\right) \text{e}^{-b}db\\ &= \int_0^{7-t}\text{e}^{-b}db - \int_0^{7-t} \text{e}^{-(7-t)}db \\ &=1-e^{-(7-t)} - (7-t) e^{-(7-t)} \\ &= 1 - (1 + 7 -t)e^{-(7-t)} \end{align}$
This is how the expression is obtained. Now the $\max$ comes from the fact that there are values of $t$ for which the expression is negative. These values are all $t\ge 7$, for which you see that the probability is actually $0$. So the correct expression is actually $$\mathbb{P}(E + B\le 7 - t) = \max\{0,1 - (1 + 7 -t)e^{-(7-t)}\} \, \forall t\ge 0$$
Since this holds for all $t$, this proves that the conditional probability is indeed $$ \mathbb{P}(Y=1|T) = \max\{0,1 - (1 + 7 -t)e^{-(7-t)}\} $$ as expected.