Live data from Hacker News

Finding Waldo in π

kundor.github.io

1–10 of 80 posts

Re: Finding Waldo in π

#3
post #2

It’s kind of obvious that they are cheating: 23,074,248th through 23,075,235th hexadecimal digits is approximately 500 bytes. Finding 500 exact bytes in a random sequence would take a very long expected sequence :-) They do explain what they do: https://kundor.github.io/Cheating-images/

I read this but I'm not sure how it's done. Does he run an optimization step to select the palette that minimizes the error?

In that case I'd be cool to know the probability in finding a close enough image in that optimized space

Re: Finding Waldo in π

#4
post #2

It’s kind of obvious that they are cheating: 23,074,248th through 23,075,235th hexadecimal digits is approximately 500 bytes. Finding 500 exact bytes in a random sequence would take a very long expected sequence :-) They do explain what they do: https://kundor.github.io/Cheating-images/

I read this but I'm not sure how it's done. Does he run an optimization step to select the palette that minimizes the error? In that case I'd be cool to know the probability in finding a close enough image in that optimized space

In the target image, byte 0 is red, byte 1 is blue, byte 3 is red.

In the candidate stream, byte 0 is 4. The error is minimised if byte 2 is also 4. The values of the bytes don't matter, just the patterns of which bytes have the same value.

Re: Finding Waldo in π

#5
> The trick is that we can reassign the colors using a palette. And in fact you always need to do this; you have to somehow decide which color each byte should represent.

Hmm. I don't know that I agree. There are certainly more objective choices here than just picking any old palette, and in fact there are choices where it's not obvious the result should be considered a "palette" at all.

For example, the obvious choice to me is to treat the π bitstream as 8 bit RGB data like you would see in the PPM image format. In other words, one pixel at a time, each 8 bits represents a number from 0-255 for the red, green, and blue channel in that pixel respectively.

Of course that's a much harder ask since the colors are in this case not arbitrary, but you could (and should!!) still cheat at this by arbitrarily selecting the width of the resulting rows of pixels.

I'm not mad at seeing this palette based solution to the problem though, it's a very fun hack! Probably doing it for real would take an impossible amount of CPU time. Maybe if you did 4-bit RGB values it would be possible?

Re: Finding Waldo in π

#7
If you use a external pallete (one that is not coming from the pi digits themselves) I don't think it's that interesting. With any random set of data you can find a pallete that approximates the desired result

Re: Finding Waldo in π

#8
post #5

> The trick is that we can reassign the colors using a palette. And in fact you always need to do this; you have to somehow decide which color each byte should represent. Hmm. I don't know that I agree. There are certainly more objective choices here than just picking any old palette, and in fact there are choices where it's not obvious the result should be considered a "palette" at all. For example, the obvious choi…

That's still a choice of palette; you'll find it listed on Wikipedia [1] under "Regular RGB palettes".

There's no doubt it's a much more objective choice than the one I used! I did say I was cheating.

Going to 4-bit color won't make it feasible. Even with 1-bit black/white pixels on about the minimum possible 18x24 Waldo face, you have 432 bits to look for, and you're not going to find them without cheating somehow. This guy on Twitter tried pretty thoroughly: https://twitter.com/gsuberland/status/1508697913177915393

For the palette hack, you want to go the other way; it's easier with bigger pixels. I was able to create a perfect Waldo face from the first 988 bytes of π as a TIFF, where the standard supports 16-bit palette indices for the pixel data. Unfortunately nothing except imagemagick seems to support actually viewing these TIFFs.

[1] https://en.wikipedia.org/wiki/List_of_monochrome_and_RGB_col...

Re: Finding Waldo in π

#9
post #7

If you use a external pallete (one that is not coming from the pi digits themselves) I don't think it's that interesting. With any random set of data you can find a pallete that approximates the desired result

Not really true. It took 27M tries to find that one

Re: Finding Waldo in π

#10
I wonder, but don’t have a strong instinct either way, whether this might be easier to do without cheating targeting a format intentionally designed for lossy compression and at least somewhat forgiving error correction (like JPEG, but certainly not limited to that).
Post reply on HN