Exercise 1. Let $n \geq 3$ be an integer and consider $n$ lines in general position (i.e., no three lines are concurrent and no two lines are parallel). How many triangles are formed by these lines?

N.B. For example, in the figure below, there are 4 triangles.

![](https://cdn.mathpix.com/cropped/2024_06_04_b0ba6c54c3f8a539c7bdg-2.jpg?height=372&width=597&top_left_y=405&top_left_x=772)
Solution to Exercise 1 If we number the $n$ lines from 1 to $n$, we notice that each triangle is encoded by a subset of $\{1,2, \ldots, n\}$ with three elements. Therefore, there are $\binom{n}{3}=$ $\frac{n(n-1)(n-2)}{6}$ triangles.