Write a program with infinite expected output Write a program that halts producing a random finite numerical output with probability 1. The expected value of the outputs of the program must be infinite.
For physical limits, you can assume your language and related functions use infinite precision numbers. E.g. for languages with random function providing range \$[0,1)\$, it returns a real in \$[0,1)\$. (Anyway I need to choose from 1/rnd and while(rnd)print(1))
Inspired by St. Petersburg paradox.
Shortest code wins. Would be quite small for lots of language though.

There are two easy-seen ways to do this, both are accepted given the question: (in Javascript)
_=&gt;1/Math.random() // ∫₀¹1/xdx=∞
_=&gt;{c='1';while(Math.random()&lt;.5)c+='1';return c} // Not golfed to easier get understood for other language user, at least I try to
    // 1/2+11/4+111/8+1111/16+...=∞
R, 9 bytes

rf(1,1,1)

Try it online!
Outputs a realization of the \$F(1,1)\$ distribution. The \$F(d_1,d_2)\$-distribution has infinite mean for \$d_2 \leq 2\$.
One way of defining the \$F(1,1)\$ distribution is as follows: let \$X_1,X_2\$ be independent \$\mathcal N(0,1)\$ random variables. Then \$\frac{X_1^2}{X_2^2}\sim F(1,1)\$.
Using the \$F\$ distribution comes out 1 byte shorter than the 2 more obvious solutions 1/runif(1) and rcauchy(1).
The plot below shows the evolution of the sample mean, for sample size ranging from 1 to 1e6; you can see that it diverges.


Alternate solution for the same byte count:
rt(1,1)^2

which outputs the square of a realization of Student's distribution \$t(1)\$. It has infinite expected value, since the \$t(1)\$ distribution has infinite variance. The square is needed to guarantee that the output is positive; without it, the expected value is undefined, since the realizations are often enough arbitrarily large positive or negative numbers.