当前位置:网站首页>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 .
边栏推荐
- Find the combination number acwing 885 Find the combination number I
- Sword finger offer II 029 Sorted circular linked list
- 【Kotlin学习】类、对象和接口——定义类继承结构
- Jenkins learning (II) -- setting up Chinese
- Introduction to the usage of getopts in shell
- [point cloud processing paper crazy reading classic version 13] - adaptive graph revolutionary neural networks
- On a un nom en commun, maître XX.
- AcWing 785. Quick sort (template)
- Linxu learning (4) -- Yum and apt commands
- LeetCode 508. 出现次数最多的子树元素和
猜你喜欢
Data mining 2021-4-27 class notes
Vs2019 configuration opencv3 detailed graphic tutorial and implementation of test code
CSDN markdown editor help document
2022-2-13 learning xiangniuke project - version control
[point cloud processing paper crazy reading classic version 12] - foldingnet: point cloud auto encoder via deep grid deformation
State compression DP acwing 291 Mondrian's dream
2022-2-14 learning xiangniuke project - generate verification code
[point cloud processing paper crazy reading classic version 7] - dynamic edge conditioned filters in revolutionary neural networks on Graphs
We have a common name, XX Gong
LeetCode 438. Find all letter ectopic words in the string
随机推荐
Go language - JSON processing
Vscode connect to remote server
What is the difference between sudo apt install and sudo apt -get install?
【Kotlin学习】运算符重载及其他约定——重载算术运算符、比较运算符、集合与区间的约定
We have a common name, XX Gong
【点云处理之论文狂读经典版8】—— O-CNN: Octree-based Convolutional Neural Networks for 3D Shape Analysis
Just graduate student reading thesis
【点云处理之论文狂读前沿版12】—— Adaptive Graph Convolution for Point Cloud Analysis
DOM render mount patch responsive system
我們有個共同的名字,XX工
数字化转型中,企业设备管理会出现什么问题?JNPF或将是“最优解”
即时通讯IM,是时代进步的逆流?看看JNPF怎么说
20220630 learning clock in
Data mining 2021-4-27 class notes
[point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points
状态压缩DP AcWing 291. 蒙德里安的梦想
Use of sort command in shell
AcWing 786. Number k
【点云处理之论文狂读经典版10】—— PointCNN: Convolution On X-Transformed Points
String splicing method in shell