{"id":71,"date":"2012-01-30T20:43:00","date_gmt":"2012-01-30T12:43:00","guid":{"rendered":"https:\/\/andy9999678.me\/blog\/?p=71"},"modified":"2021-09-29T07:47:50","modified_gmt":"2021-09-28T23:47:50","slug":"%e7%94%a8%e8%92%99%e7%89%b9%e5%8d%a1%e7%bd%97%e6%96%b9%e6%b3%95%e8%a7%a3%e5%86%b3-monty-hall-problem-%e4%b8%89%e9%97%a8%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/andy9999678.me\/blog\/archives\/71","title":{"rendered":"\u7528\u8499\u7279\u5361\u7f57\u65b9\u6cd5\u89e3\u51b3 Monty Hall problem (\u4e09\u95e8\u95ee\u9898)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6628\u665a(\u4eca\u65e9?)\u7761\u4e0d\u7740\u89c9\uff0c\u5c31\u5f00\u59cb\u60f3\u4e0b\u5b66\u671f\u8981\u5b66\u7684\u6982\u7387\u8bba\u7684\u90a3\u4e9b\u4e8b\u4e86\uff0c\u60f3\u7740\u60f3\u7740\u5c31\u60f3\u5230\u4e86\u8457\u540d\u7684<a href=\"https:\/\/zh.wikipedia.org\/zh-cn\/%E8%92%99%E6%8F%90%E9%9C%8D%E7%88%BE%E5%95%8F%E9%A1%8C\">\u5c71\u7f8a\u4e0e\u6c7d\u8f66\u7684\u95ee\u9898<\/a>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"180\" height=\"100\" src=\"https:\/\/andy9999678.me\/blog\/wp-content\/uploads\/2021\/09\/Monty_open_door.png\" alt=\"\" class=\"wp-image-73\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u5927\u610f\u662f\u8fd9\u6837\uff0c\u67d0\u7535\u89c6\u8282\u76ee\u91cc\u6709\u8fd9\u6837\u7684\u573a\u666f\uff1a\u4e09\u4e2a\u95e8\u540e\u9762\u968f\u673a\u5730\u653e\u6709\u4e24\u53ea\u5c71\u7f8a\u548c\u4e00\u8f86\u6c7d\u8f66\u3002\u53c2\u8d5b\u8005\u53ef\u4ee5\u968f\u673a\u9009\u51fa\u4e00\u6247\u95e8\uff08\u5f53\u7136\u76ee\u6807\u662f\u6c7d\u8f66\u4e0d\u662f\u5c71\u7f8a\uff09\uff1b\u5f53\u9009\u624b\u505a\u51fa\u9009\u62e9\u540e\uff0c\u77e5\u9053\u8f66\u5177\u4f53\u5728\u54ea\u6247\u95e8\u540e\u7684\u4e3b\u6301\u4eba\u6253\u5f00\u4e00\u6247\u540e\u9762\u6709\u5c71\u7f8a\u7684\u95e8\u3002\u8fd9\u662f\u9009\u624b\u53ef\u4ee5\u9009\u62e9\u66f4\u6362\u81ea\u5df1\u7684\u9009\u62e9\u6216\u8005\u4e0d\u6362\u3002\u95ee\u9898\u662f\uff0c\u505a\u51fa\u54ea\u4e00\u4e2a\u9009\u62e9\u540e\u66f4\u5bb9\u6613\u7684\u5230\u6c7d\u8f66\u5462\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5927\u591a\u6570\u4eba\u90fd\u4f1a\u8fd9\u6837\u601d\u8003\u95ee\u9898\uff1a\u5728\u4e3b\u6301\u4eba\u6253\u5f00\u6709\u5c71\u7f8a\u7684\u95e8\u4e4b\u524d\uff0c\u9009\u624b\u62ff\u5230\u6c7d\u8f66\u7684\u6982\u7387\u4e3a1\/3\uff1b\u800c\u4e3b\u6301\u4eba\u6392\u9664\u4e00\u4e2a\u9519\u8bef\u9009\u9879\u540e\uff1b\u76f8\u5f53\u4e8e\u5728\u4e24\u4e2a\u91cc\u9762\u968f\u673a\u62bd\u4e00\u4e2a\uff0c\u6982\u7387\u4e5f\u5c31\u53d8\u62101\/2\u4e86\uff0c\u56e0\u6b64\u6362\u4e0e\u4e0d\u6362\u7684\u6982\u7387\u662f\u4e00\u6837\u7684\uff1b\u90fd\u662f1\/2\u3002\u6628\u665a\u6211\u5927\u6982\u5c31\u662f\u8fd9\u4e48\u60f3\u7684\uff0c\u4f46\u53c8\u77e5\u9053\u7b54\u6848\u662f\u6362\u6bd4\u4e0d\u6362\u597d\uff0c\u56e0\u800c\u7ea0\u7ed3\u4e86\u597d\u4e45\u2026\u2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a5\u4e0b\u6765\u6211\u4eec\u8bd5\u7740\u7f16\u4e2a\u7a0b\u5e8f\u6765\u6a21\u62df\u4e0b\u8fd9\u4e2a\u8fc7\u7a0b\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"cpp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#include &lt;stdio.h>\n#include &lt;math.h>\n#include &lt;time.h>\n#include &lt;stdlib.h>\n#include &lt;iostream>\n\nusing namespace std;\n\nint main() {\n  int car,choice,change,no_change,open;\n  change=0;no_change=0;\n  int a[3],goat[2];\n  srand(time(NULL));\n  cout &lt;&lt; \"#tchoicetcartopentchangetno_changen\";\n\n  for (int t=0;t&lt;500;t++){\n    for (int i=0;i&lt;3;i++) a[i]=0;\n    choice = rand()%3;\n    car = rand()%3;\n\n    a[car] = 1;\n    goat[0] = (car+1)%3;\n    goat[1] = (car+2)%3;\n\n    if (choice == car){\n      open = goat[rand()%2];\n      cout &lt;&lt; t &lt;&lt; \"t\" &lt;&lt; choice+1 &lt;&lt; \"t\" &lt;&lt; car+1 &lt;&lt; \"t\" &lt;&lt; open+1 &lt;&lt; \"tt*n\";\n      no_change++;\n    }\n    else{ \/\/ choice &lt;> car\n      if (choice == goat[0]) open = goat[1];\n      else open = goat[0];\n      cout &lt;&lt; t &lt;&lt; \"t\" &lt;&lt; choice+1 &lt;&lt; \"t\" &lt;&lt; car+1 &lt;&lt; \"t\" &lt;&lt; open+1 &lt;&lt; \"t*n\";\n      change++;\n    }\n  }\n\n  cout &lt;&lt; \"============================n\" &lt;&lt; \"Sum: n\" &lt;&lt; \"Change: \" &lt;&lt; change &lt;&lt; \"nNo_change: \" &lt;&lt; no_change &lt;&lt; \"n\";\n}<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"597\" height=\"442\" src=\"https:\/\/andy9999678.me\/blog\/wp-content\/uploads\/2021\/09\/mot1.png\" alt=\"\" class=\"wp-image-76\" srcset=\"https:\/\/andy9999678.me\/blog\/wp-content\/uploads\/2021\/09\/mot1.png 597w, https:\/\/andy9999678.me\/blog\/wp-content\/uploads\/2021\/09\/mot1-300x222.png 300w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u8bbe\u7f6e\u7684\u6a21\u62df\u6b21\u6570\u662f500\uff0c\u7ed3\u679c\u8868\u793a\uff0c\u6362\u9009\u9879\u6210\u529f345\u6b21\uff0c\u4e0d\u6362\u6210\u529f155\u6b21\u3002\u5177\u4f53\u7ed3\u679c\u53c2\u89c1\u4e0b\u9762\u94fe\u63a5\u3002<\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/andy9999678.me\/blog\/wp-content\/uploads\/2021\/09\/result.txt\">result.txt<\/a><a href=\"https:\/\/andy9999678.me\/blog\/wp-content\/uploads\/2021\/09\/result.txt\" class=\"wp-block-file__button\" download>\u4e0b\u8f7d<\/a><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a5\u7740\u505a\u4e24\u4e2a\u89e3\u91ca\uff1a<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">1. \u6b63\u786e\u7b54\u6848\u662f\u4ec0\u4e48<\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">\u5176\u5b9e\u900f\u8fc7\u4ee3\u7801\u6211\u4eec\u4e5f\u53ef\u4ee5\u77e5\u9053\u8fd9\u91cc\u5e94\u8be5\u5206\u4e3a\u4e24\u79cd\u60c5\u51b5\u8ba8\u8bba\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5982\u679c\u6211\u4eec\u7b2c\u4e00\u6b21\u5c31\u9009\u4e2d\u4e86\u6c7d\u8f66\uff08\u8fd9\u91cc\u7684\u6982\u7387\u662f 1\/3\uff09\uff0c\u90a3\u4e48\u4e3b\u6301\u4eba\u4f1a\u968f\u673a\u4ece\u4e24\u53ea\u5c71\u7f8a\u91cc\u9009\u51fa\u4e00\u53ea\u3002\u8fd9\u662f\u663e\u7136\u5982\u679c\u6362\u4e86\u5c31\u9519\u8fc7\u6c7d\u8f66\u4e86\uff0c\u5e94\u8be5\u4e0d\u6362\uff1b<\/li><li>\u5982\u679c\u6211\u4eec\u7b2c\u4e00\u6b21\u9009\u62e9\u5c71\u7f8a\uff08\u8fd9\u4e2a\u6982\u7387\u4e3a2\/3\uff09\uff0c\u90a3\u4e48\u4e3b\u6301\u4eba\u4e00\u5b9a\u4f1a\u6253\u5f00\u53e6\u4e00\u5220\u540e\u9762\u6709\u5c71\u7f8a\u7684\u95e8\uff1b\u8fd9\u662f\u5269\u4e0b\u6700\u540e\u4e00\u6247\u95e8\u540e\u9762\u5c31\u4e00\u5b9a\u662f\u6c7d\u8f66\u3002\u8fd9\u65f6\u66f4\u6362\u9009\u9879\u5c31\u4f1a\u6210\u529f\u3002<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u6b64\uff0c\u66f4\u6362\u662f\u5426\u6210\u529f\u5b8c\u5168\u5728\u4e8e\u7b2c\u4e00\u6b21\u662f\u5426\u9009\u9519\uff0c\u90a3\u4e48\u6982\u7387\u4e5f\u5c31\u662f 2\/3\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">2. \u4e3a\u4ec0\u4e48 1\/2 \u662f\u9519\u8bef\u7684<\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u6211\u4eec\u53ef\u4ee5\u518d\u56de\u5230\u4e0a\u9762\u770b\u4e00\u4e0b\u90a3\u4e2a\u901a\u4fd7\u7684\u9519\u8bef\u89e3\u91ca\u3002\u201c<strong>\u4e3b\u6301\u4eba\u6392\u9664\u4e00\u4e2a\u9519\u8bef\u9009\u9879\u540e\uff1b\u76f8\u5f53\u4e8e\u5728\u4e24\u4e2a\u91cc\u9762\u968f\u673a\u62bd\u4e00\u4e2a\uff0c\u6982\u7387\u4e5f\u5c31\u53d8\u6210 1\/2 \u4e86<\/strong>\u201d \u800c\u5b9e\u9645\u4e0a\uff0c\u8fd9\u91cc\u663e\u7136\u9009\u624b\u6ca1\u6709\u518d\u6b21\u505a<strong>\u968f\u673a<\/strong>\u9009\u62e9\u7684\u80fd\u529b\uff0c\u800c\u53ea\u662f\u9009\u62e9\u201c\u6362\u201d\u6216\u8005\u662f\u201c\u4e0d\u6362\u201d\u3002\u6bd4\u5982\u8bf4\uff0c\u5982\u679c\u53c2\u8d5b\u8005\u77e5\u9053\u7b54\u6848\uff0c\u5b83\u7b2c\u4e00\u6b21\u4e00\u5b9a\u80fd\u9009\u4e2d\u6c7d\u8f66\u7684\u8bdd\uff0c\u90a3\u4e48\u7b2c\u4e8c\u6b21\u673a\u4f1a\u5373\u4f7f\u770b\u8d77\u6765\u662f\u201c\u5728\u4e24\u4e2a\u91cc\u9762\u968f\u673a\u62bd\u4e00\u4e2a\u201d\uff0c\u4e0d\u6362\u7684\u6982\u7387\u5c31\u662f1\uff1b\u800c\u4e0d\u662f1\/2\u3002\u53ef\u4ee5\u8bf4\uff0c\u8fd9\u4e2a\u9519\u8bef\u7684\u89e3\u91ca\u91cc\u6df7\u6dc6\u4e86\u6982\u7387\u4e0e\u7ed3\u679c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><br>\u5982\u679c\u8fd8\u662f\u5f88\u96be\u7406\u89e3\u7684\u8bdd\uff0c\u53ef\u4ee5\u628a\u95ee\u9898\u62bd\u8c61\u6210\u5c0f\u7403\u5e76\u6269\u5c55\u5230 5 (n) \u4e2a\u3002\u5047\u8bbe\u6709 4 \u4e2a\u767d\u7403 1 \u4e2a\u9ed1\u7403\uff0c\u5f53\u968f\u673a\u62bd\u51fa\u4e00\u4e2a\u540e\uff0c<strong>\u786e\u5b9a<\/strong>\u5730\u62ff\u51fa 3 (n-2) \u4e2a\u767d\u7403\u3002\u90a3\u4e48\u5269\u4e0b\u7684\u90a3\u4e2a\u6ca1\u88ab\u62ff\u8d70\u7684\u7403\u662f\u9ed1\u7403\u7684\u6982\u7387\u4e0d\u5c31\u662f\u7b2c\u4e00\u6b21\u62bd\u5230\u767d\u7403\u7684\u6982\u7387\uff0c\u4e5f\u5c31\u662f 4\/5 (1-1\/n)\u4e86\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u95ee\u9898\u4e5f\u6709\u4eba\u53eb\u505a\u739b\u4e3d\u83b2\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u95ee\u9898\u662f\u56e0\u4e3a\u4e16\u754c\u4e0a\u667a\u5546\u6700\u9ad8\u7684\u4eba<a rel=\"noreferrer noopener\" href=\"https:\/\/zh.wikipedia.org\/zh-cn\/%E7%91%AA%E9%BA%97%E8%93%AE%C2%B7%E6%B2%83%E6%96%AF%C2%B7%E8%8E%8E%E5%87%A1%E7%89%B9\" target=\"_blank\">\u739b\u4e3d\u83b2<\/a>\u7ed9\u51fa\u4e86\u8fdd\u53cd\u76f4\u89c9\u7684\u6b63\u786e\u89e3\u7b54\u540e\u624d\u5f15\u8d77\u5e7f\u6cdb\u7684\u8ba8\u8bba\u7684\u3002<a rel=\"noreferrer noopener\" href=\"http:\/\/www.marilynvossavant.com\/articles\/gameshow.html\" target=\"_blank\">\u8fd9\u91cc<\/a>\u662f\u5979\u7684\u7f51\u7ad9\u4e0a\u8bb0\u5f55\u7684\u8ba8\u8bba\uff0c\u53ef\u4ee5\u770b\u5230\u65e0\u6570\u7684 PhD \u5012\u5728\u7684\u8fd9\u91cc\u2026\u2026<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6628\u665a(\u4eca\u65e9?)\u7761\u4e0d\u7740\u89c9\uff0c\u5c31\u5f00\u59cb\u60f3\u4e0b\u5b66\u671f\u8981\u5b66\u7684\u6982\u7387\u8bba\u7684\u90a3\u4e9b\u4e8b\u4e86\uff0c\u60f3\u7740\u60f3\u7740\u5c31\u60f3\u5230\u4e86\u8457\u540d\u7684\u5c71\u7f8a\u4e0e\u6c7d\u8f66\u7684\u95ee\u9898\u3002 \u5927\u610f\u662f &hellip; <a href=\"https:\/\/andy9999678.me\/blog\/archives\/71\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u7528\u8499\u7279\u5361\u7f57\u65b9\u6cd5\u89e3\u51b3 Monty Hall problem (\u4e09\u95e8\u95ee\u9898)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-71","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/andy9999678.me\/blog\/wp-json\/wp\/v2\/posts\/71","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/andy9999678.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andy9999678.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andy9999678.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/andy9999678.me\/blog\/wp-json\/wp\/v2\/comments?post=71"}],"version-history":[{"count":2,"href":"https:\/\/andy9999678.me\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions"}],"predecessor-version":[{"id":77,"href":"https:\/\/andy9999678.me\/blog\/wp-json\/wp\/v2\/posts\/71\/revisions\/77"}],"wp:attachment":[{"href":"https:\/\/andy9999678.me\/blog\/wp-json\/wp\/v2\/media?parent=71"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andy9999678.me\/blog\/wp-json\/wp\/v2\/categories?post=71"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andy9999678.me\/blog\/wp-json\/wp\/v2\/tags?post=71"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}