I have executed two experiments to verify whether smaller natural numbers are more common than bigger ones, spired by some high-performance database software that stores smaller natural numbers with a unique(memory-saving) approach.
Experiment one extracted all natural numbers from a text corpus like Jeopardy(Over 200,000 questions from the famed tv show) and computed each number's frequency.
The other experiment extracted all natural numbers from the Fibonacci sequence as follows.
integers_freq = {}
integers_cnt = 0
# get all substrings from a numeric string
# e.g. n = 144 substrings = ['1', '4', '4', '14', '44', '144']
def get_substrings(s):
# omit...
# fibonacci numbers
fibonacci = [1, 1]
for i in range(2, 20):
fibonacci.append(fibonacci[i-1] + fibonacci[i-2])
for n in fibonacci:
s = str(n)
substrings = get_substrings(s)
for substring in substrings:
integers_cnt += 1
if substring in integers_freq:
integers_freq[substring] += 1
else:
integers_freq[substring] = 1
# sort the integers by integer value
integers_freq = sorted(integers_freq.items(), key=lambda x: int(x[0]))
for integer, freq in integers_freq:
print("count = {} Pr({}) = {:.4f}".format(freq, integer, freq/integers_cnt))
And I plot the natural numbers(extracted from top 20 Fibonacci sequence) distribution with a bar chart
Both experiments expressed that smaller natural numbers are more common than bigger ones. Can we use Benford's law(Generalization to digits beyond the first) to explain this phenomenon?