Theory
Conditional probability, independence, and Bayes' theorem
Calculating probabilities given new information, recognizing independence, and updating probabilities with Bayes' theorem.
This chapter calculates probabilities when some information is already known. One example is quality control in a department where of the items are defective. An automatic inspection flags of the defective items and, by mistake, also of the nondefective items. If an item is flagged, the probability that it is actually defective is about , so just over one flagged item in four is defective. The number answers a different question, namely what proportion of the defective items is flagged. The chapter shows how to keep the two questions apart and how to move from one to the other.
There are five tools. Conditional probability is a probability calculated within a group, for example among the flagged items only. The multiplication rule gives the probability of an experiment in several stages, such as two successive draws from an urn. The law of total probability obtains the rejection rate of the whole production from the rejection rates of the individual lines. Bayes’ theorem reverses the direction of conditioning, that is, it goes from the proportion of defective items that are flagged, , to the proportion of defective items among the flagged ones, . Two events are independent when knowing that one has occurred leaves the probability of the other unchanged, as with tosses of a coin.
The chapter uses the events, probabilities, and partitions of Chapter 3, and it reworks in terms of probabilities the conditional frequencies of the two-way tables of Chapter 1. Together with Chapters 5 to 7 it completes the probability part of the course, which is used to measure the error made in passing from a sample to the population. Independence returns in Chapter 5, where the number of successes in independent trials gives the binomial distribution, in Chapter 7 for independent random variables, and in Chapter 8, where a sample consists of independent observations; the inference of Chapters 8 to 12 is based on this.
The reference group
Conditional probability
Roll a fair die. Face comes up with probability . If we know that an even number came up, the outcomes still possible are , , and , all with the same probability, and is one of the three. Given that the result is even, the probability of therefore becomes . The information has narrowed the possible outcomes down to a smaller group, and the new probability is calculated within that group.
In symbols, (read “omega”) is the sample space of Chapter 3, that is, the set of all possible outcomes, and an event is a subset of . Let and be events with . Once is known to have occurred, the outcomes still possible are those in . Among these, the outcomes for which also occurs form the intersection . The conditional probability of given is denoted by , read “the probability of given ,” and is
For the die, and , so and , as in the count of cases.
Dividing by gives the outcomes of a total probability of one. For the die, each of the faces , , and has conditional probability , and the sum is . Since , monotonicity of probability (Chapter 3) gives , so the ratio lies between zero and one.
Conditional probability answers questions that contain “given that” or “among the…”. In the inspection of the introduction, the probability that a flagged item is defective is the conditional probability of “defective” given “flagged.” It is the same idea as the conditional frequency of Chapter 1, with probabilities in place of frequencies.
Two questions about the same table
Of students, commute from outside the area. Among these commuters, travel by train. Of the students who live locally, travel by train. Let be the event that a student is a commuter and the event that a student travels by train. A student is chosen at random, so each student has probability and the probability of an event is the number of corresponding students divided by .
| Group | By train | Other transportation | Total |
|---|---|---|---|
| Commuters | 20 | 30 | 50 |
| Local residents | 10 | 140 | 150 |
| Total | 30 | 170 | 200 |
The probability of traveling by train given that a student is a commuter is calculated among the commuters, so divide by the first row total. The probability of being a commuter given that a student travels by train is calculated among the students who travel by train, so divide by the first column total. The numerator is the same in both calculations, because it counts the same students, commuters who travel by train.
Remark
If has finitely many equally likely outcomes, the definition reduces to the ratio of two counts, . The symbol denotes the number of elements in the set. Indeed and , so the common factor cancels in the ratio.
If outcomes have different weights, the weights of the outcomes are added in place of the counts. For example, a die gives probability to face and probability to each of the other five faces. Given an even result, the known event contains faces , , and , with total weight . The conditional probability of face is therefore .
Warning
The definition requires . If an ordinary die is rolled and is the event of rolling , then and for every . The ratio becomes , which is not a number, so the probability conditional on is undefined. The same difficulty arises in a table of counts when the group on which we wish to condition is empty, that is, when its row or column has total zero.
Complements and bounds on probabilities
The complement under a fixed condition
Among the students in an evening session, pass a test. Then of the students in that same session do not pass, because each student in the session either passes the test or does not. The same rule holds for conditional probabilities.
Let and be events with , and let be the complement of , that is, the event “ does not occur” (Chapter 3). Then
Indeed, the events and are disjoint, meaning they have no outcomes in common, and their union is . By additivity of probability (Chapter 3), . Dividing by gives .
Changing the reference group
Of receipts, are for online orders. Corrections were made to online order receipts and receipts for other orders. Let be the event that a receipt was corrected and the event that the order was placed online, so is the event that the order was not placed online. Changing the condition from to changes the denominator from to . Thus
The complement of the first probability is , and it still refers to online receipts. Indeed, among the online receipts, were not corrected, and . The probability instead concerns receipts for the other orders, so it cannot be obtained from and differs from .
Remark
Let and . The probability of the intersection cannot exceed , because is contained in . Nor can it fall below . If were , the inclusion–exclusion formula of Chapter 3 would give the union probability , while no probability exceeds one. Therefore can only be a number between and .
For any two events, and divide into four regions: , the part of outside , the part of outside , and the part outside both. Setting , the four regions have probabilities
The last value is obtained by subtracting the other three probabilities from one. Every probability is nonnegative. The first and last give and ; the second and third give and . Therefore
These bounds decide whether a value assigned to is possible.
Reconstructing a table from three probabilities
Let be the event that a request is urgent and the event that it is submitted online. Every request not submitted online is submitted in person, so “in person” is the event . Suppose , , and .
Urgent requests account for and urgent online requests for , so urgent requests submitted in person account for . This value is a proportion of all requests. In the same way, online requests that are not urgent account for . This leaves for nonurgent requests submitted in person. The complete table is therefore
| Channel | Urgent | Nonurgent | Total |
|---|---|---|---|
| Online | |||
| In person | |||
| Total |
Each cell of the table contains the probability that two events occur together, calculated over all requests. A probability of this kind is called a joint probability, like the joint frequency of Chapter 1. Conditional probabilities are obtained by dividing a cell by the total of its row or column. Given that a request was submitted in person, the probability that it is urgent is , which differs from the joint probability . Given that a request was submitted online, the probability that it is urgent is .
End of the free preview
The theory of this topic continues with 7 more sections
- The multiplication rule and tree diagrams
- Independence of two events
- Partitions and total probability
- Reversing the direction of conditioning
- Classifiers and base rates
- Multiple events and mutual independence
- Keep studying
Full access also includes the other 7 worked examples of this topic and the solutions of the 14 practice exercises.
Unlock Statistics and probability · €49Read the first 3 worked examples in this chapter for free.