2. (17 points) Given a rectangle $A B C D$. On two sides of the rectangle, different points are chosen, six points on $A B$ and seven - on $B C$. How many different triangles exist with vertices at the chosen points?
Answer: 231.

Solution. To form a triangle, one needs to choose two points on one side and one point on another. There are 6 ways to choose the first point on $AB$, 5 ways to choose the second, and since the triangle does not change with the permutation of its vertices, we divide $6 \cdot 5$ by 2. Thus, $\frac{6 \cdot 5}{2}=15$ ways to choose two points on side $AB$, and 7 ways on side $BC$. In total, $15 \cdot 7=105$ ways. Similarly, $\frac{7 \cdot 6}{2}=21$ ways to choose two points on side $BC$ and 6 ways to choose one point on side $AB$. In total, $21 \cdot 6=126$ ways. Therefore, there are 231 different triangles with vertices in the chosen points.