Site icon Strange Quarks

On the N Days Of Christmas, part 8

My last post ended with the strong hint that I may not have been finished with this topic.

In part 4, triangular numbers were used as a first simplification to computing the total number of gifts for the 12 days of Christmas by eliminating some additions.

It turns out that the polynomial from part 5 is the equation for the class of tetrahedral numbers.

I wanted to determine the optimal solution from first principles and experimentation. The triangular numbers link was found through serendipity (listening to an unrelated podcast). I learned about tetrahedral numbers through further reading after finishing part 7.

In a Wikipedia article about the 12 days of Christmas song, Donald Knuth’s analysis of computational complexity is mentioned and then as an afterthought:

Incidentally, it is also observed that the total number of gifts after m days equals m3 / 6 + m2 / 2 + m / 3.

which is the polynomial we saw from part 5.

One thing led to another and I came across another Wikipedia page about tetrahedral numbers that are computed with this function. The name of the class of numbers arises from the fact that such numbers can be modelled by stacking spherical balls into a tetrahedron, as illustrated with this nice 3D graphic:

The number of balls in each layer is a triangular number. The number of balls in the tetrahedron is the nth tetrahedral number, and also the number of gifts for the nth day of Christmas.

gifts-for-day-of-xmasn = 1 ball in layer1 + 3 balls in layer2 + 6 balls in layer3 + … + n(n+1)/2 balls in layern

There is also a relationship to the problem of finding the optimal way to stack canon balls worked on by Johannes Kepler (one of my heroes, who realised that planetary orbits are elliptical, not circular), but that’s a different post.

Here are some other interesting things I found along the way:

source: https://sahilmohnani.wordpress.com/2013/02/23/pascals-triangle-cubic-quartic-and-sextic-numbers/

It seems that the avenues down which one could stroll in relation to this topic are never-ending.

I can’t promise not to ever return to it, but it’s time to move on I think, at least for now.

Exit mobile version