# Counting/combinations question

The motivation here is I have a system of 4 point charges and I want to find the potential energy.

In a mathematical sense, I want to know how I could count combinatorially the number of lines I can make between four point. I know the answer is 6, but how can I show this using factorials/combinations. What is the general formula for $n$ points?

I hope the question is clear! Thanks!

A line is defined by its two endpoints, so there are $\binom{n}{2}$ such lines.

For $n=4$, we indeed get $\binom42=6$ lines ...

and for $n=10$, this formula gives $\binom{10}2=45$ lines.

The number of possible lines is equal to the number of distinct pairs of points. This is the same as the handshaking problem.

Choose a point, and note that there are $n-1$ points that it can be connected to. Draw those lines. Then choose another point and see that there are $n-2$ points that it can be connected to (since it is already connected to the first one). The third one has $n-3$, and so on, and the last second-to-last point will have one line drawn from it. The last point will already be connected to all others by the time you get to it.

Thus the number of lines is $$n-1+n-2+n-3+...+1$$ Can you find a formula for this?