Answer:
n(n - 3)/2
Explanation:
We are told that;
A square has 4 sides and 2 diagonals.
Now, a pentagon will have 5 sides and 5 diagonals
A hexagonal when drawn will have 6 sides and 9 diagonals
Thus, we see that;
When n = 4, d = 2
When n = 5, d = 5
When n = 6, d = 9
Using combination, we will find number of pairs of 2 vertices that can possibly be formed from n-vertices. Thereafter we will subtract n from that since it's neighboring vertices can't combine with the current one.
Thus, we have;
C(n, 2) - n
This gives s;
(n(n-1)/2) - n
Simplifying this gives;
(n(n - 1) - 2n)/2
>> (n² - n - 2n)/2
>> (n² - 3n)/2
>> n(n - 3)/2