









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Suppose that we pick a random person in the world. Everyone has an equal chance of being selected. Let A be the event that the person is an MIT student, and let B be the event that the person lives in Cambridge. What are the probabilities of these events? Intuitively, we’re picking a random point in the big ellipse shown below and asking how likely that point is to fall into region A or B:
set of all people in the world
set of people who live in Cambridge
set of MIT students
The vast majority of people in the world neither live in Cambridge nor are MIT students, so events A and B both have low probability. But what is the probability that a person is an MIT student, given that the person lives in Cambridge? This should be much greater— but what it is exactly?
What we’re asking for is called a conditional probability ; that is, the probability that one event happens, given that some other event definitely happens. Questions about conditional probabilities come up all the time:
There is a special notation for conditional probabilities. In general, Pr (A | B) denotes the probability of event A, given that event B happens. So, in our example, Pr (A | B) is the probability that a random person is an MIT student, given that he or she is a Cam bridge resident.
How do we compute Pr (A | B)? Since we are given that the person lives in Cambridge, we can forget about everyone in the world who does not. Thus, all outcomes outside event B are irrelevant. So, intuitively, Pr (A | B) should be the fraction of Cambridge residents that are also MIT students; that is, the answer should be the probability that the person is in set A ∩ B (darkly shaded) divided by the probability that the person is in set B (lightly shaded). This motivates the definition of conditional probability:
Pr (A | B) =
Pr (A ∩ B) Pr (B)
If Pr (B) = 0, then the conditional probability Pr (A | B) is undefined.
Probability is generally counterintuitive, but conditional probability is the worst! Con ditioning can subtly alter probabilities and produce unexpected results in randomized algorithms and computer systems as well as in betting games. Yet, the mathematical definition of conditional probability given above is very simple and should give you no trouble— provided you rely on formal reasoning and not intuition.
The Halting Problem is the canonical undecidable problem in computation theory that was first introduced by Alan Turing in his seminal 1936 paper. The problem is to determine whether a Turing machine halts on a given blah, blah, blah. Anyway, much more impor tantly, it is the name of the MIT EECS department’s famed Cleague hockey team.
In a bestofthree tournament, the Halting Problem wins the first game with probability 1 2.^ In^ subsequent^ games,^ their^ probability^ of^ winning^ is^ determined^ by^ the^ outcome^ of^ the previous game. If the Halting Problem won the previous game, then they are envigorated by victory and win the current game with probability 23. If they lost the previous game, then they are demoralized by defeat and win the current game with probablity only 13. What is the probability that the Halting Problem wins the tournament, given that they win the first game?
This is a question about a conditional probability. Let A be the event that the Halting Problem wins the tournament, and let B be the event that they win the first game. Our goal is then to determine the conditional probability Pr (A | B).
We can tackle conditional probability questions just like ordinary probability prob lems: using a tree diagram and the fourstep method. A complete tree diagram is shown below, followed by an explanation of its construction and use.
Step 4: Compute Event Probabilities
We can now compute the probability that The Halting Problem wins the tournament, given that they win the first game:
Pr (A | B) =
Pr (A ∩ B) Pr (B) Pr ({W W, W LW }) = Pr ({W W, W LW, W LL}) 1 /3 + 1/ 18 = 1 /3 + 1/18 + 1/ 9 7 = 9
We’re done! If the Halting Problem wins the first game, then they win the whole tourna ment with probability 7 / 9.
1.2 Why Tree Diagrams Work
We’ve now settled into a routine of solving probability problems using tree diagrams. But we’ve left a big question unaddressed: what is the mathematical justficiation behind those funny little pictures? Why do they work?
The answer involves conditional probabilities. In fact, the probabilities that we’ve been recording on the edges of tree diagrams are conditional probabilities. For example, con sider the uppermost path in the tree diagram for the Halting Problem, which corresponds to the outcome W W. The first edge is labeled 1 / 2 , which is the probability that the Halt ing Problem wins the first game. The second edge is labeled 2 / 3 , which is the probability that the Halting Problem wins the second game, given that they won the first— that’s a conditional probability! More generally, on each edge of a tree diagram, we record the probability that the experiment proceeds along that path, given that it reaches the parent vertex.
So we’ve been using conditional probabilities all along. But why can we multiply edge probabilities to get outcome probabilities? For example, we concluded that:
1 2 Pr (W W ) = 2
Why is this correct?
The answer goes back to the definition of conditional probability. Rewriting this in a slightly different form gives the Product Rule for probabilities:
Rule (Product Rule for 2 Events). If Pr (A 2 ) = 0� , then:
Pr (A 1 ∩ A 2 ) = Pr (A 1 ) · Pr (A 2 |A 1 )
Multiplying edge probabilities in a tree diagram amounts to evaluating the right side of this equation. For example:
Pr (win first game ∩ win second game) = Pr (win first game) · Pr (win second game | win first game) 1 2 = 2
So the Product Rule is the formal justification for multiplying edge probabilities to get outcome probabilities!
To justify multiplying edge probabilities along longer paths, we need a more general form the Product Rule:
Rule (Product Rule for n Events). If Pr (A 1 ∩... ∩ An− 1 ) = 0, then:
Pr (A 1 ∩... ∩ An) = Pr (A 1 ) · Pr (A 2 | A 1 ) · Pr (A 3 | A 1 ∩ A 2 ) · · · Pr (An |A 1 ∩... ∩ An− 1 )
Let’s interpret this big formula in terms of tree diagrams. Suppose we want to compute the probability that an experiment traverses a particular roottoleaf path of length n. Let Ai be the event that the experiment traverses the ith edge of the path. Then A 1 ∩... ∩ An is the event that the experiment traverse the whole path. The Product Rule says that the probability of this is the probability that the experiment takes the first edge times the probability that it takes the second, given it takes the first edge, times the probability it takes the third, given it takes the first two edges, and so forth. In other words, the probability of an outcome is the product of the edge probabilities along the corresponding roottoleaf path.
Suppose that we turn the hockey question around: what is the probability that the Halting Problem won their first game, given that they won the series?
This seems like an absurd question! After all, if the Halting Problem won the series, then the winner of the first game has already been determined. Therefore, who won the first game is a question of fact, not a question of probability. However, our mathemati cal theory of probability contains no notion of one event preceding another— there is no notion of time at all. Therefore, from a mathematical perspective, this is a perfectly valid question. And this is also a meaningful question from a practical perspective. Suppose that you’re told that the Halting Problem won the series, but not told the results of indi vidual games. Then, from your perspective, it makes perfect sense to wonder how likely it is that The Halting Problem won the first game.
always comes up heads. Now you choose a coin at random so that you’re equally likely to pick each one. If you flip the coin you select and get heads, then what is the probability that you flipped the fair coin?
This is another a posteriori problem since we want the probability of an event (that the fair coin was chosen) given the outcome of a later event (that heads came up). Intuition may fail us, but the standard fourstep method works perfectly well.
Step 1: Find the Sample Space
The sample space is worked out in the tree diagram below.
fair
unfair
choice of coin
result
flip
outcome event A: probability fair coin?
event B: outcome heads?
event chose A B?
Step 2: Define Events of Interest
Let A be the event that the fair coin was chosen. Let B the event that the result of the flip was heads. The outcomes in each event are marked in the figure. We want to compute Pr(A | B), the probability that the fair coin was chosen, given that the result of the flip was heads.
Step 2: Compute Outcome Probabilities
First, we assign probabilities to edges in the tree diagram. Each coin is chosen with prob ability 1 / 2. If we choose the fair coin, then head and tails each come up with probability 1 / 2. If we choose the trick coin, then heads comes up with probability 1. By the Product Rule, the probability of an outcome is the product of the probabilities on the correspond ing roottoleaf path. All of these probabilities are shown in the tree diagram.
Step 4: Compute Event Probabilities
Pr(A | B) =
Pr(A ∩ B) Pr(B) 1 = 4 (^1) + 1 4 2 1 = 3
The first equation uses the Product Rule. On the second line, we use the fact that the probability of an event is the sum of the probabilities of the outcomes it contains. The final line is simplification. The probability that the fair coin was chosen, given that the result of the flip was heads, is 1 / 3.
2.2 A Variant of the Two Coins Problem
Let’s consider a variant of the two coins problem. Someone hands you either a fair coin or a trick coin with heads on both sides. You flip the coin 100 times and see heads every time. What can you say about the probability that you flipped the fair coin? Remarkably— nothing!
In order to make sense out of this outrageous claim, let’s formalize the problem. The sample space is worked out in the tree diagram below. We do not know the probability that you were handed the fair coin initially— you were just given one coin or the other— so let’s call that p.
result of 100 flips
1/ 100
1/2^100
1−1/2^100
event A: given fair coin?
event B: flipped all heads? coin given to you
fair coin
trick coin
all heads
some tails
all heads
probability X
X
X
X 1−p
p / 2
p − p / 2
100
100
p
1−p
Let A be the event that you were handed the fair coin, and let B be the event that you flipped 100 heads. Now, we’re looking for Pr(A | B), the probability that you were
test is not perfect, however:
A random person is tested for the disease. If the test is positive, then what is the probability that the person has the disease?
Step 1: Find the Sample Space
The sample space is found with the tree diagram below.
person has X? test result outcome probability event A B?
yes
no
pos
neg
pos
neg
.
.
.
.
.
.
.
.
.
. event A: event B: has disease?
test positive?
Step 2: Define Events of Interest
Let A be the event that the person has the disease. Let B be the event that the test was positive. The outcomes in each event are marked in the tree diagram. We want to find Pr (A | B), the probability that a person has disease X, given that the test was positive.
Step 3: Find Outcome Probabilities
First, we assign probabilities to edges. These probabilities are drawn directly from the problem statement. By the Product Rule, the probability of an outcome is the product of the probabilities on the corresponding roottoleaf path. All probabilities are shown in the figure.
Step 4: Compute Event Probabilities
Pr(A | B) =
Pr (A ∩ B) Pr (B)
If you test positive, then there is only a 25% chance that you have the disease!
This answer is initially surprising, but makes sense on reflection. There are two ways you could test positive. First, it could be that you are sick and the test is correct. Second, it could be that you are healthy and the test is incorrect. The problem is that almost everyone is healthy; therefore, most of the positive results arise from incorrect tests of healthy people!
We can also compute the probability that the test is correct for a random person. This event consists of two outcomes. The person could be sick and the test positive (probability
But wait! There is a simple way to make the test correct 90% of the time: always return a negative result! This “test” gives the right answer for all healthy people and the wrong answer only for the 10% that actually have the disease. The best strategy is to completely ignore the test result!
There is a similar paradox in weather forecasting. During winter, almost all days in Boston are wet and overcast. Predicting miserable weather every day may be more accu rate than really trying to get it right!
The remaining sections illustrate some common blunders involving conditional probabil ity.
There is a gambling game called Carnival Dice. A player picks a number between 1 and 6 and then rolls three fair dice. The player wins if his number comes up on at least one die. The player loses if his number does not appear on any of the dice. What is the probability that the player wins? This problem sounds simple enough that we might try an intuitive lunge for the solution.
We can use this theorem to compute the real chance of winning at Carnival Dice. The probability that one die matches the player’s guess is 1 / 6. The probability that two dice both match the player’s guess is 1 / 36 by the Product Rule. Similarly, the probability that all three dice match is 1 / 216. Plugging these numbers into the preceding theorem gives:
Pr (win) = + + 6 6 6 1 1 1 − 36
These are terrible odds for a gambling game; you’d be much better off playing roulette, craps, or blackjack!
4.2 Other Identities
There is a close relationship between computing the size of a set and computing the prob ability of an event. Theorem 3 is one example; the probability of a union of events and the cardinality of a union of sets are computed using similar formulas.
In fact, all of the methods we developed for computing sizes of sets carry over to com puting probabilities. This is because a probability space is just a weighted set; the sample space is the set and the probability function assigns a weight to each element. Earlier, we were counting the number of items in a set. Now, when we compute the probability of an event, we are just summing the weights of items. We’ll see many examples of the close relationship between probability and counting over the next few weeks.
Many general probability identities still hold when all probabilities are conditioned on the same event. For example, the following identity is analogous to the Inclusion Exclusion formula for two sets, except that all probabilities are conditioned on an event C.
Pr (A ∪ B | C) = Pr (A | C) + Pr (A | C) − Pr (A ∩ B |C)
Be careful not to mix up events before and after the conditioning bar! For example, the following is not a valid identity:
Pr (A | B ∪ C) = Pr (A | B) + Pr (A |C) (B ∩ C = φ)
A counterexample is shown below. In this case, Pr (A | B) = 1, Pr (A |C) = 1, and Pr (A | B ∪ C) = 1. However, since 1 = 1 + 1, the equation above does not hold.
sample space
So you’re convinced that this equation is false in general, right? Let’s see if you really believe that.
4.3 Discrimination Lawsuit
Several years ago there was a sex discrimination lawsuit against Berkeley. A female pro fessor was denied tenure, allegedly because she was a woman. She argued that in every one of Berkeley’s 22 departments, the percentage of male applicants accepted was greater than the percentage of female applicants accepted. This sounds very suspicious!
However, Berkeley’s lawyers argued that across the whole university the percentage of male tenure applicants accepted was actually lower than the percentage of female appli cants accepted. This suggests that if there was any sex discrimination, then it was against men! Surely, at least one party in the dispute must be lying.
Let’s simplify the problem and express both arguments in terms of conditional prob abilities. Suppose that there are only two departments, EE and CS, and consider the experiment where we pick a random applicant. Define the following events:
Assume that all applicants are either male or female, and that no applicant applied to both departments. That is, the events FEE , FCS , MEE , and MCS are all disjoint.
In these terms, the plaintiff is make the following argument:
Pr (A | FEE ) < Pr (A |MEE ) Pr (A | FCS ) < Pr (A |MCS )
America West had a better overall ontime percentage, but Alaska Airlines did better at every single airport! This is the same paradox as in the Berkeley tenure lawsuit. The prob lem is that Alaska Airlines flew proportionally more of its flights to bad weather airports like Seattle, whereas America West was based in fairweather, lowtraffic Phoenix!