55
$\begingroup$

Let $X$ be a non-negative random variable and $F_{X}$ the corresponding CDF. Show, $$E(X) = \int_0^\infty (1-F_X (t)) \, dt$$ when $X$ has : a) a discrete distribution, b) a continuous distribution.

I assumed that for the case of a continuous distribution, since $F_X (t) = \mathbb{P}(X\leq t)$, then $1-F_X (t) = 1- \mathbb{P}(X\leq t) = \mathbb{P}(X> t)$. Although how useful integrating that is, I really have no idea.

$\endgroup$
5
  • 1
    $\begingroup$ In the two cases, it's a rewritting of the sum. Start from the RHS, that you can express in the first case as an integral of a sum and in the second as a double integral, then switch them. This is allowed because all the quantities are non-negative. $\endgroup$ Jul 19, 2012 at 13:42
  • 3
    $\begingroup$ This question was asked here previously. Check and you will find a more detailed answer. Either here or on CV. $\endgroup$ Jul 19, 2012 at 14:21
  • 2
    $\begingroup$ See for example, the answers to this question which include both formal proofs (by Didier, who has answered your question here) as well as more intuitive approaches to the problem. $\endgroup$ Jul 19, 2012 at 15:38
  • 2
    $\begingroup$ As far as usefulness, this can be more numerically stable than differentiating $F$, mulitplying by $t$, and integrating. Actually, most random variables don't have pdfs, so differentiating $F$ may not even be possible. $\endgroup$
    – cantorhead
    Oct 26, 2015 at 21:12
  • $\begingroup$ A proof explicitly using Fubini and integrating $dP$: math.stackexchange.com/questions/536442/… $\endgroup$
    – D.R.
    Nov 20, 2019 at 8:30

3 Answers 3

54
$\begingroup$

For every nonnegative random variable $X$, whether discrete or continuous or a mix of these, $$ X=\int_0^X\mathrm dt=\int_0^{+\infty}\mathbf 1_{X\gt t}\,\mathrm dt=\int_0^{+\infty}\mathbf 1_{X\geqslant t}\,\mathrm dt, $$ hence, by applying Tonelli's Theorem,

$$ \mathrm E(X)=\int_0^{+\infty}\mathrm P(X\gt t)\,\mathrm dt=\int_0^{+\infty}\mathrm P(X\geqslant t)\,\mathrm dt. $$


Likewise, for every $p>0$, $$ X^p=\int_0^Xp\,t^{p-1}\,\mathrm dt=\int_0^{+\infty}\mathbf 1_{X\gt t}\,p\,t^{p-1}\,\mathrm dt=\int_0^{+\infty}\mathbf 1_{X\geqslant t}\,p\,t^{p-1}\,\mathrm dt, $$ hence

$$ \mathrm E(X^p)=\int_0^{+\infty}p\,t^{p-1}\,\mathrm P(X\gt t)\,\mathrm dt=\int_0^{+\infty}p\,t^{p-1}\,\mathrm P(X\geqslant t)\,\mathrm dt. $$

$\endgroup$
11
  • 2
    $\begingroup$ @Cupitor The left-hand-side, the middle side and the right-hand-side are all random variables, for example the value at $\omega$ of the right-hand-side is $$\int_0^{+\infty}\mathbf 1_{X(\omega)\geqslant t}\,\mathrm dt.$$ $\endgroup$
    – Did
    Jun 2, 2014 at 19:35
  • 5
    $\begingroup$ $U=\mathbf 1_{X\geqslant t}$ is the function defined on $\Omega$ by $U(\omega)=1$ if $X(\omega)\geqslant t$ and $U(\omega)=0$ otherwise. $\endgroup$
    – Did
    Jun 3, 2014 at 10:09
  • 2
    $\begingroup$ The second step is to consider the expectation of each side (that is, its integral with respect to $P$). $\endgroup$
    – Did
    Jun 3, 2014 at 15:14
  • 2
    $\begingroup$ @Did Can you tell me how to do this formally? I've been trying to understand your argument for hours now. First: What arguments does the function $1_{X>t}$ take? It's a function of $t$ isn't it. I will write this explicitly in the following calculation. By integration I get: $E(X)=\int_{-\infty}^{\infty}X(\omega)P(d\omega)=\int_{-\infty}^\infty\int_0^{\infty}1_{X(\omega)\geq t}(t)dtP(d\omega)=\int_{0}^\infty\int_{-\infty}^{\infty}1_{X(\omega)\geq t}(t)P(d\omega)dt$, where the last step I suppose is Fubini. I know that $\int_{-\infty}^{\infty}1_{X(\omega)\geq t}(\omega)dP(\omega)=P(X>t)$. $\endgroup$
    – azureai
    Feb 12, 2017 at 21:34
  • 3
    $\begingroup$ Maybe Fubini-Tonelli deserves a mention $\endgroup$ Jan 19, 2020 at 23:23
14
$\begingroup$

Copied from Cross Validated / stats.stackexchange:

enter image description here

where $S(t)$ is the survival function equal to $1- F(t)$. The two areas are clearly identical.

$\endgroup$
4
  • 4
    $\begingroup$ The two areas may be clearly identical, but what is unclear is why the integrals equal match the diagrams. Moreover, it appears that this proof does not apply in general: it only works when the random variable $X$ in question possesses a density. $\endgroup$
    – pre-kidney
    Jul 19, 2019 at 5:13
  • $\begingroup$ @pre-kidney In the left hand diagram I would have thought it was sensible to regard the white bordered slice as essentially having width $t$ and height $\delta F(t)$, so the area is $\int t\, dF(t)$ while the right hand diagram white bordered slice as essentially having width $\delta t$ and height $S(t)=1-F(t)$ so an area which is $\int S(t) \, dt$, with this duality working for all non-negative distributions discrete or continuous. You are correct that $\int t\, f(t) \, dt$ is only meaningful when there is a density function, since $f(t)$ is that density. $\endgroup$
    – Henry
    Jul 21, 2019 at 17:21
  • 1
    $\begingroup$ Certainly there are more issues than just the surface level you acknowledge - beyond just the fact that $\int_{t=0}^{\infty}t\ f(t)\ dt$ is meaningless in general, the way you bring in the integral $\int_{t=0}^{\infty} t\ dF(t)$ (which, by the way, I still don't know exactly what quantity you are referring to when $X$ lacks a density) seems to be via Riemann sum approximations to a Riemann integral, which cannot work for the general case (it would require a Lebesgue integral, at least in the standard formulations of probability theory...) $\endgroup$
    – pre-kidney
    Jul 21, 2019 at 21:17
  • $\begingroup$ I think it should be $dS(t)$ but not $dF(t)$ in the left equation as the function of the curve is $S(t)$. $\endgroup$
    – mxdxzxyjzx
    Aug 11, 2020 at 0:49
5
$\begingroup$

The function $x1[x>0]$ has derivative $1[x>0]$ everywhere except for $x=0$, so by a measurable version of the Fundamental Theorem of Calculus $$ x1[x>0]=\int_0^{x}1[t>0]\ dt=\int_0^{\infty}1[x>t]\ dt,\qquad \forall x\in\mathbb R. $$ Applying this identity to a non-negative random variable $X$ yields $$ X=\int_0^{\infty}1[X>t]\ dt,\quad a.s. $$ Taking expectations of both sides and using Fubini to interchange integrals, $$ \mathbb EX=\int_0^{\infty}\mathbb P(X>t)\ dt. $$

$\endgroup$
2
  • 1
    $\begingroup$ How do we get $$\int_0^{x}1[t>0]\ dt=\int_0^{\infty}1[x>t]\ dt,\qquad \forall x\in\mathbb R. $$ $\endgroup$ Apr 23, 2021 at 19:41
  • $\begingroup$ @T34driver They are both $\int\limits_0^{x}1\ dt =x$ when $x>0$ and are both $0$ when $x \le 0$ $\endgroup$
    – Henry
    Nov 12, 2021 at 3:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .