![]() |
||
Junior Member
![]() ![]() ![]() 加入日期: Jul 2002 您的住址: Calgary, Canada
文章: 931
|
引用:
下面箭頭是代表你選的門, 但這個門不能開 點了一下以後開的一個門是題目裡"主持人開的門" 接下來你才能考慮"要換門", 還是"不換門". 這也就是題目重點 我們要計算的是"換門而重獎的機率"和"不換門而重獎的機率" http://members.shaw.ca/cs1986b/chance_experiment.html ![]()
__________________
![]() |
||||||||
![]() |
![]() |
Junior Member
![]() ![]() ![]() 加入日期: Jul 2002 您的住址: Calgary, Canada
文章: 931
|
引用:
不知道您玩了幾次? 我曾經有過玩了100次左右, 結果接近50, 但後來按到快200次後, 機率還是升上去了... 我是說換門的時候 ![]()
__________________
![]() |
|||
![]() |
![]() |
Advance Member
![]() ![]() 加入日期: Apr 2004 您的住址: 楓葉國
文章: 316
|
to bestbuy 兄:
我剛剛做了你寫的程式... 發現... 我前七十次,中獎機率達 100%, 一百次稍微跌到 85% 結果後來完全沒有一次正確... 第兩百次掉到 49%... >_<" 把今天之運都用光啦∼應該去買樂透的... |
![]() |
![]() |
*停權中*
加入日期: Nov 2003 您的住址: Bakersfield
文章: 10
|
引用:
我依然建議你去買樂透,因為如果軟體設計沒問題,而標準答案是66% 的情況下, 試驗200次而只贏49%的幾率是1/5157793 也就是500萬分之一。大概中至少2等獎沒什麼問題 ![]() |
|
![]() |
![]() |
Advance Member
![]() ![]() 加入日期: Apr 2004 您的住址: 楓葉國
文章: 316
|
現在二等獎多少錢呀?
|
![]() |
![]() |
New Member
加入日期: Jun 2002
文章: 7
|
![]() 我算了一下, 中大獎機會應該是2/3. 最主要的是, 主持人開門的時候,
"只能開小獎的門, 不能開大獎的門, 也不能隨機開門". 大家可以看一下我的分析. 你會發現, 如果你永遠選擇換門的話. 你選不中的機 會只會出現在你第一次就選對的情況下. 也就是1/3. 所以, 在這種遊戲規則下, 你選中的機會就是2/3. (大獎在第二扇門跟第三扇門的結果跟第一扇門分析結果一樣) http://ejokeimg.pchome.com.tw/see-p...14&cat=22&rank= 由於小弟沒網路空間可以用, 所以就隨便貼在pchome上. 如果您也認為合理, 請代貼. 引用:
此文章於 2005-04-24 03:09 AM 被 bklin 編輯. |
|
![]() |
![]() |
Junior Member
![]() ![]() ![]() 加入日期: Jul 2002 您的住址: Calgary, Canada
文章: 931
|
引用:
我對那個random number generator沒啥信心 ![]() 程式應該沒錯...但那是臨時寫出來的, 所以... ![]() 看的懂actionscript的就看吧 ====== linkage id: no是那個X yes是那個綠O choice是下面灰色箭頭 door1, door2, door3...that's self-explanatory ====== 代碼:
MovieClip.prototype.fadeTo = function(fa, sa) { //my_mc.fadeTo(final_alpha,speed(smaller is faster)) this.onEnterFrame = function() { this._alpha += (fa-this._alpha)/sa; if ((fa-this._alpha)/sa<0.5 and (fa-this._alpha)/sa>-0.5) { this.onEnterFrame = null; } }; }; randomPlaceAnswer = function () { this.attachMovie("no", "no_mc1", 4, {_x:100, _y:18}); this.attachMovie("no", "no_mc2", 5, {_x:200, _y:18}); this.attachMovie("no", "no_mc3", 6, {_x:300, _y:18}); pos_x = 100+(Math.round(Math.random()*2)*100); this.attachMovie("yes", "yes_mc", 8, {_x:pos_x, _y:18}); }; selectFromTwo = function (a, b) { if (Math.round(Math.random())) { return a; } else { return b; } }; fadeOneDoor = function (x) { if (100*x == this.yes_mc._x) { if (x == 1) { q = selectFromTwo(2, 3); eval("door_mc"+q).fadeTo(20,2) eval("door_mc"+q).enabled = false; } if (x == 2) { q = selectFromTwo(1, 3); eval("door_mc"+q).fadeTo(20,2) eval("door_mc"+q).enabled = false; } if (x == 3) { q = selectFromTwo(1, 2); eval("door_mc"+q).fadeTo(20,2) eval("door_mc"+q).enabled = false; } } else { if (x == 1) { if (this.yes_mc._x == 200) { this.door_mc3.fadeTo(20,2) this.door_mc3.enabled = false; } else { this.door_mc2.fadeTo(20,2) this.door_mc2.enabled = false; } } if (x == 2) { if (this.yes_mc._x == 100) { this.door_mc3.fadeTo(20,2) this.door_mc3.enabled = false; } else { this.door_mc1.fadeTo(20,2) this.door_mc1.enabled = false; } } if (x == 3) { if (this.yes_mc._x == 200) { this.door_mc1.fadeTo(20,2) this.door_mc1.enabled = false; } else { this.door_mc2.fadeTo(20,2) this.door_mc2.enabled = false; } } } }; fadeAllDoor = function () { this.door_mc1.fadeTo(20,2) this.door_mc2.fadeTo(20,2) this.door_mc3.fadeTo(20,2) }; // disableAllDoor = function () { this.door_mc1.enabled = false; this.door_mc2.enabled = false; this.door_mc3.enabled = false; }; enableAllDoor = function () { this.door_mc1.enabled = true; this.door_mc2.enabled = true; this.door_mc3.enabled = true; }; resetDoorAndAnswer = function () { this.door_mc1.onEnterFrame = null this.door_mc2.onEnterFrame = null this.door_mc3.onEnterFrame = null this.door_mc1._alpha = 100; this.door_mc2._alpha = 100; this.door_mc3._alpha = 100; enableAllDoor(); this.choice_mc.removeMovieClip(); firstSelect = false; randomPlaceAnswer(); }; this.attachMovie("door1", "door_mc1", 10, {_x:100, _y:18, _alpha:100}); this.attachMovie("door2", "door_mc2", 11, {_x:200, _y:18, _alpha:100}); this.attachMovie("door3", "door_mc3", 12, {_x:300, _y:18, _alpha:100}); firstSelect = false; randomPlaceAnswer(); resetDoorAndAnswer(); game_count = 0; win_count = 0; // this.door_mc1.onPress = function() { if (!firstSelect) { fadeOneDoor(1); } else { fadeAllDoor(); game_count++; this._parent.game.text = game_count; if (this._parent.yes_mc._x == 100) { win_count++; this._parent.win.text = win_count; } win_prec = Math.round(win_count*100/game_count); this._parent.perc.text = win_prec+"%"; disableAllDoor(); } firstSelect = true; this._parent.attachMovie("choice", "choice_mc", 15, {_x:100, _y:90}); }; this.door_mc2.onPress = function() { if (!firstSelect) { fadeOneDoor(2); } else { fadeAllDoor(); game_count++; this._parent.game.text = game_count; if (this._parent.yes_mc._x == 200) { win_count++; this._parent.win.text = win_count; } win_prec = Math.round(win_count*100/game_count); this._parent.perc.text = win_prec+"%"; disableAllDoor(); } firstSelect = true; this._parent.attachMovie("choice", "choice_mc", 15, {_x:200, _y:90}); }; this.door_mc3.onPress = function() { if (!firstSelect) { fadeOneDoor(3); } else { fadeAllDoor(); game_count++; this._parent.game.text = game_count; if (this._parent.yes_mc._x == 300) { win_count++; this._parent.win.text = win_count; } win_prec = Math.round(win_count*100/game_count); this._parent.perc.text = win_prec+"%"; disableAllDoor(); } firstSelect = true; this._parent.attachMovie("choice", "choice_mc", 15, {_x:300, _y:90}); }; this.restart.onPress = function() { resetDoorAndAnswer(); }; ![]()
__________________
![]() 此文章於 2005-04-24 03:27 AM 被 bestbuy 編輯. |
|
![]() |
![]() |
Regular Member
![]() ![]() 加入日期: Jan 2004
文章: 83
|
|
![]() |
![]() |
Regular Member
![]() ![]() 加入日期: Jan 2004
文章: 83
|
寫了程式之後.. 發現問題的癥結在於
正確答案占了 1~3 中其中一個數字 你的答案也占了 1~3 中一個數字 如果第一次是答錯的話,那麼,也就是說已經占掉了兩個數字,那麼主持人能開的門只有一個! 這個情形在機率上占了 66% ... 重點在於 主持人只能開"你的答案"與"正確答案"以外的那個答案 如果說主持人雖然知道答案,但卻能開"正確答案"以外的所有答案 (包括你的答案,例如你猜1號馬上開一號給你看) 這時的機率才是 50 %(算出來的!樣本大小是 2 的十九次方) 所以這其實是相當 tricky 的問題.... 考的其實是你對文字的敏銳度 此文章於 2005-04-24 04:17 AM 被 b4283 編輯. |
![]() |
![]() |
New Member
加入日期: Jun 2002
文章: 7
|
大約會是一半一半,
正面大約是一千個, 反面剛好是一千個. 答案對嗎? 引用:
|
|
![]() |
![]() |