# data[].attributes.attachment_caption
Here is a photograph of our completed answer, alongside out past work and previous attempts

# data[].attributes.body
Imagine that you were stuck in the corner of a 3 by 3 grid, with people in each of the squares, except for the square diagonally across the grid from you. In total there are 8 people inside the 9-square grid. At the corner opposite the one you are currently occupying, there is a door, which happens to be your only exit.

# data[].attributes.body
Your objective is to make it to the other corner of the room in the least amount of moves possible.

Please Note: When you move, it counts as one move, and when somebody else moves it also counts as a move.

# data[].attributes.body
This problem is very simple and has only 3 specific rules. The rules are listed below in point form.

1. You can't have more than one person within a square.

2. You must have one square of the grid empty at all times

3. The pieces CAN ONLY MOVE horizontally or vertically. They CANNOT move diagonally

# data[].attributes.body
When working through the problem in class, we tried many attempts to see which route was the shortest of all. On our first attempt, we ended up having 25 moves, and upon conversing with other classmates, we came to the conclusion that our number was far off from the smallest possible number of moves. We tried a few more attempts and managed to lower our number to 15, but that was still quite off from what we wanted our answer to be. Finally, after another series of attempts, we managed to get the 'main person'/pen cap to the desired location in 13 moves.

# data[].attributes.body
There are a few observations that I made between the three attempts of the main problem's solution and the best solutions of the extension problems. These include patterns that appear in all of the best solutions, the sizes of the grids, and the number of moves made in each of the solutions. One of the observations I noticed is that the zig-zag pattern proved to be the most effective on the main problem, as well as the two extensions, in the sense that it created the least amount of moves when solving. Another pattern that I noticed, which was previously mentioned in the "Solution" section is this: for every time the red piece moves, two black pieces move either before or after it. I can use this observation to connect my problem to a mathematical equation.

# data[].attributes.body
The route illustrated in the diagram above turned out to be the most promising outcome, as it not only completes the task of getting you across the grid and to the desired location, but it also does it in the least number of moves. The path that the red ends up taking is a zig-zag/step pattern diagonally across the grid, (its directions being down, left, down left). The black pieces (representing other people) also start to form a pattern. This pattern will be elaborated on in the "Analysis" section.

# data[].attributes.attachment_caption
Illustration of the 2nd Possible Outcome

# data[].attributes.body
The route presented in the diagram above is very similar to the one that produced the least amount of moves. After comparing and contrasting this and the 13-move attempt, I noticed that I made more work for myself by moving the black pieces in moves 10-14, instead of moving the red down on step 10. This pattern, along with the pattern from "Possible Outcome #3," both prove my theory of the zig-zag pattern creating the shortest number of moves.

# data[].attributes.body
This outcome, the worst out of my three attempts, had the most number of moves (compared to the 15-move and 13 move attempts), and was the least effective in terms of completing the task. This differed quite a bit from the other two attempts, as with this one, I did not move the centre person at all. This resulted in more moves, as I ended up having to go around the grid, rather than incorporating all pieces and going through it.

# data[].attributes.body
In the first part of my extension of the problem, I wondered how I would be able to tweak the question to further my learning and understanding. I ended up deciding to increase the grid's size, making it a 5x5, to see if there were any patterns I could detect between the main question and this challenge. I also tweaked it once more, making it a 4x4 grid, to see if an even-numbered grid had a different outcome (compared to the two odd-numbered grids I previously used).

# data[].attributes.attachment_caption
Animated Graphic showcasing the completion of the 5x5 Grid in the least amount of moves.

# data[].attributes.attachment_caption
Animated Graphic showcasing the completion of the 4x4 Grid in the least amount of moves.

# data[].attributes.body
In conclusion, the least number of moves required to complete the problem, for the three by three grid, is thirteen. This can be determined by using the following formula:

Minimum Number of Moves = 8*(Grid Height = 3) - 11

This formula can be applied to find the minimum number of moves required to complete a grid of any size, pertaining that the grid size is equal to or greater than 2x2, and the shape of the grid is a square.

# data[].attributes.headline
Analysis: Beginning to Connect Mathematical Concepts

# data[].attributes.subject
Analysis: Beginning to Connect Mathematical Concepts

# data[].attributes.body
The pattern mentioned above (2 black pieces move for every red piece move) can be used to create a mathematical equation. After noticing this pattern, I counted how many times it would repeat until it gets to the desired location of the grid. I also counted the number of moves at the start before moving the red piece. i finally noticed that there was one last move remaining at the end, on all three of the grid sizes. With that information, I was able to write the first of two formulas. I figured out that the 2 black pieces for every red piece pattern was multiplied by the number of moves it took at the start of the problem, and added that to the number of moves at the start, plus the one move remaining at the end. I took this information and merged it with the other pieces of information I already knew to create my equation.

# data[].attributes.body
Here is the known information presented below.

Let y = the number of moves at the start

2 black pieces move + one red piece move = 3 moves

There is always one move remaining at the end

The number of moves at the start (y) + 3 multiplied by the number of moves (3y) + the last move (1) = The least possible number of moves for solving.

Here is the equation written mathematically:

y + 3y + 1 = The Least Number of Moves

If wanted, one can also combine the like terms to get 4y + 1.

I tested this equation with the 3x3 grid, the 4x4 grid and the 5x5 grid, and the equation proved to be effective for all three problems. Here is my proof that they are correct:

3x3 Grid:

y = 3 = The number of moves before the (2 black, 1 red) pattern begins

3 + (3*3) + 1 = 13 Moves

4x4 Grid:

y = 5 = The number of moves before the (2 black, 1 red) pattern begins

5 + (3*5) + 1 = 21 Moves

5x5 Grid:

y = 7 = The number of moves before the (2 black, 1 red) pattern begins

7 + (3*7) + 1 = 29 Moves

# data[].attributes.body
After completing this, I came up with another formula. This formula is used for finding out the number of moves before the (2 black, 1 red) pattern begins. To find this out, I created a T-chart, listing the height of the square grid on one side, and the number of moves (before the 2 black, 1 red pattern started) on the other. I labeled these sides 'x' and 'y'. I calculated the differences between the numbers, and found out that the numbers for the run (the 'x' side) increased by 1, and the numbers for the rise (the 'y' side) increased by 2. I then divided the rise by the run to get the slope, which equals 2. Following this, I multiplied a number from the 'x' side by the slope, and figured out how much I had to add to get the corresponding number on the 'y' side of the chart. This number (the intercept) happened to be -3. The overall equation I got is listed below.

(Slope * (# on 'x' side)) - 3 = Corresponding 'y' Number
(2 * height of the grid) - 3 = Number of Moves at Start (or 'y')

2x - 3 = y

You can see my work laid out in the document above. Once again, this equation connects to my first equation, as it solves for the unknown number of moves at the start, or 'y.' Here is the first formula and second formula together:

2x - 3 = Number of Moves at the Start (shown as 'y')

y + (3*y) + 1 = 4y + 1 = Least Possible Number of Moves Needed to Solve

Combining these gives the following:

Best solution = 4y + 1 = 4 (2x-3) + 1
= (8x - 12) +1 = 8x -11

Where 'x' is the number of squares that makes up the height of the grid

# data[].attributes.body
To illustrate the second equation, I graphed it using Desmos, and plotted the data from the T-table, to show where the 'x' and the 'y'  variables intersect. This demonstrates the linear relationship between x and y. Click the link below to view the graph in the Desmos tool, or click the image to view the line plotted.

2nd Formula Graph

# data[].attributes.headline
Final Formula: Desmos Graphing Calculator

# data[].attributes.subject
Final Formula: Desmos Graphing Calculator

# data[].attributes.body
Finally, to demonstrate the final equation (best solution = 8x - 11), I graphed it using Desmos, and tested different grid sizes to find the least number of moves to solve the problem for that grid. This also demonstrates the linear relationship between the size of the grid and the minimum number of moves required to complete. Click the link below to view the graph in the Desmos tool, or click the image to view the line plotted. Note that although the line shows multiple values of x below 1, this would not be possible in the real world scenario, as you can not have a 1x1 or smaller (negative) grid.

Final Formula Graph