This month's problem explored how many gifts we get in the song 12 Days of Christmas. This problem is broken into two possible interpretations:
I receive the partridge in a pear tree (one gift) and the two turtle doves on the second day (two gifts) for a total of three gifts after two days of Christmas.
I receive a partridge in a pear tree on the first day (one gift) and two turtle doves and a partridge in a pear tree on the second day (three gifts) for a total of four gifts after two days of Christmas?
For the solutions discussed below, we will refer to these as interpretation 1 and 2.
A special thank you and shout out to Lucia Greer for their proof by induction verifying the formula for interpretation 1, and their solution presented via Desmos to generate a formula for interpretation 2.
In the first interpretation, after 1 day, we have received 1 gift. After 2 days, we have received 1+2=3 gifts. After 3 days, we have received 1+2+3=6 gifts, and so on.
This means that we want to evaluate the following sums
12 days: 1 + 2 + 3 + ... + 12
25 days: 1 + 2 + 3 + ... + 25
n days: 1 + 2 + 3 + ... + n
The first two problems we can write out and calculate by hand. However, this can be tedious. The following solutions show two possible methods of solving these a little bit faster.
The video to the left shows how you might solve this problem in less than two minutes using a spreadsheet!
With a spreadsheet, we can use built in formulas to solve this problem recursively (by adding something to the number of gifts on the previous day). This is less efficient than using an explicit formula, but still really fast with the help of technology!
Summation notation is used to describe adding up a sequence of numbers. If we can write a formula to generate a sequence, we can then use summation notation to signify adding the numbers in that sequence, and many calculators can evaluate summation notation.
If you haven't used summation notation before, this article may be helpful.
In this problem, the number of gifts we receive each day is equal to what day it is (in other words, on the 3rd day of Christmas, we are receiving 3 new gifts), and the total number of gifts I receive is found by adding up the number of gifts from each day.
So, if it day n, I receive n gifts. The summation shown in the image to left shows adding up n gifts from days 1 to 12 and 1 to 25.
But is there a function we can create where we input the day that we are on and it gives us the number of gifts? Yes! There are many ways to get this explicit function, a few are outlined below.
The numbers that we get when we evaluate sums of the form 1+2+...+n are called triangular numbers. Using visuals, we can derive a formula for the sum, as shown in this video (and in the image to the left).
I used Polypad in the video to demonstrate.
There is a class story of a young Johann Karl Friedrich Gauss being asked to add up the numbers from 1 to 100 in class, and quickly finding a shortcut to do so using the symmetry within this problem. This article by Let's Talk Science is the source of the image to the left, and explain's Gauss' method.
In this video, I show how we can identify that this pattern of growth is quadratic, and then use technology (Desmos is used in the video) to create an explicit formula.
Perhaps someone told you this formula and you thought you remembered it but wanted to be sure it always works before you used it?
Well, you could verify it using a proof by induction, just like Lucia did!
In the second interpretation, after 1 day, we have received 1 gift. After 2 days, we have received 1+(1+2)=4 gifts. After 3 days, we have received 1+(1+2)+(1+2+3)=10 gifts, and so on.
This means that we want to evaluate the following sums
12 days: 1 + (1+2) + (1+2+3) + ... + (1 + 2 + 3 + ... + 12)
25 days: 1 + (1+2) + (1+2+3) + ... + (1 + 2 + 3 + ... + 25)
n days: 1 + (1+2) + (1+2+3) + ... + (1 + 2 + 3 + ... + n)
We also know, from our previous work, that this is equivalent to:
12 days: 1(2)/2 + (2)(3)/2 + (3)(4)/2 + ... + 12(13)/2
25 days: 1(2)/2 + (2)(3)/2 + (3)(4)/2 + ... + 25(26)/2
n days: 1(2)/2 + (2)(3)/2 + (3)(4)/2 + ... + n(n+1)/2
The video to the left shows how you might solve this problem in less than two minutes using a spreadsheet!
With a spreadsheet, we can use built in formulas to solve this problem recursively (by adding something to the number of gifts on the previous day). This is less efficient than using an explicit formula, but still really fast with the help of technology!
Similar to our first interpretation, we can use summation notation and a calculator to figure out the total gifts in interpretation 2 of the song.
As shown above, our sum can be represented as:
1 + (1+2) + (1+2+3) + ... + (1 + 2 + 3 + ... + n)
From what we found earlier, we know that 1, 1+2, 1+2+3, and so on can be rewritten with the triangular numbers formula as so:
1(2)/2 + (2)(3)/2 + (3)(4)/2 + ... + n(n+1)/2
Using this formula and summing from n=1 to n=12 and n=1 to n=25 as shown in the image to the left gives us our answers for 12 and 25 days.
With some algebraic simplification, we can turn our summation into an explicit function!
While it is harder for me to draw a picture for this one, this video shows my favorite visual explanation for where this formula comes from.
In this video, I show how we can identify that this pattern of growth is cubic, and then use technology (Desmos is used in the video) to create an explicit formula.