2
$\begingroup$

I have a random number generator that generates a random real number between $0$ and $1$ (not including $0$ or $1$).

I generate a first number. Then I generate more numbers until I get a number that is smaller than the first number.

Let $X=$ the number of numbers generated after the first number. So the possible values of $X$ are $1, 2, 3, ...$.

We can show that $E(X)=\infty$.

$P(X=n)$
$=P(\text{smallest number is last, and second smallest number is first})$
$=\left(\frac{1}{n+1}\right)\left(\frac{1}{n}\right)$

$\therefore E(X)=\sum\limits_{n=1}^\infty n(\frac{1}{n+1})(\frac{1}{n})=\frac12+\frac13+\frac14+\cdots=\infty$

How can the expectation of $X$ be larger than every possible value of $X$?

$\endgroup$
5
  • 7
    $\begingroup$ That applies even in other cases. For example if $X$ takes values in the positive integers and $P(X = n) = \frac{6}{\pi^2} \frac{1}{n^2}$ then $\mathbb E[X] = \infty$. You're basically asking how a random variable can have infinite expectation, because the expectation is supposed to be the "average" : well, the idea that it's in the middle only makes sense when there are two ends to talk about. If $X$ itself is unbounded, then it can definitely happen that $X$ is skewed enough for $\mathbb E[X] = \infty$ and the "average" notion falls apart. Somewhat "like" $\frac{1+\infty}{2} = \infty$... $\endgroup$ Commented Dec 26, 2022 at 5:00
  • $\begingroup$ Another case is if $X$ is $0$ wp $1/2$ and $1$ wp $1/2$. Then $E(X)=1/2$ but $1/2$ is not a possible outcome. $\endgroup$
    – Rptoughs
    Commented Dec 26, 2022 at 5:37
  • 3
    $\begingroup$ @Rptoughs I don't have a problem with $E(X)$ not being equal to any possible value of $X$. But I find it hard to grasp how $E(X)$ can be larger than every possible value of $X$. It must be because when the expectation is infinity, the "average" notion falls apart, as Sarvesh Ravichandran Iyer commented. $\endgroup$
    – Dan
    Commented Dec 26, 2022 at 5:48
  • 1
    $\begingroup$ For any finite number $N$, you have $E X > N$. Surely you do not object to this. So $E X = \infty$ is the only reasonable number to assign it. $\endgroup$
    – Andrew
    Commented Dec 26, 2022 at 6:53
  • 1
    $\begingroup$ By the law of large numbers, $\mathbb{E}[X]$ is the limit of sample mean $\overline{X}_n=\frac{1}{n}\sum_{k=1}^{n}X_k$ of i.i.d. samples $X_k\sim X$. This indeed gives another meaning of the mathematical expectation of a random variable. So, in OP's case, $\mathbb{E}[X]=\infty$ means that we have $$\lim_{n\to\infty}\overline{X}_n=\infty$$ with probability one. However, this effect is notoriously hard to observe in simulations, because we can prove that $\overline{X}_n$ grows like $\log n$, and the logarithm function grows really, really slow. $\endgroup$ Commented Dec 26, 2022 at 12:01

0

You must log in to answer this question.

Browse other questions tagged .