Find the maximum number of cubes with each 3 units edge length that you can place completely inside a 4 0 0 units × 3 0 0 units × 9 0 units rectangular box such that
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.
Why not ⌊ l ⌋ × ⌊ m ⌋ squares?
Log in to reply
What do you mean? The purpose of the solution is to explain that we get ⌊ l ⌋ × ⌊ m ⌋ 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.
Log in to reply
Oops; sorry. I forgot about the assumption "assumption of "parallel to sides".
The maximum number of cubes along the length= 3 4 0 0 but since we cannot put fractions of cubes inside it, so
instead of 1 3 3 . 3 3 we have to take it as 1 3 3 . For width and height, 3 3 0 0 and 3 9 0 are already integers, so we can
now multiply all to get our result, which is 1 3 3 × 1 0 0 × 3 0 = 3 9 9 0 0 0
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?
Log in to reply
It did for me
Hi Peter, you submitted two attempts, namely 119700 and 39900, while the correct answer is 399000 (note the additional zero).
Playing devil's advocate, why is that the maximum?
There is a nice coloring argument that I like to use.
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.
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.
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 ≥ 1 7 , there exists a square with side length strictly less than n , but still containing n 2 − n unit squares.
Problem Loading...
Note Loading...
Set Loading...
(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
⌊ 3 4 0 0 ⌋ × ⌊ 3 3 0 0 ⌋ × ⌊ 3 9 0 ⌋ = 3 9 9 0 0 0
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 this case, since each unit line segment has length 1, thus we are clearly allowed to have a maximum of ⌊ l ⌋ of them.
Let's move on to the 2-dimensional case:
If we repeated the previous argument, which was based on the measure of "volume", we would say that the rectangle has area l × m , and so we can fit at most ⌊ l × m ⌋ 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 . 9 9 , 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 . 9 9 , 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 . 9 9 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 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 ) with 1 ≤ i ≤ ⌊ l ⌋ and 1 ≤ j ≤ ⌊ m ⌋ . 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 squares, though all 4 grid squares touch the lattice point ( 1 , 1 ) , the "upper right corners" are ( 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 ) .
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 ) , then the lattice point ( ⌊ x ⌋ , ⌊ y ⌋ ) 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 ⌋ .
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 ) with 1 ≤ i ≤ ⌊ l ⌋ , 1 ≤ j ≤ ⌊ m ⌋ , 1 ≤ k ≤ ⌊ n ⌋ , 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.