User talk:Millbast5

Welcome!

Hello,, and welcome to Wikipedia! Thank you for your contributions. I hope you like the place and decide to stay. Here are some pages that you might find helpful: I hope you enjoy editing here and being a Wikipedian! Please sign your messages on discussion pages using four tildes ( ~ ); this will automatically insert your username and the date. If you need help, check out Questions, ask me on, or ask your question on this page and then place  before the question. Again, welcome! -- Rick Block (talk) 02:13, 15 September 2008 (UTC)
 * The five pillars of Wikipedia
 * Tutorial
 * How to edit a page
 * How to write a great article
 * Manual of Style

Calculation of the probability of winning with the switch strategy

As I mentioned earlier one can ignore the possibility that the host opens a door at random because, if he does, the switch and non-switch strategies are known to be equally good so it makes no contribution to deciding which is strategy is better.

I'm also going to ignore the possibility that the host has some known preference among the doors, because I consider that to be a different problem. To me it was an expository decision to label the doors 1, 2 and 3 in the problem statement. The problem can be stated without identifying the doors at all - in fact in problems that are considered mathematically equivalent there is nothing playing the role of the doors. The statement I gave in terms of urns and balls is one example. No doors or unidentified doors and the question of host having a known preference cannot even arise.

It is stated in the problem that the host does know what is behind the doors which leaves open the possibility that he will behave differently depending on whether the contestants original choice of doors was the winning one or not. (Logically speaking, it is not necessary for the individual acting as the host to know what is behind all the doors to be able to open one that is known to have a goat behind it - he could be signalled by someone backstage as to which door to open after the contestant made his choice but, of course, that just moves the behavior to another person. For the sake of economy, the host represents all the people are running the show and their collective decisions are what we call his decisions.)

What is variable in this problem is the probability that the host will open a door known to have a goat behind it and offer the contestant a chance to switch to the unopened door. Of course, the probabilitly can't be 0 because in the one known case in the statement of the problem he did do just that. In fact, it makes probabilities that are close to 0 unlikely. The way of making this shying away from 0 explicit is given by Bayes theorem - which is quite well explained under the Wikipedia entry "Bayes Theorem", sections "Bayes Theorem for probability densities" and "Example 2: Bayesian inference".

In order to apply Bayes Theorem you have to have a baseline distribution to modify. All we know about this distribution is contained in the fact that in one case out of one possibility the door was opened and we are going to use that information after the fact - so we are starting with a distribution we know absolutely nothing about. Mathematically, that means we have no reason to choose one probability over another so they are all equally likely.

Possible values for any probability are numbers between 0 and 1, inclusively, and the representation of them being equally likely is a constant function on the interval 0 to 1. It is a beastly concept but it takes something weird to deal with an infinity of numbers that are all the same yet don't add up to either 0 or infinity. It takes a couple of years of calculus to get comfortable with this stuff so I'm not going try to explain it.

Anyway when we apply Bayes Theorem to the constant density function with data of 1 trial with 1 door opening resulting, the density function is transformed to one that starts at 0 with value 0 and as one goes toward 1 the value steadily rises. In mathematical shorthand we represent the constant density function, which we name cdf, by cdf(x) = 1 for all x between 0 and 1. The rising density function we'll name rdf, and its formula is rdf(x) = 2x, for all x between 0 and 1. Pretty clearly this function does shy away from zero in a nice regular way.

There is a bit of a hitch with representing the hosts behavior with one probability because that does not allow for different behavior depending how successful the contestants first choice was. Using two probabilities solves this problem quite nicely. We name the two probabilities p and q; p is the probability that the host will open a goat door if the contestants original choice is the winning choice and q is the probability he'll do it when the contestants original choice is a losing door. If he opens such a door he also offers the contestant the option of switching.

Its quite straightforward to calculate the chances of winning with the switch strategy for a given pair of numbers p and q. If the contestant picks the car door, which happens with probability 1/3, the host will open a goat door with probability p and will force the contestant to stay with his first choice with probability (1-p). Of course, he gives up the winning door if he allowed to switch but wins if he's forced to stick which happens with probability 1/3 * (1-p). On the other hand if he picked a goat door, which happens with probability 2/3, he is shown a goat and allowed to switch (to the winning door) with probability q so overall that contributes 2/3 * q to his chances of winning. The contestants probability of winning by switching as a function of p and q we label spw(p, q) and we've just shown  spw(p,q) = 1/3*(1-p) + 2/3 * q.

Checking a few values of spw(p,q) against the ones given in the article one sees: spw(1,1) = 2/3; spw(1, 0) = 0; spw(0,1) = 1 and, of course, spw(0,0) = 1/3.

With a bit of algebra we have spw(p,q) = 1/3 + 1/3 * (2q - p). This allows one to see at a glance that the switch strategy is better than the non-switch whenever 2q > p, they are equal when 2q = p, and non-switch is better whenever p > 2q. This form also shows that spw increases with larger values of q and decreases with larger values of p. A bit later the following form is used: spw(p,q) = 1/3 - 1/3 * p + 2/3 * q.

Now we are ready to calculate the average value that spw takes over all possibilities and we will use density functions to weight them in that averaging process - that is the purpose for which density functions are created.

It is not known to the contestant at this point whether he's chosen the winning door or not so to which random variable p or q does the transformed density function apply? We can't answer that either but we can try it both ways and see if matters as far as deciding whether the switch strategy is better than the non-switch. The transformed density function, rdf(x), gives higher weight to larger values of x and we can see that higher values of p diminish values of spw(p,q) so we should expect a lower average when p is weighted by function rdf.

Notation: I[a,b;f(x);df(x)dx] means the definite integral over the interval [a,b] of the function f weighted by the density function df(x).

We take a double integral of spw(p,q) over the interval [0,1] using rdf for p and cdf for q.

I[0, 1; I[0,1; 1/3 - 1/3 *p + 2/3 * q; 1dq]; 2pdp] evaluating the inner integral: 1/3 - 1/3 *p + 2/3 * 1/2 which equals  2/3 - 1/3 * p     leaving the single integral: I[0,1; 2/3 - 1/3 * p; 2pdp] which evaluates to: 2/3 * 2 * 1/2 - 1/3 * 2 * 1/3 = 2/3 - 2/9 = 6/9 - 2/9 = 4/9.

Four ninths is larger than 1/3 so the switch strategy is better than the non-switch.

Of course, we go through the same thing with the density functions interchanged to make sure that we haven't misinterpreted the situation:

I[0, 1; I[0,1; 1/3 - 1/3 *p + 2/3 * q; 2qdq]; 1dp] evaluating the inner integral: 1/3 * 2 * 1/2 - 1/3 * p * 2 * 1/2 + 2/3 * 2 * 1/3 = 1/3 - 1/3*p + 4/9 = 7/9-1/3*p leaving the single integral I[0,1; 7/9 - 1/3 *p; 1dp] Evaluating that: 7/9 - 1/3 * 1/2 = 7/9 - 1/6 = 14/18 - 3/18 = 11/18

As expected this gives a higher estimate for the average of spw.

I have calculated with both p and q having constant density, both having rising density and weighted compositions of the density functions with these results:

both constant density:   1/2 both rising density:     5/9 composite:               5/9

Note that an average of 4/9 and 11/18, the former having weight 1 and the latter 2, in accordance with their odds of occurring also gives 5/9.

I just ran three simulations of the game, one with p having the rdf, one with q having the rdf and one where p has the rdf 1/3 of the time and q has the rdf 2/3 of the time(the composite density functions mentioned above). The result of 10 million trials of each were .4444X, .6111X and .5555X, respectively, which is to say 4/9, 11/18 and 5/9 accurate to 4 decimal places. That convinces me that I didn't make any arithmetic errors evaluating the double integrals, which is always good to know.

I've been fairly confident that 5/9 is the true average value for the probability of winning with the switch strategy for some time but I've never seen in any math journal an article about splitting a density function over two random variables as I do in the composite method. There is nothing formally wrong with it, in the sense that the composites meet the criteria for density functions, but there is no history that I know of solving problems that way. Thus I don't think I can claim that I've proved the average value of spw is 5/9 though I have proved that it is no smaller than 4/9.

Invitation to comment at Monty Hall problem RfC
You are invited to comment on the following RfC:

Talk:Monty Hall problem

--Guy Macon (talk) 22:15, 8 September 2012 (UTC)