Let $X_1, X_2, X_3, \ldots$ be an infinite sequence of i.i.d. Bernoulli($p$) random variables, and define the random real number $X = (0.X_1X_2X_3\ldots)_2$.
Question(s): What can be proved about the distribution of $X$ (for arbitrary $p$)? Are these singular distributions? What about their moments, etc.? Is it the case that $E[X]=p$?
Here are some pictures from my simulations:
In the above picture, the CDFs from upper left to lower right have increasing values of $p$. (In all cases, the simulations suggest that $E[X]=p$.)
In both histograms, the bars show the simulated random sample of i.i.d. $X$ values, and the small black dot near the top of each bar shows the computed value of $P(X\in \text{cell})$ for each cell, based on the infinite series for the CDF given below. (The agreement is excellent.)
There's evidently a fractal nature to these objects, and I'm unsure of the actual type of distribution, as to whether they are singular (rather than absolutely continuous or discrete). In any case, the slope of each CDF (other than for $p=\frac{1}{2}$) appears to be discontinuous at every "dyadic" point, i.e., at every $x=k\,2^{-m}$ for positive integers $k,m$.
Motivation: In a posting elswhere, I showed that if $p=\frac{1}{2}$, then $X\sim \text{Uniform}[0,1]$, so I naturally wondered about this more-general case. The same form of argument (via disjoint union) as presented there gives the following infinite series: $$\begin{align} P(X>x)&=P(X_1>x_1)\\ &+P(X_1=x_1\,\land\,X_2>x_2)\\ &+P(X_1=x_1\,\land\,X_2=x_2\,\land\,X_3>x_3)\\ &+\cdots\\ \\ &=p\,(1-x_1)\\ &+p\,^{x_1}\,(1-p)^{(1-x_1)}\,p\,(1-x_2)\\ &+p\,^{x_1+x_2}\,(1-p)^{(1-x_1)+(1-x_2)}\,p\,(1-x_3)\\ &+\cdots \end{align}$$ for any $x=(0.x_1x_2x_3\ldots)_2\in[0,1)$, where, WLOG, we always choose the unique binary representation of $x$ that has no infinite tail of $1$s. An algorithm that uses only the first $n$ bits of $x$ to approximate the CDF of $X$, viz., $P(X\le x)$, is therefore described by the following very simple pseudocode:
sum <- 0
term <- 1
for i in {1,...,n}:
if x[i] == 1:
term <- term*p
else:
sum <- sum + term*p
term <- term*(1 - p)
return (1 - sum)


