Let $X_1, \dots, X_n$ be independent and identically distributed random variables with $E(X_i) = 0$ and $$S_k = \sum_{i \leq k} X_i$$
- What is the probability distribution of $M_2 = \max \{ X_1, X_1+X_2 \}$?
We can suppose $X_i$ have normal distribution ; we have to note that $X_1$ and $X_1 + X_2$ are not independent, that's why all my attempts of computing $P(S \leq t)$ failed.
- What is the probability distribution of $M_3 =\max \{ X_1, X_1+X_2, X_1+X_2+X_3 \}$, and, more generally, of $M_n = \max\limits_{k \le n} {S_k}$ ?
1) $\max(x_1, x_1 + x_2) \le t$ if either $x_1 \le t$ and $x_2 \le 0$, or $x_1 + x_2 \le t$ and $x_2 \ge 0$. It may help to sketch this in the $x_1-x_2$ plane. Thus if $(X_1, X_2)$ has joint density $f(x_1,x_2)$, $$P(\max(X_1, X_1 + X_2) \le t) = \int_{-\infty}^t dx_1 \int_{-\infty}^{t-x_1} dx_2 f(x_1,x_2)$$
If $X_1$ and $X_2$ are iid with density $f$ and cdf $F$, this can be written as $$ \int_{-\infty}^t dx_1 \; f(x_1) F(t-x_1) $$ The density for $\max(X_1,X_1+X_2)$ is then the derivative of that with respect to $t$, namely
$$ f(t) F(0) + \int_{-\infty}^t dx_1 \; f(x_1) f(t-x_1) $$
In the case of the normal distribution $\mathscr N(\mu, \sigma^2)$, if I haven't made a mistake that density is
$$ \dfrac{\exp(-(t-\mu)^2/(2\sigma^2))}{\sqrt{2\pi} \sigma} + \dfrac{\exp(-(t/2 - \mu)^2/\sigma^2)}{2\sqrt{\pi}\sigma} \Phi\left(\frac{t}{\sqrt{2}\sigma}\right) - \dfrac{\exp(-(t-\mu)^2/(2\sigma^2))}{\sqrt{2\pi} \sigma} \Phi\left(\frac{\mu}{\sigma}\right)$$
where $\Phi$ is the standard normal CDF.