Question

In a 2×42 \times 4 rectangle grid shown below, each cell is a rectangle. How many rectangles can be observed in the grid?

A 2 by 4 rectangular grid consisting of 2 rows and 4 columns of rectangular cells, forming a total of 8 unit rectangles.
A 2 by 4 rectangular grid
Choose one option
Official answer and solution
Official answer
C
From
Official GATE 2016 answer key

Solution

Use the combination of horizontal and vertical boundary lines to count all sub-rectangles in a grid.

In a rectangular grid composed of m×nm \times n unit cells, any rectangle is formed by choosing:

  • 2 distinct horizontal grid lines from the available horizontal lines, and
  • 2 distinct vertical grid lines from the available vertical lines.

For a grid of 2×42 \times 4 cells (2 rows and 4 columns):

  • The number of horizontal lines is m+1=2+1=3m + 1 = 2 + 1 = 3.
  • The number of vertical lines is n+1=4+1=5n + 1 = 4 + 1 = 5.

Calculate the number of ways to choose pairs of lines:

  • Ways to select 2 horizontal lines:
    (32)=3×22=3\binom{3}{2} = \frac{3 \times 2}{2} = 3
  • Ways to select 2 vertical lines:
    (52)=5×42=10\binom{5}{2} = \frac{5 \times 4}{2} = 10

Total number of rectangles is the product of independent choices:

Total Rectangles=(32)×(52)=3×10=30\text{Total Rectangles} = \binom{3}{2} \times \binom{5}{2} = 3 \times 10 = 30

We can also verify by summing over rectangle sizes (h×w)(h \times w):

  • 1×11 \times 1: 2×4=82 \times 4 = 8
  • 1×21 \times 2: 2×3=62 \times 3 = 6
  • 1×31 \times 3: 2×2=42 \times 2 = 4
  • 1×41 \times 4: 2×1=22 \times 1 = 2
  • 2×12 \times 1: 1×4=41 \times 4 = 4
  • 2×22 \times 2: 1×3=31 \times 3 = 3
  • 2×32 \times 3: 1×2=21 \times 2 = 2
  • 2×42 \times 4: 1×1=11 \times 1 = 1
    Sum: 8+6+4+2+4+3+2+1=20+10=308 + 6 + 4 + 2 + 4 + 3 + 2 + 1 = 20 + 10 = 30.
Final answer

C

Common trap

Counting only the 8 unit cells or missing compound rectangles spanning multiple columns.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2016 Computer Science and Information Technology (CS) Session 2
Question
9 of 65, printed as GA Q.9
Section
General Aptitude

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.