Maximum number of cans within a box A box that is 4 ft. by 4 ft. by 4 ft. is packed with (cylindrical) cans that are 2 ft. high and have a diameter of 6 inches. When the box is fully packed with cans, how much space is wasted in the box?
My attempt at solving this:
You need to minimize this (I converted everything to feet):
$4^{3}\; -\; \pi \left( \frac{3}{12} \right)^{2}\left( 2 \right)\left( n \right)$
By equating to 0 and solving for n you get that n = $162.97$. Rounding down you get n = $162$. Now to find the wasted space simply plug in n into the above equation, and you get wasted space is $0.38274$ cubic feet.
However, the answer key to the problem says that the solution is 13.73 cubic feet. What did I do wrong?
 A: It is true that the following is the equation of the wasted volume
$$
V= 4^3-2n\pi\left(\dfrac{3}{12}\right)^2 
\tag1
$$
where n is the number of cans in the box. You just need the number of cans. Each can can be held in a box with dimensions .5 ft x .5 ft x 2 ft. The maximum number of cans that can fit in the 4 ft x 4 ft x 4 ft box is equal to the number of these .5 x .5 x 2 ft boxes that can fit in the bigger box. Thus:
$$
n = \dfrac{4^3}{0.5^22}=128
$$
Thus the box can fit 128 cans. Plugging this number into Eq.(1) yields 13.73 ft$^3$.
A: Assuming that you put the cans in a systematic way (top to down, side to side manner):
Since the height of the cans is $2\text{ ft.}$, it is easy to see that only $2$ layers of cans will occupy the box vertically. Horizontally, you can place exactly $\dfrac{4\text{ ft}}{0.5 \text{ ft}}= 8$ cans (since the diametrical width of the cans is $0.5\text{ ft.})$ This also applies in the other direction. So you have a total of $2\cdot 8\cdot 8 = 128$ cans.
Volume of each can: $\pi \left( \frac{3}{12} \right)^{2} \cdot2 {\text{ ft}}^3$.
So volume wasted: $\left(4^3 - 128\cdot\pi \left( \frac{3}{12} \right)^{2} \cdot2 \right){\text{ ft}}^3 \approx 13.73 {\text{ ft.}}^3$
