How many triangles in a chess board, allowing diagonals?

1.3k Views Asked by At

So I saw a question about how many rectangles in a grid of squares that looked like an "L", and it got me thinking: If we have an $8\times 8$ grid, how many triangles are there? This has its own issue of what angles the triangles have, so to be precise:

How many triangles are there in $8\times 8$ grid when you can only create diagonals?

Rules: A triangle can only be created by square diagonals (the building block square $1\times 1$). Meaning, the triangle sides do not cross the squires side (aka it has to cut through the corners only). Lastly, a triangle side can cut another triangle side. (So basically each individual square have 8 triangles.)

You can check the figure for example triangles which are possible:

enter image description here

2

There are 2 best solutions below

0
On

There are two main types of triangle. Those with one horizontal/vertical side and two diagonals, and those with two horizontal/vertical sides and one diagonals.

Case 1: One horizontal/vertical side.
Let's assume for now that it has a horizontal base, with the diagonal sides going up. Depending on the length of the base we have:
Base length $1$: $8\times8$
Base length $2$: $8\times7$
Base length $3$: $7\times6$
...
Base length $n$: $(9-\lceil n/2\rceil)\times(9-n)$
The first factor is the possibilities for the y coordinate, the second factor the number of possibilities for the x coordinate.

This adds to $64+56+42+35+24+18+10+5=254$. This has to be multiplied by 4 to get all 4 orientations, so there are $4\times254=1016$ triangles of this type.

Case 2: One diagonal side.
Let's assume for now that the right angle is at the bottom-left. Depending on the length of the legs at that corner we have:
Base length $1$: $8\times8$
Base length $2$: $7\times7$
Base length $3$: $6\times6$
...
Base length $n$: $(9-n)\times(9-n)$

This adds to $64+49+36+25+16+9+4+1=204$. Again this has to be multiplied by 4 to get all 4 orientations, so there are $4\times204=816$ triangles of this type.

Adding these two cases together gives a grand total of $1016+816=1832$ triangles.

3
On

Number of squares : $$S_n=\sum\limits_{i=1}^n i^2=204$$

  • $8\times 8$ squares of side $1$
  • $7\times 7$ squares of side $2$
  • $\cdots$
  • $1\times 1$ square of side $8$

Number of form factor $2:1$ horizontal rectangles : $$R_n=\sum\limits_{i=1}^{\lceil n/2\rceil}(n+1-i)(n+1-2i)=114$$

  • $8\times 7$ rectangles of sides $2\times 1$
  • $7\times 5$ rectangles of sides $4\times 2$
  • $6\times 3$ rectangles of sides $6\times 3$
  • $5\times 1$ rectangles of sides $8\times 4$

There are $4$ triangles by square, and $2$ triangles per rectangle and we have also vertical rectangles, this is giving:

$$T_n=4(S_n+R_n)=1272\text{ triangles}$$