Live data from Hacker News

Finding Waldo in π

kundor.github.io

21–30 of 80 posts

Re: Finding Waldo in π

#21
post #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.…

I am really curious about the search algorithm. I love the palette hack, how did you find candidates to then start searching through the possible palettes?

I can sort of think of:

1) Collapse the colours in the palette to the minimum necessary to be seen as "Waldo". The more slack in the gif palette the better - 24bit colour vs 16 colours (or fewer) in the starting image?

2) For each substring in Pi, map the hex value to a colour (or close to the colour) to match the expected image.

3) find best match - how?

How to backtrack though?

Perhaps pin important fragments?

The glasses and chin seem more important?

Re: Finding Waldo in π

#22
post #20

Earlier quoted context omitted.

Can someone explain to me where the palette is defined? If it's not in the bytes of waldo.gif, is it provided by the website itself? If I save the gif file, I still see it as the same on my computer. Is it not true that the bytes of the gif actually 100% match the bytes of pi? Is there some extra metadata not included in the bytes of the file itself? If I were to send those bytes over the wire and save them to a file…

The part that's from π is the actual pixel data, which is extracted in the Python snippet "waldo.tobytes()". More-or-less equivalently, you could use "list(waldo.getdata())". The GIF file as stored on disk has extra headers, and the pixel data's been compressed. So the whole file isn't found in the digits of π, just the pixel data itself. I'd guess the chance of actually finding a correctly formatted full GIF file in…

I see, I did find it slightly suspicious that they loaded the file using Image.open instead of just reading the bytes directly. Thanks!

Re: Finding Waldo in π

#23

> The pixel data in this gif are the 23,074,248th through 23,075,235th hexadecimal digits of π! You might be surprised to learn that π! (pi factorial) is a thing that makes sense π! = 7.1880827289760327020821943451247587185593017639684371624100356994... https://www.wolframalpha.com/input?i=pi%21

Well, for some definition of "make sense" yes, any arbitrary positive decimal number can have a factorial, and even negative non-integer numbers, thanks to the gamma function. I wouldn't really say it makes "sense" though, personally.

As extensions of functions with intuitive definitions go, the gamma function isn't terrible. Much worse than exponents, much better than the zeta function. Sort of middle of the road

Re: Finding Waldo in π

#25
post #12
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

I agree. Relying on an external data for interpretation is less impressive. The most impressive would be finding an exact GIF87a file. But, the cheating technique used here isn't a simple task either. I converted the smallest valid GIF file[1] (35 bytes) into decimal number: 540959129019042423917857241427143195931235689921032801204995597056286563376232988672 It's nowhere to be found in PI :) I couldn't even find "GIF…

> "It's nowhere to be found in PI :)"

Ooh, did you search all the way to the end?

Re: Finding Waldo in π

#26
I've been waiting a dozen years for this post! Did you like Sagan's book "Contact"? I'm a big fan. Check out the work I did to show pi as a series of images, and a cool "easter egg" I might have found buried in pi.

And yes, my web site looks like it was built 20 years ago and then allowed to rot ever since, since that is in fact what happened!

https://whiteis.com/whiteis/personal/programs/Pi/pi_images.s...

Re: Finding Waldo in π

#27

I've been waiting a dozen years for this post! Did you like Sagan's book "Contact"? I'm a big fan. Check out the work I did to show pi as a series of images, and a cool "easter egg" I might have found buried in pi. And yes, my web site looks like it was built 20 years ago and then allowed to rot ever since, since that is in fact what happened! https://whiteis.com/whiteis/personal/programs/Pi/pi_images.s...

Oh and here is the page right above that one, that introduces the images:

https://whiteis.com/whiteis/personal/programs/Pi/index.shtml

Re: Finding Waldo in π

#28
post #8

Earlier quoted context omitted.

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.…

I am really curious about the search algorithm. I love the palette hack, how did you find candidates to then start searching through the possible palettes? I can sort of think of: 1) Collapse the colours in the palette to the minimum necessary to be seen as "Waldo". The more slack in the gif palette the better - 24bit colour vs 16 colours (or fewer) in the starting image? 2) For each substring in Pi, map the hex valu…

Another pass.

We're looking for a substring with the largest number of unique values. If we have unique values, we can paint each value with a colour close enough to the expected value that humans will see them as the same.

Maybe?

Re: Finding Waldo in π

#29
post #12

Earlier quoted context omitted.

I agree. Relying on an external data for interpretation is less impressive. The most impressive would be finding an exact GIF87a file. But, the cheating technique used here isn't a simple task either. I converted the smallest valid GIF file[1] (35 bytes) into decimal number: 540959129019042423917857241427143195931235689921032801204995597056286563376232988672 It's nowhere to be found in PI :) I couldn't even find "GIF…

> "It's nowhere to be found in PI :)" Ooh, did you search all the way to the end?

I must admit, not all the way.

Re: Finding Waldo in π

#30
post #24

Do the digits of pi contain all digits of any rational approximation of e? Is the same true in reverse?

Maybe. The digits of pi appear to be completely random, in which case it would contain every finite sequence of digits, but it hasn't been proven. See: https://blogs.sas.com/content/iml/2015/03/12/digits-of-pi.ht...
Post reply on HN