tag:blogger.com,1999:blog-9182705499898252496.post591430250251829465..comments2015-03-25T18:07:55.933-04:00Comments on Bill the Lizard: The "N Days of Christmas" SolutionBill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-9182705499898252496.post-35220495399865587732012-12-21T11:31:41.902-05:002012-12-21T11:31:41.902-05:00Last night a friend asked me if there was an equat...Last night a friend asked me if there was an equation to figure out the number of presents in the 12 days of Christmas, and this is what I came up with:<br /><br />T(d) = Sum(n(d+1-n)), {1,d}<br /><br />T(d) = the total presents in d days<br />d = the total natural number of days (12)<br />n = the days from 1 to d, {1,d}<br /><br />So if d = 12, then<br />T(12) = Sum(n(13-n)), {1,12}<br /><br />Thoughts?Jamesnoreply@blogger.comtag:blogger.com,1999:blog-9182705499898252496.post-37900555559091927132011-12-27T02:46:59.251-05:002011-12-27T02:46:59.251-05:00If you look at the diagonals of Pascal's pyram...If you look at the diagonals of Pascal's pyramid, you will see this:<br /><br />First diagonal: 1, 1, 1, 1, ...<br />Second diagonal: 1, 2, 3, 4, ...<br />Third diagonal: 1, 3, 6, 10, ...<br />Fourth diagonal: 1, 4, 10, 20, ...<br /><br />The fourth diagonal corresponds to the total number of presents at each day.<br /><br />There exists a simple formula to calculate any given element of Pascal's pyramid. Where n is the row number and k is the column number:<br /><br />n! / (k! * (n - k)!)<br /><br />Since we want the fourth diagonal, k = 3. (counting starts at 0)<br /><br />For the first day, n = 3, since the first 3 rows do not have a 4th column.<br /><br />Second day -> n = 4<br />Third day -> n = 5<br />etc.<br /><br />Hence the general formula for the number of presents is:<br /><br />(n + 2)! / (3! * (n - 1)!) =<br />((n+2)*(n+1)*n)/6DaniĆ«lnoreply@blogger.comtag:blogger.com,1999:blog-9182705499898252496.post-90557998345706430912011-12-23T12:50:49.679-05:002011-12-23T12:50:49.679-05:00Tim,
That step is more of a leap now that you men...Tim,<br /><br />That step is more of a <i>leap</i> now that you mention it. I'll edit in at least a link for explanation this evening. Thanks a lot for sending me such a great puzzle. I love stuff like this.Bill the Lizardhttp://www.blogger.com/profile/09810099093752485841noreply@blogger.comtag:blogger.com,1999:blog-9182705499898252496.post-13713056196054004552011-12-23T07:31:06.971-05:002011-12-23T07:31:06.971-05:00Well, sure, if you already know the formula for th...Well, sure, if you already know the formula for the sum of the first n squares, then it's easy :) I solved it this way: I knew it would be cubic, because it was going to be a sum of squares, so I wrote four simultaneous equations for the first four terms:<br /><br />ax^3 + bx^2 + cx + d = sum<br />f(1) = 1 = a + b + c + d<br />f(2) = 4 = 8a + 4b + 2c + d<br />etc.<br /><br />It's pretty easy to solve that way.<br /><br />There are some other ways here:<br />http://www.trans4mind.com/personal_development/mathematics/series/sumNaturalSquares.htm<br />and here:<br />http://www.wikihow.com/Solve-Recurrence-RelationsTim Kingtonhttp://www.blogger.com/profile/10758168537980658917noreply@blogger.com