the trailboss abuses his CodeRanch power for his other stuff (power corrupts. absolute power corrupts absolutely is kinda neat!)
permaculture light bulbs permaculture electric heat permaculture cast iron permaculture wood burning stove permaculture solar food dehydrators
The moose likes Meaningless Drivel and the fly likes Prisoner's doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Meaningless Drivel
Bookmark "Prisoner Watch "Prisoner New topic
Author

Prisoner's doubt

agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
A prisoner is going to be hanged in one of the next 7 days-Monday,Tuesday,Wednesday,Thursday,Friday,Saturday and Sunday.And jailor has said him that he will not be certain of EXACT day on which he is gonna be hanged.Means like on any day,he cant say that he is gonna be hanged on this specific day.
Now he thiks let him calculate probability of each day for me to get hanged.

He starts with Sunday.He thinks that he will be hanged on Sunday ONLY when he is spared on Monday,spared also on Tuesday,also on Wednesday,Thursday,Friday and also on Saturday.Now if he is spared ALSO on Saturday then on Saturday ITSELF,he will come to KNOW that he is gonna be hanged on Sunday means he has known the day of hanging in advancebut it violates jailor's saying.SO HE CAN NOT BE HANGED ON SUNDAY means probability of his hanging on Sunday is 0 means it is IMPOSSIBLE his hanging on Sunday.

So he thinks that he has JUST 6 days of hanging option-Monday yo Saturday!Now he starts calculating probability of Saturday.Hethinks that he will be hanged on Saturday ONLY when he spares from Monday to Friday but if he spares EVEN on Friday then he will come to know IN ADVANCE that he is gonna be hanged on Saturday(Because Sunday is IMPOSSIBLE ) for him to hang.But he thinks that jailor has quoted that he will not be known the day of his hanging in advance.SO,Saturday is also impossible for him to hang on.So now he ias left with only 5 possible options of hanging-Monday to Friday.

Now when he backtraces other possible days,he finds that THERE IS NO POSSIBLE DAY WHEN HIS HANGING WILL TAKE PLACE.

BUT on one fine day,he was taken for hanging and was hanged.SO WHAT IS FLAW IN HIS thinking?

PS:I have tried to explain problem in full detail
Dinesh Bang
Ranch Hand

Joined: Jun 15, 2006
Posts: 52
The prisoner is moving ahead on the time scale,n making his hanging probability decisions accordingly . This is the flaw in his thinking.
We can compare it with the suitation of of getting a particular, say red heart "A" in the set of 52 cards. The probablity here of getting it would be 1/52.
Now if we say we take away any card , not the read heart "A" and now calculate the probablity of getting it, it comes out to be 1/51...n we go on like this with increasing probablity of getting the red heart A.
But here too we are moving along with the time scale of eliminating...the cards.
The same is the case with prisoner , wherein he is eliminating the days, by moving along with the time scale, n hence at end is left with just on day...n feels like he has betrayed death..


SCJP 1.4,SCBCD 1.3, SCWCD 1.5, ???
Bo Yyempeti
Ranch Hand

Joined: Feb 22, 2006
Posts: 111
"Conditional Probability"
agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
The same is the case with prisoner , wherein he is eliminating the days, by moving along with the time scale, n hence at end is left with just on day
By moving along with time scale?
What are chances for of any day for example of Sunday?Only when he fets spared from Monday to Saturday na?So He is just calculating chances for him of hanging.............
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11499
    
  16

His error was in assuming the Jailor didn't lie.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
His error was in assuming the Jailor didn't lie

He he.... But jailor is also logicaaly right!If someone is gonna hang on one of the next 7 days,how can one certain of choosing an exact day?
agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
Hey proceed on this thread na.......It is the question which I have asked to a lot of people from years and no one came with an answer. Seems like it is a question with NO existing answer!...? :roll:
[ July 04, 2006: Message edited by: agrah upadhyay ]
agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
Does it not have really any answer?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18991
    
    8

Are you surprised that there are questions that do not have answers? You shouldn't be.
Aj Mathia
Ranch Hand

Joined: Apr 11, 2003
Posts: 478
In my opinion,
all his assumptions are right on reverse conditional probability.
but on a forward conditional probability there is no way he can assume a situation unless the has faced it.
so for example on a friday he can assume sunday as a clear day but thats on the assumption that he has faced saturday.
Similarly
on friday he has to die and on saturday he has to die too and the same on any other day, but he can die only on one day which contradicts his assumptions.

what do you think?

A meaningless answer would be he was killed at night.

Another would be he was taken out at around midnight to be hung,
he is now certain that he will be hung but was actually hung the next day on the stroke of midnight.
and for the mother of em all he was killed yesterday.


You think you know me .... You will never know me ... You know only what I let you know ... You are just a puppet ... --CMG
agrah upadhyay
Ranch Hand

Joined: Sep 01, 2005
Posts: 579
Another would be he was taken out at around midnight to be hung,
he is now certain that he will be hung but was actually hung the next day on the stroke of midnight.

He he
I too shall answer the same if I am forced to amswer.
R K Singh
Ranch Hand

Joined: Oct 15, 2001
Posts: 5371
Originally posted by agrah upadhyay:
BUT on one fine day,he was taken for hanging and was hanged.SO WHAT IS FLAW IN HIS thinking?


He is getting hanged and you are smiling ..

AW the flaw in prisoner's logic was that he applied only probability, but not permutation and combination.

When he zeroed out Sunday and while zeroing out Saturday he forgot that on Friday , still he may be hanged on Sunday. And samething is true for others day also.
On Tuesday, he may be hanged on Wed/Thu/Fri/Sat/Sun. (he could not be sured)

If he would have applied P & C then he would have got so many choices that he would have died on first day before he was hanged


"Thanks to Indian media who has over the period of time swiped out intellectual taste from mass Indian population." - Chetan Parekh
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Stop this dicussion.One should not make fun out of a dieing person.


My blood is tested +ve for Java.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42946
    
  70
I thought this discussion was about the prisoner not dying?
Steve McClintic
Greenhorn

Joined: Jul 03, 2006
Posts: 14
Originally posted by Paul Clapham:
Are you surprised that there are questions that do not have answers? You shouldn't be.


All questions have answers, whether right or wrong. Some questions probably shouldn't be answered though. "Have you stopped beating your wife? Yes or No"
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
Originally posted by Chetan Parekh:
Stop this dicussion.One should not make fun out of a dieing person.


As long as he's not hanged, he's very much alive and may remain so for an indeterminate interval.
As such he's no different from anyone else (he know he'll die at some point but doesn't know when) and therefore can be made fun of.
Him being a convicted criminal furthermore means he has no right to not be made fun of


42
Devesh H Rao
Ranch Hand

Joined: Feb 09, 2002
Posts: 687

1.he will not be certain of EXACT day on which he is gonna be hanged.Means like on any day,he cant say that he is gonna be hanged on this specific day.
Now he thiks let him calculate probability of each day for me to get hanged.
2.He starts with Sunday


The two statements are contradictory in nature, for the second statement to hold true the first needs to be not valid, and if we take the first statement to hold true there is no way the prisoner can start counting from Sunday which happens to be the last day and has dependencies of probability of him being hung on any previous day being not known which is not the case if the second statement is true in totality

In either case both the statements cannot be true at the same time hence any results borne out of using the two as base will not be valid.

The assumption made by the problem is again another fallacy on lines of 2=3 problem. A result just cannot be based on untrue statements.

PS: The assumption being if a person is not sure of the �EXACT� day of his hanging, he is not sure of his �EXACT� day of not hanging as well.
Devesh H Rao
Ranch Hand

Joined: Feb 09, 2002
Posts: 687

Originally posted by Chetan Parekh:
Stop this dicussion.One should not make fun out of a dieing person.


coz the person does not know when he is going to be hung, he can be made fun of on the days when he will be not hung...

so lets see... start from sunday... can I make fun of him today... so on and so forth...
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
in fact you can make fun of him until the moment the noose tightens
Which is of course why public executions attract such big crowds
 
permaculture playing cards
 
subject: Prisoner's doubt