Distribution of a random real with i.i.d. Bernoulli(p) binary digits? 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)

 A: In answer to your questions:


*

*$E[X] = \sum_i 2^{-i} E[X_i]= \sum_i 2^{-i} p = p$

*$\text{Var}[X] = \sum_i \left(2^{-i}\right)^2 \text{Var}[X_i] = \sum_i 4^{-i}p(1-p) = \frac13p(1-p)$


For the cumulative distribution function, you can calculate (or arbitrarily well approximate) cumulative probabilities using:


*

*$\Pr\left(X \le \frac{x}2\right) = (1-p)\Pr\left(X \le x\right)$  for $0 \le x \le 1$

*in particular $\Pr\left(X \le 2^{-n}\right) = (1-p)^n$ for non-negative integer $n$

*$\Pr\left(X \le \frac12+\frac{x}2\right) = (1-p)+p\Pr\left(X \le x\right)$  for $0 \le x \le 1$ 

*in particular $\Pr\left(X \le 1-2^{-n}\right) = 1-p^n$ for non-negative integer $n$


Those create the fractal patterns in your graphs, and prevent the cumulative distribution function from being differentiable at any dyadic rational $x=\frac{m}{2^n}$ when $p \not \in \{0,\frac12,1\}$, as one of the left- and right-derivatives would approach zero and the other approach infinity, so these are singular distributions.
They also allow the calculation or approximation of individual values. For example 


*

*$\frac23 = 0.101010101\ldots_2$ and $\Pr\left(X \le \frac23 \right)= \dfrac{1-p}{1-p+p^2}$

*$\frac1e = 0.010111100\ldots_2$ and $\Pr\left(X \le \frac1e \right)$ is slightly more than $1-p-p^2+p^3-p^5+2p^6-p^7$
