Number of right triangles formed by the diagonals of an $n$-sided regular polygon

combinatoricssolution-verification

I am trying to derive a general equation to get the number of right triangles formed by the diagonals of an $n$-sided regular polygon.

For $n\in(\text{odd}),$
this number is $0$, as we can join any two vertices of the regular polygon but they will not form the diameter of the circumscribed circle and hence according to Thales' theorem, the triangle formed by connecting that segment with any other vertex will not be a right triangle.

But, for $n\in(\text{even})$, we join the opposite vertices of the polygon. Hence we get a diameter of the circumscribable circle. Now, the polygon is divided into two parts and hence the segment can be joined to $\frac{n}{2}-1$ vertices on either side. So the number of ways of forming the right triangle here would be ${\frac{n-1}{2}}\choose{1}$$=(\frac{n-1}{2})$ ways.

$\therefore$ The total number of right-triangles in the regular polygon of $n$-sides would be equal to $(\frac{n}{2})(\frac{n-1}{2})=\frac{n(n-1)}{4}$ ways.

Am I right in this logic and calculation?

Thanks very much!

Best Answer

Your logic is correct but the calculation is wrong; everything is fine until "so the number of ways of forming the right triangle here would be $\dfrac {n-1}2$ ways."

There are $\dfrac n2$ ways to choose a diameter, and as you have observed, there are $\dfrac n 2 - 1$ vertices to connect to on either side. This gives:

$$\frac n2\left(\frac n2 - 1\right) \times 2 = \frac {n(n-2)}{2}$$

distinct right triangles.