## How many number of rectangles are present in a MxN matrix?

Click here to See Answers

Out of four points of a rectangle, two points should be in one row and other two points should be in other row. If you select any two points in the top row then we dont have any choice for two points in the bottom row, there is only one possibility for that, as in the image below.

So we first select any two rows and then select any two points in columns.

Number of ways to select any two rows = mP2

Number of ways to select any two points in a row = nP2

Thus total number of rectangles possible are = mP2*nP2

Here nPk = n!/(n-k)!