Fiche explicative de la leçon: Conditional Probability: Two-Way Tables | Nagwa Fiche explicative de la leçon: Conditional Probability: Two-Way Tables | Nagwa

Fiche explicative de la leçon: Conditional Probability: Two-Way Tables Mathématiques

In this explainer, we will learn how to deal with the concept of conditional probability using joint frequencies presented in two-way tables.

When collecting data on nonnumerical variables, we count how many times a particular characteristic occurs. We can then put our results in a table.

For example, a school may collect data on the number of pupils who travel to school by car, by foot, and by bicycle, as shown in the table below.

Mode of TransportCarFootBicycle
Number of Pupils450650200

Our population here is the number of pupils and the variable is the mode of transport, which is a categorical (i.e., nonnumerical) variable. In this data set, the variable has 3 categories: car, foot, and bicycle. We count the number of pupils who take each mode of transport.

We can delve deeper into the data by splitting it according to how many boys or girls took each mode of transport. So, the data varies not only across the mode of transport, but also with respect to whether the pupil is a boy or a girl, as shown below.

Mode of TransportCarFootBicycle
Boys200330120
Girls25032080

Our data is now displayed in a two-way table (which is sometimes also called a contingency table). The two in the two-way table refers to the two variables (which, in our case, are modes of transport and being a boy or a girl). Looking at the table, we can see that, for example, there were 200 boys who traveled by car, but only 120 boys who traveled by bicycle.

We can use two-way tables to calculate the probability of an event occurring as well as the conditional probability of an event occurring given, another event has occurred. To illustrate how this works, we will first recall the formula for conditional probability.

Definition: Conditional Probability

The probability that an event 𝐵 occurs, given that event 𝐴 has already occurred, is 𝑃(𝐵𝐴)=𝑃(𝐴𝐵)𝑃(𝐴), where 𝑃(𝐵𝐴) is the probability that 𝐵 occurred, given 𝐴 occurred, 𝑃(𝐴𝐵) is the probability that 𝐴 and 𝐵 occurred (happened) at the same time, and 𝑃(𝐴) is the probability that 𝐴 occurred.

Using the example above, we will discuss how to use a two-way table to find conditional probabilities.

If we want to find the probability that a pupil traveled by car given that they are a girl, then by replacing event 𝐵 with the event that they travel by car and event 𝐴 with the event that they are a girl we get 𝑃()=𝑃()𝑃().cargirlcargirlgirl

To calculate the probability of selecting a girl, we need to find the total number of girls and divide it by the total number of pupils. We can do this by summing the row for the girls and summing all the rows, or all the columns, to get the total number of pupils. Generally, it is helpful to calculate all the totals of the rows, columns, and overall total, as a first step when calculating probabilities from two-way tables.

Mode of TransportCarFootBicycleTotal
Boys200330120650
Girls25032080650
Total4506502001‎ ‎300

So, we need now the total number of girls and total number of pupils, as circled on the table below.

So, the total number of girls is 650, and the total number of pupils is 1‎ ‎300. So, to calculate the probability that a pupil is a girl, meaning the probability of selecting a girl, we write the following: 𝑃()==6501300.girltotalnumberofgirlstotalnumberofpupils

Next, we find the probability that the pupil selected travels by car and is a girl. We can use the two-way table to find the number of pupils who travel by car and are girls, then divide it by the total number of pupils.

So, the number of girls who travel by car is 250, and the total number of pupils is 1‎ ‎300, which means that the probability of selecting a girl who travels by car is 𝑃()==2501300.cargirlnumberofgirlswhotravelbycartotalnumberofpupils

Therefore, by substituting 𝑃()=6501300girl and 𝑃()=2501300cargirl in the formula for conditional probability we get 𝑃()=𝑃()𝑃()==2501300×1300650=250650=513.cargirlcargirlgirl

Therefore, the probability of traveling by car given that the pupil is girl is 513.

Notice that, when calculating the probability of traveling by car given that the pupil is a girl, the total number of pupils, 1‎ ‎300, cancels out. This is because we can simply use the table to find the probability of traveling by car, given that a pupil is a girl, by finding the number of girls who travel by car and dividing it by the total number of girls (since it is given that they are a girl, we only consider the girls as the total). For the rest of the explainer, we will use this approach.

Using the table, we get:

So, the number of those who travel by car is 250 and the total number of girls is 650, which means that the probability that a pupil travels by car given that they are a girl is 𝑃()==250650=513.cargirlnumberwhoareagirlandtravelbycartotalnumberofgirls

We will explore this approach further in the next example.

Example 1: Calculating a Conditional Probability from a Two-Way Frequency Table

The two-way table shows the ages and activity choices of a group of participants at a summer camp.

SwimmingClimbingRappelling
14 and Under15248
Over 14183224

A child is selected at random. Given that they chose rappelling, find the probability that the child is over 14.

Answer

To find the probability that a child is over 14 given that they chose rappelling, it is helpful to first calculate the totals of the rows and columns in the table.

SwimmingClimbingRappellingTotal
14 and Under1524847
Over 1418322474
Total335632121

Next, as we are calculating the probability that a child is over 14 given that they chose rappelling, we want to find the number of children over the age of 14 who chose rappelling and divide this by the total number of children who chose rappelling. This can be seen below in the table.

So, the number of children over the age of 14 who chose rappelling is 24, and the total number of children who chose rappelling is 32. Dividing these in order to find the probability that a child is over 14 given that they chose rappelling is 𝑃(14)==2432=34.overrappellingnumberover14andchoserappellingtotalnumberwhochoserappelling

Therefore, the probability that a child selected at random is over 14 given that they chose rappelling is 34, or 75%.

In the following example, we will consider how to find the probability of an event and the probability of a conditional event.

Example 2: Conditional Probability from a Two-Way Table

The table below contains data from a survey of core gamers who were asked whether their preferred gaming platform was the smartphone, the console, or the PC. The gamers are split by gender.

  1. Find the probability that a core gamer chosen at random prefers using a console. Give your answer to three decimal places.
  2. Given that a core gamer prefers to play using a console, find the probability that they are male. Give your answer to three decimal places.

Answer

Let us first work out the totals for the rows and columns of our table.

Part 1

To find the probability that a core gamer chosen at random prefers using a console, we find the number of gamers who prefer a console and divide by the total number of gamers.

Let C be the number of gamers who prefer a console; then, 𝑃()==60243=0.2473Cnumberofgamerspreferringconsoletotalnumberofgamerstod.p.

As a percentage, this is 0.247×100=24.7%25%. Hence, approximately 25% of gamers prefer to use a console.

Part 2

Given that a core gamer prefers to play using a console, we want to find the probability that they are male. Because we are only now interested in gamers who prefer a console, those who prefer to use smart phones or PCs do not figure in this calculation. So we only need to look at the “console” row in the table (highlighted in blue).

Our conditional probability, 𝑃()MaleConsole, the probability that a gamer chosen at random is male given that they prefer a console, is then 𝑃()==3760=0.6173MaleConsolenumberofmaleswhopreferconsoletotalwhopreferconsoletod.p.

As 0.617×10062%, we can say, given that a gamer chosen at random prefers a console, that there is approximately a 62% chance that they are male.

In the next example, we will consider how to use a two-way table to find a conditional probability where the given condition is more than two sets of categories.

Example 3: Calculating Conditional Probabilities Using a Two-Way Table

Two boxes contain a number of defective, partially defective (failing after a couple of hours of use), and acceptable light bulbs.

The numbers are given in the table.

Box 1Box 2
Defective123
Partially Defective322
Acceptable2540

A light bulb is chosen at random and put to use. If it does not fail immediately, what is the probability that it is chosen from box 2? Round your answer to three decimal places.

Answer

When working with two-way tables it is helpful to find the totals of the rows and columns first, as follows.

Box 1Box 2Total
Defective12315
Partially Defective32225
Acceptable254065
Total4065105

We are asked if a light bulb does not fail immediately, then we are asked what is the probability that it is chosen from box 2. We need to be careful with categories here, as defective means it fails immediately, partially defective means it fails after a couple of hours, so not immediately, and acceptable means it does not fail. That means that it does not fail immediately if it is acceptable or partially defective. So, we are trying to find the probability that a bulb is chosen from box 2 given that it is either acceptable or partially defective.

To find the probability that a bulb is chosen from box 2 given that it is either acceptable or partially defective, we need to first find how many bulbs are chosen from the box that are either acceptable or partially defective. We can do this by using the table and finding the number of bulbs that are from box 2 and acceptable and the number of bulbs that are from box 2 and partially defective, then adding these together.

Therefore, the number of bulbs that are chosen from box 2 and are either acceptable or partially defective is 22+40=62.

Next, to find the probability that a bulb is chosen from box 2 given that it is either acceptable, or partially defective, we need to find the total number of bulbs that are either acceptable or partially defective. Again, we will use the table to find the total number of bulbs that are acceptable and the total number of bulbs that are partially defective, then add them together.

Therefore, the total number of bulbs that are either acceptable or partially defective is 25+65=90.

Now, we calculate the probability that a bulb is chosen from box 2 given that it is either acceptable or partially defective by dividing the number of bulbs chosen from box 2 and are either acceptable or partially defective by the total number of bulbs that are either acceptable or partially defective. This gives us 𝑃()==6290=0.689.box2acceptableorpartiallydefectivenumberfrombox2andacceptableorpartiallydefectivetotalnumberthatareacceptableorpartiallydefectivecorrectto3decimalplaces

In the following example, we will discuss a question where information not presented in a table is first put in a table and then a conditional probability is found.

Example 4: Two-Way Tables, Conditional Probability, and the Relationship between Categorical Variables

In a group of 96 people, 34 out of the 71 women have a smartphone, and 18 men do not have a smartphone. Determine the probability that a randomly picked smartphone owner in this group will be female.

Answer

We are given some information about 96 people that can be classified into two sets of categories: whether they are men or women and whether they own a smartphone or not. Using a two-way table, we can input the information we know and then work out any missing information.

As we are told that there are 96 people, this number goes in the overall total in the bottom right of the table. Since we know that 34 out of 71 women own a smartphone, then we know that there are 71 women in total; this goes at the bottom of the column for women. We also know that 34 are smartphone owners, this goes in the cell in the row of smartphone owners and the column of women. We also know that 18 men do not have a smartphone, so this goes in the row of not smartphone owners, and the column of men.

MenWomenTotal
Smartphone Owners34
Not Smartphone Owners18
Total7196

We can deduce the other information by adding or subtracting different amounts to fill in blank cells. First, we can work out how many women do not own a smartphone by subtracting 34 from 71, which gives us 37.

Second, we can find the total number of those who do not own smartphones by adding the number of men, 18, and the number of women, 37, who do not own smartphones. This gives us 55.

Third, we can find the total number of men by subtracting the total number of women, 71, from the total number of people, 96, giving us 25.

Fourth, we can find the number of men who own a smartphone by subtracting the number of men who do not own a smartphone, 18, from the total number of men, 25, giving us 7.

Lastly, we can calculate the total number of smartphone owners by adding the number of men who own a smartphone, 7, and the number of women who own a smartphone, 34, which gives us 41.

We can add the total number of smartphone owners, 41 and the total number of those who do not own a smartphone, 55, to check our answers. This gives 96, which is the overall total.

Now that we have filled in all the information into the two-way table, we can calculate the probability that a randomly picked smartphone owner is a woman. In other words, we want to find the probability that a person selected is a woman given that they are a smartphone owner.

To calculate the probability that a person selected is a woman given that they are a smartphone owner, we want to divide the number of women who are smartphone owners by the total number of smartphone owners. We can find this information from the table.

So, the number of women who are smartphone owners is 34, and the total number of smartphone owners is 41. Calculating the probability that a woman is selected given that she is a smartphone owner, we get 𝑃()==3441.womansmartphonenumberofwomenwhoaresmartphoneownersnumberofsmartphoneowners

Therefore, the probability that a randomly selected smartphone owner is a woman is 3441.

In the last example, we will consider another case where the information presented is not in a table and require to be filled in the table and requires unknown information in order to calculate a conditional probability.

Example 5: Calculating Conditional Probabilities by Inputting into a Two-Way Table

A company manufactures a product in two different plants, 𝑃 and 𝑃. The company supplies three customers, 𝐶, 𝐶, and 𝐶 equally, each with 80 units a month. 𝑃 produces 10 units of this product per month and the company distributes this amount among the three customers 𝐶, 𝐶, and 𝐶 in percentages of 20%, 30%, and 50% respectively. If you select a unit at random from a 𝐶 outlet, find the probability that it is produced by 𝑃.

Answer

As we have two different variables in this question, the two different plants 𝑃 and 𝑃, and the three different customers 𝐶, 𝐶, and 𝐶, we can use a two-way table to present the information as follows.

𝐶𝐶𝐶Total
𝑃
𝑃
Total

We are told that the company supplies each of the three customers with 80 units each per month. This means the total for the columns of 𝐶, 𝐶, and 𝐶 are each 80. It also means that the overall total is the sum of these, which is 240.

𝐶𝐶𝐶Total
𝑃
𝑃
Total808080240

Next, we are told that 𝑃 produces 10 units per month, which means that the total for the row 𝑃 is 10. Since we know that the 10 units are distributed to 𝐶, 𝐶, and 𝐶 in percentages of 20%, 30%, and 50%, then we know that the number of 𝑃 that 𝐶 has is 20% of 10, which is 2, the number of 𝑃 that 𝐶 has is 30% of 10, which is 3, and the number of 𝑃 that 𝐶 has is 50% of 10, which is 5. We can then input this information in the row of 𝑃.

𝐶𝐶𝐶Total
𝑃23510
𝑃
Total808080240

We can find the remaining information needed in the table by adding or subtracting rows and columns. We can find the amounts of 𝑃 that each of the customers ordered by subtracting 𝑃 from the total. This gives us 802=78 for 𝐶, 803=77 for 𝐶, and 805=75 for 𝐶. We can then input this information in the row of 𝑃.

𝐶𝐶𝐶Total
𝑃23510
𝑃787775
Total808080240

To find the total of 𝑃 we can sum each amount that 𝐶, 𝐶, and 𝐶 ordered, giving us 78+77+75=230. We can see that, by subtracting the total of 𝑃, 10, from the overall total, 240, that this is correct.

𝐶𝐶𝐶Total
𝑃23510
𝑃787775230
Total808080240

Now that we have found all of the information in the two-way table, we can calculate the probability that if a unit is selected from 𝐶, it is produced by 𝑃, or, in other words, the probability of selecting a unit produced by 𝑃 given that it is selected for 𝐶. To calculate this, we need to calculate the number of units produced by 𝑃 for 𝐶 and divide it by the total number of units produced by 𝑃. We find this information from the table as follows.

So, the number of units per month produced by 𝑃 for 𝐶 is 75, and the total number of units produced for 𝐶 is 80. Therefore, the probability of selecting a unit produced by 𝑃 given that it is selected for 𝐶 is 𝑃(𝑃𝐶)=𝑃𝐶𝐶=7580=0.9375.numberfromfortotalnumberfor

Therefore, the probability that a unit selected from a 𝐶 outlet is produced by 𝑃 is 0.9375.

In this explainer, we have learned how to use two-way tables to find conditional probabilities. Let’s recap the key points.

Key Points

  • The two in two-way table refers to the fact that there are two variables under consideration.
  • In a two-way table, we organize the counts, or frequencies, for the categories of two categorical variables.
  • Values (or categories) of the row variable label the rows running across the table, and values (or categories) of the column variable label the columns running down the table.
  • We use two-way tables to examine the relationship between two categorical variables. In particular, we can look at conditional probabilities.
  • Conditional probabilities can be read directly from two-way tables.
  • The probability of event 𝐵 given that event 𝐴 has occurred, 𝑃(𝐵𝐴), is a fraction where the denominator is the total for event 𝐴 and the numerator is the number of occurrences of 𝐵𝐴: 𝑃(𝐵𝐴)=𝐵𝐴𝐴.numberofoccurrencesofandtotal
  • We can also use the conditional probability formula, 𝑃(𝐵𝐴)=𝑃(𝐴𝐵)𝑃(𝐴), where 𝑃(𝐴𝐵) is the probability of both 𝐴 and 𝐵 occurring at the same time.

Télécharger l’application Nagwa Classes

Assistez à des séances, chattez avec votre enseignant ainsi que votre classe et accédez à des questions spécifiques à la classe. Téléchargez l’application Nagwa Classes dès aujourd’hui !

Nagwa utilise des cookies pour vous garantir la meilleure expérience sur notre site web. Apprenez-en plus à propos de notre Politique de confidentialité