Why is the greedy algorithm philosophy to finding the maximum right cylinder inside a rectangular box not correct?

46 Views Asked by At

The largest solid right cylinder possible is placed in a rectangular box measuring 8 by 10 by 12 inches. If the box is then closed, approximately what percentage of the box's volume is occupied by the solid right cylinder?


The greedy algorithm approach is to take the longest dimension (12), divide by two, as the radius, and pick from $\{8,10\}$ as the height as long as the total volume of the cylinder is less than the volume of the rectangular prism. If that initial choice does not work, try the second largest dimension as the height, and repick from the other dimensions.

For example, If $6 \cdot \pi \cdot 10$ exceeds the rectangular prism's volume, try $6 \cdot \pi \cdot 8$. If those were not to work try $5 \pi \cdot 8.$

The volume occupied by the cylinder is $94 \%.$ when we choose 6 as the radius and eight as the height.


Why is the answer $65 \%$?