Hacker News new | ask | show | jobs
by paulmd 2095 days ago
I mean, the answer is trivially zero, there exists a PDF-like structure somewhere in Pi, and the offset of that doesn't have to be zero, it can start or end anywhere. So the range [0, N] is a valid PDF.
1 comments

"Find the last byte of the first valid PDF in the binary digits of Pi"
Since the PDF also doesn't have to be end-aligned, the answer is trivially [0, infinity].

The first place a valid PDF could be ended, perhaps.

A pdf at [0, N] sorts before the one at [0, N+1], by "first valid pdf".
No, both start at 0. Also, [0, infinity] and [0, infinity+1] are the same thing.
your example fails to satisfy the invariant. 11 is less than infinity.

you're just pasting random python snippits at me now. It's time to move on.

again, just to summarize: PDF files do not have to be zero aligned, and they do not have to be end aligned. Therefore the answer to the question "what is the first segment of Pi that is a valid PDF file" is trivially (0,infinity). That is a correct statement. The non-greedy (in the regex sense) answer to that question will be different, however.