Thursday 27 November 2014

My take on the Monty Hall problem

Let me set the scene...

Imagine you are on a game show.

There are 3 doors in front of you and you need to choose one.

You don't want to lose out now, you've come so far! £250,000 is almost in the bag. It's just waiting behind one of those doors.


1, 2 or 3.

It could be behind any. 

You choose door number 1.

The show host hesitates, amplifying the tension.
He strides over to door 3, and opens it with purpose. 

No money. You're still in the game.

You are offered the opportunity to change your mind. To switch up. Swap assets...



What do you decide?


This is the core of the Monty Hall problem


This particular problem has had a fair amount of publicity. It was discussed in blackjack hustle film  '21' and is used on show 'Deal or no Deal' when down to the last box.

So, how do we approach it?
The winning door was decided before you were in the hot seat. You could have chosen any of them...does it matter if you change your mind?



Is switching going to be more profitable?

How can we work this out?

It's worth noting that I've made a few assumptions:

  1. The host will not reveal the winning door
  2. The host will not reveal the initial choice
  3. The host will allow choice between the initially chosen door, and the single remaining one
I threw together a little model to test the problem, using random outcome placements, random initial choices and a controlled decision to switch. This can be found on my GitHub: MontyHall.java.
It is written in Java and heavily commented to aid readability.

If we consider the probability of the first choice, we understand that the odds of choosing the winning outcome are 1/3. This is straight forward. One choice, three doors. One in three.

The second choice is slightly less obvious. You could:
Leave it be: You made your initial choice with confidence. Why change it now?
Switch: Try and isolate the decisions. 

The first time you had three choices. Now you have two.
The second decision has a 50% chance of success. But how? Sticking is half of that decision, and that certainly hasn't got a 50% chance of success - we just worked it out to be around 33%!

You need to switch to take advantage of the better odds. By sticking, you locked in the odds at 1/3, because your decision was made when the odds of success were 1 in 3. Switching in your second decision will allow you to take advantage of the improved odds that now apply to the box that remains.

My model shows that the win rate is improved by 200% by switching. 
It simulated 1,000,000 rounds, half of which were switched and half not.

Across 1 million rounds...

Wins were recorded on 33.33% of not switched (NS) rounds.Compare that with a 66.617% win rate on switched rounds (SR).The probability of winning across all 1 million (NS+SR) is approximately 50%.


If that feels iffy, imagine there were 1 million doors. That means 999,998 decisions, and 999,998 doors revealed.
You are again left with the door you initially chose, and the only remaining hidden outcome.
You know that the host can't open a door that has the prize behind it. What were the odds of you choosing the correct door initially? 1 in a million. Which is the more likely outcome?

Youtube: Explanation of the Monty Hall problem from the film '21'




Neil




Here are the results from running the model I linked earlier. It was run over 1 million iterations in total.


OVERALL
Number of runs         :1000000
Number of wins         :500043
Number of losses       :499957
Percentage wins        :50.004
Percentage losses      :49.996

NOT SWITCHING:
Number of runs     :500000
Number of wins     :167171
Number of losses   :332829
Percentage wins    :33.434
Percentage losses  :66.566

SWITCHING
Number of runs         :500000
Number of wins         :332872
Number of losses       :167128
Percentage wins        :66.574
Percentage losses      :33.426

SUMMARY:
Percentage more wins by switching: 199.121

Wednesday 26 November 2014

*this is me

I will start off with a little disclaimer to break the ice before I properly dive into the world of blogging.

I will be blogging entirely on behalf of myself. 
As I get to know the world, I want the world to see me as a person. So often we hear of stories of individuals whose actions get lost on a backdrop of agenda - this should not be the case here.

Opinions and views found here are my own. 
No implication should be made about any family member, friend, person, business, or anything else based on what you have read here.

Any linked resources are voluntarily shared.
Articles, sites, pictures and other resources that you might find on here are not a result of 'plugging', 'spamming', 'click-baiting' or any other attempt to monetise people. I do not agree with deceitful methods of marketing and profiteering. Credit should be directed to the creator of any external content.

I will be wrong about something, and I'm ok with that. 
We all get things wrong sometimes - we are just a product of our information sources. Please forgive me and feel free to contribute and help with education.

I want to help you all change the world. 
Help us all get there by staying active in educated discussion on important events, whether it's here, on social media and news sites, or on another platform.