Sheep door problem
Sheep Door Problem Description: There are 3 closed doors, one door behind the car, the other two doors are goats, the host knows what is behind each door. Contestants first choose a door. Before opening it, the host opens a door from another two doors, revealing the goat behind the door. At this point, participants are allowed to change their options. May I ask if the contestants can increase their chances of guessing the car after changing their options? By designing and Writing program validation, and giving your own explanations. The answer request is given in the following manner. (The sheep door has 3 closed door, a door parked car, another-door is a goat, the host knows every door. What's the first choice of the contestants in the open door. Before it, the moderator would open a door from the other of the doors, exposes the goat after. At this time, allow the participants change their choice. Choose the contestants after replacement, can increase the chance of guessing car? Through design and program verification, and gives his own interpretation. )
1, I think will increase the opportunity to select the car.
The reasons are as follows:
(1) Do not change the choice: the probability of the choice of 1/3 (2) to choose: The probability of the choice before the replacement of the sheep, the replacement after the choice of the car. Probability is 2/3*1
2, program source code as follows):
From Random import*
Times = 10000
my_first_choice_n=0# initialization does not change the number of choices
my_change_choice_n=0# initialization changes the number of selections
For I in Range (times):
A= "Sheep 1", "Sheep 2", "Car"
Car_indoor=choice (a)
My_guess=choice (a)
If car_indoor==my_guess:
My_first_choice_n+=1
Else
My_change_choice_n+=1
Print ("Do not change selection: {}". Format (My_first_choice_n/times))
Print ("Change selection: {}". Format (My_change_choice_n/times))
3. The results of the validation run are as follows:
Goat Door Problem python simulation