I will switch to the opened door. Each of those golden donkeys are worth $200,000.If you're the contestant, should you switch doors? Should you stay on your door? Does it matter?
I will switch to the opened door. Each of those golden donkeys are worth $200,000.If you're the contestant, should you switch doors? Should you stay on your door? Does it matter?
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I will switch doors. After one of the wrong doors has been removed from play, the chance that I get the right door by switching equals the chance of hitting a wrong door on the first try, i.e. 66%.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
It really doesn't matter. MY chance of hitting the right door is 1:2 whether I switch or not.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
So you disagree with CornedBee's reasoning? Remember, the host responds to what you originally chose.It really doesn't matter. MY chance of hitting the right door is 1:2 whether I switch or not.
Incidentally, I'll probably have to keep to my chosen door since the fellow does not allow me to grab the donkey he revealed
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
I'd go berserk rip the doors out, grab the money, mount a donkey and charge off.
CornedBee reasoning is interesting, but falls to the same trap we have been discussing. What generates the probability event is that last instant when I'm given the choice of switching or not.
Since one door has a donkey and another the money, odds are 1:2
EDI: As for the host, no matter what door I choose initially, the host can always open a door with a donkey in it.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
The discussion/reasoning is an important part of the interview question.
Let's hear what others have to say before we settle it.
That's what I thought, since this problem has been circulating for years. Just blurting out a "model answer" should not be good enough.The discussion/reasoning is an important part of the interview question.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
For the people who have heard it, I ask them to explain the answer to me. The ones who have not often get it wrong, so I listen to their reasoning and also pay attention to how well it seems they understand the answer when I explain it.
It's actually better if they've heard it before, because I really get a feel for how well they can express and explain something (which is very important when coding in teams). It's harder to tell if they really understand you when you explain it to them.
I haven't heard it before and just to be safe I went back and checked for the possibility of it being a trick question
It doesn't seem so. I stand by my answer.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
Yeah, I'm with Mario on this. My reasoning would be exactly the same.
I'd keep my choice, but I wouldn't tell the host. That way, I'd always be right.
Heisenberg's cat theory is stupid.
I do not think it is a trick question when phrased this way, though on a game show it probably would be a trick question (which is why I would never want to be a game show contestant... I will probably freak out on stage when presented with trick questions).I haven't heard it before and just to be safe I went back and checked for the possibility of it being a trick question
My reasoning would be based on counting:
Let A be the winning door.
Suppose you pick door A. If you switch, you lose.
Suppose you pick door B. If you switch, you win.
Suppose you pick door C. If you switch, you win.
Since you pick the door at random and switching wins 2/3 of the time, you should switch to win. Although the host has the choice of opening either B or C if you pick A, his choice does not matter since you already played your move (pick A then switch).
The reason this happens is that the host responds to your choice by eliminating a losing door ("after one of the wrong doors has been removed from play"), so it is a matter of counting the number of wins versus losses when a switch is made after each of the original three choices.
If the host eliminates a door at random (e.g., instead of opening the door, he claims that the closed door he selected is a poor choice, but he does not know what is behind the door), then indeed it would make no difference.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Actually that makes sense now as the host would not open the winning door as that would not make good tv. So by switching you would be moving from 1/3 to 2/3 chance of winning. So yeah I get it now
I hate statistics, but I love probability.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law