12. (9) On a plane, there are 9 points arranged in a $3 \times 3$ grid, as shown in the figure.

![](https://cdn.mathpix.com/cropped/2024_05_06_94724fde63ed999618d2g-04.jpg?height=239&width=231&top_left_y=1973&top_left_x=535)

a) Through all possible pairs of points, lines are drawn. How many different lines are obtained? 
b) How many different triangles exist with vertices at these points?
Answer: a) 20 ; b) 76.

Solution: a) The number of pairs of points will be $C_{9}^{2}=36$, but lines coincide when three points lie on the same line. There are $8=3$ horizontals +3 verticals +2 diagonals such cases. Therefore, subtract $36-8 \times 2=20$.

b) The number of triplets of points is $C_{9}^{3}=84$, but not all form a triangle, i.e., we need to subtract 8 triplets lying on the same line. $84-8=76$.