# Puzzle: diagonals in a polygon – methods of solution

March 28, 2007 am31 7:35 am

How many diagonals are in a polygon?

There are at least a few different methods of solution, more if you count variations. How many methods can you find? This is the place to post them.

12 Comments
leave one →

From each vertex, there are (n-3) different diagonals that can be drawn. (A diagonal can’t go to an adjacent vertex or from a vertex to itself.) Since there are n vertices, each of which has (n-3) diagonals radiating out of it, a total of n(n-3) segments can be drawn. But now we’ve counted the segment AB and the segment BA, so the answer needs to be divided by 2. So n(n-3)/2 gives the number of diagonals in a polygon.

I used slightly different logic to get the same answer: The number of distinct ways of connecting points is

(Application note: to astronomers who do interferometry, this is the number of “baselines” between telescopes).

Of those, connect adjacent sides and so are not “diagonals,” which means the number of diagonals is:

Both of these are clear. But I wonder if anyone will run into what my students are doing? Let’s see a few more, then I will fill you in.

A middle school student-type method: Counting around the polygon from each vertex.

The first two vertices will have n – 3 diagonals each (no duplicates). The third will have one less (n – 4) because one is already drawn from the first vertex. As we proceed around the circle, one less diagonal is able to be drawn from each vertex, becuase it’s already been filled in from the other direction.

So (n -3) + (n – 3) + (n – 4) + (n – 5) … + 3 + 2 + 1.

It’s less elegant, but workable nonetheless for small value of n.

Similar to rdt’s approach:Line segments are a good abstraction of the handshake problem, where each point represents a person and each line segment a handshake. Each person (nof them) shakes all the other hands (n– 1 of them). At first, students think there should ben(n-1) handshakes, but it’s easy to see why we have to divide that product by two. Even though two people are involved in each handshake, we only want to count it once.The handshake formula counts

allthe lines between the points, butnof the lines make the polygon itself. They don’t count as diagonals, so we have to subtract them.Build-the-pattern approach:Start with a triangle, which has no diagonals. Add another vertex by drawing a point outside the triangle and connecting it to the two closest points of the triangle. What had been a side of the triangle has become a new diagonal, plus there aren-3 new diagonals that connect the new point to the other vertexes. So each new vertex on the polygon adds a total ofn-2 to the number of diagonals. The pattern builds up as the polygon grows, and the number of diagonals is 2 + 3 + 4 + 5 + … + (n-2)Sara’s n-3 + n-3 + n-4 + … + 2 + 1 gives ,

but I like all the solutions so far

I was trying to work on this same problem for a discrete course I teach that unfortunately has no solution manual. I figured out on my own that it should be n(n-3)/2, but I was trying to calculate this with finite differences and came up with n(n+3)/2. I tried to later finagle the formula, but got stuck with 2(n-3) + (n-3)(n-2)/2, which doesn’t come out quite right. By any chance could you show me how to do this correctly??

Thanks.

I don’t believe I properly understand what finite differences means. Maybe you could show me how you started?

I realize that I’d missed one major approach before. Certainly we might recognize that we have something quadratic. In that case we should find

Plugging in (3,0), (4,2), and (5,5) yields a system of linear equations:

0 = 9a + 3b + c

2 = 16a + 4b + c

5 = 25a + 5b + c

7a + b = 2, 16a + 2b = 5,

a = 1/2, b = -3/2, c = 0, so

It’s a lot simpler than that. Obviously, you can’t draw a diagonal along a side or between the same point which rules out THAT vertex and it’s neighboring ones, thus, (n-3).

Also, there are n sides and, thus, n vertices, and you would do this for EACH vertex, hence, [n (n-3)].

Last, you don’t want to duplicate the same diagonal twice, so you get rid of one of the duplicates (AC and CA), thus / 2.

In the end, you get [n (n-3)] / 2.

Easy.

We were looking for multiple solutions. n(n-3)/2 was the first (at the top).

can you please explain to me what the n-3 is? how is it related to the vertex?

Consider a pentagon. There are 5 vertices (corners).

Look at one vertex. Can a diagonal be drawn from that vertex to all 5 vertices? No. We can’t draw a diagonal from the vertex to itself (so take away one). And we can’t draw a diagonal to either of the next door vertices (they are already connected, by sides) (so take away two more). So instead of drawing n diagonals (one to each vertex) we draw n, minus 3.