Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2015-04-10 07:04:13

khushro
Member
Registered: 2015-04-10
Posts: 2

Starter puzzle on this site "12 Days Of Christmas"

The solution was very disappointing. It was just a straight-forward counting of the number of objects, which even an idiot with a calculator can do. There was nothing puzzling about it.
I was expecting a more mathematical solution, which would give the correct answer for n days instead of 12, and then substitute n=12 in the answer. Would not remain a starter, but would at least be a puzzle.

Offline

#2 2015-04-12 03:45:32

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,592

Re: Starter puzzle on this site "12 Days Of Christmas"

Hi khushro,

Yes, the given solution method is rather starter-ish.

A more satisfying solution exists, however, which by way of a nice mathematical formula in terms of n eliminates all that counting and will instantly display the answer for n (eg, n=12) days.

The formula can be found on the net, but, if you'd like to have a go at constructing it yourself, then here are a couple of hints (should you need them):

Last edited by phrontister (2015-05-20 13:58:17)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#3 2016-06-07 20:15:02

Laatokka
Member
Registered: 2016-06-07
Posts: 1

Re: Starter puzzle on this site "12 Days Of Christmas"

Hi,

And if you want, you can try making a little program smile and modify it

(JavaScript)
var x = 1;
var y = 2;
var days = 1;
var PresentsPerDay = 0;

while (days < 13){
  PresentsPerDay=x+PresentsPerDay;
  x=x+y;
  y++;
  days++;

Offline

#4 2016-06-07 20:55:37

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,592

Re: Starter puzzle on this site "12 Days Of Christmas"

True! up

A similar program in BASIC:

    x=1
    y=2
    d=1
    ppd=0
    WHILE d<13
        ppd=ppd+x
        x=x+y
        y=y+1
        d=d+1
    WEND
    PRINT ppd

And...welcome to the forum! smile

Last edited by phrontister (2016-06-07 23:10:17)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

Board footer

Powered by FluxBB