Now imagine
you are on Deal or No Deal, a
television show in which there are 26 cases filled with different amounts of cash
ranging from a penny to a million dollars.
You start out by picking one case.
Then for each round, the host, Howie Mandel, asks you to eliminate one
of the leftover cases, which is opened to reveal the amount inside, after which
a mysterious banker offers to buy your case for an amount that varies based on
the amounts that are leftover. You then
decide on either taking the money (deal) or playing another round in hopes of
getting a better offer from the banker (no deal).
On the rare
occasion that you actually get it down to just two cases left in which one of
those two cases has the million dollars, Howie will offer you the chance to
switch cases. What should you do?
This problem
is similar to the “Monty Hall Problem”, where you are a contestant on Let’s Make a Deal and Monty Hall shows
you three doors. Behind one door is a
brand new car, but behind the other two doors are two goats. You pick a door, but just before it is
opened, Monty says he will open a different door other than the door that you
picked that has a goat behind it, and then offers you the chance to switch
doors. As proved in a previous blog, you
should switch doors because switching gives you a 2 in 3 chance of winning
(since your original choice was a 1 in 3 chance, it leaves you with a 2 in 3
chance for the remaining doors, in which one choice is eliminated).
So is the
“Howie Mandel Problem” similar enough to the “Monty Hall Problem” that you
should switch cases? Or are the problems
different enough so that it doesn’t matter if you switch cases or not, because either
case has a 1 in 2 chance of winning?
Once again, I wrote a small computer program in Python that simulated
the scenario one million times and kept track of how many times you would win
by switching cases out of how many times you would actually be in a situation
where you only have two cases left. The
computer program is as follows:
01
|
#The Howie Mandel
Solution
|
02
|
#Python 2.7.3
|
03
|
|
04
|
#Be able to pick a
random number later.
|
05
|
import
random
|
06
|
|
07
|
#Total number of
trials to calculate. The higher the
number, the
|
08
|
# more accurate the probability solution.
|
09
|
trials
= 1000000
|
10
|
|
11
|
#Total number of
cases
|
12
|
cases
= 26
|
13
|
|
14
|
#Keep track of the
number of trials which get down to having two
|
15
|
# cases at the end, originally starting at
zero.
|
16
|
trials_down_to_two_cases
= 0
|
17
|
|
18
|
#Keep track of the
number of wins if you switch cases at the end,
|
19
|
# originally starting at zero.
|
20
|
trials_won_by_switching
= 0
|
21
|
|
22
|
#Go through each
trial one by one.
|
23
|
for
trial in range(1, trials + 1):
|
24
|
|
25
|
#Randomly pick a number between 1 and the
number of cases
|
26
|
#
for the case with the million dollars.
|
27
|
case_with_big_money =
random.choice(range(1, cases))
|
28
|
|
29
|
#Randomly pick a number between 1 and the
number of cases
|
30
|
#
for the case you choose first.
|
31
|
case_you_choose_first =
random.choice(range(1, cases))
|
32
|
|
33
|
#Randomly pick a number between 1 and the
number of cases
|
34
|
#
(excluding the case you already chose) for the case
|
35
|
#
you leave for last.
|
36
|
case_you_leave_for_last =
random.choice(range(
|
37
|
1, case_you_choose_first - 1) +
range(
|
38
|
case_you_choose_first + 1, cases))
|
39
|
|
40
|
#If the case with the million dollars is
in either the case
|
41
|
#
you choose first or the case you save for last,
|
42
|
#
then the game will get down to only two cases left, so add
|
43
|
#
one to the number of trials down to two cases.
|
44
|
if (case_with_big_money == 1 or
case_with_big_money == 2):
|
45
|
trials_down_to_two_cases += 1
|
46
|
|
47
|
#If case with the million dollars is in
the case you save for
|
48
|
#
last, then add one to the number of trials won by switching cases.
|
49
|
if (case_you_leave_for_last ==
case_with_big_money):
|
50
|
trials_won_by_switching += 1
|
51
|
|
52
|
#When all trials
have been run, print the number of trials won
|
53
|
# by switching and give the percent.
|
54
|
print
"Total number of times it will get down to two cases: " + str(
|
55
|
trials_down_to_two_cases) + " out of
" + str(trials) + " (" + str(
|
56
|
int(round(trials_down_to_two_cases *
100.0 / trials))) + "%)"
|
57
|
print
"Total number of wins by switching: " + str(
|
58
|
trials_won_by_switching) + " out of
" + str(
|
59
|
trials_down_to_two_cases) + "
(" + str(int(round(
|
60
|
trials_won_by_switching * 100.0 /
trials_down_to_two_cases))) + "%)"
|
The outcome after
running the computer program is as follows:
>>
|
Total
number of times it will get down to two cases: 80083 out of 1000000 (8%)
|
>>
|
Total
number of wins by switching: 39989 out of 80083 (50%)
|
Therefore, it
makes no difference whether you switch cases or not, because either case has a
1 in 2 chance of winning. The difference
between the “Howie Mandel Problem” and the “Monty Hall Problem” is that in the “Howie
Mandel Problem”, the options are being randomly eliminated by the contestant,
but in the “Monty Hall Problem”, the options are knowingly eliminated by the
host. That tiny detail makes all the
difference!
No comments:
Post a Comment