Live data from Hacker News

Show HN: I made a puzzle game that gently introduces my favorite math mysteries

rahulilango.com

171–177 of 177 posts

Re: Show HN: I made a puzzle game that gently introduces my favorite math mysteries

#171
It showed a complicated map and asked me if it was 3-colorable. Then it said it can convince me that it's 3-colorable without revealing the solution. But then it demonstrated this proof on a super simple map that we already knew to be 2-colorable, not the complicated one I was told to assess.

Re: Show HN: I made a puzzle game that gently introduces my favorite math mysteries

#172

Earlier quoted context omitted.

The best analogy of zk-proofs I've heard is to suppose you have found Waldo in "Where's Waldo," and want to prove that you have done this without revealing the location. You could take a piece of paper (much larger than the picture/book), and cut out a waldo-shaped hole it and position the paper such that he is shown in the hole. Then, when you show it to the challenger, they know that you have found him without you…

It took me a minute to fully get this, so I'm adding this so it's a bit more obvious for anyone else: the piece of paper is much larger than the picture/book so that it can hide the book's relative position underneath it.

Unfortunately that completely defeats the idea of the proof.

Here's an alternative procedure:

1. Get a very large sheet of paper, and cut a Waldo-shaped hole in it.

2. Get some more paper, and paint a picture of Waldo on it.

3. Paste your image of Waldo on the back of the paper you prepared in step 1.

4. Place this composite over a Where's Waldo book.

5. You've found Waldo!

If you can't tell where the book is, there is no evidence that the image of Waldo is part of the book.

Re: Show HN: I made a puzzle game that gently introduces my favorite math mysteries

#173

Earlier quoted context omitted.

It took me a minute to fully get this, so I'm adding this so it's a bit more obvious for anyone else: the piece of paper is much larger than the picture/book so that it can hide the book's relative position underneath it.

Unfortunately that completely defeats the idea of the proof. Here's an alternative procedure: 1. Get a very large sheet of paper, and cut a Waldo-shaped hole in it. 2. Get some more paper, and paint a picture of Waldo on it. 3. Paste your image of Waldo on the back of the paper you prepared in step 1. 4. Place this composite over a Where's Waldo book. 5. You've found Waldo! If you can't tell where the book is, there…

if you can tell where the book is, it's not zero-knowledge anymore...

see my other comments -- the idea is that in each round you should be able to verify the construction (there's a Waldo-sized hole and the correct book and page when the pieces are separated) or the proposed solution (Waldo through the hole) but never the offset of the book and hole (because then you can deduce where Waldo is).

a cheating prover (utilizing your strategy, or just Waldo from a different book or whatever) would try to guess which one you will want but only has probability 1/2 of succeeding. through iteration the verifier can be exponentially increasingly confident that the prover knows where Waldo is.

Re: Show HN: I made a puzzle game that gently introduces my favorite math mysteries

#174
post #125

Great work! I really enjoyed the interactivity. Actually I already was aware of the concept of zero-knowledge proof from the wonderful article by ZCash(which is a privacy-oriented cryptocurrency) core developer Matthew Green, worth to check it out: https://blog.cryptographyengineering.com/2014/11/27/zero-kno... My two cents of the ZKP illustration is that directly using hashes are more likely to convince "computer-fr…

I triggered a coloring bug as well during that stage.

Re: Show HN: I made a puzzle game that gently introduces my favorite math mysteries

#175
post #149

So, there was this one question "Can every map be colored with just 4 colors?"... And there I sit, knowing that every map of CONTIGUOUS territories can be colored with 4 colors - but on real world maps, there are enclaves - little islands that belong to a country that they have not connection to. And if those shall have the same color as their parent country, then 4 colors is not enough... So I pick the answer "NO".…

>but on real world maps, there are enclaves - little islands that belong to a country that they have not connection to. And if those shall have the same color as their parent country, then 4 colors is not enough...

Can you give an example of one that can't be colored with 4 colors?

Re: Show HN: I made a puzzle game that gently introduces my favorite math mysteries

#176
(spoiler alert)

Thanks a lot for the game. I really enjoyed it and it got me thinking about the coloring problem.

I wonder if it could be interesting to also add some bits of the corresponding graph problem into the game. This might be able to make the coloring problem a bit less "mysterious", but not less interesting.

Some shower thoughts:

It's easy to see that if you start with an arbitrary "country map", you can easily convert it into a graph with the same coloring properties: Just draw a node into the center of each region, then, if two regions have a shared border somewhere, connect their nodes with an edge.

The coloring problem is now the task of coloring all the nodes, so that no two nodes that are directly connected with an edge have the same color.

The solution to that task is also easy to see: If you have n nodes where each nodes has edges to all the other nodes, then you need n colors. The more "missing" edges you have in the graph, the less colors you can get away with. (The location of the missing edges is important though: As soon as there a group of n fully connected nodes, you need at least n colors, no matter how many additional nodes and missing edges there are)

Does that mean you can construct graphs that need 5 colors or more? Yes, just make the desired number of nodes and draw edges between all of them.

So then, where does the limit of 4 come from? There it gets interesting: Because not every graph con be converted back into a country map: Only planar graphs, i.e. graphs where no edges cross if you lie it out on a plane have a corresponding country map, otherwise you'll get an "impossible geometry".

So the coloring problem "really" shows that you can have at most 4 fully connected nodes in a planar graph - if you have graphs with more connections, you will always have at least two edges crossing, no matter how you arrange the nodes and edges on the plane.

This might also explain why it is so hard to produce good visualisations for arbitrary graphs.

An interesting question might be how the planar criterion works for other geometries, e.g. if you lay out the graph on a sphere or torus or multi-hole torus.

Another aside: In real life, states are not always continous regions on a map. There are a lot of nations that have enclaves, oversea territories or for other reasons consist of more than one geographical region. So in theory, a "map of nation states" instead of a "map of regions" could represent a nonplanar graph and could have a coloring number greater than 4. I'm not sure if there is actually such a situation anywhere on the globe though.

Re: Show HN: I made a puzzle game that gently introduces my favorite math mysteries

#177
post #175
post #149

So, there was this one question "Can every map be colored with just 4 colors?"... And there I sit, knowing that every map of CONTIGUOUS territories can be colored with 4 colors - but on real world maps, there are enclaves - little islands that belong to a country that they have not connection to. And if those shall have the same color as their parent country, then 4 colors is not enough... So I pick the answer "NO".…

>but on real world maps, there are enclaves - little islands that belong to a country that they have not connection to. And if those shall have the same color as their parent country, then 4 colors is not enough... Can you give an example of one that can't be colored with 4 colors?

They all can be colored in 4 colors - if you don't care about giving the enclave the same color as the parent country.

If you insist giving those little islands the same color as the country they belong to, then things get difficult. That's not always doable in 4 colors.

see: https://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/4C...

Post reply on HN