Brief rundown of what the Monty Hall paradox is, just for the sake of completeness: you must choose one of three doors on a TV show, only one of which has a valuable prize behind it. After you make a choice, host of the show opens another door and offers you to switch. Switching turns out to be preferrable course of action, because the probability of the prize being behind another door is 2/3 instead of 1/2 that one might think.

I've heard of Monty Hall paradox many times, and heard it once more today. I've finally figured out what's **paradoxical** about it, at least for me. When I hear about TV show shenanigans — I assume that the host has an ability to **trick** show contestant because they probably have an incentive to keep the contestant from prize. So, if the rules of the show is that the host **has** to offer the choice, then using this choice is, for me, intuitively right.

Now, assume that it is not necessarily the case, that is, host **can** open another door and offer a choice to switch, but it's at their discretion whether to actually do it. Let's try to figure out what the optimal strategy is going to be in this situation.

Assume the following model:

- If the host knows that you've made the
**right**choice, they offer you to switch with probability**p**(with probability_{1}**1 − p**you get your prize instantly and there are nothing you can do about it)_{1} - If the host knows that you've made the
**wrong**choice, they offer you to switch with different probability,**p**._{2}

Now, you've found yourself in a situation when host actually offers you a choice. Using Bayes' theorem, we can determine that the probability of you already selecting the prize is **p _{1} / (p_{1} + 2p_{2})**.

The correct strategy in this case seems to be to compare that probability with 1/2 and switch if it is less than that, which turns to be exactly when **p _{1} < 2p_{2}**. Note that when the both probabilities are equal to 1, which corresponds to TV host

Now, if you have some existing data about the show, you can probably estimate these parameters. Assuming uniform distribution for both **p _{1}** and