Puzzles – Blogarithm ../../../../bln Curtis' self-improvement blog Sun, 01 Feb 2015 04:58:33 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.3 The names in boxes puzzle ../../../2015/01/31/the-names-in-boxes-puzzle/ Sun, 01 Feb 2015 04:58:33 +0000 http://www.curtisbright.com/bln/?p=1134 Continue reading ]]> This is one of the best puzzles I’ve come across:

100 prisoners have their names placed in 100 boxes so that each box contains exactly one name. Each prisoner is permitted to look inside 50 boxes of their choice, but is not allowed any communication with the other prisoners. What strategy maximizes the probability that every prisoner finds their own name?

I heard about this puzzle years ago, spent several days thinking about it, and never quite solved it. Actually, I did think of a strategy in which they would succeed with probability over 30% (!), which was the unbelievably-high success rate quoted in the puzzle as I heard it posed. However, I ended up discarding the strategy, as I didn’t think it could possibly work (and probably wouldn’t have been able to prove it would work in any case).

]]>
The infinite hat problem ../../../2014/08/29/the-infinite-hat-problem/ Fri, 29 Aug 2014 22:19:13 +0000 http://www.curtisbright.com/bln/?p=981 Continue reading ]]> The infinite hat problem is a great puzzle. If you have a strong math background, you should try solving it before reading my solution below!

Here’s my strategy for the wizards: first, they agree on an ordering of themselves. Each wizard can be indexed by a natural number, since there are countably many of them. They then consider the set of all possible hat configurations $S$ with respect to that ordering. By the well-ordering theorem (which is equivalent to the axiom of choice) a well-ordering of $S$ exists; the wizards also agree on a specific well-ordering.

Note that this step is non-constructive because it relies on the axiom of choice. That is, such a well-ordering exists but there may not be a way to explicitly construct it. The point of the note about assuming the axiom of choice was a tip-off that the wizards need to make their decision based off of a set whose existence is only ensured by the axiom of choice.

Once the well-ordering has been chosen the wizards are ready to receive their hats. Once they are able to see everyone else’s hat, they each construct a subset $T$ of $S$ which contains the hat configurations which differ from the configuration they can see in only finitely many hats. The lack of knowledge about a wizard’s own hat is irrelevant to this construction, since that lack of knowledge only changes the configuration they see in finitely many hats. In particular, for every wizard their subset $T$ will consist of the true configuration along with all configurations which differ from the true configuration in finitely many hats, and therefore be the same for all wizards.

Now that all the wizards have constructed the same $T\subset S$, they use the well-ordering of $S$ to find the least element of $T$, and everyone guesses the hat colour which they have in the least element. Since every element of $T$ differs from the true configuration in finitely many hats, the configuration that the wizards guess will also differ in finitely many hats. Thus almost all wizards will choose correctly.

I heard about the problem on a list of good logic puzzles compiled by Philip Thomas. I purposely haven’t read his solution yet, since I didn’t want that to influence me while writing down my solution.

]]>
An extended hat puzzle ../../../2014/07/31/an-extended-hat-puzzle/ Fri, 01 Aug 2014 03:48:50 +0000 http://www.curtisbright.com/bln/?p=977 Continue reading ]]> Shortly after hearing about the hat puzzle I wrote about last month I came across an interesting extension of the problem, which replaces the 100 wizards with an infinite number of wizards:

A countably infinite number of wizards are each given a red or blue hat with 50% probability. Each wizard can see everyone’s hat except their own. The wizards have to guess the colour of their hat without communicating in any way, but will be allowed to devise a strategy to coordinate their guesses beforehand. How can they ensure that only a finite number of them guess incorrectly? You may assume the axiom of choice.

This seems paradoxical since somehow knowing about other wizard’s hats—which are chosen independently from a wizard’s own hat—allows each wizard to conclude that they will almost surely guess their hat colour correctly.

]]>
A hat puzzle ../../../2014/06/30/a-hat-puzzle/ Tue, 01 Jul 2014 03:30:11 +0000 http://www.curtisbright.com/bln/?p=966 Continue reading ]]> I heard about an interesting puzzle recently:

100 wizards are each given either a red or blue hat with 50% probability. Each wizard can see everyone’s hat except their own. The wizards have to guess the colour of their hat without communicating in any way, but will be allowed to devise a strategy to coordinate their guesses beforehand. How can they maximize the probability that all 100 of them guess correctly?

I like this puzzle because at first it seems impossible to do much better than guessing randomly—how could knowing the colour of other people’s hats help you guess the colour of your own, since the colours were chosen independently? However, there is a very simple strategy which allows them to do much better than guessing randomly.

The strategy is this: beforehand, the wizards simply agree that they will assume the total number of red hats is even. Since it is equally likely that the total number of red hats is even or odd, they have a 50% chance of guessing correctly. And it is easy for each wizard to know the colour of their own hat using the assumption that the total number of red hats is even, since they know the number of red hats worn by others.

I heard about this problem from Tanya Khovanova. She also gives an argument that the strategy is optimal. No matter how the hats are distributed, it is always the case that any specific wizard’s hat is equally likely to be red or blue—so no matter what strategy they use, each wizard will always guess correctly with 50%. Thus the expected number of wizards who guess correctly will always be 50, no matter what strategy is used. But a strategy with a >50% chance in which everyone guessed correctly would have an expected number of wizards guessing correctly of >50, and therefore cannot exist.

The puzzle really demonstrates the power of looking at a problem from the right angle. I spent a lot of my spare time one day thinking about it, and my conclusion kept being that it sounded impossible. I went to bed thinking about the problem, and believe it or not, by the time I had woken up I had thought of the answer. Like a magic trick, the problem suddenly transforms from seemingly impossible to easy with the introduction of the right bit of knowledge.

]]>
Chess problem solution ../../../2013/09/15/chess-problem-solution/ Sun, 15 Sep 2013 21:16:50 +0000 http://www.curtisbright.com/bln/?p=532 Continue reading ]]> Today I’ll go through the solution to the chess problem I posted two weeks ago. If you’re still stuck, another hint is that the solution involves multiple lines of play to consider. You can find my solution after the break.

The correct move is Qh5!, as shown below.

chessproblemsol

A complicating factor is that the move does not place Black in check, so there are more possible responses; we’ll go through each in turn.

If Black responds with Be2 then Qxe2 is mate. If Black responds with any other move of the bishop (including the superficially best-looking move Bxh5) then Rf1 is mate. If Black moves their pawn (f3) then Qh4 is mate. Finally, if Black moves their king (Ke1) then Qe2 is mate.

]]>
Chess problem ../../../2013/08/31/chess-problem/ Sat, 31 Aug 2013 11:47:35 +0000 http://www.curtisbright.com/bln/?p=509 Continue reading ]]> Although I prefer playing Go these days, I still enjoy working through a good chess problem. The following is a rather nice one; regrettably, I don’t remember where I found it.

chessproblem
White to move and mate in two.

If you’re stuck, highlight the following for a small hint: A mate in two is no longer possible if Black can pass.

]]>
Super stalemate ../../../2013/02/24/super-stalemate/ Sun, 24 Feb 2013 23:51:32 +0000 http://www.curtisbright.com/bln/?p=50 Continue reading ]]> Yesterday I posed the following puzzle: is stalemate possible in chess if it is legal to move into check? Give it some thought first, then see my answer below.

Although the kinds of stalemate which are likely to occur in actual play depend on the fact that it is not legal to move into check, a more restrictive stalemate is possible. In the following two positions, white is in “super stalemate”, with no legal moves even if they could move into check.

stalemate1 stalemate2

Technically, one also has to verify there is some legal sequence of moves which produces such positions. In these cases it is tedious but completely straightforward to do.

]]>
A chess variant puzzle ../../../2013/02/23/a-chess-variant-puzzle/ Sun, 24 Feb 2013 02:47:29 +0000 http://www.curtisbright.com/bln/?p=40 Continue reading ]]> Consider the rules of chess modified so that the objective is to capture the opposing king. (I once played someone who apparently thought this was the objective, which was my inspiration for this.) The rest of the game remains the same, except that it is now legal to move into check—otherwise capturing the king is impossible, since checkmate would be followed by stalemate.

At first glance one might think the game is identical so long as one takes care to never move into check if at all possible. In fact, the game has appreciably changed since forcing a stalemate is harder when one has additional legal moves.

The puzzle is this: is stalemate even possible now? Why or why not?

]]>