證明題1提(通信解題)

2014-11-06 4:45 am

阿 (ㄚ)里 (ㄌㄧˇ)巴 (ㄅㄚ)巴 (ㄅㄚ)試圖潛入山洞,在山洞入口處立著一面鼓,鼓的側面有4個孔,在每個孔的裡面靠近孔口處各裝有一個開關,開關有上和下兩種狀態。如果4個開關的狀態全都一致,洞門即可打開。允許將手伸入任意兩個孔,觸摸開關以了解其狀態,並可隨意改變或不改變其狀態。但每當這樣做了之後,鼓就飛快地轉動起來,以至在停轉之後無法確認剛才觸動了哪些開關。現允許重複這種步驟10次,求證阿里巴巴必能進入山洞。

回答 (2)

2014-11-07 7:33 pm
1.如果4個開關的狀態全都一致,洞門即可打開。
不必等10次都玩完嗎?

2.允許將手伸入任意兩個孔,觸摸開關以了解其狀態,並可隨意改變或不改變其狀態。
可以改變多次 再將手那出來嗎?

2014-11-07 11:33:41 補充:

0.設定:
+ 命名4洞各為,12點,3點,6點,與9點
+ 命名2狀態為0與1
1.step 1:test(12,6)
1a. if(0,0) set to (1,1)
1b. if(1,1) set to (0,0)
1c. if(0,1) set to (1,1)
1d. if(1,0) set to (1,1)

2.step 2: test(6,9)
case from 1a: (1x0+3x1)
2aa. if(0,0) impossible
2ab. if(0,1) set to (1,1) then open (end)
2ac. if(1,0) set to (1,1) then open (end)
2ad. if(1,1) set to (1,0)

case from 1b: (3x0+1x1)
same as case 1a but reverse 0 and 1

case from 1c:
2ca. if(0,0) set to (1,1) then open (end)
2cb. if(0,1) set to (1,1)
2cc. if(1,0) set to (1,1)
2cd. if(1,1) do nothing
Notes: all these 3 cases now have 1x0 and 3x1

from 1d:
case 1d is the same as case 1c above.

3. step 3: test(12,6)
case from 2ad: (2x0+2x1 - 0101 or 0011)
3ada. if(1,0) do nothing
3adb. if(0,1) do nothing
3adc. if(0,0) set to (1,1) then open (end)
3add. if(1,1) set to (0,0) then open (end)

case from 2cb,2cc,2cd: (1x0+3x1)
3cba. if(0,0) impossible
3cbb. if(0,1) set to (1,1) then open (end)
3cbc. if(1,0) set to (1,1) then open (end)
3cbd. if(1,1) set to (0,1) go to step 3, case from 2ad.
Notes: 2x0 + 2x1 but not sure if cross(0101) or side(0011) - go to step2 continue case 2ad.

4. step 4: test(6,9)
case from 3ada:
4adaa. if(0,0) set to (1,1) then open (end)
4adab. if(0,1) impossible
4adac. if(1,0) impossible
4adad. if(1,1) set to (0,0) then open (end)

case from 3adb: (same as 3ada)
4adba. if(0,0) set to (1,1) then open (end)
4adbb. if(0,1) impossible
4adbc. if(1,0) impossible
4adbd. if(1,1) set to (0,0) then open (end)

2014-11-07 11:41:15 補充:
4adab. if(0,1) impossible (X) -> change to if(0,1) set to (1,0)
4adac. if(1,0) impossible (X) -> change to if(1,0) set to (0,1)
4adbb. if(0,1) impossible (X) -> change to if(0,1) set to (1,0)
4adbc. if(1,0) impossible (X) -> change to if(1,0) set to (0,1)

2014-11-07 11:44:29 補充:
after 4adab 4adac 4adbb 4adbc, it must be 2x0+2x1 (0101)

step 5: test (12,6)
a. if(0,0) set to (1,1) open
b. (0,1) and (1,0) impossible
c. if(1,1) set to (0,0) open
2014-11-06 7:26 pm
樓主盡問些怪問題
頗ㄏ


收錄日期: 2021-04-27 21:29:14
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20141105000015KK04639

檢視 Wayback Machine 備份