GeeCON Prague 2014*
The moose likes Programming Diversions and the fly likes The quizz and the price behind a door Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "The quizz and the price behind a door" Watch "The quizz and the price behind a door" New topic
Author

The quizz and the price behind a door

Piet Souris
Ranch Hand

Joined: Mar 08, 2009
Posts: 587
    
  11
Chances are that this problem is known to everyone, but nevertheless I still find
it very much fun.

The problem was presented in a national newspaper about 15 years ago. And believe
it or not, it then led to an enormous discussion that went on for about two weeks,
after which the newspaper put an end to this. Professors, doctors, lawyers,
plumbers, the local idiots, all disagreeing, gee, that was some discussions going on!

The situation is: you've just won a television quizz, and it is time to decide
on the price. It goes like this: you see three doors. Behind only one of then
is a huge price, but behind the other two there's just thin air.
You must choose a door. The quizzmaster, knowing which door has this price,
then opens a door of which he knows that there is no prize.
You then are given the opportunity to switch to another door, or stick to
your initial choice of door.

The question is: should you switch or not?

Now, mathematiccaly this is not difficult to solve, although many people will still
find the correct answer hard to believe. But my question is:

write a program that simulates this situation, and check that the outcome of your
simulations are in line with the correct answer.

Have fun!

Greetings,
Piet
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18874
    
  40

Piet Souris wrote:
The question is: should you switch or not?


Anyone who is a fan of "let's make a deal" knows that you should absolutely switch -- which is why the current version of the game show, doesn't give the option to switch anymore.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Piet Souris
Ranch Hand

Joined: Mar 08, 2009
Posts: 587
    
  11
Never heard of this "let's make a deal" program. But I gather now that that newspaper was talking about that show!
Well, if all of the USA knows about this thing, this kind of spoils it a little bit...

How does it go now then? Does it now start with an open door, then you make a choice and THEN you can switch if you like?

If so, I have another question (for you, Americans ;) ): this last situation gives a different outcome compared to the original situation.
So in these two situations the information implicitly supplied must be different. What is this difference in information?

Greetings,
Piet
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

The additional information is just what you said:

The quizzmaster, knowing which door has this price,
then opens a door of which he knows that there is no prize.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18874
    
  40

Piet Souris wrote:
How does it go now then? Does it now start with an open door, then you make a choice and THEN you can switch if you like?


The current version of the game no longer has the option to switch. You pick one of the three doors. The game opens one of the other two (not picked) doors that isn't the grand prize. Then it opens one of the two remaining doors followed by the last door. And there isn't any particular order with the second and third doors to be opened.

Obviously, by the time the second door is opened, you realized if you won the grand prize or not.

Henry
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18874
    
  40

Paul Clapham wrote:The additional information is just what you said:

The quizzmaster, knowing which door has this price,
then opens a door of which he knows that there is no prize.



And it is the knowledge of which door has the prize that doesn't change the odds. Meaning... You pick one of the doors, hence, you have 1/3 chance of being correct and 2/3 chance of being wrong. The quiz master can open a door that don't has the prize, regardless of whether you are right or wrong. This means that you still have a 1/3 chance of being correct and 2/3 chance of being wrong... so, if you switch, you now have a 2/3 chance of being correct and a 1/3 chance of being wrong.

Henry
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 3016
    
  10
Piet Souris wrote:The problem was presented in a national newspaper about 15 years ago. And believe
it or not, it then led to an enormous discussion that went on for about two weeks,
after which the newspaper put an end to this.

One reason discussion can go on for so long is that it's usually stated ambiguously, as it is above. It needs to be made clear that the game show host always opens a door and offers the contestant a choice. It's part of the rules, and the host doesn't get to choose whether or not to do it. If there were a choice, then the problem would be unsolvable (without knowing the host's motivation). As it is though, the host is compelled to give the contestant new information which the contestant didn't have when they first made their selection; this information makes it statistically advantageous to switch.
Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2383
    
  28

Actually, this problem is very famous is one of the problems where the mathematical proof seems antithetical to common sense for most people. For most people, common sense says "Ok, so I had 1 out of 3 chance of picking right and now I have 1 out of 2 chance no matter what door I pick. So, the answer is doesn't matter" Intuitively, "doesn't matter" feels right. Switching doors just seems so un-intuitive. However, if you run through the various combinations, and really think about the problem you realize that switching door is the one that gives you highest chance of success.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39044
    
  23
Is this the same as the Monty Hall problem?
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 3016
    
  10
Yup, the very same. Discussed here multiple times, as well.

Monty Hall's dilemma
Let's Make a Deal Quiz
Bill Clar
Ranch Hand

Joined: Sep 21, 2006
Posts: 152

Henry Wong wrote:
And it is the knowledge of which door has the prize that doesn't change the odds. Meaning... You pick one of the doors, hence, you have 1/3 chance of being correct and 2/3 chance of being wrong. The quiz master can open a door that don't has the prize, regardless of whether you are right or wrong. This means that you still have a 1/3 chance of being correct and 2/3 chance of being wrong... so, if you switch, you now have a 2/3 chance of being correct and a 1/3 chance of being wrong.

Henry


I'm stumped.

Before the host's reveal, I have a 1/3 chance of guessing correctly.

After the door is revealed I'm now faced with two doors. Two choices. Shouldn't I have a 1/2 chance of guessing correctly?
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4397
    
    8

Bill Clar wrote:Two choices. Shouldn't I have a 1/2 chance of guessing correctly?


Two choices*, but that doesn't mean they have the same probability. You've been given no reason to believe that your original choice was more or less likely to be right than it was originally.

I find that one way of "tricking" your intuition into seeing it correctly is to exaggerate the problem. There are 1000 doors, with a prize only behind one of them. You choose one. The host then opens 998 other doors that don't have a prize, leaving only two left. Do you still think it's 50/50 that you picked the right one in the first place?

(* well, one choice, two options, but that's a whole other area of pedantry )

 
GeeCON Prague 2014
 
subject: The quizz and the price behind a door