2740: Square Packing

Explain xkcd: It's 'cause you're dumb.
(Redirected from 2740)
Jump to: navigation, search
Square Packing
I also managed to improve the solution for n=1 to s<0.97, and with some upgrades I think I can hit 0.96.
Title text: I also managed to improve the solution for n=1 to s<0.97, and with some upgrades I think I can hit 0.96.


The square packing problem is a type of geometry problem. The goal is to find the smallest possible "outer square" that will fit N "inner squares" that are each 1 unit wide and 1 unit tall. In the comic N=11, leading to its name of "The N=11 Square Packing Problem," and the value 's' is the length of the outer square's sides. (For example, with 16 squares arrayed in a 4x4 square, 's' would be 4. [an image would be helpful here])

This comic spoofs a common phenomenon for some values of N: sometimes the optimal solution looks very "sloppy" to human sensibilities. The lack of a uniform grid or pattern, where some squares look to be misaligned or a lot of space looks wasted, counterintuitively leads to a smaller value for 's' than something more "organized" might be. 'N=11' is one such "frustrating" solution (though it should be noted, the solution depicted has not yet been proven to be optimum).

A few days before this comic's post, a web page Squares in squares gained interest on social media platforms such as Twitter and Hacker News. For many values of N, that page depicts the best known solutions, some of them known to be optimum. The one for N=11 (best known but not proven to be optimum) is the one Randall uses for this comic; its general arrangement was found by Walter Trump in 1979 and slightly improved by Gensane et al. in 2004.[1]

Munroe claims to have found a more efficient solution for this N=11 case, by physically deforming the squares involved in the best-known solution with a hydraulic press. The size of the resulting bounding square is indeed smaller, but the "solution" isn't actually one because the inner shapes have countless wrinkles and are no longer squares. Geometrical shapes in packing problems are not conventionally assumed to be a soft-body in this manner.[citation needed]

The title text mentions the same approach "improved" the solution for 1 unit square, whose optimum solution is obviously that unit square itself with s=1. Munroe remarks that if he had "some upgrades", presumably a more powerful hydraulic press, he could get the resulting square to be even smaller.

The humorous implication behind the comic and the title text is that rather than the shapes being mathematical, abstract shapes, they are actually physical squares, constructed of some extremely strong, but not completely incompressible material. It is not obvious what material that might be: even using a hydraulic press, its cross-sectional area can only be reduced to 92-94% of its original size. (The fact that the theoretical squares exist in a 2D universe in the problem statement, but here are seemingly 3D objects showing distortions in the sides facing the viewer after being presumably crushed from the top and sides in turn by the hydraulic press, is not more fully addressed.)

This is perhaps a related joke to 2706: Bendy, but now with squares and compressed areas instead of triangles and extended lengths. Unsolved packing problems also appear to be a long-standing interest of Randall, who shows himself pondering "the most efficient packing of round-cut diamonds of uniform size" in the What If? Expensive Shoebox, with the title text "A Google search for unsolved+packing+problems very nearly got me just now."

  1. Gensane, T., Ryckelynck, P. – Improved dense packings of congruent squares in a square. Discrete Comput Geom 34, pages 97–109 (2005). https://doi.org/10.1007/s00454-004-1129-z


[11 squares are optimally packed inside a square arrangement. A grey square behind it shows the space that the squares take up. There are two squares in the top left and top right corner, then four in an L shape in the bottom left corner with the long side on the bottom. The remaining 5 squares are imperfectly formed into a larger square, rotated roughly 45 degrees, with the fifth square in the remaining space in the bottom right, also rotated. The squares are hand-drawn so the lines are imperfect.]
Previous best
(Gensane, 2004)
[The same arrangement is shown, however the squares have been "crushed" as if they were real objects. The rotated squares have been most affected, with lines indicating crushing as well as rounded corners. The outer squares have been crushed into the inner squares, and many have cracks. A dashed line shows the old grey square while a new, smaller grey square marks the edges of the new arrangement.]
New record
[Caption below the panel:]
I've significantly improved on the solution to the n=11 square packing problem by using a hydraulic press.

comment.png add a comment! ⋅ comment.png add a topic (use sparingly)! ⋅ Icons-mini-action refresh blue.gif refresh comments!


I suspect Randall saw the same social media post that I did (or maybe a repost of the same social media post, who knows or cares). I don't really want to make an explanation, but anyone who does, here's a link to a bunch of square packing findings... of course, no hydraulic press allowed for these packings. https://erich-friedman.github.io/packing/squinsqu/ Tsumikiminiwa (talk) 22:07, 20 February 2023 (UTC)

Yeah, this was on r/mathmemes the other day. 00:03, 21 February 2023 (UTC)

Welcome to the Hydraulic Press Channel. Today we have a set of squares that are usually used in packing problems. You are supposed to fit them into other squares by arranging them. But I think we can get them to fit easier if we put them on the press, and just try to make them smaller. We are going to start with one square, and see how much smaller we can make this. And here we go.

Needs to include a mention of the "Square Packer Five Meeellion"... 16:48, 21 February 2023 (UTC)

The post where I saw this said: “God is dead, and what killed him was learning [the similarly inelegant-appearing n=17 solution].” 13:08, 21 February 2023 (UTC) 19:26, 21 February 2023 (UTC) Welcome to the Hydraulic Press channel

What does "s<" mean? Kev (talk) 22:54, 21 February 2023 (UTC)

"S" (the size of the square, within which lie the N small squares) is less than the following number. i.e. that any S of that amount or greater is more than enough space to contain N unit squares. But it isn't fully established what the smallest value of S is, just that it will not be bigger than (or equal to) that provisional limit.
(Do we need a wikilink to inequality notation in the explanation, then? Maybe you can tell us, Kev.) 23:17, 21 February 2023 (UTC)
Please! I came to the discussion to ask that an explanation of what s means. I did have a look in the Wikipedia article about it, but they don't use it there. So an explanation in the text with perhaps a link to something that expands on the explanation would be greatly appreciated by me :-) 12:45, 22 February 2023 (UTC)
Added something about this. Seems too wordy and partly a repeat of the above. Future editors will refine, no doubt. 19:43, 22 February 2023 (UTC)
Well, I had added it. Someone rewrote it and it now just says something not at all what the above people wanted it to say... Go figure... 01:10, 23 February 2023 (UTC)
Is there a solution to the problem of the smallest explanation into which n explanations can be packed? 11:29, 23 February 2023 (UTC)
Probably, that's [one of] the issue[s] addressed by compression algorithms. 23:26, 26 February 2023 (UTC)

I think I saw this new solution in a paper authored by USPS et al. 23:33, 21 February 2023 (UTC)

I believe we can get S<3.32 for this problem... if it will Blend. -- 09:28, 22 February 2023 (UTC)

Assuming that when Randall says "some upgrades", he means the strongest hydraulic press humanity has created, what would be the compressive strength of the square in the title text? ~ Megan she/her talk/contribs 01:57, 23 February 2023 (UTC)

First time I've seen a citation in an Explain XKCD explanation, LOL! And if I haven't read all 2740 up until here, I'm close (MAYBE the first few hundred I skipped the explanation if I understood the comic). :) NiceGuy1 (talk) 05:07, 26 February 2023 (UTC)

I'm on mobile so can't easily edit it myself but I think the reference to 11 square packing in 2765: escape speed should be linked to here :) 11:37, 29 September 2023 (UTC)