Question
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 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 cells (2 rows and 4 columns):
- The number of horizontal lines is .
- The number of vertical lines is .
Calculate the number of ways to choose pairs of lines:
- Ways to select 2 horizontal lines:
- Ways to select 2 vertical lines:
Total number of rectangles is the product of independent choices:
We can also verify by summing over rectangle sizes :
- :
- :
- :
- :
- :
- :
- :
- :
Sum: .
C
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.