# Total number of triangles that can be made by $4n$ points, $n$ at each side of square

We are given a square with $n$ points on each side of the square. None of these points co-incide with the corners of this square. We have to compute the total number of triangles that can be formed using these $4n$ points ($n$ points on each side of the square) as vertices of the triangle.

I tried to do this my self but I think my approach is wrong. I did something like this:

For $n\ge3$, the answer will be $\begin{pmatrix}4n\\3\end{pmatrix}-4\begin{pmatrix}n\\3\end{pmatrix}$.

• Your answer is correct: $\binom{4n}{3}-4\binom{n}{3}=12n\binom{n}{2}+4n^3=10n^3-6n^2$. – Batominovski Jul 24 '15 at 21:47
• @Batominovski yes,I just cross checked and found that I was correct :).I might sound wierd but I request you please tell me how did you get to the equation.I can't convince myself that how did I get it.This happens to me every time in Combinatorics :) – bitshiftleft Jul 24 '15 at 21:57

The number of ways of choosing $3$ points among $4n$ points is ${4n \choose 3}$. However, some of them do not form a triangle. This happens when you have $3$ points in the same side of the square. The number of those is ${n \choose 3}$ for each side, but you have $4$ sides. The amount of triangles then is $${4n \choose 3} - 4{n \choose 3}.$$