On this page
You have two sets of lines on a page: m lines parallel to each other, and n lines parallel to each other but not to the first set, so every line in one set crosses every line in the other. It is a standard permutations and combinations question, and simple to state: how many parallelograms can you see?
How many parallelograms do m and n parallel lines form?
A parallelogram has two pairs of parallel sides. In this picture, one pair must come from the first family and the other pair from the second, because two lines from the same family never meet. So a parallelogram is nothing more than a choice: 2 lines from the m, and 2 lines from the n.
Choosing objects when order does not matter is a combination, and the number of ways to choose r objects from n is C(n, r) = n!/(r!(n − r)!), as set out in OpenStax College Algebra 2e, Counting Principles. For r = 2 this becomes nC2 = n(n − 1)/2.
The two choices are independent, so you multiply them:
Number of parallelograms = mC2 × nC2 = mn(m − 1)(n − 1)/4.
GeeksforGeeks derives the same count from the same two-lines-from-each-set argument.
Why does each choice give exactly one parallelogram? The four chosen lines meet in exactly four points, which are its corners. Change any one line and a side moves, so different choices give different shapes. That one-to-one match is the whole proof.
Worked example: 4 lines crossing 3 lines
Take the picture at the top of this page: 4 horizontal lines and 3 slanted ones.
Pairs of horizontal lines: 4C2 = (4 × 3)/2 = 6.
Pairs of slanted lines: 3C2 = (3 × 2)/2 = 3.
Parallelograms: 6 × 3 = 18.
The shaded one uses the 1st and 3rd horizontal lines with the 1st and 3rd slanted lines. Label the horizontals A to D and the slants p to r, and list all 18 once as pairs of pairs (AC with pr, and so on). After that, the formula feels obvious rather than memorised.
A bigger case: 5 lines crossing 6 lines gives 10 × 15 = 150.
How is this the same as counting rectangles in a grid?
Make the two families perpendicular and every parallelogram becomes a rectangle; nothing else changes. A grid that is a squares wide and b squares tall has a + 1 vertical lines and b + 1 horizontal lines, so it contains (a + 1)C2 × (b + 1)C2 rectangles. A 4 × 3 grid of squares, for example, has 5C2 × 4C2 = 10 × 6 = 60.
The classic case is the chessboard. A rectangle on it is bounded by two of its 9 vertical and two of its 9 horizontal grid lines, so it holds C(9, 2) × C(9, 2) = 36 × 36 = 1,296 rectangles, as this chessboard rectangles solution shows. Counting squares is a different question, because the two gaps you choose must be equal; our post on counting squares and rectangles on a chessboard works through both.
So one idea covers both problems: a four-sided figure bounded by lines is fixed by choosing its four lines. The angle between the families decides whether you call the shape a rectangle or a parallelogram. The count is the same.
What if there are three families of parallel lines?
Some questions add a third family of p lines in another direction. A parallelogram still uses exactly two families, so add the three ways of picking which two:
mC2 × nC2 + nC2 × pC2 + pC2 × mC2
For 4, 3 and 2 lines: 6 × 3 + 3 × 1 + 1 × 6 = 18 + 3 + 6 = 27.
Read the wording: "parallelograms formed" means figures whose sides lie on the given lines, even if other lines cut through them; "regions" means count cells instead.
A 4-step check before you write the answer
Name the families. Lines from the same family can only be opposite sides, never adjacent ones.
Choose, don't arrange. Lines 1 and 3 make the same pair as lines 3 and 1, so use combinations, not permutations.
Multiply across families, add across separate cases.
Test a tiny case by drawing it: 2 lines crossing 2 lines must give exactly 1, and 2C2 × 2C2 = 1.
Choosing boundaries instead of hunting for shapes also works for counting the diagonals of a polygon and the triangles and lines in counting geometric figures.
If your number keeps disagreeing with the answer key, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning, so you can see which step your count went wrong on. If combinations themselves still feel shaky, the Fermi Concept Library gives each mathematics concept its own lesson, so you can rebuild the idea before going back to the formula.



