Thursday, 4 October 2018

The Messiness of Layered Spheres

Below is what I wrote earlier in Layered Spheres (repeated because it was such a short thing):


Say you have a standard solid, rigid sphere like a ball bearing.  Surround that sphere with as many identical spheres as you possibly can.  Hint: the maximum number of equal sized spheres that you can put around a single sphere is 12, according to sphere packing geometry.

You can see how that works here, if you imagine removing the top orange and adding three oranges below, so you have three above, three below and six surrounding the central orange in the middle, for a total of twelve.

Call this the first layer, or Layer 1, and then keep adding more layers.

How many spheres in total will you have when you reach Layer 100?  For bonus points, how many spheres will there be in Layer 100?


When I originally wrote this, I had an inkling what the answer was but I thought that someone might have the staff answer, which despite looking for it, I could not find.  That may well still be the case, but I’ve not had anyone provide me with the answer (or a link to the answer).  I did have someone tell me about packing geometry which, while it wasn’t really my question, did lead me to conclude that my solution wasn’t right.

The answer I had was that for layer x surrounding a seed sphere with other spheres, there are ((2x)2-1).4 spheres.  The problem is that I wasn’t considering all the implications of packing, and how you can’t really fit as many spheres in the second layer, because it’s not smooth.  I suspect that what the equation might be telling me is that if I put putty in the gaps of each layer, making it a new smooth, larger sphere with a radius of 2x+1, then that new sphere could be surrounded by ((2x)2-1).4 spheres.  It seems to work for the second layer at least (when you get 60 spheres fitting nicely around a new sphere of radius 3r, where the standard sphere has a radius r).

If we work on that basis (which I accept isn’t what I asked) then there will be, in the 100th layer, 159996 unit spheres.

I was thinking, as you get more and more layers, that the created sphere becomes more and more smooth, even if I don’t fiddle around with hypothetical putty – because the deviation from perfectly smooth becomes relatively smaller – but in thinking that way, I was perhaps not properly taking into account the fact that the spheres that I am using in the new layer have the same sort of dimensions as the deviations from smooth that exist throughout the process.

That said, I do think that the deviation from ((2x)2-1).4 spheres in the outer layer will become increasingly small as the created sphere increases in size.  There will always be a deviation, but I suspect that when you get to thousands or millions of layers, that deviation will be neglible – even if it’s not zero.  In other words, as x approaches infinity the number of spheres in the xth layer divided by ((2x)2-1).4 approaches unity.

So now my answer to my original question is “approaching 1.6x105 but probably short of that by about 10-20%”.  I’ve hedged this quite a bit because it’s messy.

One of the problems is that what I asked and what I was thinking were slightly different.  I was actually thinking of an expanding notional sphere, and then thinking about how many unit spheres of radius r fit into that expanding sphere.  That made me think about layers, because I was basically thinking in steps of 2r.  However, if you do do that, you will find that with some increments of 2r, you can fit in more spheres than you would if you were merely adding a new layer – basically because a dodecahedron isn’t quite a sphere, and the shape you end up with when you slot in a more spheres into the gap isn’t quite a sphere and so on.  The shape you create this way becomes increasingly spherical – but never quite makes it.

Thinking about it another way, if you used very small increments on an expanding sphere (notionally infinitesimal), then you would just be putting in new spheres into dimples on the surface of the created shape whenever possible, which would create new dimples, which would be filled in turn.  You wouldn’t just add a whole new layer at a time.  And that’s messy.