in reply to Re: Suggestions for writing a Perl application
in thread Suggestions for writing a Perl application
The solution is that if two convicts wear a black disk, the third convict knows he has a white disk. But from looking at the backs of the other convicts, the convicts know that there is at most one black disk - and if there's a black disk, it's on their back, and the others see a white and a black disk. However, since noone leaves right away, the ones seeing a black and a white disk will conclude their disk must be white - there cannot be two black disk, and they can leave. But this also doesn't happen, so the premises that one's disk is black is false, ergo, everyone has a white disk.
But as I said, there's a timing problem, and the assumption the others are smart. Usually, this question is asked with perfect logican getting hats or disks to wear, and there is some timing mechanism (for instance, each of them is asked a question in a particular order).
I don't really see a way of demonstrating this puzzle in Perl.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Suggestions for writing a Perl application
by jacques (Priest) on Sep 10, 2003 at 05:55 UTC |