# How is conditional probability computed?

Let’s look at the expressions we have used to compute conditional probability. To compute the likelihood that a consumer is female given that the consumer owns a basic phone, we computed the relative frequency

The numbers in this relative frequency came from the consumer survey summarized in the table below.

Since we know that the consumer owns a basic phone, the denominator is the total number of consumers that own a basic phone, 1311. The numerator is the number of consumers who own a basic phone and who are female, 660. Note the use of the word “and”. This number is the number of consumers in the joint event F and B. Using the letter n to denote the number of items in the collection, we write

This fraction is equivalent to

In this expression, the numerator is divided by the total number of consumers in the survey, 3743. In terms of probabilities, the fraction on top is the probability . The bottom is also a probability, . If we put these probabilities into the conditional probability, we get

This expression allows us to compute the conditional probability from the joint and marginal probabilities.

Conditional ProbabilityIf A and B are events, the likelihood of A occurring given that B has occurred is
provided that P(B) ≠ 0.

In this expression, the probability in the denominator is always the probability of the given event. Since its probability is never zero, we know the event will actually occur.

### Example 3      Conditional Probability

A community college is interested in hiring qualified instructors to teach online courses. The community college estimates that the likelihood that a candidate will have the proper educational background is is 0.8. The probability that a candidate has online teaching experience and proper educational background is 0.1. If a candidate is randomly selected and is found to have the proper educational background, what is the likelihood that they have online teaching experience?

Solution Define two events for this application,

A: candidate has online teaching experience
B: candidate has the proper educational background

The information in the application gives us two probabilities,

The likelihood of a candidate having online teaching experience given they have the proper educational experience is

# What is conditional probability?

A typical consumer survey might result in data like that shown below.

Based on what we have done in previous sections, we could calculate the likelihood that a consumer in the survey uses a smartphone. From the table we know there are 2432 smartphone owners in the 3743 consumers who were surveyed. Using relative frequencies, the probability of a consumer owning a smartphone is

A marketer might be interested in knowing whether the fact that a consumer is male changes the likelihood that they own a smartphone. In other words, given that the consumer is male, what is the likelihood that the consumer owns a smartphone. This is an example of conditional probability. In conditional probability, one event is assumed to have occurred and we are interested in knowing the likelihood of another event occurring.

If we define

M: consumer is male
S: consumers owns a smartphone

as the two events. We would like to determine the probability that S occurs given that M has occurred. This probability is represented using a vertical bar and is written P(S | M) .This is read “the probability of S occurring given that M has occurred”.

We can calculate this probability using the values in the table.

Since we know the consumer is a male, we now constrain ourselves to the data in the column shaded above. We are no longer considering all 3743 consumers in the survey. Now we are only examining the 2062 males who took the survey. Of those males, 1411 own a smartphone. This gives us the conditional probability

In this relative frequency, the numerator is the number of consumers in the compound event “consumer is male and consumer owns a smartphone”. The denominator is the number of consumers in the event “consumer is male”. For this pair of events, assuming that the consumer is male makes the likelihood that they own a smartphone slightly higher than if we do not make this assumption.

### Example 1      Conditional Probability

Let F and B represent the events,

F: consumer is female
B: consumer owns a basic phone

Use the data from the consumer survey below to find the conditional probabilities in each part.

a. The probability that a consumer owns a basic phone given that the consumer is female.

Solution There are 1681 female consumers in the survey. Of this amount, 660 own a basic phone. The likelihood a consumer owns a basic phone given that the consumer is female is

b. The probability that a consumer is female given that the consumer owns a basic phone.

Solution Start with the 1311 consumers who own a basic phone. Of these consumers, 660 are female. The corresponding relative frequency gives the conditional probability,

Conditional and marginal probabilities are often represented pictorially using a tree diagram. In a tree diagram, branches grow from branches and help to identify various conditional probabilities. For instance, we might start a tree diagram with two branches indicating whether the consumer is male or female. The probabilities for “consumer is male” and “the consumer is female” are written along the corresponding branch.

From each of these branches, we branch to smart phone or basic phone. Each of these branches represents a conditional probability. For instance, the branch originating at male and ending at smart phone represents the probability that the consumer owns a smart phone given the consumer is a male. The point at which the branch originates establishes the event that has occurred. The event at which the branch ends establishes what probability we are interested in.

For each set of branches, the sum of the probabilities is equal to 1. For instance,

This characteristic allows you to check the probabilities quickly to insure a simple arithmetic error has not been made.

### Example 2      Tree Diagrams

Use the results of the consumer survey above to label each of the branches on the tree diagram below.

Solution The first branches are to the events

S: consumer owns a smart phone
B: consumer owns a basic phone

The probability of these events are using the numbers of consumers in each event,

As we hoped

Next, calculate the conditional probabilities originating from the event “consumer owns a smart phone”. From the survey, we know 2432 consumers own a smart phone. Since 1411 of those owners are male and 1021 are female,

The conditional probabilities originating from the event “consumer owns a basic phone” are calculated in a similar manner. Of the 1311 consumers who own a basic phone, 651 are male and 660 are female. This gives the probabilities

Label each of these probabilities on the tree diagram.

## Section 7.2 Question 4

### What is the difference between marginal and joint probability?

In Question 3 we introduced the idea of joint probability. Joint probabilities are the likelihoods associated with compound events using “and”. The joint probability of A and B is the likelihood that both events will occur simultaneously. Such probabilities are often encountered in consumer surveys. In this context, a consumer answers many questions about their behavior. In addition, the consumer also gives other information about themselves like gender, income, or educational attainment.

In several examples, we have looked at the results of a survey of 3743 consumers regarding data usage on cell phones. This survey also examined the gender of cell phone users with the results shown below.

Suppose we are interest in the joint probability that user is male and uses 2GB or more of data. The inclusion of the word “and” indicates we are interested in a compound event A and B where

A: the user is male
B: 2 GB or more of data is used

To find the joint probability , we need to calculate the relative frequency of the event A and B. Since there are 507 male users who use 2 GB or more of data and 3743 total users,

In this context, the probability of either of the individual events is called the marginal probability of the event. The marginal probability of A is calculated by finding the relative frequency of the event A.

Since there is a total of 2062 male users out of 3743 total users, the marginal probability is

The total number of male users is found by summing the shaded column values. In the example below, we use joint and marginal probabilities to find the likelihood of a compound event using “or”.

### Example 6      Joint and Marginal Probability

In this example, we are interested in the events

C: the user is female
D: less than 200 MB of data is used

Use the information in the table below to calculate probabilities in each part.

a. Find the likelihood that a female user will use less than 200 MB of data.

Solution In terms of these events, we must find the probability that the user is female and less than 200 MB of data is used, P(C and D) . From the table, we recognize that there are 641 female users who use less than 200 MB of data. Since the total number of users is 3743, the relative frequency may be calculated,

The likelihood that a user in the survey is female and used less than 200 MB of data is approximately 17.1%.

b. Find the probability that a user is female.

Solution To use calculate the relative frequency of the event, we must divide the number of female users by the total number of users. The total number female users is at the bottom of the third column. Dividing this by the total number of users in the bottom of the last column gives,

The probability that a user in the survey is female is approximately 44.9%.

c. Find the probability that a user in the survey will use less than 200 MB of data.

Solution According to the survey, 1291 users of the total 3743 users used less than 200 MB of data. This means the probability of using less than 200 MB of data is

The likelihood of using less than 200 MB of data is approximately 34.5%.

d. Find the probability that the user is female or less than 200 MB of data is used.

Solution The event “the user is female or less than 200 MB of data is used” corresponds to the compound event C or D. We calculate the probability of this event by using the probabilities of the events in parts a through c,

The probability that a user is female or less than 200 MB of data is used is approximately 62.3%.

## Section 7.2 Question 3

### How do you find the probability of a compound event?

Events may be combined together in various ways. These combinations are called compound events. If we know the probability of the events that make up the compound event, we are often able to compute the probability of the compound event.

Outcomes that are in the event A as well as the event B are said to be in the compound event, A and B. The word “and” is used to indicate that the outcomes in this event are in both events simultaneously. Mathematicians describe outcomes in A and B with the intersection symbol ∩. An outcome in A and B are the same outcomes in the intersection of A with B, AB. The probability of A and B occurring is often referred to as the joint probability of A and B.

Another type of compound event is denoted using the word “or”. An outcome is in the event A or B if it is in A, B, or both events simultaneously. In the language of sets, the compound event A or B is the same as the union of the set A with the set B. The symbol ∪ represents the union of two sets. Using this symbol, we write the union of A with B as A ∪  B. In this text we will use the word “or” instead of the union symbol to represent outcomes in A, in B, or in both events.

### Example 4      Compound Events

Suppose A is the event “consumer plans to purchase a laptop computer in the next six months” and B is the event “consumer plans to purchase a tablet computer in the next six months”. Describe the outcomes in each of the events below.

a. A and B

Solution The event A and B corresponds to outcomes that are in both A and B. In other words, A and B is “consumer plans to purchase a laptop and a tablet computer in the next six months”. To get a visual sense of these outcomes, imagine the consumers in each event as being represented by circles.

Outcomes in A and B are in the gray region where both circles overlap.

b. A or B

Solution The event A or B corresponds to outcomes that are in A, in B, or in both events. The phrase “consumers who plan to purchase a laptop computer or a tablet computer in the next six months” describes these outcomes. The gray region below gives a visual representation of these consumers.

c.  A’ and B

Solution The outcomes in A’ and B must be in both events. This means that the consumers do not plan to purchase a laptop computer, but do plan to purchase a tablet computer. Visually, this event is the gray region outside of A and inside of B.

The probability of the events A and B and the probability of the events A or B are related to each other. We can see how this relationship works by examining a survey of 200 consumers.

To calculate the probability of the event A or B, we need to use the survey to count the number of consumers in the event A or B. Initially you might try to simply add the consumers in A and the consumers in B. However, since there are 5 consumers in both sets, A and B, those consumers would be counted twice. To fix this problem, we add the number of consumers in A to the number of consumers in B, and subtract the consumers in A and B:

Divide each term by the number of consumers in the sample space, 200, to get the probability of each event.

The likelihood of a consumer planning to purchase a laptop computer or a tablet computer in the next six months is 35/200 or 17.5%. This relationship holds even when the outcomes in the sample space are equally likely or not equally likely.

The Probability of A or B

The likelihood of an event A occurring or an event B occurring is

If we know the individual probabilities P(A) and P(B), as well as one of the compound events, this relationship may be used to find the other compound event.

### Example 5      Probability of a Compound Event

In Example 2 we examined probabilities associated with a company shipping bicycle parts from warehouses in Newark, New Jersey, Jacksonville, Florida, Industry, California, Portland, Oregon, and Dallas, Texas. Suppose we define

A: “part ships from east of the Mississippi”
B: “part ships from a coastal state”

Find the probability the part ships from east of the Mississippi or from a coastal state. Assume each outcome is equally likely.

Solution Recall that each outcome in the sample space is equally likely. The likelihood of each event is

Additionally, there are two outcomes in the event “part ships from east of the Mississippi” and “part ships from a coastal state”. This means

Using these values, the probability of the event “part ships from east of the Mississippi” or “part ships from a coastal state” is

In Example 4, we could also simply count the number of outcomes in the event “part ships from east of the Mississippi” and “part ships from a coastal state”. Since there are 4 outcomes, Newark, New Jersey, Jacksonville, Florida, Industry, California, and Portland, Oregon, in the compound event, we could also calculate the probability as 4/5. Counting outcomes is often impractical for experiments with larger number of outcomes.

## Section 7.1 Question 2

### What is probability?

Probability is a number that indicates the likelihood of an occurrence happening. This number may be as low as 0 indicating the occurrence will not happen. If the probability is equal to 1, the occurrence is certain to happen. Probabilities between 0 and 1 indicate the varying levels of uncertainty about the occurrence.
A weather forecaster may indicate that there is an 80% chance of rain. This percentage may be written as 0.8. Since this number is close to 1, it is very likely that it will rain. If the forecast was for a 10% chance of rain, the probability is 0.1. A low probability like this indicates that it is not likely to rain.

Probability is defined in terms of the outcomes in the sample space of an experiment. Suppose we have an experiment with a finite number of outcomes in the sample space. Let’s represent the outcomes with the letter e followed by a subscript. If there are n outcomes from the experiment, then the sample space S is

The probability of each outcome is symbolized by writing P(e1), P(e2), …, P(en). We can assign a probability to each outcome as long as the probability satisfies certain requirements.

Each outcomes of an experiment must meet two requirements.

1. The probability of each outcome is a number from 0 to 1,

2. The sum of the probabilities of all outcomes is equal to 1,

We can use these requirements to determine whether the probability assignments for an experiment are valid.

### Example 5 Assigning Valid Probabilities

The chief financial officer of a nanobrewery conducts an experiment to determine the likelihood that a person will order a brown ale, pale ale, or lager. The sample space for the experiment is

S = {b, p, l}

where the outcomes of the experiment are brown ale (b), pale ale (p), and lager (l). Determine if the probability assignments in each part are valid.

a. P(b) = 0.5, P(p) = 0.4, and P(l) = 0.25.

Solution The outcomes in this experiment are represented by b, p, and l instead of e1, e2, and e3. However, we can still check each of the requirements listed above. Each probability is a number from 0 to 1 so the first requirement is satisfied. The sum of the probabilities is

Since this sum is not equal to 1, this assignment is not valid.

b. P(b) = 0.25, P(p) = 0.25, and P(l) = 0.5.

Solution Each probability is from 0 to 1 and the sum of the probabilities is

This is a valid probability assignment.

c. P(b) = 1/3, P(p) = 1/3, and P(l) = 1/3.

Solution Each probability is from 0 to 1 and the sum of the probabilities is

This is a valid probability assignment. In this assignment, each of the outcomes is just as likely as any other outcome. In this situation, we say the outcomes are equally likely.

A probability model for an experiment consists of the sample space for the experiment and a valid probability assignment. In Example 5, parts b and c each constitute probability models. However, the probabilities in each part are different so the models are different.

You might be inclined to ask yourself, “Which model is correct?” From a mathematical viewpoint, they are both correct since each model meets the requirements for the probabilities of the outcomes. Realistically, we might prefer one model over the other depending upon the assumptions we make about the outcomes. In the next question we’ll look at these assumptions and use them to assign probabilities.