Applied math: making squares from a rectangle

Okay, the following problem*: I have a rectangle of width w and height h, therefore an area a of w x h.
The relation between w and h is “usual”, that is to say, similar to what US calls letter/legal size and what Europe calls DIN A4. So they are 1 to square root of 2, 1.3, 1.5, 1.7, around that rough size. Obviously, not as easy as h = 2w or a similar simple ratio, it’s odd.

The goal is to cut as many equal-sized squares with lenght y from this rectangle as possible. Not in the math sense of cutting everything in 1x1 squares, in the practical sense. So if w = 20.5 cm and h=29.5 cm, then 4 10x10 squares seem possible.

I have decided on the manual approach of taking the shorter number of w, rounding off the next even number, dividing by 2, and use that for 4 squares. But maybe instead of 4 pieces of 10x10 squares, I could get 6 pieces of y x y squares and have less waste.

I think there must be function of they type f(x)= (insert math) h x w (insert math) => y times 6 or maybe a limit function of lim (h,w) = something => y times 8

but my knowledge of functions and limits has deserted me.

On the one hand, I suspect this is a three-planets-type of question with too many variables, and I have calculate/ misjudge each sheet of paper individually. On the other hand, I suspect that because I don’t know my limits and functions anymore I think this is unsolvable, and somebody with better understanding can whip up a nice formula in ten minutes.

So, esteemed math Dopers: insights, explanations, ideas?

*If you want to know why I’m cutting up rectangles: it’s not homework, it’s for origami. Most instructions use squares, very few are for rectangles.

For origami, you need the squares to be reasonably large – where 1 cm square is not large enough. So I think you need to do a bit of trial-and-error here, working with integral fractions of each side of the rectangle (i.e., 1/2, 1/3, 1/4, etc.) down to where the square becomes too small for origami.

Assuming the smallest size you would work with is 5 cm, here are the possibilities for 20.5 x 29.5 cm:

5.125 cm – 4 x 5 = 20 squares
5.9 cm – 3 x 5 = 15 squares
6.833 cm – 3 x 4 = 12 squares
7.375 cm – 2 x 4 = 8 squares
9.833 cm – 2 x 3 = 6 squares
10.25 cm – 2 x 2 = 4 squares
14.75 cm – 1 x 2 = 2 squares

It seems like you’re looking for the most number of usable squares with the least waste, right? I think we need to know what the minimum acceptable square size is. Obviously, the smaller they are the less waste there tends to be.
But I would find the ratio between the two sides and find the nearest simple ratio. Something like 3:2 or 5:3, depending on how small the squares can be. Then adjust a 3x2 or 5x3 pattern of squares so that they just fit on the piece of paper.

Yes, as Giles pointed out, less than 5 cm is not practicable. Standard Origami size is 15 cm, but 14 or 10 would also work.

But that, like Giles approach, is still the manual trial-and-error way. I hoped/ wondered that there might be a formula to get the optimum number and size of squares. Like I said, I have forgotten most of my higher math from school (through non-practice).
I mean, I know this sounds dumb, but I don’t even remember how to figure out the ratio from the decimal calculator. I mean, I divide the numbers to get the ratio, expressed as decimal fraction; but 3:2 is a other type of faction.

Basically, what you’ve got is a ratio of side lengths which is arbitrary and may (in the case of European sizes) be irrational, and what you want to find is a rational approximation to that side length ratio. For the irrational proportions, this is a standard problem, and can be done (for instance) using continued fractions. For rational papers like American 8.5 x 11 inches, though, I think that the continued fractions method will just tell you that the ratio is 17:22, and not give you an approximation with a smaller denominator.

For the case of European paper, the first few convergants of the continued fraction for sqrt(2) are 1, 3/2, 7/5, and 17/12 (though that last one is almost certainly impractical for you). So your choices then would be to make a square the size of the short side and throw the rest away, to go 2 by 3, or to go 5 by 7.

Giles’s method isn’t really trial and error, though (even though he calls it that). It gets you every possible solution that minimizes waste, and in order of edge size (well, two lists, each in order).

I think I’m standing on the line, because I still don’t get the steps you took. Giles, how did you arrive at your sizes - did you divide the area by the integers?

No, I divided each side by the integers, then put the two lists into one list sorted by size:

**20.5 / 4 = **5.125 cm – 4 x 5 = 20 squares
**29.5 / 5 = **5.9 cm – 3 x 5 = 15 squares
**20.5 / 3 = **6.833 cm – 3 x 4 = 12 squares
**29.5 / 4 =**7.375 cm – 2 x 4 = 8 squares
**29.5 / 3 = **9.833 cm – 2 x 3 = 6 squares
**20.5 / 2 = **10.25 cm – 2 x 2 = 4 squares
**29.5 / 2 = **14.75 cm – 1 x 2 = 2 squares

You want a maximal number of y-sized squares from an h-by-w rectangle.

If you cut parallel to the rectangle’s edges, you can get this many squares:
⌊ h/y ⌋ ⋅ ⌊ w/y ⌋

If you cut at a 45-degree angle, I think you can get this many squares:
⌈ (⌊ √2⋅h/y ⌋-1) ⋅ (⌊√2⋅w/y ⌋-1) / 2 ⌉

Sorry if my html math symbol coding fails. Whether or not you can ever improve on both these results by cutting at an angle other than 0 or 45-degrees is left as an exercise. :dubious: