![]() ![]() Bearing this in mind, it is enough for us to describe how the second prisoner can answer this question for each of the three patterns independently. Moreover if he knew the answer to this question not only for the first of these patterns but for all three patterns then he would know the exact column of the magic square. Now suppose the second prisoner knew whether the magic square was one of the 'X' squares or one of the 'o' squares in the first of these patterns, then he would have narrowed down the column of the magic square to either the left or the right hand side of the board. ![]() O o o o X X X X o o X X o o X X o X o X o X o X For this, consider the following three chessboards patterns with the squares marked 'o' or 'X': Not surprisingly the rules for calculating the row index are the same as those for calculating the column index except that everything is just turned sideways so we will content ourselves with a description of how to calculate the column index. He calculates the row and column index independently. The input for the second player's algorithm is the configuration of coins he sees on the chess board. It is convenient to begin by describing the second player's algorithm. In the case of the first prisoner these indices identify the coin he must turn over, in the case of the second prisoner these indices identify the magic square which he will announce to the jailer. The output of each player's algorithm is the row and column index of a square on the chess board. A strategy consists of a pair of algorithms: one algorithm for the first player and one algorithm for the second player. The prisoners can guarantee their freedom. Obviously I recommend thinking a bit about the puzzle before diving down to the solution but it's up to you, reader.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |