Balls in a Cube

So while working our team came upon a interesting problem. Stacking balls with in a volume and calculating this number, is alot harder than making a cube out of a ball and filling the volume, or just dividing volumes. I did a little research on keplers sphere packaging problem and found that the most efficient way to stack them is about 74% of their volume or if randomly places about 65% of their volume. Going by these numbers, assuming our robot is a storage containers 36x24x40 I can hold 390 balls at maximum efficiency and randomly placed it would be 343 at randomly designed. Is my math right and is there a better formula for this. My calc teacher couldn’t direct me to a formula and I already asked them.

Tl;dr: How many balls can I fit into a cube that is 40x36x24 inches. And what is the math and how do I solve this. I found 74% max efficiency and 65% random efficiency.


As thorough as your math might be, I’d say your best bet is to get cardboard boxes of different sizes and see how much fuel can fit inside. Also, I kinda doubt anyone will ever have a reasonable need for >300 pieces of Fuel at one time.

The reason I have a large volume is just for examples sake. I’m just wondering if my math is correct and what is the proper way to do it. While I realize creating a regression equation empirically is just as good, I would like to learn the math so I can apply it to other things than just this game.

I was doing the exact same math as you a few minutes ago.

This is the article I used to find out a packing density that would be reasonable for spheres in a container. (Judging by your 74% figure, you probably used the same one. Oh well, here it is for everyone else.)

I was assuming that they were being poured in from either a hopper or a loading station and used the low end of efficiency for poured random packing, which is 60.9%. The volume of one ball is 65.54 in^3, that divided by 0.609 is effectively ~107 in^3 per ball. The rest of the math should be fairly straightforward, and I got ~320 balls in your 40x36x24 container.

I forgot to add to my previous reply, the actual number of balls contained will most likely be a little less than that because not all the dimensions are divisible by 5 (the diameter of the ball), so you’ll have some extra space not being occupied by a ball necessarily.a

Josef - one thing to note is that I don’t think the volume is really 36x40x24 (see R03). Those dimensions include bumpers, so you are limited to something closer to 30x34x24 for the actual robot, with the 24 being the max allowable height. Just want to make sure you followed R03 properly.

I believe that would leave you with max 24,480 cubic inches of storage.

To be fair, the calculation also assumes that your entire robot is just fuel.

Yes you are pretty close. This is a common problem for calculating the capacity of petroleum reservoirs. A rough guess for any volume, no matter the size of the spheres (as long as they are uniform) is about 30% porosity.

Yours won’t be?

If you really wanted to you could have some fuel balls stick out of the robot boundaries (like stacked up above the boundary) but this would likely be bad design as you’d have to stop slowly.

While this is still assuming that they entire robot is just fuel, there is nothing in the rules that says that you have to remain inside the frame perimeter, so theoretically you could have a robot that extends completely to the maximum dimensions by hanging over the bumpers. Note: you do have to start inside the frame perimeter, but do not have to stay within it.