An integer $x\in\mathbb{Z}$ can be identified with its binary expansion, $x = \ldots b_3 b_2 b_1b_0$ where $b_i \in \{0,1\}$ for each $i\geq 0$ and $b_i = 0$ for all sufficiently large $i$. Fixing a probability measure on $\mathbb{Z}$, if we select $x$ randomly according to this measure, then we have a random selection of bits given by the binary expansion of $x$. My question is: which measures on $\mathbb{Z}$ make the bits $b_i$ independent?
I think that it may be easier to answer this question if we think about it in the reverse direction: we can start with a stochastic process $(b_i)_i$, then $x = \sum_i 2^i b_i$ is an integer-valued random variable which thus defines a measure on $\mathbb{Z}$. If $(b_i)_i$ is an independent process, then (I believe) it is determined by the probabilities $p_i = P(b_i = 1)$.
A natural choice would be $p_i = 1/2$ for every $i$, but the problem with that is then $b_i = 1$ for infinitely many $i$ with probability $1$, meaning $x$ is almost surely infinite. Then I have two associated questions:
What conditions on $(p_i)_i$ make $x$ almost surely finite? (I think $\lim_i p_i = 0$ is sufficient, but is it necessary?)
Subject to these conditions, what measure does $x$ impose on $\mathbb{Z}$? What is its pdf, $f(n) = P(x = n)$?
Edit: Thanks all for your input. The first of my questions has been settled: $x = \sum_i 2^i b_i$ is almost surely finite iff $\sum_i p_i < \infty$. I would like now to characterize the pdf $f(n) = P(x = n)$, analytically if possible (though I think this is unlikely). Is there, for instance, a "natural" choice of $(p_i)_i$ making $f(n)$ especially simple to describe/well behaved (e.g., positive and decreasing?)
To start off, let's assume $0 < p_i < 1$ for each $i$, since it wouldn't make sense for any bit to be almost surely constant. Then if $s = \sum_i p_i$ it holds that $f(0) = \prod_i(1-p_i) < e^{-s}$ (since $\ln(1-x) < -x$). Then using the independence of bits, we can compute the following values:
- $f(1) = \frac{p_0}{1-p_0}f(0)$
- $f(2) = \frac{p_1}{1-p_1}f(0)$
- $f(3) = \frac{p_1}{1-p_1}\frac{p_0}{1-p_0}f(0)$
- $f(4) = \frac{p_2}{1-p_2}f(0)$
A pattern emerges:
$$ f(n) = f(0) \prod_j \frac{p_j}{1-p_j}$$
where the product is taken over the indices $j$ with $b_j = 1$ in the binary expansion of $n$.
If $f(n)$ is positive and decreasing, then one observes two necessary conditions: $\frac{p_i}{1-p_i} < 1$ (equiv.: $p_i < 1/2$) for each $i$, and
$$\frac{p_0}{1-p_0}\frac{p_1}{1-p_1}\cdots \frac{p_{n-1}}{1-p_{n-1}} > \frac{p_n}{1-p_n}$$
I now have a precise question:
- Is there a natural or obvious example (or any example) of a sequence $(p_i)_i$ of probabilities satisfying these four criteria?:
(i) $0 < p_i < 1/2$ for every $i$
(ii) $\sum_i p_i < \infty$
(iii) $\prod_i (1-p_i) > 0$
(iv) $\prod_{j=0}^{n-1} \frac{p_j}{1-p_j} > \frac{p_n}{1-p_n}$


There is a natural and elementary example: the geometric distribution.
Let $a \in (0,1)$ be fixed and choose $p_i = \frac{a^{2^i}}{1+a^{2^i}}$. Then $\frac{p_i}{1-p_i} = a^{2^i}$, in which case we have the beautiful coincidence:
$$f(n) = f(0)\prod_j a^{2^j} = f(0)a^{\sum_j 2^j} = f(0)a^n$$
since $j$ ranges over precisely the indices where $b_j = 1$ in the binary expansion of $n$. And since $\sum_n f(n) = 1$ we must have $f(0) = 1-a$, therefore $f(n) = (1-a)a^n$ for each $n$.
The four properties for $(p_i)_i$ are also easily checked, with property (iv) simplifying to the identity $1 + 2 + 2^2 + 2^3 + \cdots + 2^{n-1} <2^n$.
I have never seen the geometric distribution motivated/discovered by way of asserting that the digits of a random integer must be independent. This is of course already known (mentioned under general properties of the distribution on Wikipedia) and astonishingly it works not only in base $2$ but in any base. Truly remarkable.