It’s that time of year again where I am forced to come face to face with my one and only flaw: wrapping presents. Yes, the great staff of Debenhams may as well be superheroes to me, expertly taping seams and tying ribbons while I look on with envious bewilderment. My efforts in comparison look like they’ve washed ashore after six months at sea due to a tragically festive shipping accident. In an attempt to reclaim some Christmas pride then, let’s see if there is anything interesting in the present wrapping process, without, you know, actually doing any wrapping.
To keep things simple, let’s consider the wrapping of a cuboid present with side lengths :
We also make the prescription that this box has a well defined volume , so (easy as 1,2,3?). I will also use my own, most likely inefficient, wrapping procedure:
First I take two opposite edges and fold them over the top of the box to meet on the upper surface. I then take the other edges and fold them up to cover the vertical sides of the box, not needing to cover the upper surface this time. Let’s assume we’re being lazy and just cutting out rectangles of wrapping paper. The layout of the wrapping paper then looks like the following, from which we can deduce how much paper we need:
The side lengths of the rectangle are and , so the total area of the paper is then
We’d like to know the minimum possible area of paper we need for a present of volume . This condition allows us to express where is fixed, so this three-dimensional problem is reduced to a two-dimensional problem. We need to do a bit of calculus then, and find the point where
Doing the algebra we arrive at the coupled cubic equations for and :
Oh dear, this looks a bit evil to solve which is a shame. However, curiously there is a way to arrive at a solution without needing to solve any nasty cubics, it just requires a bit more mathematical machinery.
The problem we’re having is that we have to substitute in for , which is giving us an extra power of and in our equations and making them difficult to solve. We need to do this to enforce our constraint of constant volume. Lets then look at a different way of enforcing this constraint, with the use of a Lagrange multiplier.
Instead of finding a stationary point of , we will find a stationary point of an auxiliary function
where is the volume of the box and the constant is known as a Lagrange multiplier. It isn’t immediately obvious why we should do this, but you can think of the constraint as representing a surface in 3D space. The area of our wrapping paper is a function which fills this space like a gas, but we are only interested in its values where it touches the surface . With enough squinting (and reading Wikipedia pages), you can convince yourself that at the stationary point, the gradients of the function and the constraint are in the same direction, so by minimising a linear combination of both we find the point where the gradients are parallel (and the correct value of along the way).
Chundering along then, we have
and we now need to find a stationary point of , i.e. where
Doing this, we have 3 equations in 4 unknowns:
but now we remember our constraint , allowing us to substitute for . We can then solve for in the first of our equations:
and substitute in the second to find . Amazingly, lots of things cancel and we get the simple result
Lovely. Continuing to the third equation, we end up at
which at first glance looks horrible. We’ve done our GCSE maths though, and noticed this sneaky exam question before: substitute and solve the simple quadratic in . We do this, end up with 6 solutions, discard those which are negative or imaginary, and finally arrive at
So for a box of fixed volume, to use as little wrapping paper as possible with my naive method, it should have sides in the ratio 1:2:4, and the area of paper will be . Simple!
As always, we should double-check to make sure we’ve found a minimum rather than a maximum, but rather than do any more algebra I’ll simply do it numerically. For a range of and , I calculate the required paper area, and find the result we calculated:
If there is a more optimal wrapping procedure I’d like to hear about it, it will change the ‘optimal’ box shape. This technique will also extend itself naturally to higher-dimensional gifts, appropriate for that mathematician in your life. Unfortunately I can’t convince Sainsburys to sell me a festively-decorated holiday hypersurface with which to wrap such a gift, perhaps when the Christmas industry catches up we can revisit this topic in the future.
Thanks for reading, have a great holiday break and a decidedly optimal new year.