Intuition behind using complementary CDF to compute expectation for nonnegative random variables I've read the proof for why $\int_0^\infty P(X &gt;x)dx=E[X]$ for nonnegative random variables (located here) and understand its mechanics, but I'm having trouble understanding the intuition behind this formula or why it should be the case at all. Does anyone have any insight on this? I bet I'm missing something obvious.
For the discrete case, and if $X$ is nonnegative, $E[X] = \sum_{x=0}^\infty x P(X = x)$.  That means we're adding up $P(X = 0)$ zero times, $P(X = 1)$ once, $P(X = 2)$ twice, etc.  This can be represented in array form, where we're adding column-by-column:

$$\begin{matrix} P(X=1) &amp; P(X = 2) &amp; P(X = 3) &amp; P(X = 4) &amp; P(X = 5) &amp; \cdots \\ &amp; P(X = 2) &amp; P(X = 3) &amp; P(X = 4) &amp; P(X = 5) &amp; \cdots \\ &amp; &amp; P(X = 3) &amp; P(X = 4) &amp; P(X = 5) &amp; \cdots \\ &amp; &amp; &amp; P(X = 4) &amp; P(X = 5) &amp; \cdots \\ &amp; &amp;  &amp;  &amp; P(X = 5) &amp; \cdots\end{matrix}.$$

We could also add up these numbers row-by-row, though, and get the same result.  The first row has everything but $P(X = 0)$ and so sums to $P(X &gt; 0)$.  The second row has everything but $P(X =0)$ and $P(X = 1)$ and so sums to $P(X &gt; 1)$.  In general, the sum of row $x+1$ is $P(X &gt; x)$, and so adding the numbers row-by-row gives us $\sum_{x = 0}^{\infty} P(X &gt; x)$, which thus must also be equal to $\sum_{x=0}^\infty x P(X = x) = E[X].$

The continuous case is analogous.

In general, switching the order of summation (as in the proof the OP links to) can always be interpreted as adding row-by-row vs. column-by-column.
Perhaps by considering this question with a concrete physical example,
it will provide some intuition.

Consider a beam of length $L = 10$ (you can pick your favorite units)
attached to a wall. Now, at positions $1, 2, \ldots, 9$
hang weights $w_1,w_2,\ldots,w_9$. For simplicity, let's assume
$\sum_{n=1}^9 w_n = 1$.

Then the center of mass of the beam is $c = \sum_{n=1}^9 n
w_n$. below is an example picture, with the weights in blue (heights
proportional to weight) and the center of mass in red.



In a probabilistic setting, our weights correspond to probabilities
and $c = \mathbb E X$ where $X$ takes on the values $1,2,\ldots,9$
with probabilities $w_1,w_2,\ldots,w_9$, respectively.

Now, to explain how $c = \mathbb E X = \sum_{n=0}^9 \mathbb P(X &gt; n) = \sum_{n = 0}^9
\sum_{k=n+1}^9 w_k$ comes about, expanding out the latter sum we have
$$
c = (w_1 + \cdots + w_9) + (w_2 + \cdots + w_9) + \cdots + (w_9) \&gt;, 
$$
so, $w_1$ appears once, $w_2$ appears twice, $w_3$ appears three
times, etc. Hence $c = \sum_{n=1}^9 n w_n$.

In terms of the beam, we can think of the expression $\sum_{n=0}^9 \mathbb P(X
&gt; n)$ in the following way. Standing at zero, look out to the right
and count up all the weights in front of you. Now, move one step to
the right and repeat this process, adding the result to your initial
sum. Continue this process until you get out to position 9, at which
point there are no more weights in front of you.

The resulting sum is the center of mass, or, in probabilistic terms,
the expectation $\mathbb E X$.

Extending this intuition to discrete random variables taking on non-integer values is straightforward. The extension to continuous variables is also not difficult.