# Review on my method for $Number$ $of$ $diagonals$ in a regular $n$-gon is $\frac12n(n-3)$

I have an assignment on permutations and combinations topics. In that there is a question- The number of interior angles of a regular polygon is $$150^\circ$$ each. The number of diagonals of the polygon is _____.

Attempt

I don't know about any thing about the P&C method for diagonals. So I found the side as per the formula $$(n-2)(360^\circ)=(\theta)n$$ where $$n$$ is the number of side and $$\theta$$ as interior angle.

But the main problem came to be the diagonal part because I was not able to understand the logic given on platforms like MSE itself. (Maybe it is due to language problem because I am still learning English language.)

But I tried to count the polygon diagonal one by one to generate some pattern which may be useful. So I observed this-

In quads, if we start making diagonals then for first it will be $$1$$, then again $$1$$ and $$0$$ and $$0$$.

In pents, the similar process gave $$2$$ then again $$2$$ then $$1$$ and then $$0$$, and $$0$$.

In hexes, $$3$$ then $$3$$ then $$2$$ then $$1$$ then $$0$$ and again $$0$$.

Also, I observed that for the last two vertices it came to be $$0$$ always.

So observing this I first did in same way for hepts and after doing this I checked the answers for above cases in that formula $$\frac{n(n-3)}{2}$$. (Though I didn't understand how it was formed. And to my surprise, it came to be same. I even checked for $$12, 13, 50, 40 \ldots$$ It all gave the same value as that formula.

Now my doubt is What I observed is right but how? Also I wrote it in terms of $$2(n-3)+(n-4)+...+1$$ to give $$\frac{n(n-3)}{2}$$.

You can use inclusion-exclusion principle. Let $$A_1A_2...A_n$$ be the $$n$$-gon. $$A_1$$ can connect with $$n-1$$ vertices, $$A_2$$ can connect with $$n-2$$ vertices (note connection with $$A_1$$ was already considered) and so on $$A_{n-1}$$ can connect with only $$1$$ vertex $$A_n$$. Hence: $$(n-1)+(n-2)+\cdots +1=\frac{n(n-1)}{2}.$$ Now to find the number of diagonals, we must exclude the lines between the neighboring vertices, which is $$n$$: $$\frac{n(n-1)}{2}-n=\frac{n(n-3)}{2},$$ which is pretty much the same as mlerma54's answer.
The number of line segments determined by $$n$$ points in the plane is $$n$$ choose 2, i.e., $$\binom{n}{2} = \frac{n(n-1)}{2}$$. But in a polygon, $$n$$ of those segments will be sides, so subtract it to get the number of diagonals: $$\frac{n(n-1)}{2} - n = \frac{n(n-3)}{2}$$.
The classic formula for the number of diagonals of an $$n$$ sided polygon is $$\frac {n(n-3)}2$$ as you say. The way to see it is you have $$n$$ choices for the first end of a diagonal, then $$n-3$$ choices for the other end because you can't use the original vertex or a neighboring one, but have counted each diagonal twice so divide by $$2$$.
You can write your sum $$2(n-3)+(n-4)+(n-5)+\ldots+1=2(n-3)+\sum_{i=1}^{n-4}i\\=2(n-3)+\frac 12(n-4)(n-3)\\=\frac 12(n-3)(4+(n-4))\\=\frac 12n(n-3)$$
You can also use the Handshake Lemma from graph theory. Let $$G(V,E)$$ be a graph on $$n$$ vertices, where the vertices form a regular $$n$$-gon and the edges are the diagonals of the $$n$$-gon. Then, prove that each vertex of $$G$$ has degree $$n-3$$. By the Handshake Lemma, $$G$$ has $$|E|=\frac{1}{2}\,\sum_{v\in V}\,\deg(v)=\frac{1}{2}\,n\,(n-3)=\frac{n(n-3)}{2}$$ edges.