• Welcome to the Internet Infidels Discussion Board.

The Twelve Days of Christmas

lpetrich

Contributor
Joined
Jul 27, 2000
Messages
26,852
Location
Eugene, OR
Gender
Male
Basic Beliefs
Atheist
 The Twelve Days of Christmas (song)

This is an old Xmas song, going back to the late 18th century. It has numerous versions, including lots of parody versions. The best-known version is Frederic Austin's 1909 version, and it goes:

On the first day of Christmas my true love sent to me
A partridge in a pear tree.

On the second day of Christmas my true love sent to me
Two turtle doves
And a partridge in a pear tree.

On the third day of Christmas my true love sent to me
Three French hens,
Two turtle doves,
And a partridge in a pear tree.

The next verses continue in this fashion, with each one repeating the previous gifts and adding a new set:
Four calling birds
Five gold rings
Six geese a-laying
Seven swans a-swimming
Eight maids a-milking
Nine ladies dancing
Ten lords a-leaping
Eleven pipers piping
Twelve drummers drumming


I have a challenge. What is the total number of each item? Can you find a formula for that number?
 
Please explain what x is supposed to be, and how you got that formula.
 
Why are the maids milking and the ladies dancing? This song should be banned due to the misogynistic stereotyping of gender roles. :mad:
 
I don't see the connection. What is n supposed to be? Why do you think that (1 + 2 + ...) fits this song's item numbers?
 
Oh, I get it. We might be counting each thing multiple times because the partridge is in every verse and you want to count it with each verse.

So it would be

1x12 +
2x11 +
3x10 +
[ent]hellip[/ent] +
n (13-n)

(Forgive me, but I don't know LaTeX)

12
[ent]Sigma[/ent] i(13-i) =
i=1

Unfortunately, it's been over 2 decades since I had a math class, so I'm more than a little rusty, and I don't know how to calculate the formula for the answer.
 
This is so fucking humiliating. I had to use an online curve-fitter to do this.

[ent]nbsp[/ent]n
[ent]Sigma[/ent] i(13-i) = (-n3 + 18n2 + 19n)/3
i=1

Can someone less ignorant than me show the math for how you get from the left side of the above equation to the right side?

I've been thinking of taking a calculus class just to brush up.
 
Here is the solution.

Let's number the gift items by the day that they are first given. Thus, a partridge in a pear tree is item #1, a turtledove is item #2, a French hen is item #3, etc.

On the first day, one gets one of #1
On the second day, one gets one of #1 and two of #2
On the third day, one gets one of #1, two of #2, and three of #3.

The pattern is evident: on day n, one gets k of item #k for k from 1 to n.

That is a total of (1/2)*n*(n+1) items each day. I will prove that result by mathematical induction. On the first day, n = 1, and one gets only 1 item that day, that partridge in a pear tree. For day (n+1), one gets what one got on day n and also (n+1) of item #(n+1). That day's total number is:

(1/2)*n*(n+1) + (n+1) = (1/2)*(n+1)*(n+2) = (1/2)*(n+1)*((n+1) + 1)

This is the same formula, with (n+1) instead of n.

-

Now for the total number of each item over all the days. At day n, one received item #1 for all the days, so one has received n*1 of it. One has received two of item #2 starting on the second day, for a total of (n-1) days. This gives a total of (n-1)*2 of #2. Etc.

In general, by day n, one will have received a total of k*(n-k+1) of item #k, k each day for day k to day n, (n-k+1) days in all.

That gives a total of (1/6)*n*(n+1)*(n+2) for all the items.

It should be easy to find how many one has received over all twelve days.
 
Why are the maids milking and the ladies dancing? This song should be banned due to the misogynistic stereotyping of gender roles. :mad:

To say nothing of the very alarming fact that these people were apparently given as a gift to the singer. Serfdom is not on anymore, people. Get woke!

I note that it never occurred to me to think that the person was actually giving repeats of the same gifts every day; I realize the song repeats itself, but I always thought it was more like a running tally of what had thus far been given. Which would leave the recipient with just 78 presents altogether, a much more possible total in terms of practical gifting. Am I off my rocker?
 
Thanks for the solution.

nn[ent]nbsp[/ent]
[ent]Sigma[/ent][[ent]Sigma[/ent] k]
i=1j=1[ent]nbsp[/ent]

Then we just nest n(n-1)/2 in itself and solve.

QEDuh. I feel dumb(er) now.
 
Why are the maids milking and the ladies dancing? This song should be banned due to the misogynistic stereotyping of gender roles. :mad:

Gosh, them dumb broads is always compalinin' about how they are represented in media. Isn't that unreasonable of them? Why can't they just let me enjoy keeping everything the way it is? [/satire]

I don't remember who the original quote is from, and pardon my paraphrase, but when people complain about something being "too political," they are making an inherently political statement. They are saying that they like the way things are and they're offended anyone thinks things should change.
 
My maths is rusty and basic, but what I worked out was that it is the sum of the values of n ranging from 0 to 11 (one could adopt range 1 to 12 instead for a variation of my formula) for the formula 11n - n^2 + 12 => 726 -506 + 144 = 364. This interestingly is one less than the number of days in a standard year.
 
I've worked out the numbers. The total count of each item is:
  • 12*1=12 partridges in pear trees
  • 11*2=22 turtledoves
  • 10*3=30 French hens
  • 9*4=36 calling birds
  • 8*5=40 gold rings
  • 7*6=42 geese a-laying
  • 6*7=42 swans a-swimming
  • 5*8=40 maids a-milking
  • 4*9=36 ladies dancing
  • 3*10=30 lords a-leaping
  • 2*11=22 pipers piping
  • 1*12=12 drummers drumming
The total for each day is:
  • Additional: 1, Day Total: 1, Grand Total: 1
  • Additional: 2, Day Total: 3, Grand Total: 4
  • Additional: 3, Day Total: 6, Grand Total: 10
  • Additional: 4, Day Total: 10, Grand Total: 20
  • Additional: 5, Day Total: 15, Grand Total: 35
  • Additional: 6, Day Total: 21, Grand Total: 56
  • Additional: 7, Day Total: 28, Grand Total: 84
  • Additional: 8, Day Total: 36, Grand Total: 120
  • Additional: 9, Day Total: 45, Grand Total: 165
  • Additional: 10, Day Total: 55, Grand Total: 220
  • Additional: 11, Day Total: 66, Grand Total: 286
  • Additional: 12, Day Total: 78, Grand Total: 364

From Tracy W. Bush:12 Days Of Starcraft Christmas Lyrics | LyricWiki | FANDOM powered by Wikia:
On the twelfth day of Christmas,
Blizzard gave to me...
12 Arbiters,
11 Science Vessels,
10 Ultralisks,
9 Battle Cruisers,
8 Archons Burning,
7 Zerglings swarming,
6 Zealots fighting,
5 newborn Queens,
4 Hydralisks,
3 Marines,
2 Terran Wraiths,
And a brand new SCV.
 
x*(13 - x)

X is the quantity mentioned in the song. For example, twelve drummers drumming (x=12) is only sung once, so there are 12 of them.

12 * (13 - 12) = 12 * 1 = 12

Eleven pipers piping (x=11) is sung twice, so there are 22 of them

11 * (13 - 11) = 11 * 2 = 22

Etc.
 
I have been working more on this and obtained an actual formula - its pretty ugly.
Let n=11. then using my previous equation of the sum of 11n-n^2 +12, and rearranging it to 11n +12 -n^2, then have:

[(n^3 + n^2) / 2] + [(n + 1) ^ 2] - sum of squares.
As sum of squares = [n(n +1)(2n + 1)] / 6, then have:

[(n^3 + n^2) / 2] + [(n + 1) ^ 2] - [ n(n +1)(2n + 1)] / 6

For n = 11 => (1331 +121)/2 + 144 - 506 = 726 + 144 - 506 = 364
 
If one prefers to use n = 12, then the formula becomes:

[(n^3 - 2n^2 + n) / 2] + n^2 - [(n^2 - n)(2n - 1)]/6

Which gives:
726 + 144 -506 = 364 also.

If do not wish to use complicated (?!) formulae, then the solution can be most simplified by noticing the reflection in values, and use:

2 (12 + 22 + 30 + 36 + 40 + 42) = 2 x 182 = 364.
 
I wrote a Windows PowerShell script to find the value:

Code:
$array = (1..13)
$sum = 0
foreach ($day in $array) {
    for ($i = 1; $i -lt $array[$day]; $i++) {
        $sum = $sum + $i
    }
}
$sum

And the value of $sum comes out to: 364
 
Back
Top Bottom