Answers.Body: <p>Not to detract from <a href="https://chess.stackexchange.com/a/41197">db_max's answer</a> with its marvellous picture, but here's another way to arrive at the answer.</p>
  <p>When a knight moves, it moves from a white square to a black square or vice versa. You ask about how many moves it takes to move from e5 to e4. e5 is black and e4 is white, so the answer is an odd number. The squares are not a knight's-move apart, so the answer is not 1. As db_max's picture shows, the knight can move there in 3 moves. So the answer is 3.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-22T13:21:54.287Z
Answers.Text: Yeah, though with just that calculation, we only know it has to be _at least_ 3 moves, but could be 5, 7, ... We need some way to limit the upper bound too.
Answers.UserDisplayName: ilkkachu
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-22T13:40:06.273Z
Answers.Text: Yes, you also need a sequence of moves such as e5 - d3 - c5 - e4.
Answers.UserDisplayName: Especially Lime
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-23T01:49:56.547Z
Answers.Text: @ilkkachu The question asks "For example, if I wanted to move a knight from e5 to e4 what is the minimum number of moves it would take?" When you're trying to find the minimum of a set, every element of the set is an upper bound for the minimum. This answer says "There's a way to do it in 3, you can't do it in 2 because that's even, and you can't do it in 1 by inspection, therefore 3 is the minimum."
Answers.UserDisplayName: Acccumulation
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-23T08:22:52.127Z
Answers.Text: @Acccumulation, well, the answer here says "here's another way to arrive at the answer", another from db_max's answer, and that alternative logic that's provided here is what's lacking the way to show it in 3. It's only shown by referring back to db_max's answer which kinda pulls the rug out from under the idea of having a wholly another way.
Answers.UserDisplayName: ilkkachu
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-22T08:15:31.087Z
Answers.LastActivityDate: 2022-12-22T08:15:31.087Z
Answers.UserDisplayName: Rosie F
Answers.Body: <p>Assuming an unobstructed chessboard, it takes three moves to move one square horizontally or vertically and normally takes two to move one square diagonally. However moving from a corner square to the diagonally adjacent square or vice-versa requires four moves.</p>
  <p>A knight has eight possible moves, they can be expressed in vector form as (+1,+2), (+2,+1), (-1,+2), (-2,+1), (+1,-2), (+2,-1), (-1,-2), (-2,-1). We observe that the sum of the horizontal and vertical components is always odd, or to put it in chess terms the square a knight lands on will always be a different colour from the one they started on.</p>
  <p>This means that moving to a square of the same color will always take an even number of moves, while moving to a square of a different color will always take an odd number. This implies that a one square diagonal move will always take at least two moves, and a one square straight move at least three.</p>
  <p>On an infinite chess board, we can build one square diagonal moves by combining two regular knight moves.</p>
  <pre><code>(+1,+1) = (+2,-1) + (-1,+2)
  (-1,+1) = (-2,-1) + (+1,+2)
  (+1,-1) = (+2,+1) + (-1,-2)
  (-1,-1) = (-2,+1) + (+1,-2)
  </code></pre>
  <p>To build a straight move we can combine one of our diagonal moves with a regular knight move.</p>
  <pre><code>(+1,0) = (+2,-1) + (-1,+1) = (+2,+1) + (-1,-1)
  (0,+1) = (-1,+2) + (+1,-1) = (+1,+2) + (-1,-1)
  (-1,0) = (-2,+1) + (+1,-1) = (-2,-1) + (+1,+1)
  (0,-1) = (+1,-2) + (-1,+1) = (-1,-2) + (+1,+1)
  </code></pre>
  <p>On a real chessboard not all moves are always possible. For straight  moves, and most diagonal moves we can work around this by re-ordering the moves, starting with a move that moves away from the edge/corner and ending with a move that moves back towards the edge/corner.</p>
  <p>However if we are trying to move diagonally from or to a corner, re-ordering does not help us. Whichever order we perform the two move sequence in, it will take us outside the board. Thus to move from a corner to the diagonally requires first moving to a square adjacent to our destination (since these are the only possible moves from a corner). Then using three further moves to actually reach our destination.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-23T07:21:26.617Z
Answers.LastActivityDate: 2022-12-26T04:11:58.980Z
Answers.LastEditDate: 2022-12-26T04:11:58.980Z
Answers.UserDisplayName: Peter Green
Answers.Body: <p>Depends on whether the square is diagonal (2 moves) or not (3) as shown in the diagram below:
  <a href="https://i.sstatic.net/pyRkp.png" rel="noreferrer"><img src="https://i.sstatic.net/pyRkp.png" alt="enter image description here" /></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-22T08:03:40.353Z
Answers.Text: How did you do this coloring? I am curious about what would be the shape if the board were bigger/infinite? There seems to be an interesting pattern.
Answers.UserDisplayName: Minot
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-22T08:12:06.007Z
Answers.Text: great so i'm fairly safe from a knight on a 3 square and uber safe on a 4 square
Answers.UserDisplayName: danday74
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-22T14:32:37.430Z
Answers.Text: @Minot There is an inductive pattern.
Answers.UserDisplayName: Vivaan Daga
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-22T15:11:56.123Z
Answers.Text: @Shinrin-Yoku What do you mean? What is that?
Answers.UserDisplayName: Minot
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-22T16:16:23.107Z
Answers.Text: Note that it also depends on the starting position of the knight e.g. if the knight is on b7 and you want it on a8, that will take 4 moves, not 2
Answers.UserDisplayName: ajd138
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-22T16:55:27.253Z
Answers.Text: https://docs.google.com/spreadsheets/d/1NJOaxPSaz0UskJC24n_k0i9nUeWMRR6XH4cUAIZiPBQ/edit?resourcekey=0-RYaST9mhtTPv26jrXA2TUA#gid=0 I have (badly) emulated his graph out 26 squares from the knight. It forms an interesting "checkered circle" pattern.
Answers.UserDisplayName: Mooing Duck
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-23T04:19:55.740Z
Answers.Text: @Minot Simple. First you find all spots where the knight can get to in 1 move. All others are unreachable in 1 move at this point, so you now consider all these spots and find where the knight can go from there (inductive step). After those are exhausted, you know the rest of the board takes at least 3. Repeat 2 more times until all squares are visited. This is what you would do intuitively but it has mathematical rigor behind it, proving the squares you visit at each step are *at least* that far away.
Answers.UserDisplayName: Lodinn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-23T14:30:43.477Z
Answers.Text: @Minot I saw this question from the "Hot network questions" section and decided to make a tool you can play with: [you can find it here](https://codepen.io/statox/pen/gOjpKoB?editors=0010). You can change the grid size to the size you want and see the pattern. I think the pattern itself isn't that interesting but the evolution of the maximum moves required depending on the size of the grid is.
Answers.UserDisplayName: statox
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-23T17:48:33.547Z
Answers.Text: Beautiful graphics
Answers.UserDisplayName: ShadYantra
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-25T03:08:17.183Z
Answers.Text: @Minot it actually gets less interesting on a larger board... the number of moves to reach a distant point ends up being a little under half the Euclidean distance (presumably in the limit it will always be within a couple moves above d/sqrt(5)), and always has the same parity as the Manhattan distance.
Answers.UserDisplayName: hobbs
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-22T05:33:44.693Z
Answers.LastActivityDate: 2022-12-22T05:33:44.693Z
Answers.UserDisplayName: db_max
Body: <p>How many moves does it take a knight to move 1 square forward?</p>
  <p>For example, if I wanted to move a knight from e5 to e4 what is the minimum number of moves it would take?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-22T14:55:36.397Z
Comments.Text: I don't want to be rude, but, isn't this easy enough to figure out on your own?
Comments.UserDisplayName: Adam Rubinson
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-22T16:19:48.027Z
Comments.Text: yes and no - there's some complications (apparently) - see @ajd138 comment - also I want a quick mental mind map of this without having to think during a blitz chess game
Comments.UserDisplayName: danday74
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-12-22T18:57:22.717Z
Comments.Text: as soon as you realize that the knight changes color with each move, it's fairly quick to visualize where it can go in 1, 2, and 3 moves
Comments.UserDisplayName: njzk2
Tags: <knights><mathematics>
Title: How many moves does it take a knight to move 1 square forward?
ThreadText: # How many moves does it take a knight to move 1 square forward?
  
  (Asked by: username_0 on 2022-12-22)
  
  How many moves does it take a knight to move 1 square forward?
  
  For example, if I wanted to move a knight from e5 to e4 what is the minimum number of moves it would take?
  
  **Tags:** knights, mathematics
  
  > **Comments:**
  > **username_1**: I don't want to be rude, but, isn't this easy enough to figure out on your own?  
  > **username_0**: yes and no - there's some complications (apparently) - see @username_11 comment - also I want a quick mental mind map of this without having to think during a blitz chess game  
  > **username_2**: as soon as you realize that the knight changes color with each move, it's fairly quick to visualize where it can go in 1, 2, and 3 moves  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_8 on 2022-12-22. Score: 31 | Accepted answer
  
  Depends on whether the square is diagonal (2 moves) or not (3) as shown in the diagram below:
  [![enter image description here](https://i.sstatic.net/pyRkp.png)](https://i.sstatic.net/pyRkp.png)
  
  > **Comments:**
  > **username_9**: How did you do this coloring? I am curious about what would be the shape if the board were bigger/infinite? There seems to be an interesting pattern.  
  > **username_0**: great so i'm fairly safe from a knight on a 3 square and uber safe on a 4 square  
  > **username_10**: @username_9 There is an inductive pattern.  
  > **username_9**: @Shinrin-Yoku What do you mean? What is that?  
  > **username_11**: Note that it also depends on the starting position of the knight e.g. if the knight is on b7 and you want it on a8, that will take 4 moves, not 2  
  > **username_12**: https://docs.google.com/spreadsheets/d/1NJOaxPSaz0UskJC24n_k0i9nUeWMRR6XH4cUAIZiPBQ/edit?resourcekey=0-RYaST9mhtTPv26jrXA2TUA#gid=0 I have (badly) emulated his graph out 26 squares from the knight. It forms an interesting "checkered circle" pattern.  
  > **username_13**: @username_9 Simple. First you find all spots where the knight can get to in 1 move. All others are unreachable in 1 move at this point, so you now consider all these spots and find where the knight can go from there (inductive step). After those are exhausted, you know the rest of the board takes at least 3. Repeat 2 more times until all squares are visited. This is what you would do intuitively but it has mathematical rigor behind it, proving the squares you visit at each step are *at least* that far away.  
  > **username_14**: @username_9 I saw this question from the "Hot network questions" section and decided to make a tool you can play with: [you can find it here](https://codepen.io/username_14/pen/gOjpKoB?editors=0010). You can change the grid size to the size you want and see the pattern. I think the pattern itself isn't that interesting but the evolution of the maximum moves required depending on the size of the grid is.  
  > **username_15**: Beautiful graphics  
  > **username_16**: @username_9 it actually gets less interesting on a larger board... the number of moves to reach a distant point ends up being a little under half the Euclidean distance (presumably in the limit it will always be within a couple moves above d/sqrt(5)), and always has the same parity as the Manhattan distance.  
  
  ---
  
  ### Answer by username_3 on 2022-12-22. Score: 17
  
  Not to detract from [db\_max's answer](https://chess.stackexchange.com/a/41197) with its marvellous picture, but here's another way to arrive at the answer.
  
  When a knight moves, it moves from a white square to a black square or vice versa. You ask about how many moves it takes to move from e5 to e4. e5 is black and e4 is white, so the answer is an odd number. The squares are not a knight's-move apart, so the answer is not 1. As db\_max's picture shows, the knight can move there in 3 moves. So the answer is 3.
  
  > **Comments:**
  > **username_4**: Yeah, though with just that calculation, we only know it has to be _at least_ 3 moves, but could be 5, 7, ... We need some way to limit the upper bound too.  
  > **username_5**: Yes, you also need a sequence of moves such as e5 - d3 - c5 - e4.  
  > **username_6**: @username_4 The question asks "For example, if I wanted to move a knight from e5 to e4 what is the minimum number of moves it would take?" When you're trying to find the minimum of a set, every element of the set is an upper bound for the minimum. This answer says "There's a way to do it in 3, you can't do it in 2 because that's even, and you can't do it in 1 by inspection, therefore 3 is the minimum."  
  > **username_4**: @username_6, well, the answer here says "here's another way to arrive at the answer", another from username_8's answer, and that alternative logic that's provided here is what's lacking the way to show it in 3. It's only shown by referring back to username_8's answer which kinda pulls the rug out from under the idea of having a wholly another way.  
  
  ---
  
  ### Answer by username_7 on 2022-12-23. Score: 5
  
  Assuming an unobstructed chessboard, it takes three moves to move one square horizontally or vertically and normally takes two to move one square diagonally. However moving from a corner square to the diagonally adjacent square or vice-versa requires four moves.
  
  A knight has eight possible moves, they can be expressed in vector form as (+1,+2), (+2,+1), (-1,+2), (-2,+1), (+1,-2), (+2,-1), (-1,-2), (-2,-1). We observe that the sum of the horizontal and vertical components is always odd, or to put it in chess terms the square a knight lands on will always be a different colour from the one they started on.
  
  This means that moving to a square of the same color will always take an even number of moves, while moving to a square of a different color will always take an odd number. This implies that a one square diagonal move will always take at least two moves, and a one square straight move at least three.
  
  On an infinite chess board, we can build one square diagonal moves by combining two regular knight moves.
  
  ```
  (+1,+1) = (+2,-1) + (-1,+2)
  (-1,+1) = (-2,-1) + (+1,+2)
  (+1,-1) = (+2,+1) + (-1,-2)
  (-1,-1) = (-2,+1) + (+1,-2)
  
  ```
  
  To build a straight move we can combine one of our diagonal moves with a regular knight move.
  
  ```
  (+1,0) = (+2,-1) + (-1,+1) = (+2,+1) + (-1,-1)
  (0,+1) = (-1,+2) + (+1,-1) = (+1,+2) + (-1,-1)
  (-1,0) = (-2,+1) + (+1,-1) = (-2,-1) + (+1,+1)
  (0,-1) = (+1,-2) + (-1,+1) = (-1,-2) + (+1,+1)
  
  ```
  
  On a real chessboard not all moves are always possible. For straight moves, and most diagonal moves we can work around this by re-ordering the moves, starting with a move that moves away from the edge/corner and ending with a move that moves back towards the edge/corner.
  
  However if we are trying to move diagonally from or to a corner, re-ordering does not help us. Whichever order we perform the two move sequence in, it will take us outside the board. Thus to move from a corner to the diagonally requires first moving to a square adjacent to our destination (since these are the only possible moves from a corner). Then using three further moves to actually reach our destination.
  
  
  ---
  
  