Article 1J0EQ Prime factors, phone numbers, and the normal distribution

Prime factors, phone numbers, and the normal distribution

by
John
from John D. Cook on (#1J0EQ)

Telephone numbers typically have around three distinct prime factors.

The length of a phone number varies by country, but US a phone number is a 10 digit number, and 10-digit numbers are often divisible by three different prime numbers, give or take a couple. Assuming phone numbers are scattered among possible 10-digit numbers in a way that doesn't bias their number of prime factors, these numbers will often have between 1 and 5 prime factors. If a country has 9- or 11-digit phone numbers, the result is essentially the same.

Let I(n) be the number of distinct prime factors of n. Then the ErdAs-Kac theorem says roughly that I(n) is distributed like a normal random variable with mean and variance log log n. More precisely, fix two numbers a and b. For a given value of x, count the proportion of positive integers less than x where

(I(n) - log log n) / sqrt( log log n)

is between a and b. Then in the limit as x goes to infinity, this proportion approaches the probability that a standard normal random variable is between a and b.

So by that heuristic, the number of distinct prime factors of a 10-digit number is approximately normally distributed with mean and variance log log 10^11 = 3.232, and such a distribution is between 1 and 5 around 73% of the time.

My business phone number, for example, is 8324228646. Obviously this is divisible by 2. In fact it equals 2 i- 32 i- 462457147, and so it has exactly three distinct prime factors: 2, 3, and 462457147.

Here's how you could play with this using Python.

 from sympy.ntheory import factorint def omega(n): return len(factorint(n))

I looked in SymPy and didn't see an implementation of I(n) directly, but it does have a function factorint that returns the prime factors of a number, along with their multiplicities, in a dictionary. So I(n) is just the size of that dictionary.

I took the first 20 phone numbers in my contacts and ran them through omega and got results consistent with what you'd expect from the theory above. One was prime, and none had more than five factors.

phone_bar.png

sXotK32BJN8
External Content
Source RSS or Atom Feed
Feed Location http://feeds.feedburner.com/TheEndeavour?format=xml
Feed Title John D. Cook
Feed Link https://www.johndcook.com/blog
Reply 0 comments