The first digits of powers of 2 and Benford's Law
by greenturtle3141, Dec 5, 2023, 4:08 PM
Reading Difficulty: 3/5
Intro
The distribution of the last digits of powers of
is pretty easy to find. After
, the last digits are
, repeating thereafter. Hence,
of powers of two end in
,
end in
,
end in
, and
end in
. To make this "percentage" more formal, you would use a limit. For example,
What if I told that the distribution of the first digit is... also not terribly difficult to obtain? This surprised me, since I expected the first digits of powers of
to be ill-behaved and hard to tame. It turns out that with a little trick, you can reason about the first digits with ease!
I think the trick is a pretty cute, so I'll let you try to come up with it yourself via the following exercise before we continue.
Exercise for you: Prove that there exists a power of
whose first nine digits are
.
Hint 1
Hint 2
Solution
Weyl Equidistribution Theorem and Ergodic Theory
Studying successive multiplication by
is unwholesome. Therefore, the (first) key idea was to take a log! We convert the problem to studying the arithmetic sequence
taken "mod 1" (i.e. taking the fractional parts). This is because, for example,
begins with a
if and only if
, and conveniently
.
A nice way to visualize the sequence
"mod 1" is to draw a circle with circumference
. Then, the fractional parts of
form an infinite sequence of points on the circle, formed by making "jumps" of length
along the circumference. If you keep jumping forever, the points you land on intuitively form a dense subset of the circle.
It's also intuitive that the points we land on are "equally distributed". Over the infinitely many points we jump on, there shouldn't be more points near
than
. This intuition is formalized by the following theorem, called the Weyl Equidistribution Theorem.
Theorem (Weyl): Suppose we jump around a circle of unit circumference, with each jump being of length
where
is an irrational number. Then, for any arc
, we have that the proportion of jumps that land in
is precisely the length of
.
More formally... Click to reveal hidden text
Using this theorem, we can compute the exact proportion of powers of
that begin with the digit
! The numbers between
and
form an interval of length
. On the circle, that corresponds to an arc of the same length. So by the Weyl Equidistribution Theorem, the proportion of powers of
that begin with
is exactly
.
More generally, the proportion of powers of
that begin with the digit
is
.
There is a surprising connection with ergodic theory, which is essentially the study of dynamical systems. Essentially, we can view "jumping by
" along the circle as iterated compositions of the transformation function
, which is a setting that is handled incredibly well by ergodic theory. It turns out that the transformation
is ergodic when
is irrational, and results in ergodic theory can be used to prove the Weyl Equidistribution theorem.
Benford's Law
If you look at sets of data that span various magnitudes, such as population sizes, it's quite likely that the most common first digit in the data is
. In fact, the proportion of numbers that begin with
in such data sets is typically around
. The pattern continues for other possible starting digits:
satisfy Benford's Law exactly!
Beyond the First Digit
Reading Difficulty: lol/10
What proportion of powers of
begin with
? We can follow the arguments we've made up to now to see that this is not hard at all. The
th power of
begins with
exactly when
lies within the "arc" between
and
. So by Weyl Equidistribution, the proportion is exactly
. This generalizes in an obvious way: For any positive integer
, the proportion of powers of
that "begin with
" is exactly
.
Now here's a fun question: What is the distribution of the
th digit? Does the distribution of the
th digit approach some limiting distribution as
? It turns out that it does! It approaches the uniform
distribution exponentially fast.
Theorem: Let
be the proportion of powers of
whose
th digit is
. Then
.
Proof. For
, the
th digit is
exactly when the first
digits end in
. That is, the first
digits are
where
is a
-digit number. For such an
, the proportion of powers of
that begin with
is given by
as we discussed previously. Since
ranges over
-digit numbers, it will range from
to
. Hence the proportion of powers whose
th digit is
is given exactly by
Base
is stupid, so write this as
We now use the bounds
for
. This gives
The error term
is extremely small. Indeed, the sloppy bounds
show that it vanishes rapidly as
. Thus
. To handle the new limit, we write the sum as
and use the standard integral bound
to find that
or
But it's clear that
hence
as needed. 
One Last Thing...
Throughout the whole post, we were talking about powers of two. But is two actually important here? Absolutely not! As long as
is not a power of
, this entire post still holds for powers of
!
So, for instance, the first digits of
satisfy Benford's Law, and the
th digits of the powers of
approach a uniform distribution as
.
Intro
The distribution of the last digits of powers of













I think the trick is a pretty cute, so I'll let you try to come up with it yourself via the following exercise before we continue.
Exercise for you: Prove that there exists a power of


Hint 1
If
is irrational, then you can show that the set
is \textit{dense} in
. That is, every real number can be approximated as closely as you want by numbers of the form
.




Hint 2
A power is a product. Can you turn it into a sum?
Solution
Let
. Then we are trying to find a power
such that
for some integer
. (If you have trouble seeing this, replace
with a single-digit integer like
). Taking logs, this is equivalent to
or
But since
is irrational, the set
is dense in
! So we must be able to find a
satisfying the inequality.












Weyl Equidistribution Theorem and Ergodic Theory
Studying successive multiplication by






A nice way to visualize the sequence




It's also intuitive that the points we land on are "equally distributed". Over the infinitely many points we jump on, there shouldn't be more points near


Theorem (Weyl): Suppose we jump around a circle of unit circumference, with each jump being of length





More formally... Click to reveal hidden text
Let
be an interval of
where we view
as
mod 1. Then for any irrational
we have







Using this theorem, we can compute the exact proportion of powers of








More generally, the proportion of powers of



There is a surprising connection with ergodic theory, which is essentially the study of dynamical systems. Essentially, we can view "jumping by




Benford's Law
If you look at sets of data that span various magnitudes, such as population sizes, it's quite likely that the most common first digit in the data is



:
:
:
:
:

Beyond the First Digit
Reading Difficulty: lol/10
What proportion of powers of













Now here's a fun question: What is the distribution of the




Theorem: Let





Proof. For




































One Last Thing...
Throughout the whole post, we were talking about powers of two. But is two actually important here? Absolutely not! As long as



So, for instance, the first digits of




This post has been edited 4 times. Last edited by greenturtle3141, Dec 5, 2023, 10:05 PM