当前位置:网站首页>Explanation of the answers to the three questions
Explanation of the answers to the three questions
2022-07-03 09:16:00 【Fingering 13】
Answers to three questions
A brief introduction to the three door problem
First , Introduce what is the three door problem . Here you are 3 A box , There is a box with a prize , The other two are empty boxes . We can't see any difference from the outside . Let's choose one at random first , Next , The host opens an empty box , Now do you want to change the box you originally chose ?
The answer is to change the box !
The probability of winning the prize after changing the box is 2/3, The probability of not changing is 1/3.
Is it quite different from our intuition ? The host opens a box , One of the two boxes has a prize , Then our winning rate should not be all 1/2 Do you ?
Tell the truth , The child thought so at the beginning , I didn't understand it even after others gave an answer ( Stupid to death ...) Know that the child wrote a simulation of three questions with the idea of refuting them python experiment ,, The answer really should be changed , Slap your face .
The right way of thinking
When we first selected a box , Our winning probability is 1/3, That's good , But the problem is that we instinctively think that after the host opens a box, the probability of originally belonging to the box will be equally divided into two unopened boxes , The winning rate of these two boxes is 1/2. But is it really OK ? The answer is No .
When we choose a box , The state of this box is different from the other two , We can 3 The boxes are divided into two parts , What we have chosen and what we have not chosen . The winning rate of the selected part is 1/3, The median rate of the unselected part is 2/3, It's obvious . The point is that the host opened a box in the unselected part , Theoretically, it should not affect the part we choose . The winning rate of the selected part is still 1/3, The unselected part of the median rate is still 2/3, But the box that was opened was originally 1/3 The winning rate becomes 0, The winning rate of unopened boxes ranges from 1/3 Change into 2/3.( It will be difficult to understand here , But it is also the key to this problem .)
So now the situation is , Two boxes , The winning rate we chose is 1/3, The winning rate of the selected one is 2/3. So of course I have to change the box .
Code
I know the expression of words is difficult to understand , After all, I didn't change my inherent paranoia at the beginning , So let's look at the code .
Here are the running results :
Windows PowerShell
copyright (C) Microsoft Corporation. All rights reserved .
Try a new cross platform PowerShell https://aka.ms/pscore6
PS C:\Users\hunzi> & C:/Users/hunzi/AppData/Local/Programs/Python/Python310/python.exe c:/Users/hunzi/Desktop/ Three door problem simulation program .py
No change Win the prize :1652
No change I didn't win :3376
in Win the prize :3342
in I didn't win :1630
The winning rate of not changing is :0.32856006364359586 And the winning rate is :0.672164119066774
PS C:\Users\hunzi>
link :https://pan.baidu.com/s/13lsx6NN03SsXwfT-lEtzeA
Extraction code :1234
Avoid possible errors in the copy and paste process , The child is directly put in the net tray , Permanent validity . This is also my first time to try Baidu online disk sharing , Always try something new .
边栏推荐
- LeetCode 438. 找到字符串中所有字母异位词
- [graduation season | advanced technology Er] another graduation season, I change my career as soon as I graduate, from animal science to programmer. Programmers have something to say in 10 years
- 【点云处理之论文狂读经典版7】—— Dynamic Edge-Conditioned Filters in Convolutional Neural Networks on Graphs
- 数位统计DP AcWing 338. 计数问题
- Low code momentum, this information management system development artifact, you deserve it!
- How to check whether the disk is in guid format (GPT) or MBR format? Judge whether UEFI mode starts or legacy mode starts?
- Simple use of MATLAB
- 拯救剧荒,程序员最爱看的高分美剧TOP10
- Install third-party libraries such as Jieba under Anaconda pytorch
- On February 14, 2022, learn the imitation Niuke project - develop the registration function
猜你喜欢

AcWing 786. 第k个数

CSDN markdown editor help document

LeetCode 75. Color classification

Jenkins learning (III) -- setting scheduled tasks

Jenkins learning (II) -- setting up Chinese

【点云处理之论文狂读前沿版13】—— GAPNet: Graph Attention based Point Neural Network for Exploiting Local Feature

【点云处理之论文狂读经典版11】—— Mining Point Cloud Local Structures by Kernel Correlation and Graph Pooling

Jenkins learning (I) -- Jenkins installation

LeetCode 241. 为运算表达式设计优先级

DOM render mount patch responsive system
随机推荐
【点云处理之论文狂读前沿版10】—— MVTN: Multi-View Transformation Network for 3D Shape Recognition
数字化转型中,企业设备管理会出现什么问题?JNPF或将是“最优解”
【点云处理之论文狂读前沿版12】—— Adaptive Graph Convolution for Point Cloud Analysis
LeetCode 438. Find all letter ectopic words in the string
[point cloud processing paper crazy reading cutting-edge version 12] - adaptive graph revolution for point cloud analysis
excel一小时不如JNPF表单3分钟,这样做报表,领导都得点赞!
【Kotlin学习】运算符重载及其他约定——重载算术运算符、比较运算符、集合与区间的约定
LeetCode 57. Insert interval
What are the stages of traditional enterprise digital transformation?
2022-2-14 learning xiangniuke project - generate verification code
LeetCode 871. Minimum refueling times
Using variables in sed command
【毕业季|进击的技术er】又到一年毕业季,一毕业就转行,从动物科学到程序员,10年程序员有话说
推荐一个 yyds 的低代码开源项目
低代码起势,这款信息管理系统开发神器,你值得拥有!
DOM render mount patch responsive system
Sword finger offer II 091 Paint the house
【点云处理之论文狂读前沿版9】—Advanced Feature Learning on Point Clouds using Multi-resolution Features and Learni
Digital management medium + low code, jnpf opens a new engine for enterprise digital transformation
State compression DP acwing 291 Mondrian's dream