Saturday, December 15, 2012

Is There a Formula for The 'Perfect' Christmas Tree?

The other week I was waiting for my tram, reading Metro, and I see this article - Treegonometry: Formula for perfect Christmas tree discovered

In other word, a set of equations that will tell you, for example, how much tinsel, or how many baubles are 'required' for the 'perfect' Christmas tree.

Here is the press release, with the actual formulas.

Now, I have a few issues with this. For one thing, it's a bit silly. Surely the perfect tree is a matter of personal preference, and in that sense can't be defined by a set of mathematical rules.

Plus, it seems kind of arrogant to declare that their way is the 'perfect' way, and that (implicitly) any other way is wrong.

Also, the fact that the equations are preposterously simple (perfect thing = constant*tree height) makes me suspicious of them. But, worse than that, it really bothers me that I have no idea how they were derived.

But I'm starting to rant.

The equations in question were actually from a 'study' by the Sheffield University Maths Society (student from my university), and were commissioned by Debenhams (department store). So, I dunno, maybe I'm just bitter that no-one's ever commissioned me to do maths.

Anyway. If they'd said that these were equations for an 'ideal' Christmas tree, then I'd consider that more reasonable. You can say, for example, that the ideal Christmas tree should strike a balance between too many and too few decorations, etc.

So, to that end, I'm going to have a crack at deriving some, more general, 'Equations for an Ideal Christmas Tree' of my own.


Lights

Before we start, there's one simplification we need to make - we will assume that Christmas trees can be approximated to a smooth, regular, right-circular cone - height h, and base radius r.

There's going to be a certain degree of error as a result of this approximation, but I'm not going for perfect.

Okay. So, for lights, there's actually a justifiable basis for an ideal - the ideal tree should have its lights evenly distributed.

Or, to put it another way, you ideally want to wrap your lights such that you have a (roughly) constant light surface density (lights per unit surface area); because you don't want your tree to be covered in clumps and bald spots.

This seems like a vague point; how do you decide on the correct 'density'?

Well, we actually have two constraints to work from: firstly, we have to wrap a single line around our conical shape, and second, the distance (s) between each pair of adjacent lights on a string will be fixed.

From this, we can layout a (hypothetical) grid on the surface of the tree, so that all the lights are equally spaced out.

So, how do we do that?

1) Draw yourself a cone (tree)
2) Draw a grid
3) Draw lights at the points where the grid lines meet
4) Draw in the proper row lines - these represent the actual string of lights
In this cases, I've drawn the grid a little tight, so you'd probably want two strings of lights to get this layout (hence the two colours).

And if you like, you can play with the distances between rows, and the angles, to get some slightly different layouts
The best grid to try for would be a triangular grid, where the distances between each light and the six nearest are the same
So, let's say we've picked a grid. How many light will we need?

There's a nice short-cut to working this out, without having to worry about lengths of spirals on conic surfaces. To do this, we take advantage of the regular grid layout to work out the lights density (lights per unit area).

Each section of grid is roughly a diamond, with all sides about the same length
So with a bit of trigonometry, you can get an approximate equation for the area of this diamond
Then, the density is one over that area (since there's one light per grid diamond).

We then multiply this density by the total conic surface area (excluding the base) to get the total number of lights needed
And, finally, multiplying that by the separation between lights (s), we get the total length needed:
Easy. Though, somewhat more complicated than the L = pi*h equation, derived by SUMS.

So, then, for the triangular grid (theta=60), you get
Cool.

The only problem then is getting the lights to line up on a grid on the actual tree. So... good luck with that.

Realistically, all of this is mostly irrelevant anyway - you can't go out and ask for, say, exactly 5.83m of lights; you buy your lights in pre-cut lengths. Can't get hold of the 'perfect' length of light? Then your tree is imperfect, and you should feel bad.

Anyway. The point is, if you can get your lights more or less even - so that there aren't any clumps or bald spots -, then as far as I'm concerned, you're on to a winner.


Tinsel

What's interesting about their equation for tinsel is this factor of 13/8. Now, again, I don't know how these equations were derived, so I don't know if this was intentional; But, 8 and 13 are consecutive Fibonacci numbers. Why is this important? Well, the Fibonacci sequence is closely related to spirals.

In particular, there's this thing you see in nature; for example, if you look at the spirals on a pineapple, the spirals going in one direction might be 13 and the number in the opposite direction might be 8. Or the numbers might be 21 left and 13 right... The point is, the numbers of spirals on a pineapple are always consecutive Fibonacci numbers (or sometimes Lucas numbers).

And you get the same effect on other things, like the spirals of seeds in the head of a sunflower, or the seeds on a strawberry, or the spirals on a pinecone, or a cauliflower, or all sorts of things. Hell, maybe the branches on a Christmas tree form Fibonacci spirals.

Vi Hart explains it better than me.

So maybe that has something to do with that pre-factor. Or maybe not. It's an interesting tidbit, though.

Anyway.


The thing with tinsel is different people like to do tinsel differently - some like to elegantly drape it across the outer branches, others like to wrap up their tree light they're restraining a hostage. It's a matter of preference. But it's going to affect the amount of tinsel you'll need.

Where tinsel differs from lights is, you're not trying to set up a grid, or get an even surface density. Rather, in this case, you'd probably want to wrap it such that the rows are more horizontal, with a roughly constant vertical separation.
Here's where things get messy; the equation for the length of a spiral on the surface of a cone is given by
I know, right? Maybe you would be better using the SUMS equation for this one.


Extras

The star/angel is going to be some fraction of the height of the tree.
I don't know what the ideal value of the fraction (alpha) would be, but the 10th they came up with seems reasonable.

Baubles, I haven't a clue how they came up with those numbers. The factor of sqrt(17) makes me think some geometry was probably involved, but I dunno.

You would probably want to figure it out as some ideal ornament surface density, Db (like with the lights). In this case, the number of baubles needed would be something like
In fact, if your baubles are all, more or less, the same, you can lay them out on a grid, like the lights. Though, this time, you'd want to have them a little more spaced out, since baubles are much bigger than fairy-lights. But at least this time you don't have the separation constraint.


Thoughts

Here are various things Ben Goldacre, of Bad Science, has said on the subject of commissioned, 'perfect' formulas. Here is an article by mathematician, Simon Singh. Here is an article on BBC News. And here is a collection of such formulas on Apathy Sketchpad.


To be honest, I wouldn't bother with any of this; their equations, or mine. I mean, would you really want a tree that was 'perfectly' decorated? Cold and artificial are the words that come to mind.

And, frankly, I'm not sure my equations would actually work in practice.

I'd say, use your best judgement on how much of everything you'll need, and just do your own thing. Have fun with it!


Our Christmas tree is imperfect. In fact, it's gloriously imperfect. No, seriously, it's a mess.

My ex's family used to construct these massive, elaborate, works-of-art trees; with yearly colour schemes, and matching baubles, and everything. By comparison, she described our tree as kitsch.

But it's adorned with all the baubles, and tinsel, and decorations we accumulated over the last 20-odd years; at least, the ones that haven't been lost or broken. And, in a sentimental sort of way, it is perfect.

Well, okay, not perfect. But, damn it, it's ours.





Oatzy.


[I want you to know, I had no part in decorating that tree.]

[...And, yes, that's a weeping angel on top.]

4 comments:

Unknown said...

This is agreat discussion - but it still leaves a key question uncovered - on a large tree (30 ft.) this question becomes key

How to practically hange lights with the same density - so on a conical surface - what is the distance between each string would give the same density of lights. The answer will yield rows of lights that are parallel - The answer will also start a a small number (e.g. 3in between the rows) and at the bottom be much larger (e.g. 10 cm) Any ideas?

Help?

Oatzy said...

How do you practically hang lights on a 30ft tree? With a big ladder XD

Sorry.

So wait, do you have an actual 30ft tree you want to hang lights on? I don't know if I can offer much in the way of practical advice. Some thought though...

With a tree 30ft tall, perspective becomes important. For example, if you space the lights out perfectly, the rows at the top of the tree will appear closer together than the rows at the bottom, when viewed from below (and vice versa). You can do some trigonometry to figure out how to compensate for that, but the answer depends on how far away and from what height people will be viewing the tree.

Okay, practical advice. So as I mention in the blog, the distance between lights on the string is fixed - that's your guide. Presumably you'll be hanging them from top to bottom. Wing it for the first couple of rows while it's still too narrow to really space things out. Then you want to make sure each new light is roughly the same distance from the nearest light(s) on the previous row as the distance between lights on the string. If that makes sense.

As a rough guide, if you do that, then the distance between rows will be ~sqrt(3)/2 * S ~ 0.87*S, where S is the distance between light on your string.

Of course, that assumes the layout is locally flat (or near enough). If you wanted to be exact you'd have to take into account the curvature / base-to-height ratio of the tree. But working that out would be a nightmare (see the link under 'tinsel' for the length of a conic spiral). It'd be interesting to try and calculate, but from a practical perspective, you'd be better just estimating.

I don't know if any of this helps...

Unknown said...

Hi Oatsy!

Thanks for your quick response - actually we are trying to work this out tonight, since the lights go up tomorrow.

Yes the tree is tall, its for the downtown square. It is artificial, so a perfect cone in shape

I think our problem is a bit different - i will try to explain. Here are the actual numbers (all in meters, i have learned that the tree is 12.2 meters (40ft).

string of lights=700m ... the problem is we don't want to test out how to put the lights on, then take them back off... etc, so the question becomes how much space should be put in between each spiral of light string to make the tree look even

Here are the numbers

height= 12.2m
diameter at bottom 5m
radius at bottom 2.5 m
hypotenus (outside length 12.5m (calculated)

Circumference at bottom = 15.7m

since circumference is a linear function, we can average the circumference at each end to determine the average circumference of the cone = 15.7m + 0m = 7.85m

Thus 700m of light will go around the cone 89.1 times

Easy answer would be: Since the hypotenuse is 12.5 m long, the space between each spiral would be 14 cm (12.5m/89).

However I'm not sure it is the right answer. Here is why.

the horizontal distance at the top of the cone is very small horizontally, resulting in a steep decent angle for the spiral. As the spiral continues lower, each decent angle is reduced. Thus it seems (i believe) the result is lower density of lights on the top (per surface area), and higher density on the bottom. The resulting impression will be a bright bottom and less bright top...

I have some imagination that an integral function may solve the problem, but i have not been able to figure it out... hahaha

Does this detail spark any ideas?

Really appreciate your help! We are string this tree with a crane tomorrow, doing it once will be enough! hahaha!

Oatzy said...

You know, I didn't think to take the average circumference to find the number of turns - that's brilliantly simple (and simply brilliant).

I was looking at the formula for the arc length of a conic spiral. To find the vertical separation between rows of lights, you would have to solve

\[ L = \frac{1}{2} H \sqrt{1 +r^2 + \left(\frac{2\pi r H}{\delta h}\right)^2} + \delta h \frac{1+r^2}{4\pi r} \sinh^{-1}\left(\frac{1}{\delta h}\frac{2\pi r H}{\sqrt{1 + r^2}}\right) \]

for dh - where L is the length of lights and r is the radius of the tree divided by the height (just to confuse you). I don't know if it's possible to solve analytically, but if you put your numbers in (using wolfram alpha) you get dh~13.7cm OR 89.05 turns(!)

Okay, so I've done a 'proof' that having the strings evenly spaced leads to a uniform light density, but I don't know if Tex will render in comments, so you can see it here.

Having said that, I think you're right that the light's will be more sparse at the top of the tree - especially while the circumference is roughly equal to the space between lights on the string, in which case you'll only have one or two lights per row. So maybe you want to bunch them up a little at the top. But once the circumference is much bigger than the light separation, you can just space the rows out evenly.

But, also, as I mentioned in my last comment, looking up at the top of the tree from ground level, the lights will appear closer together anyway because of the perspective.

Anyway, good luck with your tree! I'm sure it'll turn out great.