Q:

Counting Rectangles

I was solving a figure counting question, and boy was it hard. It gave me a rectangle, which was divided into 9 parts vertically and 6 parts horizontally. I had to get the total number of rectangles.
Since there were so many, I had immense difficulty in counting. Is there a formula for that?

A:

Hint. Any rectangle is given by choosing two distinct horizontal lines and  two distinct vertical lines.

A:

A rectangle is basically a set of $2$ pairs of parallel lines.
If you have $h$ and $v$ horizontal and vertical lines, then you have $h-1$ and $v-1$ parts.
Then the total number of rectangles is the total number of combinations of horizontal lines, multiplied with the total number of combinations of vertical lines.
This is $^hC_2\cdot^vC_2$, which is equal to $${hv (h-1)(v-1)}\over4$$
In your case $h=7, v=10$, which gives $945$ rectangles. Quite a lot to count, so you are possibly expected to know the formula, or derive it yourself.

