logo
Interesting Math Problem   Math Problems Home  |  Home  |  Send Feedback

Combinatorics: How many rectangles in a grid ?

How many rectangles are there in a 4×6 grid of squares ?
How many in an m × n grid ?
What happens if m = n and we are only interested in squares?



Another way to reach the answer more quickly is:

In a rectangle m × n there are (m+1) vertical grid lines
and (n+1) horizontal grid lines (7 and 5 in the example here).

To define any rectangle within the grid,
we must choose 2 of each and there are
( (m+1) choose 2 ) × ( (n+1) choose 2 ) ways to do that.

For 4 × 6 that gives us
(5 choose 2) × (7 choose 2) =
10 * 21 = 210.
If the grid is 1x1, there is 1 rectangle.
If it is 2x1, there are 2 + 1 = 3 (2 1×1, 1 1×2) rectangles
If it is 3x1, there are 3 + 2 + 1= 6 rectangles.
n×1: n + (n-1) + (n-2) ... + 1 = (n)(n+1)/2 rectangles

If we add another column to n×1,
first we have as many rectangles in the 2nd column as the first,
and then we have that same number of 2×M rectangles.
So n×2 = 3 (n)(n+1)/2

If we add another column, to n×2,
we add another n(n+1)/2 in that column,
another (n)(n+1)/2 for new n×2 section
and another (n)(n+1)/2 for the 3-wides,
so we have 6 (n)(n+1)/2

So for n×m, we'll have
(m)(m+1)/2 (n)(n+1)/2 = m(m+1)(n)(n+1)/4

for 4×6 that would be:
4 × 5 × 6 × 7 / 4 = 210