Trading places

westworld

New member
Joined
Feb 1, 2012
Messages
24
.I ran across this problem and tried solving this by cases. taking one knight the shortest distance then the next but kept getting lost in the count and path what is the strategy to solve these type problems? Suppose you arrange four knights on a 3-by-3 chessboard. There are white knights in the top left and top right squares, and black knights in the bottom left and bottom right squares. A knight's move is one space in any direction (horizontally or vertically) followed by two spaces in either perpendicular direction. Knights can jump over pieces in their paths, but two knights cannot simultaneously occupy the same square. Only one knight may move at a time. How many moves are required in order for the white knights to trade places with the black knights?
 
Last edited:
Hello, westworld!

Suppose you arrange four knights on a 3-by-3 chessboard. .There are white knights in the top-left and top-right
squares, and black knights in the bottom-left and bottom-right squares. .A knight's move is one space in any
direction (horizontally or vertically) followed by two spaces in either perpendicular direction. .Knights can jump
over pieces in their paths, but two knights cannot occupy the same square. .Only one knight may move at a time.
How many moves are required in order for the white knights to trade places with the black knights?

Code:
      * - - - * - - - * - - - *
      |       |       |       |
      |   1   |   2   |   3   |
      |       |       |       |
      * - - - * - - - * - - - *
      |       |       |       |
      |   4   |   5   |   6   |
      |       |       |       |
      * - - - * - - - * - - - *
      |       |       |       |
      |   7   |   8   |   9   |
      |       |       |       |
      * - - - * - - - * - - - *
The White Knight in cell 1 can proceed: 1 - 8 - 3 - 4 - 9
The White Knight in cell 3 can proceed: 3 - 4 - 9 - 2 - 7
The Black Knight in cell 9 can proceed: 9 - 2 - 7 - 6 - 1
The Black Knight in cell 7 can proceed: 7 - 6 - 1 - 8 - 3

To avoid running into each other, they must move "in rotation".

\(\displaystyle \text{Moves: }\:\begin{array}{c}1\to 8 \\ 3\to4 \\ 9\to2 \\ 7\to6 \end{array}\quad\text{ Then: }\:\begin{array}{c} 8\to3 \\ 4\to9 \\ 2\to7 \\ 6\to1 \end{array} \quad\text{Then: }\:\begin{array}{c} 3\to4 \\ 9\to2 \\ 7\to6 \\ 1\to8 \end{array} \quad\text{ Then: }\:\begin{array}{c} 4\to9 \\ 2\to7 \\ 6\to1 \\ 8\to3 \end{array}\)

And I can't improve on 16 moves.
 
Top