# How to compute the number of regular spheres needed to fill a rectangular space

Computing the volume of a sphere is straightforward 4/3*pi*R^3

As is the volume of a rectangular space length*width*height (e.g. 10*10*6)

How might I go about determining how many spheres would fit into a rectangular space, assuming the spheres are solid and not flexible?

• Closed as "ask wikipedia": see qwerty's link below to the sphere packing article. – Scott Morrison Mar 8 '10 at 22:26
• I don't think this is off topic, so I'll sketch an answer: According to the Kepler conjecture, which has probably been proved by Hales, the densest possible packing of spheres in 3-space has density pi/\sqrt{18}. So, if your region has volume V, it can contain at most $V (\pi/\sqrt{18})/(4/3 \pi) = 2 \sqrt{2} V$ unit spheres. If all the sides of your box are much longer than unit length, this bound will be close to achievable. I have the impression that there are no good exact bounds for finite regions, but I am not an expert. – DES-SupportsMonicaAndTransfolk Mar 9 '10 at 2:48
• Reopened. My apologies for acting hastily, I agree closing was a mistake. Sorry for the inconvenience. – Scott Morrison Mar 9 '10 at 6:58
• When you say "regular", do you mean all spheres have diameter 1? Even in this case, it is a difficult computational problem. There are obvious upper and lower bounds given by truncating/embedding as much of a hexagonal close packing as possible. I've been told that any particular case (including the asymptotic infinite one) is a finite computation "by quantifier elimination". – S. Carnahan Mar 10 '10 at 2:10