Do you remember that famous carol “The Twelve Days of Christmas”? You can find some historical information about it at Wikipedia. There is also a section on its financial implications.

What I find interesting about this carol, from a mathematical point of view, is the *structure* of the underlying collection of gifts as well as the *calculation* of their total number.

The carol starts with a seemingly innocent gift of a partridge in a pear tree sent on the first day of Christmas, which is 25 December. Then, however, as the days proceed through the Christmas period, the gifts received on any one day are:

- a
*completely new*set of gifts equal in number to the*number*of the day within Christmas (e.g. on the third day I get three French hens for the first time, on the fourth I get four calling birds for the first time and so on) - the whole lot of gifts that were sent on the preceding day

This process, where the set of gifts on any one day is linked directly to the gifts of the preceding day, is an example of a concept known as *recursion*. Recursion is widely used in both Mathematics and Computer Programming. Many interesting books have been written, which address this concept. If you have ever come across those beautiful images known as *fractals*, then I should tell you that recursion plays a great part in their production.

Let me turn to the second reason for my interest in the carol: How do I calculate the total number of gifts received from my true love?

Well, if you examine its verses, you will see that I get:

- 1 partridge in a pear tree on each of the 12 days of Christmas, hence 1 × 12 partridges in their pear trees
- 2 turtle-doves on each of the last 11 days, hence 2 × 11 turtle-doves
- 3 french hens on each of the last 10 days, hence 3 × 10 french hens
- 4 calling birds on each of the last 9 days, hence 4 × 9 calling birds
- 5 golden rings on each of the last 8 days, hence 5 × 8 golden rings
- 6 geese a-laying on each of the last 7 days, hence 6 × 7 geese
- 7 swans a-swimming on each of the last 6 days, hence 7 × 6 swans
- 8 maids a-milking on each of the last 5 days, hence 8 × 5 maids
- 9 ladies dancing on each of the last 4 days, hence 9 × 4 ladies
- 10 lords a-leaping on each of the last 3 days, hence 10 × 3 lords
- 11 pipers piping on each of the last 2 days, hence 11 × 2 pipers
- 12 drummers drumming on the final day, hence 12 × 1 drummers

Phew! That’s the whole lot… So, the total number of gifts is the sum of all the above, namely:

(1 × 12) + (2 × 11) + (3 × 10) + (4 × 9) + (5 × 8) + (6 × 7) +

(7 × 6) + (8 × 5) + (9 × 4) + (10 × 3) + (11 × 2) + (12 × 1)

Now, the individual products of the first line are all repeated once on the second line, so this sum is actually twice the value of the first line i.e.

**2** × ((1 × 12) + (2 × 11) + (3 × 10) + (4 × 9) + (5 × 8) + (6 × 7))

or

**2** × (12 + 22 + 30 + 36 + 40 + 42)

or by doing the sum in brackets

**2** × 182

and finally **364**.

Now, isn’t that strange? Because the total we have arrived at is precisely one less than the number of days in a year (forgetting leap-years). So, by sending me all these gifts and with the proviso that I resort to one gift per day, my true love has taken care of me for all but one of the days making up *one whole year* beginning on Christmas Day. These gifts will take me up to the day before next Christmas Eve. That Christmas Eve there will be no gift to use as it will be the 365th day. I should then spend that day thanking my true love and anticipating the flurry of gifts, which will follow on the next day, if she still has the means!

I cannot help wondering whether the creators of this carol designed it on purpose so that the total would come out to 364 or whether this fact completely escaped them. In any case, it is an interesting calculation.

Thank you for bearing with me. May you have a Merry Christmas and a Happy New Year!

## Leave a Reply