# How many different rectangles can be formed by connecting four dots in a 4x4 square array of dots, such that the sides are parallel to the grid?

The question goes as such: How many different rectangles can be formed by connecting four of the dots in a $$4 \times 4$$ square array of dots, such that the sides of the rectangle are parallel to the sides of the grid?

I am confused as to why my answer is incorrect: $$\dfrac{16\times6\times3\times1}{4!} = 12.$$

My thought process goes as such: first select any 16 dots in the array. Then you have 6 possible options for the second dot. Then you have 3 possible options for the third dot. And finally, the last dot only has one possible option. Then divide by $$4!$$ as the order doesn't matter.

The correct answer is 36 obtained by $$\binom{4}{2}\binom{4}{2}$$ which I understand as they are using the horizontal and vertical lines. However I'm confused why my answer is off by a factor of $$3$$.

Because for any given rectangle, your method can't choose the 4 corners in $$4!$$ different orders. The first point you choose and the last point you choose must be diagonally opposite. (At least the way I read your recipe; it's possible to read it so that the first and last points must be adjacent, but the end result is the same.)
So you should've divided by $$4\cdot2$$ instead: choose which of the corners comes first, then which of the two adjacent corners comes second, the remaining two have their order forced.
If you want to perform the computation by corner selection instead of by edge selection, then I would suggest instead proceeding by recognizing that each rectangle can be identified by just two non-adjacent corners. That gives you $$\frac{16\times 9}{2 \times 2} = 36$$ different rectangles as 16 choices for one corner, 9 choices for a second corner not in the same row or column as the first, 2 orders for that selection, and 2 distinct diagonals for each rectangle.
• @LeoLiang, Consider a grid-oriented rectangle. It is completely defined by either the (top-left, bottom-right) vertex pair or the (top-right, bottom-left) vertex pair. The $16 \times 9$ counts both orders of both diagonals of each rectangle. Commented Jul 28 at 12:44