SOLUTION: How do I calculate all the possible rectangles that can fit into a 2D rectangle? For instance if the large rectangle has height H = 2 and width W = 5 the total number of rectangle

Algebra ->  Rectangles -> SOLUTION: How do I calculate all the possible rectangles that can fit into a 2D rectangle? For instance if the large rectangle has height H = 2 and width W = 5 the total number of rectangle      Log On


   



Question 297613: How do I calculate all the possible rectangles that can fit into a 2D rectangle?
For instance if the large rectangle has height H = 2 and width W = 5 the total number of rectangles that can fit into it are 31.
what formula do I use to find all rectangles (including the large rectangle)that can fit into H x W? I tried dividing the rectangle by smaller values of H and W increasing, but still didn't get the right answer. Please help

Answer by Fombitz(32388) About Me  (Show Source):
You can put this solution on YOUR website!
For a H=2 and W=5 rectangle, you get
10 H=1,W=1 rectangles
8 H=1, W=2 rectangles
6 H=1, W=3 rectangles
4 H=1, W=4 rectangles
2 H=1, W=5 rectangles
5 H=2, W=1 rectangles
4 H=2, W=2 rectangles
3 H=2, W=3 rectangles
2 H=2, W=4 rectangles
1 H=2, W=5 rectangles
That's a total of 45 rectangles.
.
.
.
Now for a formula.
Start simple and work up to see a pattern.
H=2 , W=1
1x1=2
2x1=1
3 total rectangles
.
.
.
+H=2, +W=2
+1x1=+4
+1x2=+2
+2x1=+2
+2x2=+1
+9+total rectangles.
.
.
+H=2, +W=3
+1x1=6
+1x2=4
+1x3=2
+2x1=3
+2x2=2
+2x3=1
+18+total
.
.
.
+H=2, +W=4
+1x1=8
+1x2=6
+1x3=4
+1x4=2
+2x1=4
+2x2=3
+2x3=2
+2x4=1
+30 total rectangles.
.
.
You're starting to get a pattern.
The 2xn rectangles sum from 1 to n in steps of 1 for a total of n%28n%2B1%29%2F2.
The 1xn rectangles sum for 2 to 2n in steps of 2 or n%28n%2B1%29.
So the grand total of rectangles in a 2xn rectangle would be
S%28n%29=n%28n%2B1%29%2F2%2Bn%28n%2B1%29
S%28n%29=%283n%2F2%29%28n%2B1%29