
Brandon B. answered 03/02/21
Cornell Physics PhD. 10+ years teaching college math/physics.
In order to construct a rectangle we must select 2 horizontal sides and 2 vertical sides.
In an M by N grid there are M + 1 horizontal sides and N + 1 vertical sides.
The total number of rectangles is the number of ways to choose 2 horizontal sides from M + 1 times the number of ways to choose 2 vertical sides from N + 1.
The number of ways to choose k elements from n total elements is called n choose k in combinatorics and written like n!/((n-k)!k!), where ! denotes the factorial operation.
Thus the total number of rectangles in a 4 x 4 grid is [5!/(3!2!)]2 = (5*4/2)2 = (10)2 = 100.
Krugen K.
Thank you.03/02/21