Posted by Mazin07 on 09/20/05 21:00
Steve wrote:
>>Just compress the file with the zlib functions. The compression routine
>>will squeeze out most of the redundancy.
>
>
> OT: Chung, I was about to tell you off for suggesting that an
> irrational number like PI could be compressed but... luckily I paused
> for a moment, and googled this
> <http://thestarman.dan123.com/math/pi/picalcs.htm> that shows better
> than 50% compression rates. So that told me.
>
> Back to the OP, where you go from here depends entirely on what your
> search algorithm is doing at the moment with the string version of PI.
> If it is a brute force dumb search, it will not need much modification
> but it will be slow.
>
> You need to pack the search substring first in the same way as your PI
> digits. You probably have to do a minimum of two searches: one to look
> for odd-aligned substrings and one to look for even-aligned substrings.
> Doing a search with a substring starting or ending on an odd-aligned
> digit also means managing the "don't care" digits. You might be able to
> devise a suitable regexp to handle all of this. Best of luck. Can you
> tell me if my birthday is in there (19590318)?
>
> ---
> Steve
>
I haven't tried it yet, but I was figuring I could maybe unpack the
whole thing or partrs of it at a time into hex and then search it from
there.
BTW: 19590318 isn't in the first 8 million digits.
I guess you could try (the slow one) for yourself.
http://ericjiang.co.nr/pi.php
[Back to original message]
|