# How many triangles can be formed using 10 points located in each of the sides (but not vertices) of a square?

How many triangles can be formed using 10 points located in each of the sides (but not vertices) of a square? There are a total of $40$ points.

Here's how I thought of it: First I have to choose the side for each vertex of the triangle, for the first one I have $4$ options, for the second one I have $4$ options as well, but for the third one I have $3$ options, as (I think) I can't form a triangle with $3$ points in a line. Then, for each of those options I have 10 choices (each point from each side), so I thought the result would be $10^3 \cdot 4 \cdot 4 \cdot 3$, but then I'm not accounting for the triangles that are formed with vertices from $3$ different sides. Any help/hints to how to think this is welcome.

The answer is supposed to be $10^3\binom{4}{3} + \binom{10}{2}\binom{10}{1} \cdot 2 \binom{4}{2}$. But I don't understand how to get there.

• I would say you can choose any $3$, so $40\choose3$, except you can't choose $3$ from the same side, so subtract $4{10\choose3}$. – Gerry Myerson Mar 21 '15 at 23:21
• Oh man I had tried doing that on the first try, and turns out it's the correct answer, I was reading the solution incorrectly! I am however, still interested in how to arrive to the answer the way I was given the solution (the train of thought, so to speak). Thanks! – YoTengoUnLCD Mar 21 '15 at 23:29
• The first term of the answer you quote looks good. The second term is presumably intended to count the triangles with $2$ vertices on the same side. That should be $\binom{4}{1}\binom{10}{2}\binom{30}{1}$. – André Nicolas Mar 21 '15 at 23:32
• When I wrote the comment, the second term was wrong, so I gave a right version. Then the OP was modified to give another correct version of the second term. – André Nicolas Mar 22 '15 at 2:42

The first term is the number of triangles with vertices on different sides. The second term is the number of triangles with two vertices on the same side. We need to pick two sides, ordered $2\binom{4}{2}$. We need to pick $2$ points on one side $\binom{10}{2}$, and one point on the other $\binom{10}{1}$.