Timeline for 100 Prisoners and a light bulb
Current License: CC BY-SA 3.0
62 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 10, 2018 at 19:44 | answer | added | Xcali | timeline score: 1 | |
May 10, 2018 at 10:31 | answer | added | user78881 | timeline score: 0 | |
Nov 1, 2016 at 16:07 | history | reopened |
Peter Taylor user45941 user41805 Laikoni xenia |
||
Nov 1, 2016 at 3:03 | review | Reopen votes | |||
Nov 1, 2016 at 16:07 | |||||
Oct 25, 2016 at 15:22 | history | edited | jacksonecac | CC BY-SA 3.0 |
added 29 characters in body
|
Oct 25, 2016 at 14:58 | comment | added | jacksonecac | This needs re-opened or deleted. I cannot do either. | |
Oct 25, 2016 at 14:51 | history | edited | jacksonecac | CC BY-SA 3.0 |
added 1 character in body
|
Oct 25, 2016 at 12:18 | history | edited | jacksonecac | CC BY-SA 3.0 |
added 21 characters in body
|
Oct 25, 2016 at 11:53 | history | edited | jacksonecac | CC BY-SA 3.0 |
added 24 characters in body
|
Oct 25, 2016 at 11:42 | history | edited | jacksonecac | CC BY-SA 3.0 |
added 1474 characters in body
|
Oct 25, 2016 at 7:42 | history | edited | Peter Taylor | CC BY-SA 3.0 |
Clarify
|
Oct 24, 2016 at 19:40 | review | Reopen votes | |||
Oct 25, 2016 at 6:39 | |||||
Oct 24, 2016 at 17:08 | history | closed |
Peter Taylor mbomb007 NoOneIsHere jacksonecac user41805 |
Needs details or clarity | |
Oct 24, 2016 at 16:40 | comment | added | trichoplax is on Codidact now |
The comment "n is set to 99 when the leader has entered the room for the last time ... the program should exit and return the number of iterations, n. " means "always output 99", which isn't what is intended. This is just a typo, but it's these little things that need to be tidied up to avoid confusing people. We're getting there but this isn't ready yet.
|
|
Oct 24, 2016 at 16:38 | comment | added | trichoplax is on Codidact now | It seems that we now know what the requirement is, but the challenge wording doesn't make that clear for new people arriving, so it needs to be edited to be short, clear and unambiguous. | |
Oct 24, 2016 at 16:03 | answer | added | Peter Taylor | timeline score: 2 | |
Oct 24, 2016 at 15:30 | comment | added | mbomb007 | Correct. But it wasn't clear from your description of the challenge. "Repeat this process until all elements are true and output how many iterations there were." - this description is wrong | |
Oct 24, 2016 at 15:27 | comment | added | jacksonecac | @mbomb007 that depends entirely on when you increment n. Which should only be when the leader is in the room. n is set to 99 when the leader has entered the room for the last time and when he counts to 99. Once he counts to 99, the program should exit and return the number iterations, n. | |
Oct 24, 2016 at 15:24 | comment | added | mbomb007 |
@jacksonecac The leader doesn't know "magically" when the 99th prisoner has turned on the light. The leader is chosen randomly, so you have to wait for the leader to be chosen and see that the light is on for the 99th time. We're just trying to be clear for users who might try to implement the algorithm wrong. The prisoners are not freed until the leader has entered the room and counted 99 , which is different than checking whether every prisoner has been in the room and flipped the light with your code.
|
|
Oct 24, 2016 at 15:13 | answer | added | mbomb007 | timeline score: 2 | |
Oct 24, 2016 at 15:12 | comment | added | jacksonecac | @mbomb007 not free and count < 99 are synonymous. You can't be free if count < 99 and you can't be in prison if count > 98 | |
Oct 24, 2016 at 15:11 | comment | added | mbomb007 |
@jacksonecac So it's not while (not free) {...} , it's really while (count < 99) {...} , and you have to increment that count whenever the leader turns off the light.
|
|
Oct 24, 2016 at 15:09 | history | edited | jacksonecac | CC BY-SA 3.0 |
deleted 75 characters in body
|
Oct 24, 2016 at 15:08 | comment | added | jacksonecac | @mbomb007 so the i.e. is correct the definition isn't. | |
Oct 24, 2016 at 15:07 | comment | added | mbomb007 |
@jacksonecac That's not true. The light will be turned on by the 99th prisoner, and the leader has already entered the room, but needs to enter again after the light was turned on the 99th time in order to count the last prisoner, even though they've all been in the room. Also, it's probably helpful to note in the question that if you're doing it right, you should be getting a number ~10000 . The algorithm is probably O(n^2)
|
|
Oct 24, 2016 at 15:06 | comment | added | jacksonecac | @Emigna no it isn't as the leader will be the last random chosen index. | |
Oct 24, 2016 at 15:05 | review | Close votes | |||
Oct 24, 2016 at 17:08 | |||||
Oct 24, 2016 at 15:02 | history | edited | jacksonecac | CC BY-SA 3.0 |
added 56 characters in body
|
Oct 24, 2016 at 14:59 | comment | added | trichoplax is on Codidact now | I believe "the number of times a prisoner enters the room after the prisoners have gained their freedom" is intended to mean "the total number of times a prisoner has entered the room when the prisoners gain their freedom". The current phrasing gives a meaning that is almost opposite, so I feel this challenge would benefit from being on hold longer while this is discussed. | |
Oct 24, 2016 at 14:54 | comment | added | jacksonecac | They do not keep entering no.. while(not free){iterate, n++} return n; | |
Oct 24, 2016 at 14:53 | comment | added | Peter Taylor | Do they not stop entering the room when they're free? | |
Oct 24, 2016 at 14:51 | history | edited | jacksonecac | CC BY-SA 3.0 |
deleted 43 characters in body
|
Oct 24, 2016 at 14:51 | comment | added | jacksonecac | @PeterTaylor Output the number of times a prisoner enters the room after the prisoners have gained their freedom. n iterations. | |
Oct 24, 2016 at 14:49 | comment | added | Peter Taylor |
"Output the number of times a prisoner enters the room after it is guaranteed they have all been in the room at least once." Huh? Guaranteed by what process? Don't they claim their freedom once it's guaranteed that they've all been in the room at least once, so that the output would be 0 unconditionally?
|
|
Oct 24, 2016 at 14:42 | comment | added | trichoplax is on Codidact now | If the edit is to correct a previous unclear wording, then it would be better to remove the previous wording and just settle on one new wording that is unambiguous. The old versions are all stored in the edit history, so it isn't necessary to have "Edit" as a heading - you can simply rewrite and delete anything no longer required. | |
Oct 24, 2016 at 14:30 | history | reopened |
jacksonecac edc65 Wheat Wizard♦ mbomb007 Emigna |
||
Oct 24, 2016 at 14:26 | history | edited | mbomb007 | CC BY-SA 3.0 |
deleted 1 character in body
|
Oct 24, 2016 at 14:09 | comment | added | jacksonecac | Hopefully the new edit makes things a little more clear. | |
Oct 24, 2016 at 13:57 | review | Reopen votes | |||
Oct 24, 2016 at 14:34 | |||||
Oct 24, 2016 at 13:56 | history | edited | jacksonecac | CC BY-SA 3.0 |
added 47 characters in body
|
Oct 24, 2016 at 13:55 | comment | added | Luis Mendo | @trichoplax Good point. I was about to point out the same, but the linked post explains it much better | |
Oct 24, 2016 at 13:54 | comment | added | trichoplax is on Codidact now | It's worth considering this meta post on non observable requirements. Is it a requirement that code follows the steps described and uses the same method? Or is any code that gives output with the equivalent probability distribution valid? | |
Oct 24, 2016 at 13:52 | comment | added | Luis Mendo | The hidden quoted block seems to be essential rather than optional. I think it should be a non-hidden quoted block. Also, in this challenge I find it hard to decide when an answer is correct | |
Oct 24, 2016 at 13:50 | comment | added | trichoplax is on Codidact now | I don't mind how long it takes to get it clear, or how many edits. There's no rush. | |
Oct 24, 2016 at 13:48 | comment | added | trichoplax is on Codidact now | @edc65 The sentence didn't make immediately clear to me what the meaning was, so I'd like to see it replaced with an unambiguous one. Removing such ambiguities will make the challenge read more smoothly, which will increase the number of people who answer, which is better for everyone. | |
Oct 24, 2016 at 13:48 | comment | added | edc65 | In fact, after the edit it's so less clear. The first few paragraph of the added section are a total mess. From the initial text, is seems that the leader is chosen at random from the 100 prisoners, but now ... I cannot tell | |
Oct 24, 2016 at 13:43 | comment | added | edc65 |
I have some problems reading the challenge (and the edit). Probably due to difficulties with the english language. But overall the challenge seems clear. @trichoplax do you really not understand Randomly select one element from an array of 100 where one is the leader as Randomly select one element from an array of 100 so that this one is the leader ?
|
|
Oct 24, 2016 at 13:41 | history | edited | jacksonecac | CC BY-SA 3.0 |
added 84 characters in body
|
Oct 24, 2016 at 13:34 | comment | added | trichoplax is on Codidact now | For future challenges, I recommend leaving them in the sandbox for a few days to gather feedback before posting here on main. I've done this for all of my challenges except one, and that one didn't go well... I find the sandbox works well for fine tuning and potentially making changes that are harder to make after posting. | |
Oct 24, 2016 at 13:29 | comment | added | trichoplax is on Codidact now |
Randomly select one element from an array of 100 where one is the leader For this I wasn't sure if "one is the leader" meant that one should also be randomly selected, or whether the leader is always at index 1.
|
|
Oct 24, 2016 at 13:25 | history | edited | jacksonecac | CC BY-SA 3.0 |
added 673 characters in body
|
Oct 24, 2016 at 13:25 | history | closed |
manatwork TuxCrafting Emigna trichoplax is on Codidact now AdmBorkBork |
Needs details or clarity | |
Oct 24, 2016 at 13:24 | comment | added | trichoplax is on Codidact now | What needs to be quick is putting on hold. That prevents any answers so then improvements can be made slowly until it's ready. I've just read through and decided it isn't yet clear to me, so I've voted to put on hold as unclear. That was the urgent bit. Now I can take the time to try and explain what I found unclear so the challenge can be edited and then reopened. | |
Oct 24, 2016 at 13:20 | comment | added | jacksonecac | @trichoplax point taken, however a close vote and a comment is much more helpful to the OP to make corrects faster and easier. | |
Oct 24, 2016 at 13:19 | history | edited | jacksonecac | CC BY-SA 3.0 |
added 673 characters in body
|
Oct 24, 2016 at 13:15 | comment | added | trichoplax is on Codidact now | Better a close vote with no explanation than nothing at all. If it results in the question being put on hold then a reason will be displayed, and others can comment with suggestions for improvement. The idea of putting on hold is to prevent answers coming in until the challenge is ready, so answers aren't invalidated by any changes that need to be made to the wording. It's a positive thing. | |
Oct 24, 2016 at 13:13 | comment | added | edc65 | It's probably not clear what is asked. I'll try to add an answer, but I'm not too sure too | |
Oct 24, 2016 at 12:31 | review | Close votes | |||
Oct 24, 2016 at 13:25 | |||||
Oct 24, 2016 at 12:24 | comment | added | jacksonecac | @Lembik I would hope so, I am watching the close votes pile up and as I read my question over and over I am struggling to find a reason. | |
Oct 24, 2016 at 12:23 | comment | added | user9206 | Shouldn't the close vote people add some useful comment? | |
Oct 24, 2016 at 12:20 | history | edited | jacksonecac | CC BY-SA 3.0 |
added 24 characters in body
|
Oct 24, 2016 at 12:09 | history | asked | jacksonecac | CC BY-SA 3.0 |