Skip to content

Comment on Your birthdate in the decimal expansion of Piparent

Comments

I don't know about (1), but (2) could be achieved by scanning through the first n digits and building a lookup tree. If we restrict ourselves to Pi then (3) could be achieved by either just keeping all the digits in memory or using the Bailey–Borwein–Plouffe formula [1], which allows the nth digit to be determined without needing to calculate the preceeding digits.

Your're essentially describing a compression mechanism. As you might expect, this isn't a new idea [2] and it generally fails because (as you said) the index quickly gets large as the size of the block of data increases - basically destroying any advantage for non-trivial block sizes. There is some discussion of the space trade-offs in [3], and I wouldn't be surprised if the speed of this approach is poor when compared to conventional techniques.

Another problem is that it is still not known whether number like Pi actually contains every possible finite sequence of digits [3], so not all input blocks can be compressed. In practice, this shouldn't be a problem for small blocks though.

[1] http://en.wikipedia.org/wiki/Bailey-Borwein-Plouffe_formula

[2] https://www.google.co.uk/search?q=pi+compression

[3] http://penduin.blogspot.co.uk/2006/10/pi-compression.html

[4] http://www.askamathematician.com/2009/11/since-pi-is-infinit...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.