Module II
Probability
Recall that our eventual goal in this course is to go from the random sample
to the population. The theory that allows for this transition is the theory of
probability.
Words that are usually come top mind when you hear the word
“probability”
Chance
Likelihood
Uncertainty
Odds
Gambling
Risk
Precipitation Probability
There are three ways in which to define probability.
Definition One
Axiomatic Probability
Define an “experiment” as a situation with an uncertain outcome.
For example: You flip a fair coin.
You role a fair die.
You pick a card from a well-shuffled deck.
Define an “outcome” of an experiment as one of the possible things that
could occur.
For example:
Experiment
Outcomes
Flip a Coin
Heads or Tails
Role a Die
1,2,3,4,5, or 6
Pick a Card
Get a Heart, Spade, Club,
or Diamond
or
Pick an Ace, King,
Queen, Jack, 10, 9,etc
To define the probability of an outcome of an experiment using the
Axiomatic Definition, you follow a three step process:
1) List all of the possible outcomes (say there are K of them);
2) Assume each outcome is as likely as any other outcome;
3) Assign the probability (1/K) to each possible outcome.
In our cases then, we would have:
Experiment -- Flip a coin
Outcome
Probability
Heads
Tails
.5 = ½
.5
Experiment -- Role a die
Outcome
1
2
3
4
5
6
Probability
.1667 = 1/6
.1667
.1667
.1667
.1667
.1667
Experiment -- Pick a Card from a well shuffled deck
Outcome
Hearts
Spades
Clubs
Diamonds
Probability
.25 = ¼
.25
.25
.25
or
Outcome
Ace
King
Queen
Jack
Ten
Nine
Eight
Seven
Six
Five
Four
Three
Two
Probability
.077 = 1/13
.077
.077
.077
.077
.077
.077
.077
.077
.077
.077
.077
.077
To obtain the probability of more complicated situations (called events) one
simply adds together the probabilities of the outcomes which make up the event.
For example, the probability of rolling an even number can be found by
realizing that an even number is either a 2, a 4 or a 6. Therefore:
Probability (even number) = 1/6 + 1/6 + 1/6
= 3/6 = ½ = .5
In the card experiment,
Probability (Red Suit) = ¼ + ¼ = ½ =.5
since Diamonds and Hearts are both red suits.
Some events require a bit more thinking, for example what is the Probability
that we pick a King or pick a Spade?
The difficulty here is that the two lists we have constructed for the card
picking experiment are insufficient to answer the question for if we simply added
the probability of picking a King ( = 1/13) plus the probability of picking a Spade
( = ¼) we would overestimate the answer. This is true since if you picked the King of
Spades it would be part of both outcomes and thus you would count it twice. To
solve this problem, you would need to construct a new list with 52 outcomes (each
possible suit and rank) and then add up the possibilities to obtain a probability of
16/52 or .3077. We shall make this procedure more explicit later.
Other deeper problems exist with the Axiomatic Method. For example what
is the probability that it will rain tomorrow? Using the Axiomatic method, we could
say that the two possible out comes are either Rain or not Rain and assign each of
them a probability of .5. Clearly there is not a .5 chance of rain each day (unless
you live in Seattle).
Also, the axiomatic definition can sometimes be interpreted in several ways.
For example consider the following experiment:
I have two coins, one is a double-headed coin and the other is a regular coin
with a head and a tail. I mix them up without looking, and pick one of them, place it
down on a desk and observe that a head is showing. What is the probability that the
other side of the coin is a head?
Consider the following three arguments:
1) The probability is .5 since it is either the double-headed coin or it is not;
2) The probability is .75 since three time out of four a side will be heads:
3) The probability is 2/3 since the double headed coin has twice the chance
of showing a head face up.
All of these arguments are “logical” but only one of them is correct. Before
you go to the next page pick the one you think makes the most sense to you.
If you picked 2/3 you are correct, and if you picked one of the other answers
you probably still don’t believe it is true.
How does one resolve a situation like the above or apply probability to events
like rain or no rain. The answer is to use the Frequency Definition of Probability.
Definition Two
Probability as Frequency of Occurrence
The way to resolve which of the three arguments given above is to actually
perform the experiment a large number of times and see which of three
probabilities is correct by measuring how often the event occurred. That is, we
could take a coin and mark both sides as heads and then also select a normal coin.
We place them into a cup and shake the cup and pick a coin out at random. We
would then place the coin on the desk and observe which side was up. If a tail
showed, we would stop and repeat the experiment, if a head was showing we would
look at the other side and record the number of times we got heads. By dividing this
number by the number of times heads showed, we would get the proportion of
times that the other side of the coin was a head. This process is called simulation
and forms the basis of the frequency definition of probability.
Let A be an event, and assume that you have performed an experiment n
times so that n is the number of times A could have occurred. Further let nA be the
number of times that A did occur. Then define:
P(A) = nA / n.
It is possible to criticize this definition by pointing out that if I flipped a coin
100 times and counted 52 heads, I would say that the probability of heads is .52. If
you then flipped the same coin 100 times and got 47 heads, you would say the
probability of heads is .47. How can the same coin have different probabilities of
coming up heads?
Notice that if I pooled my results and your results, we would have 99 heads in
200 flips giving a probability of heads of .495. By flipping the coin a larger and
larger number of times (i.e. increasing n), it can be shown that the absolute
deviation from .5 (assuming the coin is “fair”) would get smaller and smaller as n
increased. Therefore using the concept of the limit from Calculus, this objection
could be removed by the definition:
P ( A ) lim( nA / n )
n
From this definition of Probability we see immediately that for any event A,
0 P( A ) 1
since it is impossible for A to occur less that 0% of the time, and it is impossible for
A to occur more than 100 % of the time.
Now if you wished to find the Probability of Rain, you could look through
meteorological records to find days with similar weather conditions and determine
the proportion of times it rained on such days.
Similarly, you wouldn’t have to assume that a coin was fair, you could flip it
many times and see if it moved toward a probability of heads of .5.
Of course physical simulation of experiments takes a great deal of time.
Most of the time it is done by computer.
Computer Simulation
In order to simulate a random situation on the computer, we must have the
computer perform the same steps as would be performed if you were simulating the
situation physically. Consider the steps involved in physically simulating the double
headed coin problem:
1) Pick one of the two coins at random
2) Determine if a head is showing when you put it on the desk
3) Determine if the other side of the coin is also a head.
The computer must simulate each one of the above steps. One way to do
this is to use the RAND() command which we used in EXCEL when we were taking
a random sample. Since RAND() generates pseudo-random numbers which are
approximately equi-probable on the range of 0 to 1, we could establish the rule that
if the random number is less than .5 then the two headed coin is picked, otherwise
the regular coin is picked. This would accomplish Step 1 above.
To perform step2 realize that if the two headed coin is picked, then it will
always show a head. On the other hand, if the regular coin is picked then there is
only a .5 chance that a head will show so we would have to generate another random
number to decide if the head or tail was showing. We could use the rule that if the
second random number is less than or equal to .5, a head will show, otherwise it
would be a tail
Step 3 is automatic since if a head is showing, only the double-headed coin
has the flip side as a head.
Notice that except for the RAND() command, the rest of the simulation is a
series of “if” statements.
EXCEL also has a command called “IF” it has the form:
=IF(condition, result if true, result if false)
Notice that there are three arguments inside the parentheses. The first is the
condition we are evaluating. For example in order to pick a coin, we would put in
the condition
RAND()<=.5
If it is true, we will put a “1” in to indicate that the double headed coin was
picked, otherwise if it is false we will put a “0” to indicate that it is the regular coin .
The whole statement would look like this:
=IF(RAND()<=.5, 1, 0).
Open up an EXCEL file and put this statement into cell B7.
For the second step (is a head showing), we now want to determine if ahead is
showing. We can use the “IF” statement again. For the condition we use:
B7 = 1
If this is true, then it is the double headed coin and a head is showing.
Indicate this with a “1”.
If it is false, then a head will show only half the time, so we will put in the
following result in the false area:
IF(RAND()<=.5,1,0).
You will notice that this is exactly the command we used in cell B7 because
again we are simulating an event with a probability of occurrence of .5. The whole
statement would look like this:
=IF(B7=1, 1, IF(RAND()<=.5, 1, 0)) .
Type the above line into cell D7. Now copy cells B7, C7 and D7 down the
sheet for one hundred rows. This is equivalent to doing the picking 100 times.
You should observe something like the following (which I have reproduced
from EXCEL worksheet “simhead.xls” which can be found in folder MBA Part II).
Now add up all the values in Column B and Column C using the EXCEL
command “SUM”. Enter the following command in cell B108:
=SUM(B7:B106)
This will add the 100 values you entered in column B. Enter a similar sum in
Column D using the expression:
=SUM(D7:D106).
The result should look something like the following:
Case
Col B
Col D
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
0
0
1
0
0
1
0
1
1
0
1
0
0
0
1
1
0
1
1
0
0
1
0
1
1
0
1
1
1
0
1
1
Sum
56
84
The value “84” is the sum of the values in column D and indicates that 84
times out of 100, the side showing was a head.
The value “56” is the sum of the values in column B and indicates that 56
times out of 100 we picked the two-headed coin.
Therefore of the 84 time a head was showing, 56 times it was the two-headed
coin and the flip side of the head showing was a head. This is a proportion of:
56 / 84 = .666666.
Therefore this is our estimate of the probability that the other side of the coin
showing a head, is also a head.
The graph below indicates how the probability that the other side of the coin
is a head given that a head is showing approaches its correct value as the number of
trials increases from 1 to 100. You will notice that when n is small, the value of the
probability varies from its correct value, but as n gets large it approaches its correct
limiting value of .66667.
Prob Other Side is a Head
0.8
Prob
Prob
0.6
.5
0.4
2/3
0.2
.75
0
1
10
19
28
37
46
55
64
Cumulative trials
73
82
91 100
The result does not always come out exactly equal to 2/3. On your worksheet
press the F9 key (i.e. the F9 function key usually on the top row of your lap-top).
You will notice that all the numbers change and you get new sums. Pressing that
one key is equivalent to performing the experiment 100 more times. I did this 50
times (equivalent to performing the simulation 5,000 times) with the following
results summarized in histogram form:
Histogram
14
12
Frequency
10
8
6
4
2
0
0.5
0.525
0.55
0.575
0.6
0.625
0.65
0.675
0.7
0.725
0.75
0.775
More
Probability
As you can see I never got a value of .5, and rarely went over .75. The
average probability was .657 and the median was .667. This clearly indicates that
the correct answer is .667.
Although the frequency definition is very useful and simulation allows one to
quickly get answers without a great deal of symbolic manipulation, the definition is
still not complete.
Consider a horse race say with eight horses running. What is the probability
that horse 3 will win the race?
The axiomatic method would say 1/8 = .125. Clearly this is wrong.
The frequency method would require us to run the race over and over again
to determine how often horse 3 wins. However, this is impractical and dull. Rarely
are all the horses in a race the same as in any previous race.
Yet it makes sense to speak about the probability of this event, and in fact
people regularly place bets on the outcomes of such “one time” events.
Definition 3
Subjective Probability
The last definition of probability is called Subjective Probability which says:
Pr(A) = anything you think it is.
Now at first this sounds preposterous, can I just say that the probability of a
coin coming up heads is .75 just because I think it is?
The answer is no, because we could flip the coin and use the frequency
approach to determine the probability.
Therefore we must restrict subjective probability only to those events which
are either theoretically unrepeatable or, like the race example above, practically
unrepeatable.
Surprisingly, a great number of business situations are “one-time” events,
which require the use of subjective probability. Indeed, the entire market concept is
based on the idea of differing assessments of the probability of an event by different
people.
Think of a simple sale of 100 shares of stock. The person selling the stock
probably thinks they will decrease in value. On the other hand, the buyer must
think that the same stocks will increase in value, otherwise why would he buy them?
A great many people have models or “systems” for selling and buying shares,
some based on complicated statistical models and others based on the analysis of
stock prices in similar situations in the past, but since the market rarely duplicates
itself exactly, the other approaches can only provide guidance on what is essentially
a “unique”, unrepeatable set of conditions.
We shall see later, that one can actually determine a person’s subjective
probability by determining the amount of money they would wager on the outcome
(Incidentally, there is no structural difference between placing a bet, investing in a
stock, or taking out an insurance policy. From the point of view of the theory of
probability they are all mathematically the same).
Fortunately, one can show what whatever definition is used, the laws of
Probability are all the same. Accordingly the various techniques can be mixed in
any actual decision.
In buying a stock we might consult a forecaster (probably using an
econometric model (usually built with Axiomatic models and past data ). In
addition you might look at your past success in similar situations (the Frequency
approach). And taking the first two methods into account you will follow your
“hunch” (the Subjective approach). Studies of management decision making have
indicated that just playing your “hunch” without looking at past data or more
formal models is not a good way to make decisions. These same studies have also
indicated that blindly following models and past data without using your experience
is also a poor way to make decisions. The best way seems to be a mix of
quantitative models, past data, and your own experience.
The Basic Rules of Probability
Since all three of the definitions of probability must follow the same rules, we
shall use the frequency definition to motivate the basic rules.
We have already used two of the basic rules in our earlier discussion. The
first rule is:
0 P( A ) 1
A probability of 0 corresponds to an event, which cannot possibly occur. A
probability of 1 corresponds to an event that will happen with absolute surety.
Needless to say these extremes are rarely encountered in the real world.
The second rule applies to two events A and B which are mutually exclusive,
that is the two events cannot occur at the same time. In this case we can say that:
P(A or B) = P(A) + P(B).
(Note that some textbooks use the mathematical symbol “” instead of the
word “or”. The symbol “” is a mathematical representation for the union of two
sets. Since business executives rarely deal with Set Theory, I will use the word “or”
as this is the equivalent when Set Theory is applied to verbal statements in the study
of Logic.)
The above rule only applies to two events, which cannot happen at the same
time (mutually exclusive). There are many business events that can happen
simultaneously. In order to generalize the result to such situations, consider the
following simple experiment.
You roll two dice, one red and one blue. Let A be the event that the red die is
even and let B be the event that the blue die is even. In order to compute the
probability, examine the table below which shows all possible outcomes of the roles:
Red Die
1
2
3
4
5
6
1
X
X
X
X
X
X
2
X
X
X
X
X
X
Blue
Die
3
X
X
X
X
X
X
4
X
X
X
X
X
X
5
X
X
X
X
X
X
6
X
X
X
X
X
X
The points which correspond to event A are the rows highlighted in red. The
points which correspond to event B are highlighted in blue. If we assume that the
dice are fair, then every point has a probability of 1/36= .0278. Since there are 18
points which where the red die is even, the event A has probability .5. Similarly, the
event B also has probability .5.
Now the probability that the red die is even or the blue die is even cannot be
the simple sum of the two probabilities since they add up to 1. This would imply
every time one rolled the die one would have to get either an even number on the
red die or an even number on the blue die. Clearly the white cells above show that
this does not occur.
The mistake is that the grey cells above are being double counted. The
correct answer is obtained by counting the number of cells that are non-white (27)
and multiplying by 1/36 to obtain .75. Another way to obtain the same result is to
add the 18 cells that represent the red die being even, plus the 18 cells that represent
the blue die being even and subtracting the nine cells where both the red die is even
and the blue die is even. The results gives (18 + 18 –9)/36 = .75. This leads to the
generalized formula which applies to any events A and B:
P(A or B) = P(A) + P(B) – P(A and B)
where P(A and B) is the probability that the two events occur simultaneously.
If you know the P(A), how do you find the P(not A)? The event “not A”, is
called the complement of the event A. For example, in the above we found that the
probability of the Red Die being even and the Blue Die being even was .25. By a
similar argument we could find that the probability of the Red Die being odd and
the Blue Die being odd is also .25. We could then compute that the probability that
both dice are either odd together or even together is .5 (i.e. .25 + .25). If we think of
A as the probability that both dice are either odd or both are even, then the event
“not A” would correspond to the event that one of dice is even and the other is odd.
To compute the probability, let us again use the frequency definition of
probability. First realize that if we do something n times and each time either A or
not A can occur then one has:
n = nA + nnot A
It then immediately follows that :
P(not A) = nnot A / n = (n – nA)/n = 1 – nA/n = 1 – P(A).
In our example then the probability that one of the dice is even and the other
is odd is 1 - .5 = .5 .
So far we have treated events as unchanging. But in the real world,
probabilities change as we get more and more information. For example, we know
that the probability that a fair coin comes up heads is .5. But suppose I told you
that I had flipped a coin ten times and it had come up heads 10 times in a row.
What do you think the probability is that it comes up heads on the 11th flip?
Most people would think (incorrectly) that the probability of heads would be
lower and that tails would now be more likely (actually it might be more probable).
This is an example of computing a probability when we are given some prior
information. If we want to compute the probability of the event A given some
condition which has already occurred, say B we would write this symbolically as
P(A B)
and read it as the probability of A given that B has occurred.
From the frequency definition of probability, we would discard all the times
that B did not occur (leaving us with nB times when B occurred) and then of those
look at the number of times A also occurred. In other words we would find the
proportion of times A occurred of the times that B occurred. We could write this as:
P(AB) = nA and B /nB
.
If one now divides the numerator and denominator by n , we arrive at the
general formula:
P(AB) = P(A and B) / P(B) .
By interchanging the roles of A and B in the previous formula and realizing
that the event "B and A" is the same as the event "A and B" we arrive at the
formula:
P(BA) = P(A and B)/ P(A).
In general then P(AB) P(BA) unless it accidentally happens that P(A) =
P(B), or the events A and B are mutually exclusive so that P(A and B) = 0.
The fact that these two probabilities are usually unequal causes a great deal
of confusion as colloquial spoken or written English is not always careful to
distinguish between the cases.
Keep in mind the difference between the probability of rain given that it is
cloudy and the probability that it is cloudy given that it is raining.
The last two formulae lead to the general multiplicative rules of probability
which state that:
P(A and B) = P(AB) P(B)
= P(BA) P(A) .
These multiplicative laws always apply and allow one to obtain the
probabilities of the joint occurrence of events.
Suppose I told you that the probability of the market going up tomorrow
was .60. If I then told you that Alan Greenspan, the current Chairman of the
Federal System, planned to raise interest rates in the United States, would you alter
your assessment of the probability of the market going up?
Most people would revise their estimate of the probability downward. This
implies that the event "raising interest rates" has an effect on the event that the
market goes up. In other words there is a dependence between the events.
On the other hand if I told you that I had just received a clean bill of health
after undergoing a physical examination, would you revise your estimate of the
market going up tomorrow from .60?
Probably not since there is no plausible connection between the events
"market going up tomorrow" and my good health. In this case we would say the
two events are unrelated or independent.
We say two events A and B are independent if:
P(AB) = P(A)
or
P(BA) = P(B).
(One can show mathematically that if either one is true, then so is the other).
If two events are independent, then by substituting the above definition into
the general rule of multiplying probabilities, we get the special case that:
P(A and B) = P(A) P(B).
It must be emphasized that this special multiplicative rule is the exception
with most events in the business world exhibiting dependence.
Although these rules of probability are few and simple, they are incredibly
powerful in application. As an example (which is much more complicated than
anything you as a manager would be expected to deal with) consider the following
situation. You randomly sample 30 of the employees at your firm. What is the
probability that at least two of the employees were born on the same day in the same
month (ignoring the year of their birth)?
First we must realize that this is a very complicated event. It could be the
case that all 30 were born on the same day in the same month or only two people
share the same birthday , or three people share the same birthday, or perhaps two
people share one birthday, and another two share a different birthday, etc.
However the complement of this event is quite simple, that is that no two
people share the same birthday. If I could find the probability that no two people
share the same birthday, then by subtraction from 1.00, I would have the answer to
my question.
In order to find the probability that no two people have the same birthday, I
will have to make two assumptions.
First, I will not deal with the problem of leap years, that is years with the day
February 29. I will just assume that such individuals either celebrate their birthday on
February 28 or March 1.
Second, I will assume that births are equally distributed throughout the year,
that is, that approximately the same number of people are born on each day of the year.
(This assumption is approximately true in societies in pleasant climates or in societies
that effectively control inside climates through use of air-conditioning and heating).
Now consider the first person picked at random. He or she was obviously
born on some day, so let us assign that person a probability of 1.
Now consider the second person picked at random. Given that the first
person was born on one of the 365 days in the year, what is the probability that the
second person was born on a different day?
Since one of the days is assigned to the first person, the conditional
probability of being born on a different day is then 364/365.
Using the general multiplicative rule, the joint probability that the first two
people picked at random were born on different days is then:
1 x 364/365 = .997260.
The probability of the at least two of the first two having the same birthday is
then:
1 - .997260 = .002740
Now consider the third person picked at random. Given that the first two
were born on different days, what is the probability that the third person was born
on still another day?
Since two days have been used up, the conditional probability is 363/365.
Accordingly, using the general multiplicative rule, the probability of all three having
different birthdays is:
1 x (364/365) x (363/365) = .991796.
And the probability in a random group of three people that at least two have
the same birthday is:
1- .991796 = .008204.
Continuing with this same argument, and writing "1" as 365/365, we get that
the in a random group of 30 people, the probability that all 30 have different
birthdays is:
(365/365) x (364/365) x (363/365) x ………….x(336/365) = .293684.
Accordingly, the probability that at least two people have the same birthday
is:
1 - .293684 = .706316.
Most people are surprised at how large this value is.
If you open the EXCEL file "birth.xls", you will find this probability
computed for all group sizes from n =2 to n = 75. The plot below shows how the
probability changes with n, the size of the group:
Probability of At Least Two People with Same Birthday
1.2
1
Probability
0.8
0.6
0.4
0.2
74
70
66
62
58
54
50
46
42
38
34
30
26
22
18
14
10
6
2
0
Number of People
As you can see, the probability rises quite sharply as the group size increases,
with the probability being approximately 50-50 with a group of 23 people.
If I introduce the notation:
n! = n x (n-1) x (n-2) x ……….x 1
( with the convention that 0! = 1),
then a general formula for the probability that at least 2 people out of n have
the same birthday is given by:
1 – 365! / [(365-n)! 365n]
for n = 2, 3, ….., 365.
Again, this problem is much more complicated than anything you as a manager
would be expected to solve. However, it does illustrate the power of the simple rules
of probability.
Bayes Probabilities
Suppose that the probability of a randomly chosen person having an active
case of tuberculosis (TB) is 1/1000 = .001. Suppose that a diagnostic test exists
which if a person has TB, will indicate a positive result 99% of the time. Further
suppose that if a person does not have TB, the test will indicate a negative result
99% of the time.
Suppose that you visit the doctor and are administered this test. If the result
is positive, do you think that you have good chance of having an active case of TB?
Most people would be extremely worried. We shall show, however, that
although you should be more concerned than if you had tested negative, there is a
relatively low chance that you have an active case of TB.
The fallacy in thinking that the probability is high is that most people
confuse the two probabilities:
P("+" test result TB)
and
P(TB "+" test result).
That is they confuse P(AB) and P(BA).
Bayes rule says that if we have K events B1, B2 , …., BK such that,
K
P( B
i 1
i
)1
and if A is any event, then:
P ( Bi | A )
P ( A | Bi )P ( Bi )
K
P( A | B
i 1
i
)P ( Bi )
To use this formula in this case, we would take B1 = “Have TB”, B2 = “ No
TB”, and A = “Positive Result on Test”.
However, there are two easier ways to achieve the same effect. These are
algorithms which automatically compute the desired probability, and in fact use the
above formula but they do so in a non-algebraic way.
The first method is called the method of the Artificial Population. Basically
one simply uses the information given in the problem and creates a population that
follows the proportions exactly. This method works very well in the case where
there are only two conditions as there are in this problem.
Assume we have a population of 1,000,000 persons and set up the following
table:
Positive
Test
Negative
Test
Total
Have TB
No TB
Total
1,000,000
Now let us apply the fact that approximate 1 in a 1,000 persons has TB. By
multiplying (1/1000) time 1,000,000 we get 1,000 people having TB and it then
follows that 1,000,000 – 1,000 = 999,000 would not have TB. The table would now
look like:
Positive
Test
Negative
Test
Total
Have TB
1,000
No TB
999,000
Total
1,000,000
The next step is to realize that of the 1,000 people with TB, 99% will test
positive. Similarly, of the 990,000 people without TB, 99% will test negative.
Multiplying we get the following entries:
Positive
Test
Have TB
No TB
Total
Negative
Test
990
Total
1,000
989,010
999,000
1,000,000
Now since we know the row total, we can fill in the missing cells by
subtraction to obtain:
Positive
Test
Negative
Test
Total
Have TB
990
10
1,000
No TB
9,990
989,010
999,000
Total
1,000,000
Finally, we can complete the table by adding up the values to get the column
totals. The final table would then become:
Positive
Test
Negative
Test
Total
Have TB
990
10
1,000
No TB
9,990
989,010
999,000
Total
10,980
989,020
1,000,000
It is now easy to compute that the probability someone with a positive test
has TB as:
P( TB + result) = 990/10,980 = .09016.
The reason that the probability is not higher, is that there are a large number
of false positives, that is people without TB who test positive.
If you have a negative result, you can use the above results to show:
P( TB - result) = 10/989,020 = .0000101
The second algorithmic method for implementing Bayes Rule is the decision
tree method. It can be used in more complicated situations then the Artificial
Population Method, and is sometimes of more general use.
One begins by listing all the possible situations that could exist. In our case a
person could either have TB or not have TB; and each person could either have a
positive or negative test result. These options are shown below:
TB
STATUS
Test
Result
+
TB
-
No TB
+
Person
-
Next we add the probabilities on each of the possible branches. This is shown
in the tree below:
TB
STATUS
Test
Result
0.99
+
0.001
TB
0.01
Person
No TB
0.999
0.01
+
0.99
Now consider the highlighted cells in the decision tree shown below. In order
to reach any of them from the starting position, one has to travel along the
branches. Since the probabilities of the test results depend on whether or not a
person has TB, we can use the general rule of multiplying probabilities of the disease
state and the test result. These are shown as the products in the highlighted cells.
TB
STATUS
0.001
TB
Test
Result
Joint
Probability
Event
0.99
+
.001 x .99
TB and "+" Test
.001 x .01
TB and "-" Test
0.01
Person
No TB
0.999
0.01
+
0.99
.999 x .01 No TB and "+" Test
.999 x .99
No TB and "-" Test
With the probabilities entered, we can sum the highlighted values to make
sure that all possibilities have been included. Since, in our case, they total to one, we
are sure that all possibilities have been considered.
TB
STATUS
0.001
TB
Test
Result
Joint
Probability
Event
0.99
+
0.00099
TB and "+" Test
0.00001
TB and "-" Test
0.00999
No TB and "+" Test
0.98901
No TB and "-" Test
0.01
Person
No TB
0.999
0.01
+
0.99
Probability Sum =
1.00000
Now we can compute the desired probability.
We want the probability of having TB given a positive test results. By the
definition of conditional probability, this is:
P ( TB |" " test )
P ( TB & "" test )
P (" " test )
From the above table we have
P(TB and “+” test) = .00099.
It is also clear that
P(“+” test) = .00099 + .00999 = .01098.
Therefore, the probability of having TB given a positive test result is:
.00099/.01098 = .09016
The probability of having TB given a negative test result can similarly be
computed as:
.00001/.98902 = .0000101.
These are the same values we computed using the artificial population
method.
© Copyright 2026 Paperzz