1
$\begingroup$

You have a $n \times m$ grid. In how many ways you can select $k$ nested rectangles from it?
Note: Each Rectangles should be completely inside another rectangle. They cant touch one another. Like the first one is good for $5\times 5$ grid with $k=3$, while the second one is not

I don't know anything about how to start or how to solve it. Any hint will be helpful

  • 1
    Hint: you can pick the x coordinates and the y coordinates independently.2017-02-03
  • 0
    @Tad Then? :| -_-2017-02-03

1 Answers 1

3

As was suggested you can pick the horizontal and vertical lines independently.

To pick the vertical lines we just have to select the $2k$ lines in $\binom{n+1}{2k}$ ways, and to pick the horizontal we just have to select the $2k$ lines in $\binom{m+1}{2k}$ ways.

So the answer is $\binom{n+1}{2k}\binom{m+1}{2k}$

  • 0
    How did you get that for 1D the $k$ nested line can be selected in $\binom{n+1}{2k}$?2017-02-03
  • 0
    because there are $n+1$ vertical lines in the grid and we need $2k$ for the $k$ rectangles.2017-02-03
  • 0
    I was thinking they will be nested -- where is the surety.. But just found that we can reform $2k$ points to become nested... :) Thanks :)2017-02-03
  • 0
    Once you select the $2k$ lines there is exactly one way to use them so that they become nested.2017-02-03
  • 1
    Got it .. Thanks :)2017-02-03