Talk:100 doors: Difference between revisions

From Rosetta Code
Content added Content deleted
(Task wording)
 
No edit summary
Line 1: Line 1:
An observation: You're actually making 101 passes. 100 mutative, and one for reading the final state. I'm wondering if the wording of the task should be changed, as no way of reporting the final state within the first 100 passes immediately comes to mind. --[[User:Short Circuit|Short Circuit]] 00:14, 7 October 2007 (MDT)
An observation: You're actually making 101 passes. 100 mutative, and one for reading the final state. I'm wondering if the wording of the task should be changed, as no way of reporting the final state within the first 100 passes immediately comes to mind. --[[User:Short Circuit|Short Circuit]] 00:14, 7 October 2007 (MDT)
----
Oddly enough it seems that the only doors left open after all the passes are complete are those which are perfect squares of integers: 1, 4, 9, 16, 25, 36, 49, 64, 81, and 100
Triviallly trying the same code for 1000 doors and 1000 mutative passes seems to suggest that this is true for larger numbers (though its far from proven). I should, undoubtely, do a proper analysis to see if I can prove that it generalizes and explain why.

Revision as of 22:03, 11 October 2007

An observation: You're actually making 101 passes. 100 mutative, and one for reading the final state. I'm wondering if the wording of the task should be changed, as no way of reporting the final state within the first 100 passes immediately comes to mind. --Short Circuit 00:14, 7 October 2007 (MDT)


Oddly enough it seems that the only doors left open after all the passes are complete are those which are perfect squares of integers: 1, 4, 9, 16, 25, 36, 49, 64, 81, and 100 Triviallly trying the same code for 1000 doors and 1000 mutative passes seems to suggest that this is true for larger numbers (though its far from proven). I should, undoubtely, do a proper analysis to see if I can prove that it generalizes and explain why.