Main Page
(x, why?)
by Christopher J. Burke
Mr. Burke's Math logo
937: Twelve Days of Christmas (Reprise)

Click Me
for a random comic
Mr. Michael Keegan, Math Teacher

Expressing my True Love mathematically and recursively.

This comic calls to mind my Twelve Triangle Numbers of Christmas from way back in 2007.

Once again, I used pseudo-code here, and not any particular programming language. I wouldn't program it exactly like this, but I wanted it to be readable.

As for the summations, those actually caused me some problems -- or at least a bit of thought about how they work, which is something I'll have to refresh my memory on. However, the one thing that occured to me is that I wanted the gifts in order, not just an actual sum of the number of gifts, and I wanted it to match the code. That meant that I had to count backward (or count down). Unfortunately, summations (to my knowledge at this point) count up. That meant minus signs and +1s, which I eliminated by starting j at 0 instead of 1.

More on this tomorrow, probably.

Please visit my blog:
(You can also go there to leave comments!)
First comic Previous comic Next comic Latest comic
Click Me
for a random comic
Kitt Ten. A walking, talking numeral
The Webcomic List

NOV Dec 2014 JAN
30 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 1 2 3
4 5 6 7 8 9 10

(x, why?) is hosted on ComicGenesis, a free webhosting and site automation service for webcomics.
(x, why?)