Decimal digit decomposition of a geometric random variable (source code)

= Decimal digit decomposition of a geometric random variable
{title2=$N=bY+X$}

The same argument works for any integer base $b\ge2$. Suppose $N$ has <geometric distribution> $\mathbb P(N=n)=(1-q)q^n$, $n\ge0$, with $0<q<1$. Its <Euclidean division> $N=bY+X$ gives $0\le X<b$ and $Y\ge0$. Their <joint probability mass function> is
$$
p_{X,Y}(x,y)=(1-q)q^{x+by}
=\frac{(1-q)q^x}{1-q^b}(1-q^b)q^{by}.
$$
The factors are normalized <probability mass functions>, so the final digit $X$ and quotient $Y$ are <independent>. The quotient again has <geometric distribution>, with success <probability> $1-q^b$. If $N$ is the integer part of an <exponential random variable> of rate $\lambda$, take $q=e^{-\lambda}$.