⬆️ ⬇️

Parado Monty Hall and Excel

Unhappy are those who cannot program at least at the Excel formula level! For example, it will always seem to them that the paradoxes of probability theory are the vagaries of mathematicians who are unable to understand real life. Meanwhile, the theory of probability just models the real processes, while the human thought often cannot fully realize what is happening.



Take the paradox of Monty Hall, here is his wording from the Russian Wikipedia:

Imagine that you have become a participant in the game in which you need to choose one of the three doors. Behind one of the doors is a car, behind two other doors - a goat. You choose one of the doors, for example, number 1, then the presenter, who knows where the car is and where the goats open, opens one of the remaining doors, for example, number 3, behind which there is a goat. After that, he asks you if you would like to change your choice and choose door number 2. Will your chances of winning a car increase if you accept the offer of the presenter and change your choice?



(while the participant of the game knows in advance the following rules:

  1. the car is equally placed behind any of the 3 doors;
  2. In any case, the presenter is obliged to open the door with a goat (but not the one the player has chosen) and to offer the player to change the choice;
  3. if the presenter has a choice, which of the 2 doors to open, he chooses any of them with the same probability)


At first glance, the chances should not change (sorry, for me this is no longer a paradox, and I can’t think up a wrong explanation of why the chances would not change, which at first glance would have seemed logical).



Typically, the narrators of this paradox begin to indulge in complex arguments or to overwhelm the reader with formulas. But if you can program at least a little, you don’t need it. You can conduct simulation experiments, and see how often you win or lose with a particular strategy.

')

Indeed, what is probability? When they say “with this strategy, the probability of winning is 1/3” - this means that if you conduct 1000 experiments, then approximately 333 of them will win. That is, in a different way, the chances of “1 out of 3” are literally one of three experiments. “Probability 2/3” is exactly the same in literally two cases out of three.



So, we will conduct an experiment by Monty Hall. One experiment easily fits into one line of Excel-table: here it is (the file should be downloaded to see the formulas), here is a description by columns:



A. Experiment number (for convenience)



B. We generate a random number from 1 to 3. This will be the door, behind which the car is hidden



CE. for clarity, I placed in these cells "goats" and "cars"



F. Now we are choosing a random door (in fact, you can always choose the same door all the time, because the randomness in choosing a door for a car is enough for a model - check it out!)



G. The presenter now chooses the door of the two remaining to open it to you.



H. And here is the most important thing: he does not open the door, behind which the car, and in case you initially showed the door with a goat, opens another single door with a goat! This is his clue for you.



I. Well, now let's count the odds. Until we change the door - i.e. let's calculate cases when column B is equal to column F. Let it be “1” - won, and “0” - lost. Then the sum of cells (cell I1003) is the number of wins. You should get a number close to 333 (we are doing 1000 experiments altogether). Indeed, finding a car behind each of the three doors is an equally probable event, which means choosing one door, the chance to guess is one of the three.



J. Will be enough! Let's change our choice.



K. Similarly: “1” is a gain, “0” is a loss. And what is the amount? And in total, we get a number equal to 1000 minus the number from cell I1003, i.e. close to 667. Does that surprise you? Could something else have happened? After all, there are no other closed doors anymore! If the initially selected door gives you a prize in 333 cases out of 1000, then the other door should give a prize in all remaining cases!


Do you understand me now, why am I not seeing a paradox here? If there are two and only two mutually exclusive strategies, and one gives a gain with probability p, then the other should give a gain with probability 1-p, what kind of paradox is it?



If you liked this post, try now to build a similar file for the paradox of boys and girls in the following wording:

Mr. Smith is the father of two children. We met him walking down the street with a little boy, whom he proudly presented to us as his son. What is the likelihood that the other child of Mr. Smith is also a boy?


Greetings from sunny Vietnam! :) Come join us to work! :)

Source: https://habr.com/ru/post/201788/



All Articles