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

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!

• Why don't you first try putting some (even & >2) integer in place of n?
– sato
Jan 14 at 8:21
• @Mastermind817, I did put n=8 (for an octagon) and tried to get the answer, but I was getting a wrong one. Jan 14 at 9:17

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}$$