Intersection of lines on a plane Suppose we have n lines on a plane such that there are $k_2$ points where two lines intersect, $k_3$ points where three lines intersect, ... , $k_n$ points where n lines intersect. How many segments is the plane divided into by these lines?
 A: The key here is the Euler characteristic
$$\chi=V-E+F$$
from which you can read the number $F$ of faces. For that you need
\begin{align*}
V&=\sum_{i=2}^n k_i \\
E&=n+\sum_{i=2}^n i\,k_i \\
\chi&=1
\end{align*}
You can get the correct value of $\chi$ from the following consideration: if you were to intersect your whole configuration with one big disk, then you'd get $2n$ points of intersection with its boundary, which contributes to $V$, but also $2n$ edges along the boundary, which contributes to $E$, so these two cancel out. Hence the characteristic for the disk, which is $1$, is correct for your infinite plane as well. Another approach would be stereographic projection, which turns the plane into a sphere (which has $\chi=2$) but which also adds one more point at infinity which counts in $V$. As the easiest solution, you can simple do an experiment on a case you know to obtain the correct value of $\chi$. Or read somewhere else that the characteristic of the plane is $\chi=1$.
The number $E$ of edges can be obtained as follows: originally every line is one edge. But then you intersect them, and every point of intersection between $i$ lines will split each of these $i$ lines into two parts, i.e. add one more segment to each of them. So in the end, the total number of segments, including those which go off to infinity, is represented by the formula given above.
From this you get
$$F=\chi-V+E=1+n+\sum_{i=2}^n(i-1)\,k_i$$
Examples:


*

*$n=2, k_2=1\Rightarrow F=4$

*$n=3, k_3=1\Rightarrow F=6$

*$n=3, k_2=3\Rightarrow F=7$


Looks good in these cases, so I now trust it should be correct.
One additional note: unless you have parallel lines, you can compute $n$ from the $k_i$, using the equation
$$ n^2-n = \sum_{i=2}^\infty (i^2-i)\,k_i $$
This is a quadratic equation, but in general only one solution will be positive. Only the cases $n=0$ and $n=1$ cannot be distinguished. So if there are any intersections at all, then you can give the number of regions even if you don't know the number of lines explicitly up front.
The equation essentially counts pairs of distinct lines. On the whole there are $n$ choices for a first line and $(n-1)$ choices for a second line to form a pair with that. At each vertex there are $i$ lines and each of them can be paired with $(i-1)$. Since I assumed non-parallel lines, every pair of lines has to intersect at one of the vertices, so the two counts have to agree.
