# Never assume anything

Knowing my interest in mathematics, a few weeks back, a very close friend of mine, Naveen Balakrishnan, asked me this on WhatsApp-

"I've an A4 size paper and want to divide it into squares of at least 4cm or more in length with minimal wastage.
Is there a mathematical way of solving this than a brute force?
All squares should be of equal size"

Instinctively after thinking for few minutes, I give him this formula to solve the problem:

Area of A4 in cms=$21.0\times{29.7}=623.6999999...$
$Minimize(Area_{A4} - \lfloor{\frac{Area_{A4}}{x^2}}\rfloor\times x^2)$

where:

$4\leq{x}\leq{21}$

And

$\lfloor\frac{a}{b}\rfloor$ denotes floor function of a division

And since I was, at that time, busy with something, I did not check and assumed that the formula would work seamlessly.

Later in the day when I freed myself from watching a few episodes of some random geeky TV series ( 😛 ), I looked again to check if the solution that I had provided had actually worked.

It did not! 😥

After agonizing for half an hour, I rectified my mistake and came up with yet another formula:

Area of A4 in cms=$21.0\times{29.7}=623.6999999...$
$Minimize(Area_{A4} - \lfloor{\frac{21.0}{x}}\rfloor\times\lfloor{\frac{29.7}{x}}\rfloor\times x^2)$

where:

$4\leq{x}\leq{21}$

And

$\lfloor\frac{a}{b}\rfloor$ denotes floor function of a division

Instinctively I opened up a julia shell and computed a few integer values to find out the minimum (as shown below).

After looking at few results I informed my good friend that the value of $7cm$ with a wastage of $35.6999cm^2$would suffice.

But to my despair (  😳  ), I was wrong again. If it was not out of curiosity, that I had plotted the values (using Geogebra) then I would not have even realized this mistake.

(scroll, using middle mouse wheel, to zoom inside the applet, & use coordinate point to explore further. x-coordinate of the point represents length or breadth of individual squares while y-coordinate represents the amount of paper wasted (in $cm^2$). You can reset applet by clicking on cycle at top right)

And to my surprise the optimum value was $4.2cm$ which minimized the paper wastage to $6.3cm^2$.

I had learned my lesson!  🙄

Here are 2 of Naveen's artwork:

(PS: Simple julia code below)

## 3 Replies to “Never assume anything”

1. […] Never assume anything – moebiuscurve http://moebiuscurve.com/never-assume-anything/ […]

• akshay kumar says:

It seems to me, that it still needs improvement in the formula.
Formula assumes that you are starting cutting from the corner and parallel to the side of paper and the side of the square. May change the value if you are cutting at an angle Although I am not sure that will minimize or not? worth to look at that before saying this solution is correct. Hope, you already did this home work also. Optimal value should be 4cm(my intuition must be wrong). Smaller the square, smaller the wastage.
One more interesting thing, as this problem floor function is playing well. 4.2 has maximal of integer multiple with 21.0(5) and 29.7(7) leaving value 0 and 0.07.
Anyways, title is very good.

• moebiuscurve says:

Yep, this is not a general formula as it does not consider rotations.