Showing posts with label solution. Show all posts
Showing posts with label solution. Show all posts

Sunday, 16 October 2016

The Most Valuable Solution to the Four Doors Problem

A few days ago, I posted the Four Doors Problem.  So far, no-one has had a go at solving it.  I'm guessing that some would be far happier critiquing my solution anyway, so here it is!

---

Most will recognise the problem as a complicated variation of the Two Doors Problem, for which a solution is readily available.  What are less readily available are the two other solutions to the two doors problem.

Briefly, in the two doors problem, there are only two doors which may be sentient and able to answer questions themselves, or there may be two identical guards who answer on behalf of the doors.  A classic version has one guarding the door to hell, while the other guards the door to heaven.  The heaven guard always tells the truth, while the hell guard always lies, but other than that you know nothing meaning that there are no visual clues as to which is which.  You're given one question to find out which door leads to heaven (which contains magic chocolate, or some such nonsense).

The standard answer is to ask one of the guards which door the other guard would say led to hell.  Then you go through that door, because it goes to heaven.

Another option is to ask a guard whether both doors lead to heaven.  If she says yes, then she's the hell guard so take the other door.  If she says no, then she's the heaven guard so take her door.  This relies on the additional fact that the liar guards the hell door.  If you were told no more than one lies and one tells the truth, then you'd still not know which door was which but you would be able to ask another direct question to the truth telling guard (and thus avoid being stabbed by the third guard).

The third option would risk the ire of any third guard because it's a bit tricky.  You could ask "if I had asked you earlier which door leads to heaven, which door would you have pointed to?"  The heaven guard always tells the truth, so she would have pointed to the heaven door.  The hell guard always lies, so will lie about having lied before and thus will point to the heaven door.  So no matter which guard it is, you can go through the door pointed to.

The benefit of this method (third guards aside) is that not only do you no longer need to worry about whether the guards are located in front of "their" door, the solution will work even if the heaven guard had a night off and an off-duty hell guard had taken her place (so that both lie), or vice versa (so both tell the truth).  In other words, it's the right solution if the problem were to be rephrased as "you only know that guards come in two varieties, they either tell the truth all the time or lie all the time, but you don't know what the guards in front of you are, both truth-tellers, both liars or one of each".

So, with four doors and the type of responses that Monty can give, we can ask a similar question - albeit a little more complex:

If with a third question I asked you which door would you have indicated in response to a first question had I - with the first question - asked which door had the money behind it?

Breaking it down a little:

If it's the truth-telling platform, then the door pointed to will have the money behind it because Monty will tell the truth about having told the truth before.

If it's the lying platform, then the door pointed to will have the money behind hit because Monty will lie about having lied.  Now, this needs some clarification, if you asked the first question, rather than asking about the first question, then Monty would have three options to lie.  Then, when answering the third question, he would have three options to lie (by pointing to any door other than the one he had actually pointed at).  But in the abstract, having not actually pointed at a door with an actual first question, Monty is obliged to lie and thus he is obliged to point at the door that he could not have pointed to if there had been a first question.  (This does assume that given an obligation to lie, Monty will choose from the three goat doors at random, making it a little bit equivalent to the Monty Hall problem where he has two goat doors to choose from.  I've imported that assumption on the basis of indifference.  For the purposes of this solution, if you don't like that I've made the assumption, just work on the basis that I had clarified that, when lying, Monty picks a goat door at random.)

I specify first and third questions to account for the flip-flop platform (lie-truth-lie-truth, etc).  In both these questions, Monty will be in the same phase, either telling the truth both times or lying both times and he will therefore point to the money door, following the same logic above.

The last platform introduces an issue because Monty's response will be random and the tricky nature of the question posed to him will not affect how random his response was.  Fundamentally, he's being asked to point at one of four doors, he'll choose one totally at random.  So there's only a 25% probability of his pointing at the money door.

If you asked the question twice, on two different platforms and the answers were the same, you'd have certainty that the door indicated was the money door and you'd have locked in $250,000.  However, you'll only get this if you avoided the random platform (or, while on the random platform, Monty pointed at the money door).  If you didn't avoid the random platform, and Monty didn't point at the money door, then you'll have two different answers and not know which was which, so you're left with a 50-50 decision which has less value (due to risk) than asking another question to be certain of $125,000.  While I've not calculated it, the value of asking two questions (and potentially three) is less than just taking a punt without asking any, namely $250,000.

The optimum is achieved by asking one question and one question only, on one platform only, then taking the door indicated.  25% of the time it'll be the right door because Monty was on the truth-telling platform, 25% of the time it'll be the right door because Monty was on the lying platform, 25% of the time it'll be the right door because Monty was on the flip-flop platform (and he was restrained to either telling the truth twice or lying twice) and 6.25% of the time it'll be the door because Monty was on the random platform and he pointed at the right door at random (25% of 25% = 6.25%).

So the probability that you take the correct door, with half a million behind it, is 81.25% - a value of $406,250.

---


If there is a more valuable solution, I'd be interested to hear it.

---

If you want to know for certain that you're picking the right door, then you must be prepared to ask the question three times while Monty stands on different platforms although you might only need to ask twice.  When you have two answers that are the same, then you've got the right door - with $250,000 as the prize, about 81.25% of the time.  18.75% of the time Monty will answer randomly and not point to the right door, which means that you'll get two different answers, one right and one wrong, and you will not know which is which.  So you need to ask again with Monty standing on a third platform.  Whichever door is pointed to again is the right door, but after three questions you'll only be winning $125,000.

So, if you are after certainty, you need to ask a maximum of three questions and a minimum of two.

If there's a better way, getting certainty with two questions for example, I'd be keen to know (but I doubt that it's possible with the potential for random answers).

Tuesday, 17 February 2015

The Reverse Monty Hall Problem and Conditional Probability

Please note that since I wrote this article, I have been persuaded that the argument it contains is wrong.  The correct answer for the scenario as it is worded is not 1/2 but rather 1/3 (meaning that the likelihood of winning as a consequence of staying is 2/3).

---

Originally, this was to be my last article on The Reverse Monty Hall Problem – or at least the last on why the solution is “it doesn’t matter whether you switch or stay, the likelihood of benefitting from either choice is 1/2".  It didn't work out that way ...


---

As the title suggests, we need to consider conditional probability.  The relevant equation is:

Pr(A | B) = Pr(A ∧ B) / Pr(B)

This means “The probability of A happening, given that B has happened, is equal to the (a priori) probability of both A and B happening, divided by the (a priori) probability of B happened”.  It may be phrased more briefly as “the probability that A given that B is equal to the probability that both A and B divided by the probability that B”.

In this case (please follow the links above if you don’t yet know the context), what we have is:

Pr(A) = the (a priori) likelihood that a car is hidden behind the door that you chose, but the philosopher didn’t open = 1/3

Pr(B) = the (a priori) likelihood that a goat is hidden behind a specific selected door = 2/3

Pr(A ∧ B) = the (a priori) likelihood that the car is hidden behind the unselected door AND a goat is hidden behind a specific selected door – noting that this is one of only three possible, equally likely permutations = 1/3

I have to stress, and I cannot stress this enough, that in the scenario I described, the philosopher had already opened the door before offering you the opportunity to switch.

I might need to ram this home, so please forgive me if you have already had a blinding flash of light and you now agree with me.  Let’s get more specific.  The doors don’t have any indications on them when you get there, but you are a paranoid sort and are convinced that there is some Derren Brown/Dynamo-type shenanigans going on, so you tell the philosopher you want to mark the doors just after he tells you which one he is going to open, but before he opens it.

  • You walk to the door that you selected that will remain closed, and you mark it as Door 1,
  • You walk to the door that the philosopher has told you will be opened, and you mark it as Door 2,
  • You walk to the unselected door, and you mark it as Door 3, and
  • Then you return to the philosopher to continue the show.   


The questions you must ask yourself are now made a little more simple:

Before I got here, what was the likelihood that the car would be behind Door 1?
There is only one car and three doors, therefore, Pr(A) must be 1/3

Before I got here, what was the likelihood that Door 2 would have a goat behind it?
There are two goats and three doors, therefore, Pr(B) must be 2/3.

Before I got here, what was the likelihood that the car would be behind Door 1 AND a goat would be behind Door 2?
This is precisely the same likelihood that there would be a car behind Door 2, because if there is a car behind Door 2, then there must be a goat behind Door 1, therefore Pr(A ∧ B) must be 1/3

Then it’s just a simple process of plugging in the numbers:

Pr(A | B) = Pr(A ∧ B) / Pr(B) = (1/3) / (2/3) = 1/2

It’s not rocket science, but it seems to have confused the heck out of a lot of people (including, to be totally honest, me).

Now that I have gone through this process, I am really hoping that the cognitive dissonance stays away!  However, there remains a feature that may still confuse people.

If you were asked, prior to entering the arena with the philosopher, whether it would be better, on average across multiple runs, to stay with your door (the one of two that remains to you) or to switch, the correct answer is it is better to stay – because, exactly as many have argued, this would be equivalent to the Monty Hall Problem.

This seems to be hugely counter-intuitive.

However, you have to remember that at this point in time, the philosopher has not yet opened any doors.  Therefore, at this point in time, the door that the philosopher opens could be any of the three (depending on which doors you select and which doors have goats behind them).

This seems to be the default position taken by all armchair statisticians, despite being encouraged repeatedly to consider the scenario from just after the door has been opened.

Someone did ask to explain how my two images could be reconciled (from The Reverse Monty Hall Problem – The Solution):



And
 



Someone also complained about my graphical representation of the solution to the classic Monty Hall Problem:
 



This might be difficult to explain, but please bear with me.
 

First I need to re-jig the graphical representation of the classic Monty Hall Problem, not because what I did was wrong so much as it was not adequately explained.  I am assuming that, when given the opportunity to select between two goats, the philosopher chooses at random.  Therefore, the possibilities with the classic Monty Hall Problem are:



Now, imagine that we run the Reverse Monty Hall scenario over and over again, still assuming that when there is an option to select between two goats, the philosopher makes that selection at random.  This means that the possibilities are:






Then, removing invalid scenarios, we have: 



This can be compared with the results from the classic Monty Hall Problem.
  So, yes, if you run the scenario over and over again, you will get the 2/3 - 1/3 split.  But ... there was never any intention that Reverse Monty Hall Problem be performed repeatedly.

---

Once again, please note that the argument above is incorrect.  The correct answer is that the 2/3 - 1/3 split is as true (in this scenario) as it is for multiple iterations of it.