CTK Exchange
Front Page
Movie shortcuts
Personal info
Awards
Reciprocal links
Terms of use
Privacy Policy

Interactive Activities

Cut The Knot!
MSET99 Talk
Games & Puzzles
Arithmetic/Algebra
Geometry
Probability
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
My Logo
Math Poll
Other Math sites
Guest book
News sites

Recommend this site

Manifesto: what CTK is about Search CTK Buying a book is a commitment to learning Table of content Products to download and subscription Things you can find on CTK Chronology of updates Email to Cut The Knot Recommend this page

CTK Exchange

Subject: "100 prisoners and a light bulb"     Previous Topic | Next Topic
Printer-friendly copy     Email this topic to a friend    
Conferences The CTK Exchange This and that Topic #634
Reading Topic #634
iliaden
Member since Aug-14-05
Aug-14-05, 05:18 PM (EST)
Click to EMail iliaden Click to send private message to iliaden Click to view user profileClick to add this user to your buddy list  
"100 prisoners and a light bulb"
 
   A few years ago, I have encountered this problem, and ever since I haven't been able to find the most optimal solution.

This is the problem:

There are 100 prisoners in solitary cells. There's a central living room with one light bulb; this bulb is initially off. No prisoner can see the light bulb from his or her own cell. Everyday, the warden picks a prisoner equally at random, and that prisoner visits the living room. While there, the prisoner can toggle the bulb if he or she wishes. Also, the prisoner has the option of asserting that all 100 prisoners have been to the living room by now. If this assertion is false, all 100 prisoners are shot. However, if it is indeed true, all prisoners are set free and inducted into MENSA, since the world could always use more smart people. Thus, the assertion should only be made if the prisoner is 100% certain of its validity. The prisoners are allowed to get together one night in the courtyard, to discuss a plan. What plan should they agree on, so that eventually, someone will make a correct assertion?

I have seen this problem on othe forums, and here are some of the best solutions (to my opinion):

1) At the beginning, the prisoners select a leader. Whenever a person (with the exeption of the leader) comes into a room, he turns the lights on. If the lights are already on, he does nothing. When the leader goes into the room, he turns off the lights. When he will have turned off the lights 99 times, he is 100% sure that everyone has been in the room.

2)wait 3 years, and with a great probability say that everyone has been in the room.

Does anyone know The optimal solution???

I have taken this problem from the www.ocf.berkeley.edu site, but I believe that you can find it on many others.


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top

  Subject     Author     Message Date     ID  
100 prisoners and a light bulb iliaden Aug-14-05 TOP
  RE: 100 prisoners and a light bulb alexb Aug-14-05 1
     RE: 100 prisoners and a light bulb mr_homm Aug-17-05 2
         RE: 100 prisoners and a light bulb alexb Aug-17-05 3
             RE: 100 prisoners and a light bulb Sheridan Aug-18-05 4
             RE: 100 prisoners and a light bulb mr_homm Aug-18-05 5
                 RE: 100 prisoners and a light bulb alexb Aug-18-05 6
                     RE: 100 prisoners and a light bulb mr_homm Aug-19-05 7
                     RE: 100 prisoners and a light bulb sfwc Aug-21-05 8
                         RE: 100 prisoners and a light bulb mr_homm Aug-29-05 9
                             RE: 100 prisoners and a light bulb mr_homm Aug-29-05 10
                                 RE: 100 prisoners and a light bulb sfwc Sep-21-05 12
         RE: 100 prisoners and a light bulb alexb Nov-03-05 24
             RE: 100 prisoners and a light bulb mr_homm Nov-04-05 25
                 RE: 100 prisoners and a light bulb alexb Nov-04-05 26
                     RE: 100 prisoners and a light bulb mr_homm Nov-05-05 27
                         RE: 100 prisoners and a light bulb alexb Nov-08-05 28
     RE: 100 prisoners and a light bulb alexb Sep-08-05 11
         RE: 100 prisoners and a light bulb Rod Hartfeil Sep-28-05 13
             RE: 100 prisoners and a light bulb ramsey2879 Sep-29-05 14
                 RE: 100 prisoners and a light bulb Rod H. Oct-03-05 18
             RE: 100 prisoners and a light bulb iliaden Sep-29-05 15
                 RE: 100 prisoners and a light bulb Ramsey2879 Sep-30-05 16
                     RE: 100 prisoners and a light bulb iliaden Sep-30-05 17
                 RE: 100 prisoners and a light bulb Rod H. Oct-04-05 19
                     RE: 100 prisoners and a light bulb iliaden Oct-16-05 20
                         RE: 100 prisoners and a light bulb ramsey2879 Oct-27-05 21
                             RE: 100 prisoners and a light bulb iliaden Oct-30-05 23
  RE: 100 prisoners and a light bulb Mendozas Oct-30-05 22
     RE: 100 prisoners and a light bulb Ghigginson Feb-04-07 29
     RE: 100 prisoners and a light bulb Ghigginson Feb-04-07 30
         RE: 100 prisoners and a light bulb The Dog Feb-05-07 31
  RE: 100 prisoners and a light bulb ryani Apr-23-07 32
  RE: 100 prisoners and a light bulb mmc May-31-07 33
  RE: 100 prisoners and a light bulb maryam Jul-28-07 34
  RE: 100 prisoners and a light bulb mpdlc Jul-31-07 35
  100 prisoners and a light bulb: trivial solution al_q Aug-02-07 36
  RE: 100 prisoners and a light bulb Arup Roy Sep-25-07 37
  RE: 100 prisoners and a light bulb spags Mar-28-08 38

Conferences | Forums | Topics | Previous Topic | Next Topic
alexb
Charter Member
2209 posts
Aug-14-05, 07:29 PM (EST)
Click to EMail alexb Click to send private message to alexb Click to view user profileClick to add this user to your buddy list  
1. "RE: 100 prisoners and a light bulb"
In response to message #0
 
   >A few years ago, I have encountered this problem, and ever
>since I haven't been able to find the most optimal solution.
>
>This is the problem:
>
>There are 100 prisoners in solitary cells. There's a
>central living room with one light bulb; this bulb is
>initially off. No prisoner can see the light bulb from his
>or her own cell. Everyday, the warden picks a prisoner
>equally at random, and that prisoner visits the living room.
>While there, the prisoner can toggle the bulb if he or she
>wishes. Also, the prisoner has the option of asserting that
>all 100 prisoners have been to the living room by now. If
>this assertion is false, all 100 prisoners are shot.
>However, if it is indeed true, all prisoners are set free
>and inducted into MENSA, since the world could always use
>more smart people. Thus, the assertion should only be made
>if the prisoner is 100% certain of its validity. The
>prisoners are allowed to get together one night in the
>courtyard, to discuss a plan. What plan should they agree
>on, so that eventually, someone will make a correct
>assertion?

The problem is indeed popular. It's even included in P. Winkler's Mathematical Puzzles, which is a recommended book in any event. Winkler also lists a slew of sources where the problem appeared, including ibm.com and a newsletter of the MSRI.

The solution is this:

The prisons select a fellow, say Alice, who will have a special responsibility. All other prisoners behave according to the same protocol: each turns the light off twice, i.e. they turn it off the first two times they find it on. They leave it untouched thereafter. Alice turns the light on if it was off and, additionally, counts the number of times she entered the room with the light off. When her count reaches 2n - 3 she may claim with certainty that all n prisoners have been to the room.


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
mr_homm
Member since May-22-05
Aug-17-05, 03:53 PM (EST)
Click to EMail mr_homm Click to send private message to mr_homm Click to view user profileClick to add this user to your buddy list  
2. "RE: 100 prisoners and a light bulb"
In response to message #1
 
   >
>The solution is this:
>
>The prisons select a fellow, say Alice, who will have a
>special responsibility. All other prisoners behave according
>to the same protocol: each turns the light off twice, i.e.
>they turn it off the first two times they find it on. They
>leave it untouched thereafter. Alice turns the light on if
>it was off and, additionally, counts the number of times she
>entered the room with the light off. When her count reaches
>2n - 3 she may claim with certainty that all n
>prisoners have been to the room.

This would work of course, but is it optimal? For instance, this would also work, I think:

Alice counts the times she finds the light on, and ensures that it is always off when she leaves the room. Everyone else turns on the light the first time they find it off, and then never touches it again. This way, between visits of Alice, at most one prisoner will turn on the light, and no prisoner turns it on more than once. Therefore the number of times Alice finds the light on is no more than the number of different prisoners that have entered the room. Each prisoner knows he has been counted once he has turned the light on, since he is the only one who touched the switch since Alice last visited. When Alice counts to n-1, she knows everyone has visited the room.

What does optimal mean here? It could only reasonably mean that the prisoners are freed in the shortest time. So what is the expected time they must wait until Alice has counted to n-1? This is a rather elaborate calculation in probability, so the prisoners turn to the actuary (who is in prison for embezzlement) for some answers.

He explains that using Bayes theorem, P(X|Y)*P(Y) = P(X&Y) = P(Y|X)*P(X) and the linearity of expected value, E(X|Y)*P(Y) + E(X|~Y)*P(~Y) = E(X) you can calculate the expected time in prison like this:

Suppose Alice has just visited the room, and let K be the number of days that pass before her next visit (so she visits again K+1 days from now), let n be the number of prisoners, let c be the number of times she has found the light on so far, and let P(ON) and P(OFF) be the probabilities that she finds the light on or off on her next visit. Then E(K)=1/n, P(K=k) = 1/n*((n-1)/n)^k, P(K=k|OFF) = 1/n*(c/n)^k, which are fairly obvious.

Bayes theorem then gives P(K=k|OFF) = (1-c/n)*(c/n)^k, and from this you can calculate E(K|OFF) = c/(n-c). and linearity gives E(K|ON) = ((n-1)(n-c)-c/(n-c))/(n-c-1). Now let m be the number of times Alice visits and L be the number of days that pass before she next finds it on. Each time she finds it is off, c does not change, so all the calculations regarding the time until her next visit also do not change.

Therefore, the expected number of days until she next finds the light on is found by summing over all possible m to get the expected total time wasted on visits where the light is off, plus the expected time for the one visit where it was on. This gives E(L) = (1+E(K|ON))P(ON) + sum(m(1+E(K|OFF))P(OFF)^m = n(1/(n-c-1) - 1/(n-c) + 1 - 1/(n-c)^2).

Now we know how long we expect to wait from count = c to count = c+1. Therefore, we must sum this up from c=0 to c=n-2 to find the total expected time E(T). The result is E(T) = n^2 - n/(n-1) - a, where a = sum(1/c^2) from 2 to n. Putting n=100 into this gives 9935.5 days, which is 26.2 years.

But (continues the actuary) this is absurdly long to wait. Simple probability shows that we can be almost certain much sooner than this. The probability that on day d the count is c is P(c,d), which is obviously equal to P(c-1,d-1)*(1-(c-1)/n) + P(c,d-1)*(c/n). Of course, P(0,0) = P(1,1) = 1 and P(1,0) = 0, so we can recursively calculate the probability P(n,d). It turns out that P(100,1146) = 0.999, and P(100,1375) = 0.9999, P(100,1604) = 0.99999, and P(1833) = 0.999999. That means that in 3.14 years, we have a less than 1/1000 chance of failing, and in exactly 5 years and a week, we have less than one in a million chances of failing. I say we should wait 5 years and then say "let us out, we've all seen the light."

As they are about to kill Alice (who was already a member of Mensa) for coming up with a crazy plan to keep them in prison for 26 years, the game theorist (who is in prison for insider trading on the stock market) steps in to point out that this is a losing move. If they kill her now she will never go into the room, and the warden will keep them here forever.

In the happy ending, they let Alice live, and they all get out of prison in 5 years. Strangely, they all decline to join Mensa, preferring to enter actuarial training.

--Stuart Anderson


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
alexb
Charter Member
2209 posts
Aug-17-05, 09:22 PM (EST)
Click to EMail alexb Click to send private message to alexb Click to view user profileClick to add this user to your buddy list  
3. "RE: 100 prisoners and a light bulb"
In response to message #2
 
   >This would work of course, but is it optimal? For instance,
>this would also work, I think:

It's a pleasure seeing you having fun.

>Alice counts the times she finds the light on, and ensures
>that it is always off when she leaves the room. Everyone
>else turns on the light the first time they find it off, and
>then never touches it again. This way, between visits of
>Alice, at most one prisoner will turn on the light, and no
>prisoner turns it on more than once. Therefore the number
>of times Alice finds the light on is no more than the number
>of different prisoners that have entered the room. Each
>prisoner knows he has been counted once he has turned the
>light on, since he is the only one who touched the switch
>since Alice last visited. When Alice counts to n-1, she
>knows everyone has visited the room.

The problem may be in that the original state of the light is not known. You must account for both possibilities.

Your approach will work if originally the light was off. If it was on and Alice counted it as 1, she is bound to cause an action no one of her fellow prisoners would appreciate. However, if she decides to skip the first count and originally the light was off, she will never reach the revelation point.

>
>What does optimal mean here? It could only reasonably mean
>that the prisoners are freed in the shortest time.

Or, perhaps, the least count that would assure the prisoner release.



  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
Sheridan
guest
Aug-18-05, 07:58 AM (EST)
 
4. "RE: 100 prisoners and a light bulb"
In response to message #3
 
   A simple way around the problem of not knowing the original state of the light is to say that the person who enters the room on the first day turns the light off.
They then start the procedure from day two (with the person who first entered the room "resetting")


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
mr_homm
Member since May-22-05
Aug-18-05, 01:29 PM (EST)
Click to EMail mr_homm Click to send private message to mr_homm Click to view user profileClick to add this user to your buddy list  
5. "RE: 100 prisoners and a light bulb"
In response to message #3
 
   >
>The problem may be in that the original state of the light
>is not known. You must account for both possibilities.
>
In the problem as stated here by Iliaden, the bulb was initially off. Perhaps there are other variants of this problem on the internet with different starting assumptions, such as an unknown initial bulb state, and the solution you presented is for one of those.

>Your approach will work if originally the light was off. If
>it was on and Alice counted it as 1, she is bound to cause
>an action no one of her fellow prisoners would appreciate.
>However, if she decides to skip the first count and
>originally the light was off, she will never reach the
>revelation point.
>
Actually, this is easy to fix. Just add a rule that whoever is picked to go to the room the first day must turn out the light, and then revert to the original rules starting from day 2. This adds one day to their 26.2 year wait.

By the way, I am thinking of this problem as a programming problem, in which there is a controlling process (Alice) that receives a series of 1-bit semaphore flags from some other processes in a message register which is only checked occasionally. Since she can only receive 1 bit, and there is no possibility of somehow encoding extra information into only 1 bit, at most one other prisoner can send her a signal. She must reset the register to a known state so that she can detect the next flag sent, and the other prisoners must not overwrite each other's flags, so only one prisoner may touch the switch between visits from Alice. It was this line of thinking that led me to set up the prisoners' protocol the way I did. This is also where the idea came from in the paragraph just above this one: I am simply initializing the register. It's just "startup code."
>>
>>What does optimal mean here? It could only reasonably mean
>>that the prisoners are freed in the shortest time.
>
>Or, perhaps, the least count that would assure the prisoner
>release.

Well, yes, now that you mention it, although of course the shortest time to freedom would be more to the prisoners' taste. I suspect that the least count would also be the shortest time, but this is not completely clear. For example, Alice needs to count to n-1 in my solution, 2n-3 in yours, but since each prisoner turns the light switch twice, she is twice as likely to detect a signal in the solution you presented, and therefore will increment her count more often. Possibly both solutions lead to approximately the same total waiting time.

Another type of optimality occurs to me now: minimizing the amount of information the other prisoners have to remember. In one solution each prisoner has to remember which of 2 states he is in (I have turned on the light 0 or 1 times before), and in the other, which of 3 states he is in (I have turned on the light 0, 1, or 2 times before). In human terms, the prisoners might forget after a lapse of years, whether they turned the light on once or twice (disastrous!), but they are less likely to forget whether they turned it on at all. In programming terms, the other processes need an internal buffer to hold their current state, and this buffer is smaller (1 bit) with two states than with three states (2 bits). The Alice process needs n states instead of 2n-2 as well.

Come to think of it, this question would make a good problem assignment for an electrical engineering course: design a set of interacting finite state machines with a shared one bit register that solve this problem. In order to do this, they must be good at translating outcome requirements into protocols and protocols into hardware. Of course, most students don't like to be challenged this much, so they would probably complain that the assignment was "unfair."

--Stuart Anderson


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
alexb
Charter Member
2209 posts
Aug-18-05, 03:31 PM (EST)
Click to EMail alexb Click to send private message to alexb Click to view user profileClick to add this user to your buddy list  
6. "RE: 100 prisoners and a light bulb"
In response to message #5
 
   >>The problem may be in that the original state of the light
>>is not known. You must account for both possibilities.
>>
>In the problem as stated here by Iliaden, the bulb was
>initially off.

I missed that. I just recognised the problem "holistically", as I remembered it from some time ago, without actually reading it.

>Perhaps there are other variants of this
>problem on the internet with different starting assumptions,
>such as an unknown initial bulb state, and the solution you
>presented is for one of those.

Does not look like it. The only discernable difference (besides the initial condition) is that the prisoners are sent to that room "infinitely often, but in a some arbitrary order determined by their jailer." Curious why Winkler settled for 2 actions instead of 1.

>>Your approach will work if originally the light was off. If
>>it was on and Alice counted it as 1, she is bound to cause
>>an action no one of her fellow prisoners would appreciate.
>>However, if she decides to skip the first count and
>>originally the light was off, she will never reach the
>>revelation point.
>>
>Actually, this is easy to fix. Just add a rule that whoever
>is picked to go to the room the first day must turn out the
>light, and then revert to the original rules starting from
>day 2. This adds one day to their 26.2 year wait.

Right.

>By the way, I am thinking of this problem as a programming
>problem, in which there is a controlling process (Alice)
>that receives a series of 1-bit semaphore flags from some
>other processes in a message register which is only checked
>occasionally.

Winkler spends 1.5 page proving an additional fact that, for n > 2 there could be only 1 controlling process, in the sense that an arrangement wherewith more than 1 fellow gets a chance to determine with certainty that all prisoners went to the room is impossible.

Now, at the risk of appearing denser than I really am, let me quote from your message:

"Suppose Alice has just visited the room, and let K be the number of days that pass before her next visit (so she visits again K 1 days from now), let n be the number of prisoners, ... Then E(K)=1/n,..."

I would assume that, as n grows, the wait period grows as well. Thus E(K)=1/n does not seem right.


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
mr_homm
Member since May-22-05
Aug-19-05, 06:07 AM (EST)
Click to EMail mr_homm Click to send private message to mr_homm Click to view user profileClick to add this user to your buddy list  
7. "RE: 100 prisoners and a light bulb"
In response to message #6
 
   >Winkler spends 1.5 page proving an additional fact that, for n > 2
>there could be only 1 controlling process

That's interesting; it never occured to me to consider more. I should think it was fairly obvious that only one is possible. Ultimately, some single counter (let's say Alice but it could be any of them) must become certain that all the prisoners have visited the room. If there is more than one counter, this information must come at least partly by communication from the other counters. But there is only one channel of communication, and it only holds one bit, so there is no way for a counter to know whether a signal is coming from another counter or a regular prisoner. Therefore it is impossible for a counter to respond differently to another counter than to a prisoner, so the counter must simply increment her count, just as she would with an regular prisoner.

Therefore the only signal a counter can send to another counter means "increment your count." Her only choice is of the circumstances under which to send it. If she is to transmit to other counters the number of prisoners she has counted, she must signal once for each such prisoner. But she has no control over who receives the signal--in fact, she may receive it herself, and will have no way to know. Therefore, she might increment her own count, and thus overcount the prisoners. This of course destroys the whole scheme.

>I would assume that, as n grows, the wait period grows as
>well. Thus E(K)=1/n does not seem right.

Thanks, that was my mistake. I worked this out on a blackboard, misread my own handwriting and typed what I saw. It should be E(K)=n-1, which I misread as n^(-1) and typed as 1/n, completely obscuring the connection to the original. The calculations are of course based on the correct value, n-1.

I see that Sheridan beat me to posting the way around the problem of an indeterminate initial bulb state. That's what I get for taking so long writing without checking the page for updates.

--Stuart Anderson


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
sfwc
Member since Jun-19-03
Aug-21-05, 03:25 PM (EST)
Click to EMail sfwc Click to send private message to sfwc Click to view user profileClick to add this user to your buddy list  
8. "RE: 100 prisoners and a light bulb"
In response to message #6
 
   >Winkler spends 1.5 page proving an additional fact that, for
>n > 2 there could be only 1 controlling
>process, in the sense that an arrangement wherewith more
>than 1 fellow gets a chance to determine with certainty that
>all prisoners went to the room is impossible.
In the situation where the bulb is initially off (or the first prisoner knows (s)he is first so can turn it off, and there are three prisoners, all three may use the following strategy:

If the first time you see the bulb it is on, turn it off and then never change it again. When you next see it on, declare that all prisoners have visited the room.

If the first time you see the bulb it is off, turn it on and then never change it again.

Then certainly they will be freed, but there is no controlling process. It is possible to set up strategies with no controlling process in all the variations I am aware of. However, there are some variations in which there must be a single process which obeys different rules to the others.

Thankyou

sfwc
<><


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
mr_homm
Member since May-22-05
Aug-29-05, 03:13 PM (EST)
Click to EMail mr_homm Click to send private message to mr_homm Click to view user profileClick to add this user to your buddy list  
9. "RE: 100 prisoners and a light bulb"
In response to message #8
 
   >If the first time you see the bulb it is on, turn it off and
>then never change it again. When you next see it on, declare
>that all prisoners have visited the room.
>
>If the first time you see the bulb it is off, turn it on and
>then never change it again.
>
>Then certainly they will be freed, but there is no
>controlling process. It is possible to set up strategies
>with no controlling process in all the variations I am aware
>of. However, there are some variations in which there must
>be a single process which obeys different rules to the
>others.
>
>Thankyou
>
>sfwc

Prisoner A enters the room on day one and finds the light off, so he turns it on.
Prisoner B enters the room on day two and finds the light on, so he turns it off and notes that he first saw the light on.
Prisoner C enters the room on day three and finds the light off, so he turns it on.
By chance, Prisoner B is called again to the room on day four, finds the light on, reports that everyone has entered the room, and the prisoners are all killed.

Obviously they cannot all have visited by day 4 if there are 100 prisoners. Am I missing something?

--Stuart Anderson


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
mr_homm
Member since May-22-05
Aug-29-05, 05:10 PM (EST)
Click to EMail mr_homm Click to send private message to mr_homm Click to view user profileClick to add this user to your buddy list  
10. "RE: 100 prisoners and a light bulb"
In response to message #9
 
   @ swfwc:

Never mind; I missed seeing your first paragraph because there was no space between it and the quoted material. Sorry! Your example certainly seems to work for three prisoners. Do you have any examples of strategies that work with many prisoners and yet have no single overall controlling process?

--Stuart Anderson


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
sfwc
Member since Jun-19-03
Sep-21-05, 07:55 PM (EST)
Click to EMail sfwc Click to send private message to sfwc Click to view user profileClick to add this user to your buddy list  
12. "RE: 100 prisoners and a light bulb"
In response to message #10
 
   >Do you have any examples of strategies that work
>with many prisoners and yet have no single overall
>controlling process?
Yes, but in some sense they feel a bit like cheating. For example, suppose there are 100 prisoners using the simplified strategy you suggest in message 2. Suppose further that the warden is annoyed by the pedantry one of the prisoners, a mathmo called Bob. So he hatches a cunning plot. Bob is the first into the switch room, and of course he turns the light on. After this he is called into the switch room remarkably often, indeed so often that there is never any occasion when two other prisoners consecutively enter the switch room.

One day Alice wins them all their freedom by declaring that they have all been in the room. The previous day, of course, Bob was in the switch room. Because he had been in so often, he had gathered a lot of information. As much, in fact, as Alice has the following day. So he knew that everyone had been in the room. But he pedantically stuck to the strategy as given and did not declare this fact. This caused him a good deal of frustration, which was not helped by the warden's evil cackling at the success of his ploy.

Now, with hindsight, Bob concieves of a new strategy, just like the old one except that a person in his situation may declare that everyone has in fact been in the room. Of course this strategy is certain to work, but it now has no single overall controlling process, since any of the prisoners may make the declaration which wins them their freedom. This is an example of such a cheating strategy.

However, it may be shown for some versions of the problem that if there are at least 4 prisoners there is at least one prisoner in any winning strategy who follows a set of rules different to the rules of any other prisoner.

Thankyou

sfwc
<><


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
alexb
Charter Member
2209 posts
Nov-03-05, 01:40 PM (EST)
Click to EMail alexb Click to send private message to alexb Click to view user profileClick to add this user to your buddy list  
24. "RE: 100 prisoners and a light bulb"
In response to message #2
 
   Stuart,

I just remembered of my intention to give your response more publicity than it gets in the forum, as it certainly deserves. I thus made a page out of it, of which I hope you approve.

(http://www.cut-the-knot.org/Probability/LightBulbs.shtml)

Thank you,
Alex


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
mr_homm
Member since May-22-05
Nov-04-05, 12:11 PM (EST)
Click to EMail mr_homm Click to send private message to mr_homm Click to view user profileClick to add this user to your buddy list  
25. "RE: 100 prisoners and a light bulb"
In response to message #24
 
   >Stuart,
>
>I just remembered of my intention to give your response more
>publicity than it gets in the forum, as it certainly
>deserves. I thus made a page out of it, of which I hope you
>approve.

Yes, thank you! I am very happy that you thought well enough of it to include it as a page.

However, I was embarrassed to find that I had made a typo in one of the formulas in my original post:

In the paragraph


Suppose Alice has just visited the room, and let K be the number of days that pass before her next visit (so she visits again K+1 days from now), let n be the number of prisoners, let c be the number of times she has found the light on so far, and let P(ON) and P(OFF) be the probabilities that she finds the light on or off on her next visit. Then E(K) = 1/n, P(K=k) = 1/n·((n-1)/n)^k, P(K = k|OFF) = 1/n·(c/n)^k, which are fairly obvious.

the very last formula should be P(K = k & OFF) = 1/n·(c/n)^k.

Also, since it it now a separate page on its own, it might be nice to clarify one step of the calculation for those who didn't read it in the context of the thread. Since you have to calculate P(OFF) before you can apply Bayes theorem, I would suggest adding the following sentence at the start of the very next paragraph:

"Summing the last formula over all k gives P(OFF) = 1/(n-c)."

Thanks again for making a page out of this.

--Stuart


  Alert | IP Printer-friendly page | Reply | Reply With Quote | Top
alexb
Charter Member
2209 posts
Nov-04-05, 12:18 PM (EST)