My question concerns the distribution of the first non-zero digit in base $b$ of $X/Y$ where $X,Y$ are two i.i.d random variables. I think that the digit $1$ is the most frequent.
Let $X,Y$ be two real i.i.d random variables and $b>1$ be an integer. Consider the base $b$ numeral system and define $f_b(z)$ as the first non-zero digit of $z$ in base $b$ (example: if z =0.002333 in base-$10$ then $f_{10}(z)=2$). Consider the probability distribution of $f_b(X/Y)$. Let $p_b(i)=P(f_b(X/Y)=i) (i=1,2,...,b-1)$ then the following claim is true?
- $p_b(1)=\max_{i=1,...,b-1}p_b(i)$ ?
Solutions for particular cases or counter-examples are interesting.
In decimal system: If $X,Y$ are uniformly distributed on $(O,1)$ then the probability that $1,2,...,9$ be the first non-zero digit of $X/Y$ is respectively 0.3333, 0.1481, 0.1019, 0.0834, 0.0741, 0.0688, 0.0655, 0.0633, 0.0617. In this case, $p_{10}(1) =1/3$?
If $X,Y$ are standard normal variables then the probability is 0.3093, 0.1690, 0.1185, 0.0938, 0.0788, 0.0683, 0.0602, 0.0537, 0.0483.
If $X,Y$ are exponentially distributed then the probability is 0.3021, 0.1753, 0.1242, 0.0965, 0.0791, 0.0671, 0.0582, 0.0514, 0.0461.
Code Matlab:
%%%Uniform distribution
N = 10^8;
b = 10;
x = rand(1,N);
y = rand(1,N);
d = floor(abs(x./y)./ b.^floor(log(abs(x./y))/log(b)));
T = zeros(1,b-1);
for i = 1:b-1
T(i) = mean(d==i);
end
T
sum(T)
First, when $X,Y$ are uniform on $[0,1]$: the probability that the first base-10 digit of $X/Y$ equals $1$ is the sum of the areas of infinitely many triangles, cut out of the unit square $[0,1]^2$ by pairs of lines of the form $y=10^kx$, $y=2\cdot10^kx$ (see picture). The total area of these triangles is indeed exactly $\frac13$. The other probabilities can be calculated similarly: they are exactly $$ \left\{\frac{1}{3},\frac{4}{27},\frac{11}{108},\frac{1}{12},\frac{2}{27},\frac{13}{189},\frac{11}{168},\frac{41}{648},\frac{5}{81}\right\}. $$
As for a counterexample: let $X$ take a uniform value in $[1,1.1]$ with probability $\frac13$, a uniform value in $[2,2.5]$ with probability $\frac13$, and a uniform value in $[4,5]$ with probability $\frac13$ (and similarly for $Y$. Experimentally, the probablities that 1,...,9 are the first digit of $X/Y$ are about 0.244, 0.255, 0.022, 0.233, 0.077, 0.002, 0, 0.031, 0.136. In particular, the first digit 2 seems more likely than 1.