Number of triangles formed by $m$ lines

Problem:

How many triangles do $m$ lines form if

a) Every two lines intersect and no three lines intersect at one point.

b) There are $n$ lines among $m$ lines that are parallel to each other. No other line is parallel to these $n$ lines, and no other two lines are parallel to each other. Again no three lines intersect at one point.

Thank you.

• @Yury: Thanks for trying to clarify the question. The title is still not clear and in fact seems to be at odds with your interpretation of the question. Maya, could you please confirm that the body of the question now expresses your question correctly? (By the way, it's not a good idea to delete comments without explanation if other comments refer to them; one of my comments no longer made sense after you deleted yours.) – joriki Dec 16 '12 at 18:27
• @joriki new body is correct. – Maya Dec 16 '12 at 18:34
• Count the number k of intersection points. The number you want is $\binom k3$ minus the number of sets of 3 points which are aligned. – Mariano Suárez-Álvarez Dec 16 '12 at 18:44
• I made a slight additional correction to the title to bring it in line with the body; I think it all makes sense now. – joriki Dec 16 '12 at 18:48

There are $n$ parallel lines. Each pair of the $m-n$ forms a triangle with each of the $n$. So the triangles are ${m-n \choose 2}n=\frac 12(m-n)(m-n-1)n$
Take one of these lines. Ever pair of lines intersecting it is forming a triangle-- combination of $m-1$ to $2$.
Do this for every line-- excluding the ones you already worked on. So the second line you are looking at has $m-2$ to $2$ additional triangles formed by itself and the ones intersecting it, ... .
All add up to $\sum_{i=2}^{m-1}i\times(i-1)/2$.