GeeCON Prague 2014*
The moose likes Programming Diversions and the fly likes The next day... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "The next day..." Watch "The next day..." New topic
Author

The next day...

David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

A guy is sentenced to be executed. The judge says "You will be executed some time during the next 7 days. The day you are to die your Executioner will arrive, completely unexpected, and will announce that you will die that day."
The guy's lawyer tells him he's safe, since:
* The Executioner can't turn up on day 7, since the Executioner would be expected (it's supposed to be unexpected)
* Likewise the Executioner can't turn up on day 6, since he can’t turn up on day 7 and therefore he'd be expected on day 6.
* So on, eliminating each day.
Therefore he won't die.
Except that the Executioner turned up on day 4, completely unexpected, and announced his execution.
Please explain
(For some reason this reminds me of the "$25 pizza that costs $27" problem from a while back)
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
listen to the judge not the lawyer?
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
Originally posted by David O'Meara:
* The Executioner can't turn up on day 7, since the Executioner would be expected (it's supposed to be unexpected)

I am not understanding the above sentence.is this really a puzzle or some verbal trick?


MH
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
it seems that the executioner could appear on any of the first 4 days and be unexpected.
  • 7th day - cannot appear because that is the last possibility
  • 6th day - cannot appear because it would be expected since day 7 is out
  • 5th day - cannot appear becuase it would be expected since days 6 and 7 are out
  • 4th day - CAN appear because he could still appear on the 5th day (which is not completely out because days 6 and 7 follow)
  • 1st - 3rd days - CAN appear because they would all be unexpected


  • [ July 01, 2003: Message edited by: Greg Harris ]

    what?
    David O'Meara
    Rancher

    Joined: Mar 06, 2001
    Posts: 13459

    Originally posted by Capablanca Kepler:
    I am not understanding the above sentence.is this really a puzzle or some verbal trick?

    Possibly just poorly explained.
    I threw the description together from something I partially remembered a while ago.
    SJ Adnams
    Ranch Hand

    Joined: Sep 28, 2001
    Posts: 925
    no, he can appear on day 5.
    on day 5 he could turn up today, or tommorow. you are only sure he won't appear on day 7.
    Greg Harris
    Ranch Hand

    Joined: Apr 12, 2001
    Posts: 1012
    > no, he can appear on day 5
    true, he can appear on day 5... but only if it is day 4. if he does not appear on day 4, then he has to appear on day 5 because he cannot appear on day 7 and therefore cannot appear on day 6 - which forces him to appear on day 5.
    so, the only way he can appear on day 5 is if it is only day 4 and he has not appeared yet. in that case, you do not know if he will appear on day 5 or 6. but, we know that he cannot appear on day 6, and therefore must appear on day 5... which means that he cannot appear on day 5 - unless it is day 4.
    SJ Adnams
    Ranch Hand

    Joined: Sep 28, 2001
    Posts: 925
    true, he can appear on day 5... but only if it is day 4. if he does not appear on day 4, then he has to appear on day 5 because he cannot appear on day 7 and therefore cannot appear on day 6 - which forces him to appear on day 5.
    so, the only way he can appear on day 5 is if it is only day 4 and he has not appeared yet. in that case, you do not know if he will appear on day 5 or 6. but, we know that he cannot appear on day 6, and therefore must appear on day 5... which means that he cannot appear on day 5 - unless it is day 4.

    LOL
    David Hibbs
    Ranch Hand

    Joined: Dec 19, 2002
    Posts: 374
    Originally posted by David O'Meara:
    Therefore he won't die.
    Except that the Executioner turned up on day 4, completely unexpected, and announced his execution.
    Please explain

    The judge knows that the lawyer will figure this out, and explain it to the prisoner. Therefore, the prisoner will expect to never see the executioner. Hence, the executioner can show up *any* day, completely unexpected, and announce the execution. QED.


    "Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
    Michael Morris
    Ranch Hand

    Joined: Jan 30, 2002
    Posts: 3451
    Send him to Texas, the judge won't give him 7 days here.


    Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: The next day...