HACKER Q&A
📣 tomachello

What's your favorite math/logic puzzle?


I personally am a fan of "hat" problems, such as the following: there are 100 inmates in a prison. Tomorrow the warden will assign each a number, from 1 to 100, that will be written on their hat. The numbers won't necessarily be different, and each prisoner will be able to see the numbers of all the other prisoners, but not their own number. The warden will free all the prisoners if one of them will correctly guess their own number. Of course, tomorrow they will not be allowed to communicate in any way, and each prisoner will be given only one chance to guess. How can they strategize today so as to be free tomorrow?


  👤 josephcsible Accepted Answer ✓
This one: https://puzzling.stackexchange.com/q/74037/34791

A rather complicated setup, admittedly, but it's super satisfying if you manage to solve it on your own without having it spoiled.


👤 hostcontroller
I really like the Josephus Problem ([Numberphile‘s Video on YT](https://youtu.be/uCsD3ZGzMgE)) because of the binary twist, really enjoyed Veritasium‘s [3x+1](https://youtu.be/094y1Z2wpJg) and my favorite is your described [100 Prisoners Riddle](https://youtu.be/iSNsgj1OCLA) too

👤 hollowpython
OP, if I understood your puzzle, then 99 prisoners can answer correctly. Is that right?

👤 liberia
x = x + 1