Isosceles triangles in the grid

How many distinct isosceles triangles can you make with vertices on this square grid?

Note: Some of the triangles can be congruent, and they can overlap one another.


Inspiration


The answer is 444.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

To describe an isosceles triangle, start at the vertex where the two legs (sides of equal length) meet. These legs can be described as vectors ( x 1 , y 1 ) (x_1,y_1) and ( x 2 , y 2 ) (x_2,y_2) . Their length satisfies 2 = x 1 2 + y 1 2 = x 2 2 + y 2 2 \ell^2 = x_1^2 + y_1^2 = x_2^2 + y_2^2 ; the base (third leg) may be described as ( x 1 x 2 , y 1 y 2 ) (x_1-x_2,y_1-y_2) and has length b 2 = ( x 1 x 2 ) 2 + ( y 1 y 2 ) 2 b^2 = (x_1 - x_2)^2 + (y_1 - y_2)^2 .

We will systematically consider the values of x 1 , x 2 , y 1 , y 2 x_1,x_2,y_1,y_2 that define an isosceles triangle and for each of them consider in how many locations they fit.

Possible complication #1 : In general, the equation x 1 2 + y 1 2 = x 2 2 + y 2 2 x_1^2 + y_1^2 = x_2^2 + y_2^2 may have various non-trivial solutions, e.g. 3 2 + 4 2 = 5 2 + 0 2 3^2 + 4^2 = 5^2 + 0^2 or 8 2 + 1 2 = 7 2 + 4 2 8^2 + 1^2 = 7^2 + 4^2 . Fortunately, because we work on a small grid, we have x 1 , y 1 , x 2 , y 2 4 |x_1|, |y_1|, |x_2|, |y_2| \leq 4 , and this complication does not arise. This means that we only have trivial cases: { x 1 , y 1 } = { x 2 , y 2 } . \{|x_1|,|y_1|\} = \{|x_2|,|y_2|\}. Naturally, we rule out denegerate triangles where the legs have the same or opposite directions, where ( x 2 , y 2 ) = ± ( x 1 , y 1 ) (x_2,y_2) = \pm (x_1,y_1) .

Possible complication #2 : With this method, we risk counting equilateral triangles double, because any pair of sides could be viewed as the legs. However, an equilateral triangle must have at least one vertex with an irrational coordinate, so we don't have to worry.

The triangles may be generated in groups of four or eight by symmetry transformations, inverting the signs of x x and/or y y , and swapping the x x and/or y y coordinates. Realize also that swapping the legs ( x 1 , y 1 ) ( x 2 , y 2 ) (x_1,y_1) \leftrightarrow (x_2,y_2) does not yield a different triangle.

Each triangle fits in an orthogonal rectangle of width a = max { x 1 , x 2 , x 1 x 2 } a = \text{max}\{|x_1|,|x_2|,|x_1 - x_2|\} and height b = max { y 1 , y 2 , y 1 y 2 } b = \text{max}\{|y_1|,|y_2|,|y_1 - y_2|\} . The triangle fits in the grid iff the rectangle fits; there are ( 5 a ) ( 5 b ) (5-a)(5-b) possibilities. This number remains unchanged under the symmetry transformations.

With all this in place, consider the possibilities:

  • ( x 1 , y 1 ) = ( 0 , p ) (x_1,y_1) = (0,p) and ( x 2 , y 2 ) = ( p , 0 ) (x_2,y_2) = (p, 0) with 1 p 4 1 \leq p \leq 4 . Here, a = b = p a = b = p . Through sign changes we obtain four versions of each. The number of triangles of this kind is 4 p = 1 4 ( 5 p ) ( 5 p ) = 4 × ( 1 2 + 2 2 + 3 2 + 4 2 ) = 120. 4\sum_{p=1}^4 (5-p)(5-p) = 4\times (1^2 + 2^2 + 3^2 + 4^2) = 120.

  • ( x 1 , y 1 ) = ( p , q ) (x_1,y_1) = (p,q) and ( x 2 , y 2 ) = ( p , q ) (x_2,y_2) = (-p,q) with 1 p 2 1 \leq p \leq 2 and 1 q 4 1 \leq q \leq 4 . Now a = 2 p a = 2p and b = p b = p . Through changing the sign of q q and exchanging x x and y y we obtain four versions of each. The number of triangles is 4 p = 1 2 q = 1 4 ( 5 2 p ) ( 5 q ) = 4 × ( 3 + 1 ) × ( 4 + 3 + 2 + 1 ) = 160. 4\sum_{p=1}^2\sum_{q=1}^4 (5-2p)(5-q) = 4\times (3+1)\times(4+3+2+1) = 160.

  • ( x 1 , y 1 ) = ( p , q ) (x_1,y_1) = (p,q) and ( x 2 , y 2 ) = ( q , p ) (x_2,y_2) = (q,p) with 1 q < p 4 1 \leq q < p \leq 4 . We have a = b = p a = b = p . Through changing the signs of p , q p,q we obtain four versions of each. 4 p = 2 4 q = 1 p 1 ( 5 p ) 2 = 4 × ( 3 × 1 2 + 2 × 2 2 + 1 × 3 2 ) = 80. 4\sum_{p = 2}^4 \sum_{q = 1}^{p-1} (5 - p)^2 = 4\times (3\times 1^2 + 2\times 2^2 + 1\times 3^2) = 80.

  • ( x 1 , y 1 ) = ( p , q ) (x_1,y_1) = (p,q) and ( x 2 , y 2 ) = ( q , p ) (x_2,y_2) = (-q,-p) with 1 q < p 3 1 \leq q < p \leq 3 . We have a = b = p + q a = b = p + q . Through changing the signs of p p and exchanging x , y x,y we obtain four versions of each. 4 a = 3 4 p + q = a , q < p ( 5 a ) 2 = 4 × ( 1 × 1 2 + 1 × 2 2 ) = 80. 4\sum_{a=3}^4 \sum_{p+q = a, q < p} (5 - a)^2 = 4\times (1 \times 1^2 + 1 \times 2^2) = 80.

  • ( x 1 , y 1 ) = ( p , q ) (x_1,y_1) = (p,q) and ( x 2 , y 2 ) = ( q , p ) (x_2,y_2) = (q,-p) with 1 q < p 4 1 \leq q < p \leq 4 . We have a = p a = p and b = p + q b = p + q . Through changing the signs of p , q p,q and exchanging x , y x,y we obtain eight versions of each. 8 b = 3 4 p + q = b , q < p ( 5 p ) ( 5 b ) = 8 × ( 2 × 1 + 3 × 2 ) = 64. 8\sum_{b=3}^4 \sum_{p+q = b, q < p} (5 - p)(5 - b) = 8\times (2 \times 1 + 3 \times 2) = 64.

This adds up to a total of 444 \boxed{444} triangles.

I'll get back to you on this. I keep getting 444 for the total count, or 80 more than 364.

Michael Mendrin - 3 years, 1 month ago

Log in to reply

You are right. I have edited the answer and my solution.

Arjen Vreugdenhil - 3 years, 1 month ago

Log in to reply

this is so easy that it took me three hours to get it :)

Ahmed Mahmoud - 3 years ago

become my teacher man

Ahmed Mahmoud - 3 years ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...