珍珠湾ART

标题: 囚 犯 问 题 新 版 (自 编 )[:D)] [打印本页]

作者: 野 菜 花    时间: 2005-4-22 23:10
标题: 囚 犯 问 题 新 版 (自 编 )[:D)]

一 个 小 屋 子 里 有 1000个 开 关 , 有 些 开 着 有 些 关 着。 每 天 进 去 一 个 囚 犯 , 必 须 也 只 能 动 15个 开 关 。 如 果 某 一 天 囚 犯 能 把 所 有 的 开 关 关 了 , 他  们 可 以 全 部 获 释 。  典 狱 长 让 他 们 在 开 始 前 讨 论  一 下 , 但 并 不 知 道 有 几 个 开 关 是 开 的。 www.ddhw.com
问 他 们 能 否 商 量 出 一 个 必 胜 的 办 法 ? 
 
(就 是 以 下 开 关 的 题 目 一 般 化 , 但 我 想 大 家 对 囚 犯 比 较 有 同 情 心 , 所 有 会 有 动 力 帮 他 们 想 办 法 。 ) 
www.ddhw.com

 

作者: fzy    时间: 2005-4-22 23:38
标题: 回复:囚 犯 问 题 新 版 (自 编 )[:D)]

Let n = number of current on switches, and a = n mod 15.If a is odd,turn on (15-a)/2 switches and turn off (15+a)/2 switches. If a = 0, turn off 15 switches. If a is even and > 0, turn on 7 and turn off 8 so it becomes odd.

Are there really bad prisoners that should not be released? If so, we change the rule to 14 switches every prizoner, but turn on an odd number of lights at the beginning. :)www.ddhw.com

 

作者: 乱弹    时间: 2005-4-22 23:52
标题: It should be OK.

In the first round, the prisoners enter the room and change the statuses of the lights following this simple rule: shut off a light whenever possible.  Then everybody can predict the process, and after this round, everybody know the current number of lights that are on.
 
Then now we have simplified the problem. There are many algorithms to finish the work. The worst one might be this: in every round, the total effect is to shut off one light People of odd numbers shut off lights, and the others turn on lights). This method would keep the poor prisoners in the prison for aquite a long time (985*15 days, which is roughly 42 or 43 years).
www.ddhw.com

 

作者: 野 菜 花    时间: 2005-4-23 00:50
标题: [:))]原来的题目的题目没人理,一变成囚犯题马上就有解了,看来大家对囚犯都很同情呀!

   原来的题目的题目没人理,一变成囚犯题马上就有解了,看来大家对囚犯都很同情呀!





作者: 野 菜 花    时间: 2005-4-23 00:54
标题: You are really saviour of those poor prisoners! [:

Using you method, in at most 68 days, all of them can be released!!
www.ddhw.com

 

作者: 野 菜 花    时间: 2005-4-23 01:04
标题: 回复:It should be OK.

Probabilty you think they deserve to stay there longer, you give them hope but let them be patient.
www.ddhw.com

 





欢迎光临 珍珠湾ART (http://zzwav.com/) Powered by Discuz! X3