You are on page 1of 2

Problem of the Week

Problem E and Solution


Chess-Bot
Problem
By pressing a button on the bot, Chess-Bot can move forward one square, backwards one
square, turn to the right or turn to the left.

Determine: (i) a series of button presses which move the bot from its initial position to its final
position in 15 moves or less without moving the chess pieces; and (ii) a series of button presses
which move the bot from its initial to its final position in 15 moves or less and moves each
chess piece to a different square on the board. (Notice that the final diagram does not include
the final position of the two chess pieces for the second part. This was intentionally done so as
not to bias your approach to either part of the problem.)

Solution
We will introduce letters to indicate the type of move. Let F represent a forward move, B
represent a backward move, L represent a left turn and R represent a right turn.
For part (i), we will try a very straight forward approach which moves the bot to an adjacent
column, moves forward to near the top of the chess board, and then uses a series of moves to
get the bot into its final position.
To move to the adjacent column, use L F R to move the bot one square left of its initial
position, facing up the board. This takes 3 moves. Now move as far forward as possible using
F F F F F F . The bot is now positioned one column to the left of its initial
position, facing the top of the board with its body in the second square from the top (and its
arms in the top square). We cannot go forward any more because that would put the bots
arms off the board. We have used a total of 9 moves.
We need to turn the bot so that it is facing down the board. We could try to do this with
R R but this would knock the top chess piece over. But we can also turn around using
L L. If we then press B we will be in the top row facing down the board one column to the
left of our desired end point. To move over one square to the right takes three moves
L F R. At this point we are in the final position. We are facing down the board and we
have not moved any of the chess pieces.
The entire sequence of moves is
L F R F F F F F F L L B L F R,
a total of 15 moves.

Part (ii) may not seem possible. We got the bot around the chess pieces and completed the
task in 15 moves. Our strategy will be to move up the board and to clear chess pieces as we
encounter them.
We will progress up the board until the bot holds the first chess piece. We must use F F to
get there.
To move the first chess piece out of the way so that the bot can continue forward requires the
following moves R F B L or L F B R. After these 4 moves the bot is facing
forward with its arms positioned in the square that originally held the first chess piece.
We will progress up the board until the bot holds the second chess piece. We must use F F
to get there.
Once the bot has the next piece in its arms, the same 4 steps used to clear the first chess piece
could be repeated to clear the second chess piece. However, we can save button presses by not
turning back to face up the board. We can turn to face down the board and then backup into
the final position instead.
By using R F B R or L F B L the bot is positioned with its body one space
below the space originally occupied by the second chess piece facing down the board. Then
B B B puts the bot in its end position. There have been a total of 2 + 4 + 2 + 4 + 3 or 15
moves.
Therefore, one possibility for the entire sequence of moves is
F F R F B L F F R F B R B B B,
a total of 15 moves.
For Further Thought
Can either part of the problem be done in less than 15 moves?

You might also like