The most elementary logarithmic numeration system is defined as follow. Any random number $X \in [0, 1]$ can be represented uniquely as $$X=\log_3(A_1 + \log_3(A_2+\log_3 (A_3 + \cdots)))$$ with $A_k \in \{1, 2\}$ also a random variable if $X$ is a random variable. Let us introduce the sequence $X_n$ with $X_1=X$, as follows:
$$X_{n+1} = 3^{X_n}-A_n, \mbox{ with } A_n = 2 \mbox{ if } X_n\geq \log_3 2, \mbox{ and } A_n = 1 \mbox{ otherwise}.$$
The above formula allows you to compute the digits $A_1, A_2$ and so on. Also $X_n\in [0, 1]$. Assuming $X_1 = X$ is uniform on $[0, 1]$, I am interested in the following quantities:
- $p_n = P(X_n < \log_3 2)$, and especially $p_\infty$.
- $E(X_\infty^k)$, $k=1, 2, 3, 4$.
- The limiting distribution of $X_n$ and whether it admits a
non-singular density function. - $\lim_{n\rightarrow \infty}n\Big(E(X_n)-E(X_\infty)\Big)$
Any result, other than the ones I already discovered myself and listed in the next section, is welcome.
1. Theoretical results obtained so far
Probably the most fundamental theorem is this:
- If $X_n\geq \log_3 2$ then $P(X_{n+1}\geq \alpha) = \frac{1}{1-p_n}P(X_n\geq \log_3(2+\alpha))$
- If $X_n < \log_3 2$ then $P(X_{n+1}\geq \alpha) = \frac{1}{p_n}\Big[p_n -P(X_n\geq \log_3(1+\alpha))\Big]$
Thus $$P(X_{n+1}\geq\alpha) = p_n + P(X_n\geq \log_3(2+\alpha)) - P(X_n\leq \log_3(1+\alpha).$$ Here $\alpha\in[0, 1]$. Many simple results can be derived from this formula, in particular:
- $P(X_2\leq\alpha)=\log_3\Big[\frac{1}{2}(1+\alpha)(2+\alpha)\Big]$
- $p_2 = \log_3\Big[\frac{1}{2}(1+\log_3 2)(2+\log_3 2)\Big]$
- $E(X_2) = \frac{2+\log 2}{\log 3} - 2$
and more generally formulas like these ones, for $n>1$:
$$P(X_n <\alpha) = -p_{n-1} -(n-1)\log_3 2 + \log_3 \prod_{i_1,\cdots,i_{n-1}} B_{i_1,\cdots,i_{n-1}}$$
$$p_n = -(n-1)\log_3 2 + \log_3 \prod_{i_1,\cdots,i_{n-1}} C_{i_1,\cdots,i_{n-1}}$$
with (for instance)
- $A_{i_1,i_2,i_3} =\log_3(i_1+\log_3(i_2+(\log_3(i_3 +\alpha))), $
- $C_{i_1,i_2,i_3} =\log_3(i_1+\log_3(i_2+(\log_3(i_3 +\log_3 2)))$.
All indexes $i_1,i_2,i_3$ and so on take only on two values: $1, 2$.
In short all the quantities of interest can be computed recursively. Note that these results are from me, if you see any error or typo, please let me know.
2. Distribution of $X_{\infty}$
It is very well approximated by $P(X_\infty <\alpha) \approx \sqrt{\alpha}$. Note that $\alpha\in [0,1]$. Below are the empirical percentile distributions for $X_1$ (uniform), $X_2, X_3$ and $X_{40}$.
Below is the error between the empirical distribution of $X_{40}$ and its approximation based on a square root distribution on $[0, 1]$:
This a remarkable chart. I had expected to be fractal-like, highly chaotic as this is the case for the nested square root system, see here.
3. Empirical results
The chart below shows convergence of the first four moments $M_1,\cdots, M_4$, as well as that of $p_n$, starting with $X_1 = X$ being uniform on $[0, 1]$.
And here is some source code for the various computations:
$lg=log(2)/log(3);
$rand=sqrt(2)/2;
$m=40; # X_1, ... X_m
$numbers=90000; # sample size
open(OUT,">lognum.txt");
for ($k=0; $k<$numbers; $k++) {
if ($k % 100==0) { print "$k\n"; }
$x=$rand;
$rand=3*$rand-int(3*$rand); # uniform deviates
$z=$x;
for ($n=1; $n<=$m; $n++) {
if ($z >= $lg ) { $digit=2; } else { $digit=1; }
$z2=$z*$z; ## to compute variance
$z3=$z*$z2;
$z4=$z*$z3;
if ($n==40) { print OUT "$k\t$x\t$n\t$z\t$digit\t$z2\n"; }
if ($digit==1) { $adigit[$n]++; }
$az[$n]+=$z;
$az2[$n]+=$z2;
$az3[$n]+=$z3;
$az4[$n]+=$z4;
$z=3**$z - $digit;
}
}
close(OUT);
open(OUT,">lognum2.txt");