/2616PZ/ :: The Circular Prison of Unknown Size

Background

You are the president of a secret society of mathematicians with n members, including yourself. No one in the society knows what n is. The dictator of the world, in an effort to erase mathematics from human history, has finally managed to capture all n members of the society, and has placed them in prison.
The prison has a funny design. There are n identical soundproof, windowless prison cells arranged in a circle, each containing a mathematician. The cells all have a light switch the prisoners can use, but the wiring system is screwed up, so the switch controls the light bulb in the clockwise neighboring cell. Furthermore, the switch is only capable of delivering a single flash of light at noon each day. Specifically, if this switch is set to "on" at noon, it will flash the next cell, and do nothing otherwise.
The prison warden worries that the prisoners might try to communicate using the lights, so every night at midnight, he fills all of the cells with knockout gas, cleans the cells so they can't communicate by leaving messages, sets all of the light switches to "off", and rearranges the prisoners in whatever fashion he pleases (still one prisoner per cell).

Questions

One day, the warden visits your cell. He confesses that he loves mathematics, and decides to offer your society a game to win their freedom. If any of the prisoners are able to figure out what n is, they may shout out loud "There are n prisoners!" (the cells are monitored with security cameras/mics). If they are correct, all prisoners will go free, and if not, they will all be executed.
The warden allows you to devise a plan for everyone else to follow. He will make n-1 copies of this plan, and allow every other prisoner to read it. The warden of course will also read your plan, and will perform the cell rearrangements in such a way to make it fail if he can.
What plan allows the prisoners to guarantee their freedom?
Extra for Experts: Can you find a plan which doesn't require the prisoners to make random decisions?


Notes

There is no lateral thinking required to solve this. Assume the prisoners have perfect, infinite memory, including knowledge of how many days have elapsed.
The warden is a god, but all you prisoners have unlimited life. :P
It is significant that you are one of the prisoners, and that you devise the plan. It means that while all n?1 other prisoners must follow the same strategy, you may follow a different strategy.
Extra for Experts" condition means there must exist a function B(n) such your plan is guaranteed to stop after B(n) days when there are n prisoners.


Answer

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末芥吟,一起剝皮案震驚了整個濱河市侦铜,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌钟鸵,老刑警劉巖钉稍,帶你破解...
    沈念sama閱讀 216,402評論 6 499
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異棺耍,居然都是意外死亡贡未,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,377評論 3 392
  • 文/潘曉璐 我一進(jìn)店門蒙袍,熙熙樓的掌柜王于貴愁眉苦臉地迎上來羞秤,“玉大人,你說我怎么就攤上這事左敌●埃” “怎么了?”我有些...
    開封第一講書人閱讀 162,483評論 0 353
  • 文/不壞的土叔 我叫張陵矫限,是天一觀的道長哺哼。 經(jīng)常有香客問我,道長叼风,這世上最難降的妖魔是什么取董? 我笑而不...
    開封第一講書人閱讀 58,165評論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮无宿,結(jié)果婚禮上茵汰,老公的妹妹穿的比我還像新娘。我一直安慰自己孽鸡,他們只是感情好蹂午,可當(dāng)我...
    茶點故事閱讀 67,176評論 6 388
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著彬碱,像睡著了一般豆胸。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上巷疼,一...
    開封第一講書人閱讀 51,146評論 1 297
  • 那天晚胡,我揣著相機(jī)與錄音,去河邊找鬼。 笑死估盘,一個胖子當(dāng)著我的面吹牛瓷患,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播遣妥,決...
    沈念sama閱讀 40,032評論 3 417
  • 文/蒼蘭香墨 我猛地睜開眼尉尾,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了燥透?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 38,896評論 0 274
  • 序言:老撾萬榮一對情侶失蹤辨图,失蹤者是張志新(化名)和其女友劉穎班套,沒想到半個月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體故河,經(jīng)...
    沈念sama閱讀 45,311評論 1 310
  • 正文 獨居荒郊野嶺守林人離奇死亡吱韭,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,536評論 2 332
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了鱼的。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片理盆。...
    茶點故事閱讀 39,696評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖凑阶,靈堂內(nèi)的尸體忽然破棺而出猿规,到底是詐尸還是另有隱情,我是刑警寧澤宙橱,帶...
    沈念sama閱讀 35,413評論 5 343
  • 正文 年R本政府宣布姨俩,位于F島的核電站,受9級特大地震影響师郑,放射性物質(zhì)發(fā)生泄漏环葵。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,008評論 3 325
  • 文/蒙蒙 一宝冕、第九天 我趴在偏房一處隱蔽的房頂上張望张遭。 院中可真熱鬧,春花似錦地梨、人聲如沸菊卷。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,659評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽的烁。三九已至,卻和暖如春诈闺,著一層夾襖步出監(jiān)牢的瞬間渴庆,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 32,815評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點兒被人妖公主榨干…… 1. 我叫王不留襟雷,地道東北人刃滓。 一個月前我還...
    沈念sama閱讀 47,698評論 2 368
  • 正文 我出身青樓,卻偏偏與公主長得像耸弄,于是被迫代替她去往敵國和親咧虎。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,592評論 2 353

推薦閱讀更多精彩內(nèi)容