I will use these formulae to achieve my final target of a formula to calculate:
- Total number of winning lines in any size square grid with any winning line length.
Investigation
In my algebraic formulae, I will be using the following key:
-
T = Total number of winning lines
-
S = Length of side of grid
-
L = Length of winning line
-
V = Total number of vertical winning lines
-
H = Total number of horizontal winning lines
-
D = Total number of diagonal winning lines
-
K = Number of tokens within the grid
There are three different types of winning lines – horizontal, vertical and diagonal. The total number of winning lines is the sum of these. My modelling on squared paper shows me that in a square grid there are always an equal number of horizontal and vertical winning lines, therefore 1 formula can be used to calculate both. However, the number of diagonal winning lines is not the same. It is proportional to the difference between the grid side length and the winning line length
From using my results table and testing formulae I calculated a formula to discover the number of horizontal or vertical winning lines using only the grid side length and winning line length.
Results table 1: S = L
This results table shows the winning lines when the length of the winning line is equal to the length of the side of the grid.
From this simple case I found many formulae based upon 2n +2. I found 16 possible formulae. This is because I found the number of verticals and horizontals is equal to the grid side length and the winning line length so any of these can represent n. Where the winning line length is equal to the grid side length there are always only two diagonal winning lines.
Results table 2: S-1 = L
This results table shows the winning lines when the length of the winning line is equal to the length of the side of the grid minus 1.
The number of vertical and horizontal winnings lines is now always double the length of the side of the grid. This is because when the winning line length is 1 shorter than the grid side it creates two winning lines on each row/ column of the grid. There are always 8 diagonals when S – 1 = L.
Results table 3: S-2 = L
This results table shows the winning lines when the length of the winning line is equal to the length of the side of the grid minus 2.
The number of vertical and horizontal winnings lines is now always triple the length of the side of the grid. This is because when the winning line length is 2 shorter than the grid side it creates three winning lines on each row/ column of the grid. There are always 18 diagonals when S – 2 = L.
These are the formulae I devised from my calculations and results:
Number of Horizontal or Vertical winning lines:
H = S ( ( S – L ) + 1 )
V = S ( ( S – L ) + 1 )
I have thoroughly tested this formula and the formulae are explained below.
To calculate the number of horizontal lines:
( S - L ) + 1 equals the number of different winning lines on each row of the grid.
Multiply this by S, the number of rows on the grid and the answer is the total number of horizontal winning lines. If the number of vertical winning lines is being calculated the same formula applies.
Number of Diagonal winning lines
D = ( ( S + ( ( S – L ) + 1 )2 + ( ( S – L ) + 1 )2 – (2S ( ( S – L ) + 1 )) – K
The first part of the formula is used to determine the sum of the Number of tokens and the total number of winning lines.
( ( S + ( ( S – L ) + 1 )2 + ( ( S – L ) + 1 )2
From this subtract the formula for calculating the horizontal and vertical lines together.
(2S ( ( S – L ) + 1 ))
This leaves the number of tokens plus the number of diagonals, so to calculate the number of diagonals subtract the number of tokens.
– K
The formula to calculate the value of the number of tokens is:
K = S2
Total Number of winning Lines
This formula is very similar to the formula to calculate the number of diagonals.
T = ( S + ( ( S – L ) + 1 )2 + ( ( S – L ) + 1 )2 – K
The first part of the formula is used to determine the sum of the Number of tokens and the total number of winning lines.
( ( S + ( ( S – L ) + 1 )2 + ( ( S – L ) + 1 )2
Therefore to calculate the total number of winning lines the number of tokens must be subtracted.
–K
The formula to calculate the value of the number of tokens is:
K = S2
Conclusion
In my investigation I have found formulae to calculate the number of horizontal, vertical and diagonal winning lines. From these I calculated the formula for the total number of winning lines. This shows that I fully completed the task set for myself. Trial and improvement and logic methods helped me find and define formulae. I believe my results are good, as I have proven them to work for any size square grid with any length winning line and I have been able to explain my formulae.
Evaluation
In evaluation my investigation was good. I had accurate results and I proved so through modelling. The worst thing about the investigation is that the formulae are complex and hard to explain in simple terms. I could improve this by using my current formula to derive other simpler and more efficient formulae. This could be a useful extension to my investigation. I could also repeat the investigation for different shapes, for example rectangles or in 3D and investigate cubes and cuboids.