Computing a conditional expectation involving exponential distribution I'm trying to understand how to compute the following expectation. 

Let $S$ be exponentially distributed with mean $1$. For any $t > 0$, find, $E[S \mid \max(S,t)]$. 

If $S > t$, then $\max(S,t) = S$ and so the expectation should be (or perhaps not?) $S$ itself.  Otherwise, if $S \leq t$, then how do I deal with the expectation in this case? 
Generally, we're supposed to use the sigma algebra generated by $\max(S,t)$. But I'm not sure what this sigma algebra looks like. Do I just condition on an event such as $\{S \leq t\}$? In which case, the conditional expectation would be quite simple: $E[S \mid S \leq t]$. 
 A: When you're conditioning on $M=\max(S,t),$ don't think about thinks in terms of cases for $S$... you don't know $S.$ Think about the cases for $M$.
Other than that, your reasoning isn't far off. In the case $M>t,$ you have $E(S\mid M) = M.$ And in the case $M=t,$ you have $E(S\mid M) = E(S\mid S\le t)$ (which is a non-random quantity). Of course these are the only possibilities for $M$.
So $E(S\mid M)$ is a random variable that is a function of $M.$ Or, if you want to think more measure-theoretically, it is a $\sigma(M)$-measurable random variable. 
Intuitively, the sigma algebra generated by $M$ is all the events that you can tell whether they occurred or not once you know the value of $M.$ So $\{M>6\}\in \sigma(M),$ $\{M=14\}\in \sigma(M)$ and $\{M\in \mathbb Q\}\in \sigma(M).$ Whereas $\{S=r\}\in \sigma(M)$ if and only if $r>t.$ And a $\sigma(M)$-measurable RV is intuitively one whose value you know once you know the value of $M,$ as you can see holds in the case of $E(S\mid M)$ above. And more generally, a $\Sigma$-measurable RV is one whose value you know once you know whether each of the events in $\Sigma$ occurred.
