Wednesday, September 17, 2008

Problem set comments

We talked about the problem set today. In particular we discussed the King and Brother problem and the ordinary dice problem.

In the King and Brother problem, the easiest way is to list all of the (assumed equally probable) ways that a couple can have two children:
BB p=1/4
BG p=1/4
GB p=1/4
GG p=1/4
The last of these didn't happen, so only the remaining three remain. Their probabilities are equal, so by inspection we see that in one of the three cases, the king has a brother, and in two of them, he has a sister. So, the probability that the king has a brother is 1/3. In symbols,
P(brother|king)=1/3
Again, looking at the list above, we can see that considering all kinds of families, the probability that there will be a king if the royal family has two children is 3/4, that is, there will be a king in all cases except GG, in which case the oldest girl will become Queen. We also see that the probability that there is one brother in addition to the king is P(brother,king)=1/4, since that only happens in the BB case. So, using the formula for conditional probability, we can calculate
P(brother|king)=P(brother,king)/P(king)=(1/4)/(3/4)=1/3, same as above.
We also got this using a tree, but I haven't figured out how to draw one and put it in the blog yet.

We found that in the case where there are three siblings, that
P(two brothers|king)=1/7
P(one brother|king)=3/7.
We got this both by listing all cases and using the formula.

We also did the ordinary dice problem by listing all of the possibilities in a square array, and putting the total in each entry:
| 1 2 3 4 5 6
------------------------------------
1 | 2 3 4 5 6 7
2 | 3 4 5 6 7 8
3 | 4 5 6 7 8* 9
4 | 5 6 7 8 9 10
5 | 6 7 8* 9 10 11
6 | 7 8 9 10 11 12
(Sorry, this isn't coming out formatted the way I expected, I apologize).

We noted that there are 36 entries in the table, and five of them total 8 (marked in red), so
P(total 8)=5/36
We discussed why (4,4) should not be repeated twice. By coloring the dice red and green, and tossing first the red one and then the green one, we get only one (4,4) amongst the examples that total to 8.

We see that there are 11 total cases that have a five showing (row 5 and column 5). Of these, two total 8 (starred). So,
P(total 8|5 shows)=2/11
Also, we just saw that there are 5 cases that total 8 (red), and of these two have a '5' showing (starred). So,
P(5 shows|total 8)=2/5
We also got the last two results by using the formula for conditional probability.

Monday, September 15, 2008

Class 9/15

Today we did several things. I told you about the problem in this week's "Cartalk" program on NPR. The problem involves two people who want to hire themselves out. Their employer insists that there be a 90% chance that they will show up for work (they have to drive), but one of them has a car that is only 70% reliable and the other's car is only 80% reliable. We were able to show that between them they would be able to get to work with better than 90% reliablility, using two different arguments.

(I still haven't figured out how to get pictures into here, so bear with me).

The first solution went this way: They first try to start the car that is 80% reliable. If it starts, they go in it. Otherwise, they try to start the car that is 70% reliable. That will happen on 20% of the days, so the probability that they will use the second car is 0.2*0.7=0.14. Add that to the 0.8 if they use the first car, and the result is 0.94, or a 94% probability that they will get to work.

Put in terms of conditional probability, we have
P(car 1 starts)=0.8,
P(car 1 doesn't start)=0.2,
P(car 2 starts|car 1 doesn't start)=0.7,
P(car 2 starts, car 1 doesn't start)=0.7*0.2=0.14 (by conditional probability formula)
P(they get to work)= 0.8+0.14

The other idea was even simpler. The probability that neither car will start is 0.2*0.3=0.06. Subtract that from 1 and you get 0.94, same as before.

Here we use the fact that the probability that car 2 will not start is independent of whether car 1 starts or not, so
P(car 2 doesn't)=P(car 2 doesn't|car 1 doesn't star2)
=0.3,
P(car 1 and car 2 both don't start)
=P(car 1 doesn't start)*P(car 2 doesn't start)
=0.2*0.3
=0.06
Both solutions are correct.

We used the opportunity to explain independence and dependence.

A and B are independent if P(A|B)=P(A). You will work on two problems involving independence for next Monday, including showing that several definitions of independence are entirely equivalent. We also wrote down a table of joint probabilities of A and B, identified the marginal probabilities that are obtained by summing across the rows and down the columns of the table. There's another problem for Monday that uses tables like this.

We spent the rest of the period discussing various flavors of the Monty Hall problem (mentioned below). We found just by our discussion that it always pays to switch in the Angelic Monty problem, it never pays in the Monty from Hell problem, and it doesn't matter in the Ignorant Monty problem. Finally, we analyzed the Mixture Monty problem by recognizing that there are six states of nature, 3 doors x 2 possible Montys. We set up a table, and used the fact that our evidence was that Monty opened door 2 and we saw a goat, to figure out the likelihood. There was some confusion, for example we found that
P(Open 2 & see goat|Door 3)= 1 for Angelic Monty and 0 for Monty from Hell
(because if you've chosen the wrong door, Angelic Monty will in this case show the only door that he can that has a goat, door #2, whereas Monty from Hell will open the door with the prize and will not open door #2).

We found that it is better to switch if we are facing Mixture Monty.

The easiest way to see this intuitively is that Angelic Monty will offer you a chance to switch twice as often as Monty from Hell will. That's because you'll choose the wrong door 2/3 of the time, so 2/3 of the time Angelic Monty will offer you a chance to switch, while Monty from Hell will offer you a switch in only that 1/3 of the cases where you have picked the right door. If you're offered a chance to switch, it's twice as likely that you're facing Angelic Monty than Monty from Hell.

Sunday, September 14, 2008

Class 9/12

Today in class we mostly pursued the Monty Hall problem, in various disguises. In the process we learned about Bayes' theorem:

P(A,B)=P(A|B)P(B)=P(B|A)P(A),

and as long as P(B) is not zero, we can divide to get the usual form of Bayes' theorem:

P(A|B)=P(B|A)P(A)/P(B).

We identified P(A) as the prior probability of A (before we observed B), P(B|A) as the likelihood, P(B|A)P(A) as the joint probability of A and B, P(B) as the probability of observing the evidence B that we actually observed (that Monty opens the second door), and P(A|B) as the posterior probability of A being true, given that we've observed evidence B.

We also learned that the denominator, P(B), is gotten by summing P(A,B)=P(B|A)P(A) over all possible values of B (not A!).

We solved Monty Hall first with a probability tree, then with a "natural frequencies" approach like that in Calculated Risks, and finally with a spreadsheet-like calculation in which we had columns. We put the possible states of nature (here the different places the prize might be) in the first column, the prior probabilities (1/3) of each state of nature in the second, the likelihood (probability of the data that Monty opens door 2 given that you choose door 1 and the prize is behind the door for that row) in column 3, the product of columns 2 and 3 in column 4 (the joint probability), the sum of column 4 under that column, and then the posterior probability in column 5, which is the entry in each row column 4 divided by the sum under that column.

I haven't figured out yet how to produce such a table in the blog, when I do I'll add it.

Journals

I was really pleased with the journals. Two were short of three full pages, please watch this. But the journals this week were really thoughtful and had some good ideas. Keep it up!

Thursday, September 11, 2008

HCOL 195 Class Members, Post Your Comments/Questions

OK, folks, the blog is started.

You can click on the comments section of any blog entry and log in under your Google account (if you do not have one, you can sign up for one here), and submit comments and/or questions about any item.

I will check the blog page on a regular basis and respond to questions and comments; others are welcome and encouraged do the same.

Please note that entries prior to September 1 are for a graduate class I taught a year ago, and have no relevance to our class. You are welcome to read them and comment on them, but they are quite advanced!

Bill

Monty Hall Problem

The basic thing to keep in mind is that initially, your chance of choosing the door with the prize is 1 in 3. This does not change when Monty shows you (as he must, under the rules) that one of the remaining doors has a goat. You knew that already, you just didn't know which door. So, if your door doesn't have the prize, then the one he didn't reveal must have the prize. Since there is a 1 in 3 chance that your door has the prize, there must be a 2 in 3 chance that the one he didn't open has the prize, and it pays to switch.

One way to think about it is to suppose that there are 100 doors, one of which has the prize. The chance that you initially choose the door with the prize is only 1 in 100. So, there is a 99 in 100 chance that one of those other doors has it. Monty knows which one it is, so he can open 98 doors and never reveal the prize. He will do this in 99 out of 100 games played, and in those 99 out of 100 games, the door he doesn't open will have the prize. In the 1 out of 100 games played where you chose the prize door, he'll open 99 doors at random, and the remaining door will have a goat. So in 99 out of 100 games played, it pays to switch.

I left the class with several variations of the problem to think about for class on Friday:
  1. Ignorant Monty: Monty doesn't know where the prize is, and sometimes randomly opens the door with the prize. Is it an advantage to switch, to stay, or doesn't it matter?
  2. Angelic Monty: Monty knows where the prize is. If you choose the door with the prize, he opens it and congratulates you. If you choose the wrong door, he opens a door without the prize and offers you the chance to switch. Is it an advantage to switch, to stay, or doesn't it matter?
  3. Monty From Hell: Monty knows where the prize is. If you choose the door with the prize, he opens a door without the prize and offers you the chance to switch; but if you choose a door with the goat, he opens it and says, "too bad, you lose." Is it an advantage to switch, to stay, or doesn't it matter?
  4. I didn't mention this, but we'll think about it as well. This is "Mixture Monty." Before coming on stage, Monty flips a coin. If it comes up heads, he behaves as Angelic Monty on stage. If it comes up tails, he behaves as Monty From Hell. Is it an advantage to switch, to stay, or doesn't it matter?

Comments on problem sets

These are the main rules I suggested for handling the problem sets.
  1. Unless otherwise stated, all problem sets are to be done together in your study groups. I expect one paper to be turned in for each study group. If there are disagreements within the group, spell them out in that paper.
  2. Be sure to do every part of every question.
  3. Be sure to explain carefully how you got each answer. The reasoning process is crucial.
  4. Do reality checks. Do the results seem reasonable? If they don't seem reasonable, say so, even if you don't know why!
  5. Carry units and cancel them to make sure that the units of the answer are correct. In particular, be careful to distinguish length, area, and volume.
  6. Use metric system and powers-of-ten (scientific) notation, it's much more error resistant.

September 11, 2008 10:13 AM