# Intuition behind expression for expected value in terms of CDF [duplicate]

Let $X$ be a random variable with support on $S \subseteq [0, \infty)$. Let $f$ be the pdf of $X$ and $F$ be the cdf.

I'm trying to get some intuition behind this identity for random variables with support on the nonnegative reals. I have a proof (given below).

$$E[X] := \int_0^{\infty} f(t)tdt = \int_0^\infty 1 - F(s)ds$$

I've managed to convince myself that it is true, but I don't have the faintest idea why the integral of the complement of the cdf should mean anything in particular, let alone something nice like the expected value.

I got the proof mostly by pushing symbols around and remembering that you can sometimes do nifty things with indicator functions and reordering sums.

Proof

$$\int_{t \in [0,\infty)} f(t) t \; dt$$

Express $t$ as integral of indicator function.

$$\int_{t \in [0,\infty)} f(t) \left( \int_{s \in [0, \infty)} \text{I}[t \ge s] ds \right) dt$$

move constant inside integral.

$$\int_{t \in [0,\infty)} \left( \int_{s \in [0, \infty)} f(t) \text{I}[t \ge s] ds \right) dt$$

reorder integrals

$$\int_{s \in [0,\infty)} \left( \int_{t \in [0, \infty)} f(t) \text{I}[t \ge s] dt \right) ds$$

This indicator function is equivalent to evaluating the inner integral on the interval $[s, \infty)$

$$\int_{s \in [0,\infty)} \left( \int_{t \in [s, \infty)} f(t) dt \right) ds$$

difference of integrals over $[0,\infty)$ and $[0, s)$

$$\int_{s \in [0,\infty)} \left( \int_{t \in [0, \infty)} f(t) dt - \int_{t \in [0,s)} f(t) dt \right) ds$$

Use the fact that $f$ is a pdf and integrates to one and definition of $F$

$$\int_{ s \in [0, \infty) } 1 - F(s) ds$$

Thus

$$\int_{t \in [0,\infty)} f(t)tdt = \int_{s \in [0,\infty)} 1 - F(s)ds$$

## marked as duplicate by joriki probability StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jun 23 '16 at 5:55

• It's probably easier to note that $1-F(s) = 1 - P(X \leq s) = P(X >s)$, and the relationship between expectation and the latter expression is much easier to derive the relationship with expectation: math.stackexchange.com/questions/64186/… – Brenton Jun 23 '16 at 5:29