How can a distribution have infinite mean and variance? It would be appreciated if the following examples could be given:


*

*A distribution with infinite mean and infinite variance.

*A distribution with infinite mean and finite variance.

*A distribution with finite mean and infinite variance. 

*A distribution with finite mean and finite variance.


It comes from me seeing these unfamiliar terms (infinite mean, infinite variance) used in an article I am reading, googling and reading a thread on the Wilmott forum/website, and not finding it a sufficiently clear explanation. I also haven't found any explanations in any of my own textbooks.
 A: It's instructive to see what goes wrong -- the integrals are all very well, but a sample average is always finite, so what is the issue?
I'll use the Cauchy distribution, which has no finite mean. The distribution is symmetric around zero, so if it had a mean, zero would be that mean.  Here are cumulative averages of two samples of ten thousand Cauchy variates (in red and black). First, the first 100, then the first 1000, then all of them. The vertical scale increases over the panels (that's part of the point)

If you had a distribution with a mean, the cumulative averages would settle down to that mean (by the law of large numbers). If you had a mean and variance, they would settle down at a known rate: the standard deviation of the $n$th mean would be proportional to $1/\sqrt{n}$.
The Cauchy averages are 'trying to' settle down to zero, but every so often you get a big value and the average gets bumped away from zero again.  In a distribution with finite mean this would eventually stop happening, but with the Cauchy it never does.  The averages don't go off to infinity, as they would for a non-negative variable with infinite mean, they just keep being kicked around by outliers for ever.
A: The mean and variance are defined in terms of (sufficiently general) integrals. What it means for the mean or variance to be infinite is a statement about the limiting behavior for those integrals
For example, for a continuous density the mean is $\lim_{a,b\to\infty}\int_{-a}^b x f(x)\  dx$ (which might here be considered as a Riemann integral, say).
This can happen, for example, if the tail is "heavy enough"; either the upper or the lower part (or both) may not converge to a finite value. Consider the following examples for four cases of finite/infinite mean and variance:

*

*A distribution with infinite mean and non-finite variance.
Examples: Pareto distribution with $\alpha= 1$, a zeta(2) distribution.


*A distribution with infinite mean and finite variance.
Not possible.


*A distribution with finite mean and infinite variance.
Examples: $t_2$ distribution. Pareto with $\alpha=\frac{3}{2}$.


*A distribution with finite mean and finite variance.
Examples: Any normal. Any uniform (indeed, any bounded variable has all moments). $t_3$.

These notes by Charles Geyer talk about how to compute relevant integrals in simple terms. It looks like it's dealing with Riemann integrals there, which only covers the continuous case but more general definitions of integrals will cover all the cases you will be likely to require [Lebesgue integration is the form of integration used in measure theory (which underlies probability) but the point here works just fine with more basic methods]. It also covers (Sec 2.5, p13-14) why "2." isn't possible (the mean exists if the variance exists).
A: Stable distributions provide nice, parametric examples of what you're looking for:


*

*infinite mean and variance: $0 < \text{stability parameter} < 1$

*N/A

*finite mean and infinite variance: $1 \leq \text{stability parameter} < 2$

*finite mean and variance: $\text{stability parameter} = 2$ (Gaussian)
A: No one has mentioned the St. Petersburg paradox here; otherwise I wouldn't post in a thread this old that already has multiple answers including one "accepted" answer.
If a coin lands "heads" you win one cent.
If "tails", the winnings double and then if "heads" on the second toss, you win two cents.
If "tails" the second time, the winnings double again and if "heads" on the third toss, you win four cents.
And so on:
$$
\begin{array}{|r|c|c|c|}
\hline \text{outcome} & \text{winnings} & \text{probability} & \text{product} \\
\hline
\text{H} & 1 & 1/2 & 1/2 \\
\text{TH} & 2 & 1/4 & 1/2 \\
\text{TTH} & 4 & 1/8 & 1/2 \\
\text{TTTH} & 8 & 1/16 & 1/2 \\
\text{TTTTH} & 16 & 1/32 & 1/2 \\
\text{TTTTTH} & 32 & 1/64 & 1/2 \\
\vdots\quad & \vdots & \vdots & \vdots
\end{array}
$$
The sum of products is $\dfrac 12 + \dfrac 12 + \dfrac 12+\cdots = +\infty,$ so that is an infinite expected value.
That means if you pay $\$1$ million for each coin toss, or $\$1$ trillion, etc., then you ultimately come out ahead. How can that be, when you're unlikely to win more than a few cents each time?
The answer is that one very rare occasions, you will get a long sequence of tails, so that the winnings will compensate you for the immense expense you've incurred. That is true no matter how high the price is that you pay for each toss.
A: For simplicity, suppose we are dealing with an absolutely continuous distribution with density function $f_X$ with some corresponding non-negative kernel function $g_X \propto f_X$.  Suppose we consider the general $k$th absolute moment, which is given by the following integral expressions:
$$\mathbb{E}(|X^k|) 
= \int \limits_\mathbb{R} |x|^k f_X(x) \ dx
= \frac{\int_\mathbb{R} |x|^k g_X(x) \ dx}{\int_\mathbb{R} g_X(x) \ dx}.$$
Broadly speaking, this integral will be finite so long as the "tails" of $g_X$ decrease fast enough relative to the growth of $|x^k|$ that their product (i.e., the integrand) yields a finite integral when taken over the whole set of real numbers.  (For the specific condition required in the tails, see the analysis below.)
The norming axiom of probability theory requires that the above integral is one when $k=0$, and this means that the tails of the kernel function $g_X$ integrates to a finite positive number.  This imposes a requirement on how fast the tails of the kernel function decrease to zero.  However, it is possible for the tails of the kernel function $g_X$ to decrease fast enough to ensure that $\int_\mathbb{R} g_X(x) \ dx$ is finite, but not fast enough to ensure that $\int_\mathbb{R} |x|^k g_X(x) \ dx$ is finite for some $k>0$.  When this happens, the above integral is infinite, and you get moments that do not exist.
Summing this up in intuitive terms, the reason you can have distributions with moments that don't exist is that probability theory imposes only weak requirements on the rate at which the tails of a distribution decrease to zero.  The norming axiom imposes a weak condition that requires the tails to decrease to zero fast enough for the integral of the density do exist, but this does not impose any requirement that the integral of the density multiplied by a positive power function must exist.

Sufficient condition for finite limit: A sufficient condition for a finite integral is $g_X(x) = \mathcal{O}(|x|^{-(k+1+\varepsilon)})$ for some $\varepsilon > 0$.  This condition ensures that the kernel function (and thus also the density function) decreases fast enough in its tails to yield a finite integral (see explanation of Big-O notation here).  To see why this condition is sufficient, suppose the condition holds and denote the corresponding limit supremum:
$$K \equiv \limsup_{|x| \rightarrow \infty} \Bigg| \frac{f_X(x)}{|x|^{k+1+\varepsilon}} \Bigg|.$$
The condition stated here ensures that $K < \infty$ and we then have:
$$\begin{align}
\mathbb{E}(|X^k|) 
&= \int \limits_\mathbb{R} |x|^k f_X(x) \ dx \\[6pt]
&= \int \limits_{-1}^1 |x|^k f_X(x) \ dx + \int \limits_\mathbb{R} |x|^k f_X(x) \cdot \mathbb{I}(|x| \geqslant 1) \ dx \\[6pt]
&\leqslant 2 + \int \limits_\mathbb{R} |x|^k f_X(x) \cdot \mathbb{I}(|x| \geqslant 1) \ dx \\[6pt]
&= 2 + \int \limits_\mathbb{R} |x|^k \mathcal{O}(|x|^{-(k+1+\varepsilon)}) \cdot \mathbb{I}(|x| \geqslant 1) \ dx \\[6pt]
&= 2 + \int \limits_\mathbb{R} \frac{\mathcal{O}(1)}{|x|^{1+\varepsilon}} \cdot \mathbb{I}(|x| \geqslant 1) \ dx \\[6pt]
&\leqslant 2 + K \times  \int \limits_\mathbb{R} \frac{1}{|x|^{1+\varepsilon}} \cdot \mathbb{I}(|x| \geqslant 1) \ dx \\[6pt]
&= 2 + K \times 2 \int \limits_1^\infty \frac{1}{x^{1+\varepsilon}} \ dx \\[6pt]
&= 2 + K \times 2 \Bigg[ - \frac{1}{\varepsilon x^{\varepsilon}} \Bigg]_{x=1}^{x \rightarrow \infty} \\[6pt]
&= K \times 2 \Bigg[ 0 - - \frac{1}{\varepsilon} \Bigg]_{x=1}^{x \rightarrow \infty} \\[6pt]
&= K \times \frac{2}{\varepsilon} < \infty, \\[6pt]
\end{align}$$
which establishes that the integral is finite.  (Note that the weaker condition $g_X(x) = \mathcal{O}(|x|^{-(k+1)})$ is not sufficient for this result.)
A: About the second distribution you are looking for, consider the random variable $$ X_2 = \text{number of times you can zoom in like 10cm into a fractal} $$
then the answer is infinite with probability one, and therefore the variance is zero and the mean of the distribution has a value of infinite.
