Confidence interval of a random variable with infinite mean. (St. Petersburg paradox) Let $X_i$ be random (independent) discrete variables such that $$\forall k\ge 0 \quad P(X_i=2^k)=2^{-(k+1)}$$
$$\begin{array}{c||ccccccc}
v & 1 & 2 & 4 & 8 & 16 & 32 & \dots \\ \hline
P(X_i=v) & \frac{1}{2}& \frac{1}{4}& \frac{1}{8}& \frac{1}{16}& \frac{1}{32}& \frac{1}{64} &\dots
\end{array}
$$
Of course $E(X_i)=\infty$.
Let $S_n$ be the mean of the first $n$ $X_i$$$S_n=\frac{1}{n}\sum_{i=1}^{n}X_i$$
Let p, a real such that $0<p<0.5$
I want to compute $a_p(n)$ and $b_p(n)$ (or, at least, an asymptotic approximation when $n\rightarrow\infty$) such that
$$\forall n \quad P(S_n<a_p(n))=P(S_n>b_p(n))=p $$
How ?
This question is related to the St. Petersburg paradox.
 A: You can't calculate $a_p$ and $b_p$ directly, but you can show that both $a_p(n) - log_2 n$ and $b_p(n) - log_2 n$ converge as $n\to\infty$.
Moreover you can get a reasonable approximations.
The precise technical statement is$\dots$
For $\lambda > 0$ let $\Lambda$ be a Poisson random variable mean $\lambda$. There exists a probability distribution $Z_\lambda$ with mean $0$ and variance $\frac 1\lambda$ such that
$$S_n - \log_2 n \to Z_\lambda + \frac 1\lambda\sum_{i=1}^\Lambda X_i - \log_2 \lambda$$
in probability as $n\to \infty$.
$$ $$ $$ $$ $$ $$ $$ $$
To see this, choose some $\lambda>0$ and let $N_i$ be a sequence of Poisson random variables mean $\lambda \cdot2^i$ and set 
$$Z_i = \sum_{j=1}^i 2^{-i}N_i$$ $$Z = lim_{i\to\infty} (Z_i-\lambda i)$$
Now $X$ is the sum of independent random variables with mean $0$ and variances $\lambda\cdot 2^{-i}$ so $Z$ is a weird but well defined random variable with mean $0$ and variance $\lambda$. 
Now fix some large $k$ and let $N$ be a Poisson random variable mean $\lambda\cdot 2^{k+1}$.  
Choose iid St.Petersburg random variables $\{X_i:i=1\dots N\}$  as in the question
and let $N_i$ be the cardinality of the set $\{j\leq N : X_j = 2^{k-i}\}$.
It's a fundamental fact about Poisson random variables that $\{N_i:i\leq  k\}$ are distributed as independent Poisson random variables with mean $\lambda\cdot 2^{i}$. Notice that $N_i$ is defined for all negative $i$.
now we have
$$2^{-k}\sum_{i=1}^N X_i = \sum_{i=1}^k 2^{-i} N_i + \sum_{i=0}^\infty 2^{i} N_{-i}$$
We can deal with the term $\sum_{i=0}^\infty 2^{i} N_{-i}$. This is just the sum of ${X_i}\cdot 2^{-k}$ for $X_i\geq 2^k$. It's easy to see that this is distributed as a sum of $\Lambda$ copies of $X_i$ for a Poisson $\Lambda$
mean $\lambda$.
The sum  $\sum_{i=1}^k 2^{-i} N_i$ is distributed as $Z_k$ and the distribution of $Z_k - \lambda k$ converges as $k\to\infty$. Dividing through by $N$ we have
$$S_N - k \sim \frac{2^k\lambda}{N}\left(\frac Z\lambda + \frac 1\lambda\sum_{i=1}^\Lambda X_i\right).$$
Furthermore $\frac{2^k\lambda}{N}$ converges to $1$ almost surely, and taking logs $\log_2 N\to k+\log_2\lambda$. As the distribution of $Z$ depends on $\lambda$, set $Z_\lambda = \frac Z\lambda$ and we have
$$S_n - \log_2 n \to Z_\lambda +  \frac 1\lambda\sum_{i=1}^\Lambda X_i - \log_2\lambda$$ in distribution. 
A: In order to get confidence intervals, the stochastic variable must have an existing variance.
If the first moment (i.e. $E(X)$) does not exist, the second moment (i.e. $V(X)$) neither exists.
This is related to the problem that your approximate expected value $S_n$ will be equal to infinity when $n$ goes to infinity. It is therefore impossible to solve, i.e. finding $a_p$ and $b_p$ for $n \rightarrow \infty$.
See more at http://en.wikipedia.org/wiki/Moment_(mathematics)
