Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's a way to reduce a large number of bits to a single bit. Each region defined on the board comes to represent one bit of the answer, and that bit is determined by the "direct sum" (or exclusive-or) of all of the coin positions in the region. A direct sum is basically addition with no carry, and in this case it's done base two (so 1+1 = 0, 0+1 = 1, 0+0=0). You can also think of it as an even/odd relation: if the number of 1's is even, the result is zero. If it's odd, the result is one. If you change any single bit, you flip the result.

Once you can do that, all you need is to be able to cleverly define your regions so that you can find a single square that overlaps with any given subset of them. Flipping the coin in that square would then change the direct sum for each of the overlapping regions, and you have your answer. You first read off the bits as they lay on the board you're given, then you figure out which bits you need to flip to turn that into the pattern you want, then you find the square that overlaps with all of those bits and flip that coin.

The way the regions are laid out in this case makes it possible to do just that - you can find a square that will overlap with any combination of the regions from none of them to all of them.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: