Hacker News new | ask | show | jobs
by fisherjeff 1795 days ago
Great. It’s the weekend and I can theoretically now stop thinking about software, and yet here I am thinking of ways to efficiently compress lists of phone numbers
2 comments

There was a thread about that last month,

https://news.ycombinator.com/item?id=27549075 ("Sorted Integer Compression")

The rabbit hole deepens…
Just enumerate them all, if none is missing it's fairly easy to compress. (And 1b per number is really inefficient) ;-)

main = traverse print [1..99999999]

The Kolmogorov complexity of the set of all phone numbers is pretty low. All phone numbers with a few missing is also pretty low.

In fact, I now wonder if you can even compress the 3.8b phone number set to less than 1 bit per phone number. It should be pretty doable since a significant chunk of the number space is not valid.

But not all numbers are valid? 911. Not all area codes exist.
What language is that?
Haskell