Friday puzzle: switches

By the way, I moderate comments on the puzzles, just to stop people posting the answer in the comments and so making it hard to avoid seeing accidentally if you want to try the puzzle yourself. So if you comment and it seems to fail, don’t worry. It will appear eventually (but after a week if you include the answer).

Last week’s puzzle is traditionally known as the “impossible problem” although there are a number of variants with different limits and slightly different statements. The answer is that the sum is 17 and the product is 52 (the underlying numbers are 4 and 13).

Start by noting that if the product alone is not enough for P to know the answer, then the product cannot be a product of two primes (since then those would be the only two possible factors and so the sum would be easy) or less obviously the cube of a prime (since then the only factorization would be the prime and its square).

S cannot thus be the sum of two primes (which eliminates all even numbers by Goldbach’s conjecture, or for a problem this small we can just check) or the sum of a prime and its square. For otherwise S could not be certain that P couldn’t solve the problem the first time around. With a bit of thought it is clear that S has to be less than 55 too: look at the first prime greater than 50 and we can see 53*(S-53) would have a unique allowable factorization since we have to keep everything less than 100.

That leaves possible sums of 11, 17, 23, 27, 29, 35, 37, 41, 47, 51, 53.

Now consider all possible splittings of each of these sums into two numbers that sum correctly, and consider the products that result. Since P knows the answer on the third statement, that product must only occur in one of these splitting (otherwise it would still be ambiguous). So we can go through and take out all the products that occur in splittings for more than one of the possible sums.

When you do this, you’ll find that only 17 has a unique splitting left. But since in the fourth statement S knew the numbers then this must be the solution, S=17, the two numbers are 4,13 and P=52.

Today’s puzzle is pure logic, without any arithmetic. It’s another puzzle that seems impossible until you’ve started to think about it for some time. A warden meets with a group of prisoners. They are told they may plan a strategy together today but from then on they will be held in isolation, unable to communicate. One at a time they will be taken into the “switch room”, where there are two switches labeled A and B which are either up or down. The prisoner in the switch room must change the position of either switch A or B (not both, not neither). Then the next prisoner is taken into the switch room, and given the same choice. The order that the prisoners visit is picked by the warden, and prisoners may be taken to the switch room multiple times, even consecutively. The only guarantee is that, given long enough, every prisoner will visit the switch room time after time. At any time, any prisoner may state “all prisoners have visited the switch room.” If this is true, all the prisoners are released, otherwise they are imprisoned forever. The initial position of the switches is unknown. But I’ll give you a hint: first try and solve the problem assuming you know both switches are up to begin with.

Answer next week

This entry was posted in puzzles. Bookmark the permalink.

Comments are closed.