Reply
Tue 7 Sep, 2004 08:03 pm
Here is a question that is driving me crazy to figure out it just seems like there is something missing. LOL the crazy part is this is suppose to be a circuits class.
How many pieces of sidewalk chalk can you fit in a box with inner dimensions of 4"x8" if each piece of chalk has a 1" diameter? (Consider different ways the chalk can be packed in the box)
Any help or tips would be great!
What's missing is the third dimension, so don't worry about the length of the chalk or the box. The problem is reduced to one in two dimensions. It's a packing problem. I'll let you figure out what you're trying to pack into what in two dimensions.
The answer should be as easy as walking down to a store and looking into a box of crayons. Notice that the sticks are all stacked in straight rows and colums.
The answer is 32.
A common alternative stacking routine is to stack the cylinders so one cylinder lies in the crevase between two others. But in your box you have the dimensions exact multiples of the basic cylinder, so direct stacking gives the best results.
Interspace stacking is done when there are space constraints in one dimension. If your box was only 8 X 3 1/2 then you would want to interspace stack to get the most in, but there would be much more lost space.
Kelly
KellyS wrote:But in your box you have the dimensions exact multiples of the basic cylinder, so direct stacking gives the best results.
Interspace stacking is done when there are space constraints in one dimension. If your box was only 8 X 3 1/2 then you would want to interspace stack to get the most in, but there would be much more lost space.
Your statements are not true in general. 41 cylinders can be placed in a 5x8 rectangle.
For a rectangle, there are always constraints in both directions. Whether or not they are integral multiples of the diameter of the circle to be packed is not the determining factor for the optimal packing method.
Consider what conditions permit extra row(s) (or columns) to be added and whether or not extra row(s) are beneficial.
markr, care to share the math?
It's a matter of figuring out the height of N rows when the rows are staggered such that the centers of the circles of one row are halfway between the centers of the circles of the row below.
The vertical distance between the centers of two rows is the altitude of the equilateral triangle formed by the centers of two circles from the lower row and the center of the circle above (and between) them. If the diameter is 1, then the altitude is sqrt(3)/2. For N+1 rows, the vertical distance between the centers of the circles in the bottom row and the centers of the circles in the top row is N*sqrt(3)/2. To that, you have to add 1 (1/2 for each the distances from the edges to the centers of the circles in top and bottom rows).
So, the overall height of the N+1 staggered rows is:
1+N*sqrt(3)/2.
If 1+N*sqrt(3)/2 <= N, then you can fit at least one extra row into the rectangle by staggering the rows. Solving for N yields N>= 7.464...
It isn't always beneficial to stagger the rows because every other row has one fewer circle than the max. If the rows are relatively short, the solution may suboptimal.
For instance, in a 3x8 you get 9 rows, but only 23 circles (3,2,3,2,3,2,3,2,3). In a 4x8, you get 32 (4,3,4,3,4,3,4,3,4). But, in a 5x8, you get 41 (5,4,5,4,5,4,5,4,5).
Note that the inequality above can be modified to determine when more than one extra row can be obtained by staggered packing.