Analytics Magazine Analytics Magazine, March/April 2014 | Page 72

FIVE- M IN U T E A N A LYST Lego Brickbox Computing the distribution of random bricks tossed into a box is difficult, because each layer is dependent on the one below it. Also, real children do things that real children do, such as shake the box to make the Legos settle. BY HARRISON SCHRAMM, CAP 72 | At the holidays, many children received special promotional “Brick Boxes” from Lego, which may be taken back to the store and filled from the brick repositories on the back wall in the store. After Christmas, one child, “Norah,” saw one of her friends, “Tyler,” meticulously build a shape to fit exactly in his box. She asked me, “How much better do you think that Tyler did by building an exact shape than I did just by tossing what I wanted into the box?” Like many things, this turned out to be a much simpler question to ask than to answer! For the remainder of the article, we will use the natural unit of “Lego cubes” (LC), which are the size of a 1x1 Lego brick, as shown in Figure 1. So, a 2x4 brick has an area of 8LC, and so on. First, an easy problem: The promotional brickbox is 11x11x9 LC, and has a capacity of 1,089 squares. Packing square bricks into a square box is very easy. This turns out to be the only easy thing about this problem. Computing the distribution of random bricks tossed into a box is difficult, because each layer is dependent on the one below it. Also, real children do things that real children do, such as shake the box to make the Legos settle. A few minutes with a paper and pencil convinced me that this was not the proper approach. So, I decided to simulate. Now, computer simulation has some of the same difficulties – imagine playing a 3-D version of Tetris – but fortunately, this is not the only way A N A LY T I C S - M A G A Z I N E . O R G W W W. I N F O R M S . O R G