3
13 SWITCH OR NOT ? THE SIMULATION OF MONTY HALL PROBLEM Qi Zhang 1 ,Meizhu Li 1 ,Yong Deng 1, 2 1 School of Computer and Information Science Southwest University Tiansheng Road, 400715, China [email protected] 2 School of Engineering Vanderbilt University Nashville, TN, 37235, USA Abstract. The Monty Hall problem is a brain teaser,The problem was originally posed in a letter by Steve Selvin to the American Statistician in 1975. To find out the principle of this conclusion which given by Marilyn vos Savant, and to find if there is always advantage to the contestants chose to switch their choice .we have make a simulation of this problem. Keywords: Monty Hall problem, Simulation 1. Analysis of the Monty Hall problem. The hole game complete by three steps: First chose a door in randomly to put a car behind it,Second let the contestants chose a door also in randomly. Third the host open a door with out of car,then calculate the probability to got the car. The first step is random ,so the contestants have 1/3 probability to got the car.Then the host open one of the doors with out of car.The host’s behavior have change the environ- ment of the the game,The host’s behavior is controlled by the chose of the contestants,if the contestants have chose the door with a car then the host will open the doors random in the last two doors,but if the contestants have chose the door with out of car,then the host have no choice with out to open the another door with out of car.So the whole process have become a controlled system,to calculate the probability of got the car in randomly is wrong,so the probability is controlled by the contestants’s behavior not the host’s. 2. The simulation of the problem. Step 1: Distribute the car randomly to the three doors First of all, set a zero matrix containing three variables,then generate a number among 1-3 in randomly, set the corresponding variable’s value to 1. Step 2: Chose the door in randomly Generate a number among 1-3 in randomly ,then got the corresponding variable’s value .if the value is 1 it means the contestants have got the car,On the contrary it means the contestants got the goat. Step 3: The host open the door with out of car Use the conclusion of Step 2,if got 1,then chose anyone of the last two doors to open,on the contrary chose the door witch value is 0 to open. Step 4: Calculate the probability of win for chose to switch Record the times of the contestants got the car. Step 5: Repeat step1 to step4 Record the times of repeat and calculate the probability. 1

Qi Zhang ,Meizhu Li ,Yong Deng - viXravixra.org/pdf/1503.0024v1.pdfQi Zhang1,Meizhu Li1,Yong Deng1;2 1School of Computer and Information Science Southwest University Tiansheng Road,

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Qi Zhang ,Meizhu Li ,Yong Deng - viXravixra.org/pdf/1503.0024v1.pdfQi Zhang1,Meizhu Li1,Yong Deng1;2 1School of Computer and Information Science Southwest University Tiansheng Road,

1–3

SWITCH OR NOT ? THE SIMULATION OF MONTY HALLPROBLEM

Qi Zhang1,Meizhu Li1,Yong Deng1,2

1School of Computer and Information ScienceSouthwest University

Tiansheng Road, 400715, [email protected]

2 School of EngineeringVanderbilt University

Nashville, TN, 37235, USA

Abstract. The Monty Hall problem is a brain teaser,The problem was originally posedin a letter by Steve Selvin to the American Statistician in 1975. To find out the principleof this conclusion which given by Marilyn vos Savant, and to find if there is alwaysadvantage to the contestants chose to switch their choice .we have make a simulation ofthis problem.Keywords: Monty Hall problem, Simulation

1. Analysis of the Monty Hall problem. The hole game complete by three steps:First chose a door in randomly to put a car behind it,Second let the contestants chosea door also in randomly. Third the host open a door with out of car,then calculate theprobability to got the car.

The first step is random ,so the contestants have 1/3 probability to got the car.Then thehost open one of the doors with out of car.The host’s behavior have change the environ-ment of the the game,The host’s behavior is controlled by the chose of the contestants,ifthe contestants have chose the door with a car then the host will open the doors randomin the last two doors,but if the contestants have chose the door with out of car,then thehost have no choice with out to open the another door with out of car.So the whole processhave become a controlled system,to calculate the probability of got the car in randomlyis wrong,so the probability is controlled by the contestants’s behavior not the host’s.

2. The simulation of the problem. Step 1: Distribute the car randomly to thethree doors

First of all, set a zero matrix containing three variables,then generate a number among1-3 in randomly, set the corresponding variable’s value to 1.

Step 2: Chose the door in randomlyGenerate a number among 1-3 in randomly ,then got the corresponding variable’s value

.if the value is 1 it means the contestants have got the car,On the contrary it means thecontestants got the goat.

Step 3: The host open the door with out of carUse the conclusion of Step 2,if got 1,then chose anyone of the last two doors to open,on

the contrary chose the door witch value is 0 to open.Step 4: Calculate the probability of win for chose to switchRecord the times of the contestants got the car.Step 5: Repeat step1 to step4Record the times of repeat and calculate the probability.

1

Page 2: Qi Zhang ,Meizhu Li ,Yong Deng - viXravixra.org/pdf/1503.0024v1.pdfQi Zhang1,Meizhu Li1,Yong Deng1;2 1School of Computer and Information Science Southwest University Tiansheng Road,

2 SWITCH OR NOT ? THE SIMULATION OF MONTY HALL PROBLEM

The Figure 1,Figure2,Figure7 and Figure4 have show the probability of win when thecontestants chose to switch the choice.

0 200 400 600 800 10000.5

0.55

0.6

0.65

0.7

0.75

0.8

0.85

0.9

0.95

1

Figure 1. The testof 1000 times

0 1000 2000 3000 4000 50000.5

0.55

0.6

0.65

0.7

0.75

0.8

0.85

0.9

Figure 2. The testof 5000 times

0 2000 4000 6000 8000 100000.55

0.6

0.65

0.7

0.75

0.8

0.85

0.9

0.95

1

Figure 3. The testof 10000 times

1 2 3 4 5 6 7 8 9 10

x 104

0.62

0.63

0.64

0.65

0.66

0.67

0.68

0.69

Figure 4. The testof 100000 times

Table 1. The times of win after a series of experiments

Times of test Win Lose probability

1000000 666883 333117 0.6669100000 66707 33293 0.667010000 6717 3283 0.67171000 653 347 0.6530100 62 38 0.620010 7 3 0.7000

We have repeat the test of the problem in 1000 times,5000times,10000 times and 100000times.The result have proof that the Marilyon vos Savant’s answer is right, see the detail at

Table 1 ,but this phenomenon only happened in three doors condition, when we use morethan three doors to test, the result will change. We have test when the door’s counts haverise to 4,5,10,12,15 and 20.We have find that the when the doors among 10 to 15,switchthe choice almost no use to increase the probability to got the car.We also have test whenthe doors counts have rise to 100,1000and10000,the result is in random distribution.Seethe detail in the fellow Figures.

3. Conclusion. The conclusion of our simulation have show that when use more than15 doors in this game,no matter the contestants chose to switch or not,the probabilityof win will approach to the random-probability.So when the door’s counts is less than 15chose to switch,else switch or not is insignificant.

Page 3: Qi Zhang ,Meizhu Li ,Yong Deng - viXravixra.org/pdf/1503.0024v1.pdfQi Zhang1,Meizhu Li1,Yong Deng1;2 1School of Computer and Information Science Southwest University Tiansheng Road,

SWITCH OR NOT ? THE SIMULATION OF MONTY HALL PROBLEM 3

0 2000 4000 6000 8000 100000.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Figure 5. Theprobability of test10000 times with 4doors

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000

0.05

0.1

0.15

0.2

0.25

Figure 6. Theprobability of test10000 times with 5doors

0 2000 4000 6000 8000 100000

0.05

0.1

0.15

0.2

0.25

0.3

0.35

Figure 7. Theprobability of test10000 times with 10doors

0 2000 4000 6000 8000 100000

0.005

0.01

0.015

0.02

0.025

Figure 8. Theprobability of test10000 times with 20doors

0 2000 4000 6000 8000 100000

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Figure 9. Theprobability of test10000 times with 12doors

0 2000 4000 6000 8000 100000

0.02

0.04

0.06

0.08

0.1

0.12

0.14

0.16

Figure 10. Theprobability of test10000 times with 15doors

Table 2. Different counts of doors to test

Counts of door Times of tests probability

4 10000 0.37455 10000 0.271310 10000 0.1147100 10000 0.01121000 10000 0.001310000 10000 0.0002