Cubes in Cuboid

Geometry Level 3

Find the maximum number of cubes with each 3 units 3\text{ units } edge length that you can place completely inside a 400 units × 300 units × 90 units 400\text{ units } \times 300\text{ units } \times 90\text{ units} rectangular box such that

  • The small cubes may touch each other, but may not overlap.
  • The faces of the small cubes are parallel to the faces of the rectangular box.


The answer is 399000.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Calvin Lin Staff
Dec 29, 2016

(Rant to explain why my solution is so long)

A common assumption is that "We can do no better than maximizing the optimization along each side", hence the maximum number of cubes would be

400 3 × 300 3 × 90 3 = 399000 \lfloor \frac{400}{3} \rfloor \times \lfloor \frac{300}{3} \rfloor \times \lfloor \frac{90}{3} \rfloor = 399000

As it turns out, for this assumption to be valid, we actually require that the faces of the unit cubes are parallel to the faces of the larger rectangular box, which I've since added to the problem. For example, try this problem of packing 5 unit squares , which has an answer that is smaller than 3. For more information (on the 2-D case), see Erdos's paper On packing squares with equal squares .


(The rest of the solution establishes why with the assumption of parallel faces, then the naive optimization is the best possible. Note that this step is skipped in most solutions.)

Notice that since we are dividing the figure up into cubes, it doesn't matter what the side lengths are as we can simply scale the figure. Henceforth, we will assume that we're using unit cubes.

Before we get started, let's analyze the 1-dimensional and 2-dimensional situation first. Understanding how to approach this problem would greatly help with generalizing the argument further to 3 dimensions.

In a line segment of side length l l , what is the maximum number of unit line segments that we can place within the original line segment? The unit line segments are allowed to touch, but not overlap.

In this case, since each unit line segment has length 1, thus we are clearly allowed to have a maximum of l \lfloor l \rfloor of them.

Let's move on to the 2-dimensional case:

In a rectangle of side length l × m l \times m , what is the maximum number of unit squares that we can place within the original rectangle? The unit squares are allowed to touch, but not overlap.

If we repeated the previous argument, which was based on the measure of "volume", we would say that the rectangle has area l × m l \times m , and so we can fit at most l × m \lfloor l \times m \rfloor squares. Note that while this is a valid upper bound, it is not the best upper bound in all cases. For example, with l = m = 1.99 l = m = 1.99 , we cannot fit 3 unit squares without overlap. (Can you prove this?)

Notice that not all area of the square is useful to us. In particular, for the counter example of l = m = 1.99 l = m = 1.99 , we see that after fitting in 1 square, the rest of the area does not allow us to fit in another square. At this point, the mathematician in you should realize that considering "area/length" as we did in the 1-dimensional case, isn't the right way to generalize this problem. Instead, we might have to find a better characterization.

An observation in the l = m = 1.99 l = m = 1.99 case is that the center of the large square must lie in any unit square that is contained within, hence we can have at most 1 square. More generally, if we consider the various lattice points in the rectangle, our hope is to associate each point to a square, which then (might) gives us a bound on the number of squares.

Let's see how to rigorize this. For any l × m l \times m rectangle, place it on a grid with the lower left corner at the origin. Consider any placement of unit squares.
Define the interesting lattice points ( i , j ) (i, j) with 1 i l 1 \leq i \leq \lfloor l \rfloor and 1 j m 1 \leq j \leq \lfloor m \rfloor . For each lattice point, we map it to the unit square which touches or contains it, and has the smallest "upper right" corner by lexicographic ordering. For example, in a 2 × 2 2 \times 2 squares, though all 4 grid squares touch the lattice point ( 1 , 1 ) (1, 1) , the "upper right corners" are ( 1 , 1 ) , ( 2 , 1 ) , ( 1 , 2 ) , ( 2 , 2 ) (1, 1), (2, 1), (1, 2), (2, 2) , and so we map the lattice point to the unit square whose upper right corner is ( 1 , 1 ) (1,1) .
Conversely, let's show that each unit square has to touch at least one of these lattice points. If the upper right corner of the unit square is ( x , y ) (x, y) , then the lattice point ( x , y ) (\lfloor x \rfloor , \lfloor y \rfloor ) will be mapped to it. Note that this mapping need not be unique, so we have a surjection from the interesting lattice points to the unit squares. This establishes that the number of unit squares is at most equal to the number of interesting lattice points, of which there are l × m \lfloor l \rfloor \times \lfloor m \rfloor .

Now, going back to the 1-D case, it is clear that the map of lattice point to unit line segments also provides us with a simple way to perform the length counting argument. Furthermore, it is clear how we can extend this argument to 3-D, by considering the interesting lattice points ( i , j , k ) (i, j , k) with 1 i l , 1 j m , 1 k n 1 \leq i \leq \lfloor l \rfloor , 1 \leq j \leq \lfloor m \rfloor , 1 \leq k \leq \lfloor n \rfloor , hence we are done.


Do you see where in the argument we used the fact that the unit squares are parallel to the sides of the rectangle? This also helps to explain why tilting squares might eventually allow for a larger number of unit squares to be fitted in.

Why not l × m \lfloor l \rfloor \times \lfloor m \rfloor squares?

Muhammad Rasel Parvej - 4 years, 5 months ago

Log in to reply

What do you mean? The purpose of the solution is to explain that we get l × m \lfloor l \rfloor \times \lfloor m \rfloor if we add the assumption of "parallel to sides". Otherwise, there are counter examples with large enough sides where tilting the squares allow for more packing (which you are asked to find). Let me make that more explicit.

In a similar way, if we think about packing circles into rectangles (of integer sides), the initial rectangular grid format fits very well. However, for large enough sides, we would want to switch to the hexagonal grid format instead.

Calvin Lin Staff - 4 years, 5 months ago

Log in to reply

Oops; sorry. I forgot about the assumption "assumption of "parallel to sides".

Muhammad Rasel Parvej - 4 years, 5 months ago
Prince Loomba
Dec 28, 2016

The maximum number of cubes along the length= 400 3 \frac {400}{3} but since we cannot put fractions of cubes inside it, so

instead of 133.33 133.33 we have to take it as 133 133 . For width and height, 300 3 \frac {300}{3} and 90 3 \frac {90}{3} are already integers, so we can

now multiply all to get our result, which is 133 × 100 × 30 = 399000 133×100×30=\boxed {399000}

Note: Your claim is not true in general. This is why it is important to be rigorous in stating your assumptions and proving that they are valid. See my solution for more details.

Calvin Lin Staff - 4 years, 5 months ago
Steven Chase
Dec 18, 2016

Answer = floor(400/3) x floor(300/3) x floor(90/3) = floor(133.333) x floor(100) x floor(30) = 133 x 100 x 30 = 399000

So why didn't it accept that answer?

Peter van der Linden - 4 years, 5 months ago

Log in to reply

It did for me

Steven Chase - 4 years, 5 months ago

Hi Peter, you submitted two attempts, namely 119700 and 39900, while the correct answer is 399000 (note the additional zero).

Brilliant Mathematics Staff - 4 years, 5 months ago

Log in to reply

Ow... That's really stupid of me

Peter van der Linden - 4 years, 5 months ago

Playing devil's advocate, why is that the maximum?

There is a nice coloring argument that I like to use.

Calvin Lin Staff - 4 years, 5 months ago

Log in to reply

Greetings. I suppose there were a few implicit assumptions there:

1) The cubes should all be oriented such that their faces are parallel to those of the box.

2) The cubes should be packed together as tightly as possible, and the cubes at the extremes should be touching the edges of the box to the extent possible.

3) After the maximum possible integer number of cubes has been added along each dimension, the remaining spaces, which by definition all have at least one of their dimensions smaller than a single cube side length, cannot store any further cubes. I believe that reasoning holds because a cube's cross section from any vantage point can be no shorter than the length of one of its sides.

4) Therefore, the product of the floors of the quotients gives the maximum number of cubes that can fit into the space.

I'd like to hear the coloring argument as well.

Steven Chase - 4 years, 5 months ago

Log in to reply

I believe that none of those assumptions are needed. Let me work out my coloring argument.

Edit: Hm, the first assumption might be needed.

Calvin Lin Staff - 4 years, 5 months ago

Log in to reply

@Calvin Lin K, the first assumption is needed (and in particular is necessary in this problem). Otherwise, this is an open question!

This claim requires the assumption that the faces of the unit cubes are parallel to the faces of the larger rectangular box. For large enough side lengths, this optimization may no longer be accurate. For example, with n 17 n \geq 17 , there exists a square with side length strictly less than n n , but still containing n 2 n n^2 - n unit squares.

Calvin Lin Staff - 4 years, 5 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...