One approach to counting the number of rectangles of a particular size and particular orientation is to again examine which points in the grid are permissible top-left corners of such a rectangle. For example, the four-by-four diagram below shows which points could serve as the top left corner of the one-by-three rectangle shown below.
Thus we see that there are 4 × 2 = 8 rectangles of that size and that orientation. In general, each type of rectangle we wish to count leads to a rectangular display of possible top left corners. These rectangles vary from a 1 × 1 square of top left corners (counting the large four-by-four square), to a 4 × 2 rectangle (counting the one-by-three rectangles as shown above, and a 2 × 4 rectangle counting the triplets that run vertically), to a 4 × 4 square display (counting the sixteen one-by-one squares). Thus the total number of rectangles in the diagram is:
1 × 1 + 1 × 2 + 1 × 3 + 1 × 4 + 2 × 1 + 2 × 2 + 2 × 3 + 2 × 4 + 3 × 1 + 3 × 2 +
3 × 3 + 3 × 4 + 4 × 1 + 4 × 2 + 4 × 3 + 4 × 4 =
1 + 2 + 3 + 4 + 2 + 4 + 6 + 8 + 3 + 6 + 9 + 12 + 16 = 100