| so, someone here has a daily trivia question on their whiteboard.
the question was, what's the total number of gifts from the song?
here's a little perl script I wrote to find the answer:
#!/usr/bin/perl
$total = 0; $k=1 ; while ($k < 13) { for ($i=$k;$i!=0; $i--) { $total += $i; $thisday++; } print "$k day of xmas, $thisday gift, total = $total\n"; $k++; }
and the output:
★ ./xmas.pl 1 day of xmas, 1 gift, total = 1 2 day of xmas, 3 gift, total = 4 3 day of xmas, 6 gift, total = 10 4 day of xmas, 10 gift, total = 20 5 day of xmas, 15 gift, total = 35 6 day of xmas, 21 gift, total = 56 7 day of xmas, 28 gift, total = 84 8 day of xmas, 36 gift, total = 120 9 day of xmas, 45 gift, total = 165 10 day of xmas, 55 gift, total = 220 11 day of xmas, 66 gift, total = 286 12 day of xmas, 78 gift, total = 364
Stunning isn't it? note that the number of gifts every day is a "triangular number".
|
| |
| from http://en.wikipedia.org/wiki/Hanlon%27s_razor :
A practical observation on the risks of stupidity was made by the German General Kurt von Hammerstein-Equord in Truppenführung,
1933: "I divide my officers into four classes; the clever, the lazy,
the industrious, and the stupid. Each officer possesses at least two of
these qualities. Those who are clever and industrious are fitted for
the highest staff appointments. Use can be made of those who are stupid
and lazy. The man who is clever and lazy however is for the very
highest command; he has the temperament and nerves to deal with all
situations. But whoever is stupid and industrious is a menace and must
be removed immediately!"
***
An example now, actually, of why is it so good to be "clever and lazy"? well, because this is seen as the height of elegance in the unix world... laziness is good... this is what makes scripts work... i don't want to type this in 500x, so I'll take 2 minutes and automate the process...
|
| |