• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

On the last day of xmas..

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    On the last day of xmas..

    This is one of my favourite puzzles...

    My true love came to me and said she's a bit hard up this year from being on the bench. Instead of giving me gifts over 12 days, she would give one gift per day. Thus:

    Day 1 (Boxing Day) a partridge in a pear tree.

    as per usual. Then:

    Day 2 a turtle dove
    Day 3 the other turtle dove
    Day 4 another partridge in a pear tree

    which I would have had on the 2nd day. This is followed by:

    Day 5 The first of three French Hens

    and so on.

    Since she intends to start doing this on December 26th this year, on what date will I receive the final gift?

    First to answer gets some bananananas and a sack of kudos.
    Drivelling in TPD is not a mental health issue. We're just community blogging, that's all.

    Xenophon said: "CUK Geek of the Week". A gingerjedi certified "Elitist Tw@t". Posting rated @ 5 lard points

    #2
    January 2nd.

    Originally posted by BrowneIssue View Post
    First to answer gets some bananananas and a sack of kudos.
    Am I the first to answer?

    Comment


      #3
      Originally posted by meridian View Post
      Am I the first to answer?
      Yes, you are. Enjoy both your bananananas.










      Smartarse.
      Drivelling in TPD is not a mental health issue. We're just community blogging, that's all.

      Xenophon said: "CUK Geek of the Week". A gingerjedi certified "Elitist Tw@t". Posting rated @ 5 lard points

      Comment


        #4
        Why thank you.

        Would the answer be Christmas Day?

        (Actually, Christmas Eve because it's Leap Year next year...)

        Comment


          #5
          Originally posted by meridian View Post
          Why thank you.

          Would the answer be Christmas Day?

          (Actually, Christmas Eve because it's Leap Year next year...)
          And you didn't even fall for the Leap Year Gotcha!

          Well done!

          ...



          Your tree's gone...
          Last edited by BrowneIssue; 13 December 2007, 22:47. Reason: Somebody came and nicked your Xmas banananana tree
          Drivelling in TPD is not a mental health issue. We're just community blogging, that's all.

          Xenophon said: "CUK Geek of the Week". A gingerjedi certified "Elitist Tw@t". Posting rated @ 5 lard points

          Comment


            #6
            Originally posted by meridian View Post
            January 2nd.
            Ay?? I make it 12th March
            It's about time I changed this sig...

            Comment


              #7
              Originally posted by MrRobin View Post
              Ay?? I make it 12th March
              12/03/2008? How do you get that result (which is wrong, as was 2nd Jan 2008).
              Drivelling in TPD is not a mental health issue. We're just community blogging, that's all.

              Xenophon said: "CUK Geek of the Week". A gingerjedi certified "Elitist Tw@t". Posting rated @ 5 lard points

              Comment


                #8
                Originally posted by BrowneIssue View Post
                Originally posted by MrRobin View Post
                Ay?? I make it 12th March
                12/03/2008? How do you get that result (which is wrong, as was 2nd Jan 2008).
                Oh, I see.

                a) you forgot days 1 to 11. A day in March 2008 would only be enough days for the gifts originally intended for 12th Day.

                b) Did you start on Xmas Day, rather than Boxing Day?
                Drivelling in TPD is not a mental health issue. We're just community blogging, that's all.

                Xenophon said: "CUK Geek of the Week". A gingerjedi certified "Elitist Tw@t". Posting rated @ 5 lard points

                Comment


                  #9
                  Ahhh. I see now. Sorry I read the question wrong. I didn't realise when you go to a new gift you have to also go back through all the previous gifts too before going onto the next one (just like in the song, Robin.. duh!)

                  OK so it's

                  12 ......n
                  SUM [ SUM(m) ]
                  n=1 ....m=1

                  which is 364 days from Xmas day, since the first day of presents is on Boxing day which is December 23rd (as next year has Feb 29th)
                  It's about time I changed this sig...

                  Comment


                    #10
                    Originally posted by MrRobin View Post
                    Ahhh. I see now. Sorry I read the question wrong. I didn't realise when you go to a new gift you have to also go back through all the previous gifts too before going onto the next one (just like in the song, Robin.. duh!)

                    OK so it's

                    12 ......n
                    SUM [ SUM(m) ]
                    n=1 ....m=1

                    which is 364 days from Xmas day, since the first day of presents is on Boxing day which is December 23rd (as next year has Feb 29th)
                    You are quite right.

                    And I made an absolutely classic error: one of the programmer's fencepost errors.

                    I took 26/12/2007 + 364 presents = last present on 24/12/2008. Which is wrong because present one was given on 26/12/2007, not 27/12/2008.

                    --------------------------------------------------
                    Explanation of fencepost errors follows:

                    1. Between my house and the neighbour's house I want to erect a fence of 1 metre fence panels. The houses are 10 metres apart. How many fenceposts are needed? Nine: because the end two fence panels are secured at the outermost ends against the houses.

                    2. At the bottom of the garden I want to erect a fence of 1 metre fence panels. The garden is 10 metres wide. How many fence posts are needed? Eleven: because each fence panel needs one at the start but the final panel needs a post at the end as well.

                    I started counting the days from 27/12/2007 and should have started form 26/12/2007. So on day zero I receive present one therefore on day 363 I receive present 264. Duh!

                    --------------------------------------------------

                    Mr Robin, you are indeed the brave red-breasted hero at the top of the Christmas banananana Tree. And I am a plank.


                    Well done!


                    ¦

















                    Drivelling in TPD is not a mental health issue. We're just community blogging, that's all.

                    Xenophon said: "CUK Geek of the Week". A gingerjedi certified "Elitist Tw@t". Posting rated @ 5 lard points

                    Comment

                    Working...
                    X