- Time
27-Jan-2005 8:11 AM - Post link

It's extremely nerdy, so continue at your own risk. Risk of us nerds.

- Time
27-Jan-2005 8:11 AM - Post link

It's extremely nerdy, so continue at your own risk. Risk of us nerds.

- Time
27-Jan-2005 8:19 AM - Post link

- Time
27-Jan-2005 8:35 AM - Post link

At some point, you're going to have two guys with points, the counter and some other guy. In order to transfer them, the one will have to go directly before the other. On any two days, each has a 1 in 100 chance of being selected. The consecutive chance is 1 in 10,000, even if you are trying every single day (which you can't, because the day holds a variable). So, even to do just that last exchange, I can't see how it is mathematically possible to average 3,000 days?

Daniel, have you found a solution to this, or am I just too pessimistic about the probability? Does the math work out like the "two people in the room with the same birthday" problem? No...it can't. Hmmm...

- Time
27-Jan-2005 8:39 AM - Post link

QuoteOriginally posted by:Starboy

Daniel, have you found a solution to this, or am I just too pessimistic about the probability? Does the math work out like the "two people in the room with the same birthday" problem? No...it can't. Hmmm...

It dosen't, because it's like throwing a dice twice and getting sequential numbers.

It's a good probability problem, the "same birthday" one... It's one of those "I can't belive this is the answer" problems.

- Time
27-Jan-2005 12:21 PM - Post link

- Time
27-Jan-2005 2:26 PM - Post link

It completed during Phase 3 - which is when you'll normally expect it to complete.

- Time
27-Jan-2005 3:20 PM - Post link

- Time
27-Jan-2005 4:15 PM - Post link

That's using these settings:

Phase1: 30, 20, 18, 16, 15.

Phase2: 750, 450, 400, 250.

Phase3: 450. (450,450,450,450).

It could be possible to do better by tweaking Phase3 further, something like:

Phase3: 550, 350, 350, 450.

Phase1:

Get counter.

Get as many people as possible on zero, by creating other members with counts.

Phase 2:

Group the tokens together in powers of 2. Starting at 2 and ending at 16.

Phase 3:

Count all remaining tokens.

For Phase 3 to work you need to allocate time to count all the 16 grouped tokens to the counter, then all the (remaining) 8 ones, 4 ones, 2 ones and then all the single tokens (there shouldn't be any, but it can happen that there is).

- Time
27-Jan-2005 4:15 PM - Post link

So that's why you have the standard count, so he knows how many to add. Interesting...

- Time
27-Jan-2005 5:11 PM - Post link

- Time
27-Jan-2005 11:11 PM - Post link

Phase 1:

For days 1 to n-1 of an n day cycle:

1. If the light is off and you have one token then remove it and leave the light off.

2. If the light is off and you have zero tokens then turn the light on and add to your count DayNumber - n. Turn the light on. If this was the first cycle then you are now the counter.

3. If the light is off and you are the counter then turn it on. Add Daynumber - n to your count.

4. There is an exception to the above, and that is if on day two of the first cycle a prisoner enters the room for the second time, then he should turn on the light but not pick up his token or designate himself the counter.

5. If on day 3 of the first cycle the light is on, then it means exactly one person has been in the room before you. Therefore add one to your count, and designate yourself the counter.

For day n of an n day cycle:

1. If the light is off then add daynum - n to your total. If this was the first cycle then you are now the counter.

2. If the light is on and this is the last cycle in Phase1 and your count is one and you are not the counter, then leave the light on and your count is now zero.

3. If the light is on, failing any or all of the above conditions then turn it off.

Phase 2:

For days 1 to n-1 of an n day cycle:

For non-counters:

1. If the light is off and you have an odd number of tokens, then remove one token and turn the light on.

2. If the light is on and you have an odd number of tokens, then add one token and turn the light off.

For the counter:

1. If the light is on then switch it off and add one token to the count.

The last day of the cycle:

1. If the light is on and you are not the counter and you have an odd number of tokens, then remove one token and leave the light on.

2. If the light is on, then add one token and turn the light off.

Phase 3:

This is the shortest phase in code. But good luck following it! It works in my head and there isn't any errors in it (like dropping counts and changeovers), I'll try to explain how it works as a set of rules later, but for now:

- Time
27-Jan-2005 11:19 PM - Post link

- Time
28-Jan-2005 12:54 AM - Post link

QuoteWell he has to know in which specified period the switch was turned on. If the light is on at the end of such a period then the person visiting on the last day must take the tokens. He can, however, turn the light switch on, or leave it on on such days if he leaves the required number of tokens in the light switch.Originally posted by:Starboy

You have two variable holders: the lightbulb and the day. If the counter does not need to know when the light switch was turned on, all he has is the lightbulb variable...

So that's why you have the standard count, so he knows how many to add. Interesting...

It is complicated in algorithm form, but on a 1-to-1 basis as described above the prisoners need only follow a set of easy rules. The way I've written them above is generic, the rules they would need to follow are very easy.

- Time
28-Jan-2005 2:25 AM - Post link

- Time
28-Jan-2005 2:20 PM - Post link

- Time
28-Jan-2005 6:16 PM - Post link

QuoteOriginally posted by:DanielB

Here are the full rules for each phase:

Phase 1:

For days 1 to n-1 of an n day cycle:

1. If the light is off and you have one token then remove it and leave the light off.

2. If the light is off and you have zero tokens then turn the light on and add to your count DayNumber - n. Turn the light on. If this was the first cycle then you are now the counter.

3. If the light is off and you are the counter then turn it on. Add Daynumber - n to your count.

this, to me makes no sense. Lets say that the 1st cycle is 20 days. Lets also say on day 10 someone goes into the room for the 2nd time and the light is off. According to your directions, that person is supposed to add to their count(which I guess starts out at zero, you don't indicate where the count starts at), the daynumber(which is 10)-n(which is 20).

0+(10-20)= -10????????????

- Time
29-Jan-2005 10:38 AM - Post link

QuoteOriginally posted by:WarblerQuoteOriginally posted by:DanielB

Here are the full rules for each phase:

Phase 1:

For days 1 to n-1 of an n day cycle:

1. If the light is off and you have one token then remove it and leave the light off.

2. If the light is off and you have zero tokens then turn the light on and add to your count DayNumber - n. Turn the light on. If this was the first cycle then you are now the counter.

3. If the light is off and you are the counter then turn it on. Add Daynumber - n to your count.

this, to me makes no sense. Lets say that the 1st cycle is 20 days. Lets also say on day 10 someone goes into the room for the 2nd time and the light is off. According to your directions, that person is supposed to add to their count(which I guess starts out at zero, you don't indicate where the count starts at), the daynumber(which is 10)-n(which is 20).

0+(10-20)= -10????????????

Starts out at one.

Yeah I think you got a point, isn't it N - daynumber?

- Time
29-Jan-2005 5:22 PM - Post link

count+(Daynumber-(daynumber of 1st day of current cycle))

if the count starts at 0

(using prevous example) 0 + (10-1)=9

- Time
29-Jan-2005 5:44 PM - Post link

Phase 1:

For days 1 to n-1 of an n day cycle, and where m = number of the 1st day of the n day cycle:

1. If the light is off and you have one token then remove it and leave the light off.

2. If the light is off and you have zero tokens then turn the light on and add to your count DayNumber - m. Turn the light on. If this was the first cycle then you are now the counter.

3. If the light is off and you are the counter then turn it on. Add Daynumber - m to your count.

- Time
29-Jan-2005 5:45 PM - Post link

- Time
30-Jan-2005 4:33 AM - Post link

- Time
4-Feb-2005 2:28 AM - Post link

- Time
4-Feb-2005 8:19 PM - Post link

- Time
4-Feb-2005 8:24 PM - Post link

- Time
5-Feb-2005 5:25 AM - Post link

**62,001** members have started **23,159** topics with **1,147,768** posts since **March 10, 2003**

Site content Copyright © 2003-2023 TEH Innernets LLC. Please read our Terms of Service.

originaltrilogy.com is not affiliated with Lucasfilm, 20th Century Fox, or Disney. All Star Wars content, images, and likenesses are the property of their respective copyright owner.

We ❤️ Star Wars and give it all the moneys. Please don't sue us.