# Does random variable $X<\infty$ almost surely imples that $E(X)<\infty \ a.s$

I have the following stupid question in my mind while i am studying for exams. Does $$X<\infty \ a.s$$, implies that $$\mathbb E(X)<\infty$$?

Further on this, is the converse of the above statement true? Do give me a bit summary on this. Thanks very much.

I thought this was true until I realize the following example: Let's consider a simple symmetric random walk, we know that each state is null-recurrent. Let $$\tau_L$$ be a stopping time when the walk first hits $$L$$ started from $$0$$. then $$\mathbb P(\tau_L<\infty)=1$$ so $$\tau_L<\infty \ a.s.$$ but we also know that $$\mathbb E(\tau_L)=\infty$$ Is this a counter-example? Thanks, i am a bit weak on measure theory.

• Perhaps an easier counterexample. We know that $\sum\limits_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}$ and so $\sum\limits_{n=1}^\infty \frac{6}{\pi^2n^2} = 1$. Consider then a discrete random variable who takes value $n\in\Bbb Z^+$ with probability $\frac{6}{\pi^2 n^2}$. The expected value of this however would have been a multiple of the harmonic series which we know to diverge. – JMoravitz Nov 15 '19 at 14:58
• so only the converse is true? – Kenneth Nye Nov 15 '19 at 15:02
• What does $\mathbb E[X]<\infty$ a.s. means ? Notice that $\mathbb E[X]$ is deterministic (it's a constant if you prefer). So, there is no randomness here. – Surb Nov 15 '19 at 15:10
• @surb you are right, i need to drop a.s. – Kenneth Nye Nov 15 '19 at 15:13

Take $$(\Omega ,\mathcal F,\mathbb P)=([0,1], \mathcal B([0,1]), m)$$ where $$m$$ denote the Lebesgue measure on $$[0,1]$$. Consider $$X(\omega )=\frac{1}{\omega }$$.

Then, $$X(\omega )<\infty$$ a.s. but $$\mathbb E[X]=\infty$$.

• Very good clear and easy (+1) – John Nov 15 '19 at 15:26
• so the $P(X=\infty)=m(\{0\})=0$, while the the area is infinity? it is indeed a simple example. – Kenneth Nye Nov 15 '19 at 15:31
• Yes exactly. But in probability, it's not a very good idea to interpret the expectation as an area...@KennethNye – Surb Nov 15 '19 at 15:51

An even simpler counterexample is to take $$P(X=n)=C/n^2$$ where n is a positive integer and $$C$$ is a normalizing constant.

However, the converse is true. Usually, the expectation is only defined when $$X$$ is absolutely integrable. We have $$P(|X|>M)M\leq E(|X|)<\infty$$ for any $$M>0$$. If $$X$$ is infinite with positive probability, then $$P(|X|>M)\ge P(|X|=\infty)>0$$ for any $$M$$, so the left hand side of the inequality diverges as $$M\to\infty$$, a contradiction.

The simplest counter example I can think of a random variable $$X$$ which can take values $$\{1, 2, 4, ...\}$$ where $$P(X=n)=\frac{1}{2^n}$$ if $$n$$ is a power of $$2$$ and $$0$$ otherwise.. Then

$$E(X)=\sum\frac{2^{n-1}}{2^{n}}=\infty$$