Knights and Coins

Bob and Jane are taking turns, placing knights and coins respectively on a chessboard. If Bob is allowed to place a knight only on an empty square which is not attacked by another knight, how many pieces at most can he place before running out of moves? Assume that Jane starts second and plays optimally, trying to prevent Bob from placing knights on the board.

Bob can place at most 16 knights. One way to do this is to keep placing knights only on the 32 white squares. In order to see that Jane can prevent Bob from placing more than 16 knights, split the board in four 4×4 grids. Then, group the squares in each grid in pairs, as shown on the image below. If Bob places a knight on any square, then Jane will place a coin on its paired square. This way Bob can place at most one knight on each of the four red squares, one knight on each of the four green squares, one knight on each of the four brown squares, and one knight on each of the four blue squares. Therefore, he can not place more than 64/4 = 16 knights on the board.

Light Bulbs in the Attic

There are three light bulbs in your attic. All of them are turned off and their switches are installed downstairs. You can play with the switches as much as you want and after that, you can visit the attic above just once. How can you find out which switch to which bulb corresponds?

You turn the first switch on, then wait for 30 minutes and turn the second switch on. After that go upstairs and examine the bulbs. The one which is turned off corresponds to the third switch. The one which is turned on and is still cold corresponds to the second switch. The one which is turned on and is hot corresponds to the first switch.

Programmers and Coins

One programmer draws on a sheet of paper several circles in a line, representing coins, and puts his thumb on the first circle, covering the rest with his hand. Then he asks another programmer to guess how many different head-tail combinations are possible if someone flips all the (imaginary) coins on the paper. The second programmer, without knowing the number of circles, takes the pen and writes down a number. Then the first programmer lifts his hand and sees that the correct answer is written on the paper. How did the second programmer manage to do this?

The second programmer wrote down “1” in front of the first circle. When the second programmer lifted his hand, he saw the number “10…00”, which is exactly the number of possible head-tail combinations in binary system.