Conditional Probability

How new information changes probability

You do it all the time without realizing it. Your friend texts that they are stuck in traffic, and suddenly you update your mental estimate of when they will arrive. The doctor says your test came back positive, and you start wondering what that really means for your health. Weather radar shows a storm heading your direction, and you adjust your plans for the afternoon.

This is conditional probability in action: updating what you believe based on new information. Probability is not static. It changes as you learn more about the world. A 10% chance of rain becomes 90% once you see dark clouds rolling in. The odds that your favorite team wins change dramatically once the star player gets injured.

Conditional probability formalizes this intuitive process. It answers questions like: “Given that I know X happened, what is the probability of Y?” This simple shift - from asking about probability in general to asking about probability given specific information - turns out to be one of the most powerful and practical ideas in all of mathematics.

Core Concepts

What Is Conditional Probability?

Conditional probability is the probability of an event occurring given that another event has already occurred (or is known to be true). It answers the question: “Now that I know this, what are the chances of that?”

Think about drawing cards from a deck. Before any cards are drawn, the probability of drawing an Ace is $\frac{4}{52}$. But suppose someone tells you that the card drawn is a face card (Jack, Queen, or King). Now you know the Ace is impossible because Aces are not face cards. The probability of having drawn an Ace, given that you drew a face card, is 0.

Or consider this: you flip two coins and someone tells you that at least one came up heads. What is the probability that both are heads? Without this information, the probability of two heads is $\frac{1}{4}$. But with the information that at least one is heads, the probability changes to $\frac{1}{3}$. (We will work through why shortly.)

Conditional probability is about updating your assessment when your available information changes. The original probability is what you believe before learning anything specific. The conditional probability is what you should believe after learning the new information.

Notation: $P(A|B)$

We write conditional probability as $P(A|B)$, which reads as “the probability of A given B.”

$$P(A|B) = \text{probability of } A \text{ occurring, given that } B \text{ has occurred}$$

The vertical bar “|” means “given that” or “conditional on.” Everything to the right of the bar is what you know or assume to be true. Everything to the left is what you want to find the probability of.

Some examples:

  • $P(\text{rain tomorrow} | \text{cloudy today})$ = probability it rains tomorrow given that today is cloudy
  • $P(\text{pass exam} | \text{studied 10+ hours})$ = probability of passing given that you studied at least 10 hours
  • $P(\text{disease} | \text{positive test})$ = probability of having the disease given that your test was positive

Reading conditional probability notation correctly is crucial. Pay close attention to what is on each side of the bar:

  • The event on the left is what you are finding the probability of
  • The event on the right is what you already know or are assuming

The Conditional Probability Formula

Here is the formal definition of conditional probability:

$$P(A|B) = \frac{P(A \text{ and } B)}{P(B)}$$

This formula makes intuitive sense. When you know that B has happened, you are restricting your attention to only those outcomes where B occurred. The sample space has shrunk from “everything that could happen” to “only things where B happened.” Within this restricted space, you want to know how often A also happens.

Let us break this down:

  • $P(A \text{ and } B)$ is the probability that both A and B occur
  • $P(B)$ is the probability that B occurs
  • The ratio tells you what fraction of the “B outcomes” are also “A outcomes”

Important: This formula only works when $P(B) > 0$. You cannot condition on an impossible event. (What would it mean to ask the probability of something given that an impossible thing happened?)

Here is a simple example. Suppose you roll a fair die. Let A be “roll a 6” and B be “roll an even number.” What is $P(A|B)$?

We need:

  • $P(A \text{ and } B)$: probability of rolling a 6 that is also even. Since 6 is even, this is just $P(\text{roll a 6}) = \frac{1}{6}$.
  • $P(B)$: probability of rolling an even number (2, 4, or 6) = $\frac{3}{6} = \frac{1}{2}$.

Therefore: $$P(A|B) = \frac{P(A \text{ and } B)}{P(B)} = \frac{1/6}{1/2} = \frac{1}{6} \times \frac{2}{1} = \frac{2}{6} = \frac{1}{3}$$

This makes sense. If you know you rolled an even number, then you know you got 2, 4, or 6. One out of these three equally likely possibilities is 6, so the conditional probability is $\frac{1}{3}$.

Two-Way Tables and Conditional Probability

Two-way tables (also called contingency tables) organize data by two categories and are perfect for calculating conditional probabilities. They show you exactly how many items fall into each combination of categories.

Here is an example. Suppose a school surveyed 200 students about their study habits and test performance:

Passed Test Failed Test Total
Studied 80 20 100
Did Not Study 30 70 100
Total 110 90 200

From this table, you can calculate many conditional probabilities:

$P(\text{passed} | \text{studied})$: Among students who studied, what fraction passed?

  • Look at the “Studied” row: 80 passed out of 100 who studied. $$P(\text{passed} | \text{studied}) = \frac{80}{100} = 0.80 = 80%$$

$P(\text{passed} | \text{did not study})$: Among students who did not study, what fraction passed?

  • Look at the “Did Not Study” row: 30 passed out of 100 who did not study. $$P(\text{passed} | \text{did not study}) = \frac{30}{100} = 0.30 = 30%$$

Notice the huge difference. Studying more than doubled the probability of passing. This is exactly the kind of insight conditional probability reveals.

$P(\text{studied} | \text{passed})$: Among students who passed, what fraction had studied?

  • Look at the “Passed Test” column: 80 studied out of 110 who passed. $$P(\text{studied} | \text{passed}) = \frac{80}{110} = \frac{8}{11} \approx 0.727 = 72.7%$$

The key technique with two-way tables: the condition (what comes after the “|”) tells you which row or column to restrict your attention to. Then you find the relevant count within that row or column divided by the row or column total.

Tree Diagrams for Conditional Probability

Tree diagrams visualize sequential events and conditional probabilities beautifully. Each branch represents a possible outcome, and the probability on each branch is the conditional probability given the path you have taken so far.

Consider this scenario: a bag contains 3 red marbles and 2 blue marbles. You draw two marbles without replacement (you do not put the first marble back). What are the probabilities of various outcomes?

Here is how to build the tree:

First draw:

  • $P(\text{Red}_1) = \frac{3}{5}$ (3 red out of 5 total)
  • $P(\text{Blue}_1) = \frac{2}{5}$ (2 blue out of 5 total)

Second draw, given first was Red:

  • Now there are 2 red and 2 blue left (4 total)
  • $P(\text{Red}_2 | \text{Red}_1) = \frac{2}{4} = \frac{1}{2}$
  • $P(\text{Blue}_2 | \text{Red}_1) = \frac{2}{4} = \frac{1}{2}$

Second draw, given first was Blue:

  • Now there are 3 red and 1 blue left (4 total)
  • $P(\text{Red}_2 | \text{Blue}_1) = \frac{3}{4}$
  • $P(\text{Blue}_2 | \text{Blue}_1) = \frac{1}{4}$

To find the probability of any complete path, multiply the probabilities along the branches:

  • $P(\text{Red, then Red}) = \frac{3}{5} \times \frac{1}{2} = \frac{3}{10}$
  • $P(\text{Red, then Blue}) = \frac{3}{5} \times \frac{1}{2} = \frac{3}{10}$
  • $P(\text{Blue, then Red}) = \frac{2}{5} \times \frac{3}{4} = \frac{6}{20} = \frac{3}{10}$
  • $P(\text{Blue, then Blue}) = \frac{2}{5} \times \frac{1}{4} = \frac{2}{20} = \frac{1}{10}$

Notice these probabilities sum to 1: $\frac{3}{10} + \frac{3}{10} + \frac{3}{10} + \frac{1}{10} = \frac{10}{10} = 1$. This is a good check that your calculations are correct.

Testing for Independence Using Conditional Probability

Two events A and B are independent if learning that one occurred does not change the probability of the other. Mathematically:

$$\text{A and B are independent if and only if } P(A|B) = P(A)$$

Equivalently: $$\text{A and B are independent if and only if } P(B|A) = P(B)$$

When events are independent, conditional probability equals unconditional probability - the information about one event is useless for predicting the other.

Here is how to test for independence:

  1. Calculate $P(A)$ (unconditional probability of A)
  2. Calculate $P(A|B)$ (conditional probability of A given B)
  3. If $P(A) = P(A|B)$, the events are independent. If not, they are dependent.

Returning to our study habits example:

  • $P(\text{passed}) = \frac{110}{200} = 0.55 = 55%$ (overall pass rate)
  • $P(\text{passed} | \text{studied}) = \frac{80}{100} = 0.80 = 80%$

Since $0.80 \neq 0.55$, studying and passing are not independent. Knowing someone studied increases your estimate of their probability of passing. This confirms what common sense tells us: studying helps.

For independent events, another useful formula emerges. If A and B are independent: $$P(A \text{ and } B) = P(A) \times P(B)$$

This is the multiplication rule for independent events. Dependent events require the more general rule: $$P(A \text{ and } B) = P(A) \times P(B|A) = P(B) \times P(A|B)$$

Bayes’ Theorem Introduction

Bayes’ Theorem is a formula for “reversing” conditional probability. If you know $P(B|A)$, it helps you find $P(A|B)$. This is incredibly useful because sometimes one conditional probability is much easier to determine than the other.

$$P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}$$

Let us understand why you might need this. Consider medical testing:

  • Doctors know $P(\text{positive test} | \text{have disease})$ - this is the test’s sensitivity
  • But patients want to know $P(\text{have disease} | \text{positive test})$ - what does a positive result mean?

These are not the same thing. Bayes’ Theorem lets you go from one to the other.

The terms in Bayes’ Theorem have names:

  • $P(A)$ is the prior probability - your probability assessment before the new information
  • $P(A|B)$ is the posterior probability - your updated probability after learning B
  • $P(B|A)$ is the likelihood - how likely is the evidence B if A were true
  • $P(B)$ is the marginal probability of B - the total probability of observing B

Often, $P(B)$ must be calculated using the law of total probability: $$P(B) = P(B|A) \cdot P(A) + P(B|A^c) \cdot P(A^c)$$

This accounts for all the ways B can occur: either A happens and B follows, or A does not happen and B follows anyway.

Common Confusion: $P(A|B)$ vs. $P(B|A)$

One of the most common errors in probability is confusing $P(A|B)$ with $P(B|A)$. These are almost never equal, and mixing them up can lead to seriously wrong conclusions.

Here is a vivid example:

  • $P(\text{wet street} | \text{rained})$ is very high - if it rained, the street is almost certainly wet
  • $P(\text{rained} | \text{wet street})$ is lower - the street could be wet from a sprinkler or street cleaner

The direction matters enormously.

This confusion shows up in real-world reasoning errors:

  • Prosecutors sometimes argue that since $P(\text{evidence} | \text{guilty})$ is high, $P(\text{guilty} | \text{evidence})$ must also be high. This is the “prosecutor’s fallacy.”
  • Medical patients learn that $P(\text{positive} | \text{no disease})$ is low (false positive rate is small), and wrongly assume $P(\text{no disease} | \text{positive})$ is also low.

Always be clear about what you are conditioning on and what you are trying to find. If you need to reverse a conditional probability, use Bayes’ Theorem.

Notation and Terminology

Term Meaning Example
$P(A | B)$ Probability of A given that B occurred Restricted sample space
Conditional Depending on known information Probability changes with knowledge
Two-way table Table organizing data by two categories Rows and columns with counts
Bayes’ Theorem $P(A | B) = \frac{P(B | A) \cdot P(A)}{P(B)}$ Updating probability with evidence
Prior probability Probability before new information $P(\text{disease})$ before testing
Posterior probability Probability after new information $P(\text{disease} | \text{positive})$
Independent events Events where one does not affect the other $P(A | B) = P(A)$
Dependent events Events where one affects the other Studying affects passing probability

Examples

Example 1: Conditional Probability from a Two-Way Table

A survey of 150 pet owners asked about pet type and whether they live in a house or apartment:

House Apartment Total
Dog 60 25 85
Cat 30 35 65
Total 90 60 150

Find the following probabilities: a) $P(\text{Dog owner} | \text{lives in house})$ b) $P(\text{lives in house} | \text{Dog owner})$

Solution:

a) $P(\text{Dog owner} | \text{lives in house})$:

The condition is “lives in house,” so we restrict to the House column.

  • House owners: 90 total
  • Dog owners living in houses: 60

$$P(\text{Dog} | \text{House}) = \frac{60}{90} = \frac{2}{3} \approx 0.667 = 66.7%$$

Two-thirds of house dwellers own dogs.

b) $P(\text{lives in house} | \text{Dog owner})$:

The condition is “Dog owner,” so we restrict to the Dog row.

  • Dog owners: 85 total
  • Dog owners living in houses: 60

$$P(\text{House} | \text{Dog}) = \frac{60}{85} = \frac{12}{17} \approx 0.706 = 70.6%$$

About 71% of dog owners live in houses.

Notice that $P(\text{Dog} | \text{House}) \neq P(\text{House} | \text{Dog})$. The order matters.

Example 2: Using the Conditional Probability Formula

In a standard deck of 52 cards, you draw one card. Given that the card is red (hearts or diamonds), what is the probability that it is a King?

Solution:

Let K = “draw a King” and R = “draw a red card.”

We want $P(K|R)$.

Using the conditional probability formula: $$P(K|R) = \frac{P(K \text{ and } R)}{P(R)}$$

Find $P(K \text{ and } R)$: A red King means King of Hearts or King of Diamonds. There are 2 red Kings out of 52 cards. $$P(K \text{ and } R) = \frac{2}{52} = \frac{1}{26}$$

Find $P(R)$: There are 26 red cards (13 hearts + 13 diamonds) out of 52. $$P(R) = \frac{26}{52} = \frac{1}{2}$$

Calculate $P(K|R)$: $$P(K|R) = \frac{1/26}{1/2} = \frac{1}{26} \times \frac{2}{1} = \frac{2}{26} = \frac{1}{13} \approx 0.077 = 7.7%$$

This makes sense: among the 26 red cards, exactly 2 are Kings, so $\frac{2}{26} = \frac{1}{13}$.

Example 3: Tree Diagram for Conditional Probability

A company has two machines that produce widgets. Machine A produces 60% of the widgets and Machine B produces 40%. Machine A produces 5% defective widgets, while Machine B produces 8% defective.

a) What is the probability that a randomly selected widget is defective? b) If a widget is defective, what is the probability it came from Machine A?

Solution:

Let us build a tree diagram. The first branch splits by machine, the second by defective status.

First level (which machine):

  • $P(A) = 0.60$
  • $P(B) = 0.40$

Second level (defective given machine):

  • $P(\text{Def}|A) = 0.05$, so $P(\text{Good}|A) = 0.95$
  • $P(\text{Def}|B) = 0.08$, so $P(\text{Good}|B) = 0.92$

Complete paths:

  • $P(A \text{ and Def}) = 0.60 \times 0.05 = 0.030$
  • $P(A \text{ and Good}) = 0.60 \times 0.95 = 0.570$
  • $P(B \text{ and Def}) = 0.40 \times 0.08 = 0.032$
  • $P(B \text{ and Good}) = 0.40 \times 0.92 = 0.368$

a) Probability a widget is defective:

Add the probabilities of all paths ending in “Def”: $$P(\text{Def}) = P(A \text{ and Def}) + P(B \text{ and Def}) = 0.030 + 0.032 = 0.062 = 6.2%$$

b) Probability it came from Machine A, given it is defective:

Use Bayes’ Theorem (or the definition of conditional probability): $$P(A|\text{Def}) = \frac{P(A \text{ and Def})}{P(\text{Def})} = \frac{0.030}{0.062} \approx 0.484 = 48.4%$$

Even though Machine A produces more widgets overall (60%), only about 48% of defective widgets come from Machine A because its defect rate is lower.

Example 4: Testing for Independence

A researcher surveys 500 adults about their exercise habits and sleep quality:

Good Sleep Poor Sleep Total
Exercises Regularly 180 70 250
Does Not Exercise 120 130 250
Total 300 200 500

Are exercise habits and sleep quality independent?

Solution:

To test for independence, we check whether $P(\text{Good Sleep} | \text{Exercises}) = P(\text{Good Sleep})$.

Calculate $P(\text{Good Sleep})$ (unconditional): $$P(\text{Good Sleep}) = \frac{300}{500} = 0.60 = 60%$$

Calculate $P(\text{Good Sleep} | \text{Exercises})$: Among the 250 people who exercise, 180 report good sleep. $$P(\text{Good Sleep} | \text{Exercises}) = \frac{180}{250} = 0.72 = 72%$$

Compare:

  • $P(\text{Good Sleep}) = 60%$
  • $P(\text{Good Sleep} | \text{Exercises}) = 72%$

Since $0.72 \neq 0.60$, exercise habits and sleep quality are NOT independent.

Knowing that someone exercises increases our estimate of their probability of having good sleep from 60% to 72%. This suggests a positive association between exercise and sleep quality.

We can also verify with the non-exercisers: $$P(\text{Good Sleep} | \text{No Exercise}) = \frac{120}{250} = 0.48 = 48%$$

Non-exercisers have only a 48% chance of good sleep, compared to 72% for exercisers. The dependence is clear.

Example 5: Bayes' Theorem in Medical Testing

A disease affects 1% of the population. A medical test has the following characteristics:

  • If a person has the disease, the test is positive 95% of the time (sensitivity)
  • If a person does not have the disease, the test is negative 90% of the time (specificity)

A randomly selected person tests positive. What is the probability they actually have the disease?

Solution:

Let D = “has disease” and + = “tests positive.”

We know:

  • $P(D) = 0.01$ (1% have the disease)
  • $P(D^c) = 0.99$ (99% do not have the disease)
  • $P(+|D) = 0.95$ (sensitivity: positive test given disease)
  • $P(-|D^c) = 0.90$ (specificity: negative test given no disease)
  • Therefore: $P(+|D^c) = 1 - 0.90 = 0.10$ (false positive rate)

We want $P(D|+)$: the probability of disease given a positive test.

Using Bayes’ Theorem: $$P(D|+) = \frac{P(+|D) \cdot P(D)}{P(+)}$$

First, calculate $P(+)$ using the law of total probability: $$P(+) = P(+|D) \cdot P(D) + P(+|D^c) \cdot P(D^c)$$ $$P(+) = (0.95)(0.01) + (0.10)(0.99)$$ $$P(+) = 0.0095 + 0.099 = 0.1085$$

About 10.85% of the population will test positive.

Now apply Bayes’ Theorem: $$P(D|+) = \frac{(0.95)(0.01)}{0.1085} = \frac{0.0095}{0.1085} \approx 0.0876 = 8.76%$$

Interpretation: Even with a positive test, the probability of actually having the disease is only about 8.76%!

This surprising result occurs because:

  • The disease is rare (only 1% have it)
  • False positives (10% of healthy people) affect many more people than the small number who have the disease
  • Most positive tests are false positives

Out of 1,000 people:

  • 10 have the disease, and about 9.5 test positive (true positives)
  • 990 do not have the disease, but about 99 test positive (false positives)
  • Total positives: about 108.5
  • True positives among positives: $\frac{9.5}{108.5} \approx 8.76%$

This is why doctors often order follow-up tests when screening for rare diseases.

Key Properties and Rules

The Conditional Probability Formula

$$P(A|B) = \frac{P(A \text{ and } B)}{P(B)}, \quad \text{provided } P(B) > 0$$

Rearranging gives the general multiplication rule: $$P(A \text{ and } B) = P(B) \cdot P(A|B) = P(A) \cdot P(B|A)$$

Independence Test

Events A and B are independent if any of these equivalent statements hold:

  • $P(A|B) = P(A)$
  • $P(B|A) = P(B)$
  • $P(A \text{ and } B) = P(A) \cdot P(B)$

Bayes’ Theorem

$$P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}$$

Where $P(B)$ can be expanded as: $$P(B) = P(B|A) \cdot P(A) + P(B|A^c) \cdot P(A^c)$$

Properties of Conditional Probability

Conditional probabilities follow the same rules as regular probabilities:

  • $0 \leq P(A|B) \leq 1$
  • $P(B|B) = 1$ (if B happened, then B happened)
  • $P(A^c|B) = 1 - P(A|B)$ (conditional complement rule)

Common Mistakes to Avoid

  1. Confusing $P(A|B)$ with $P(B|A)$ - these are usually different
  2. Assuming independence - always check; do not assume events are independent
  3. Forgetting to restrict the sample space - in conditional probability, your “universe” shrinks to only outcomes where the condition holds
  4. Multiplying probabilities incorrectly - use $P(A) \cdot P(B)$ only for independent events; otherwise use $P(A) \cdot P(B|A)$

Real-World Applications

Medical Diagnosis

Medical testing is a prime example of conditional probability. When you get a positive test result, what you really want to know is the probability you have the condition given the positive test. But test accuracy is typically reported the other way: the probability of a positive test given you have the condition.

This is exactly where Bayes’ Theorem shines. It helps doctors and patients interpret test results correctly, taking into account:

  • How accurate the test is (sensitivity and specificity)
  • How common the disease is in the population (prevalence)

For rare diseases, even accurate tests produce mostly false positives. For common conditions, even moderate tests are informative. Understanding conditional probability helps make sense of medical information.

Spam Filters

Email spam filters use conditional probability extensively. The filter learns probabilities like:

  • $P(\text{contains “free money”} | \text{spam})$ - very high
  • $P(\text{contains “free money”} | \text{not spam})$ - very low

When a new email arrives, the filter uses Bayes’ Theorem to calculate $P(\text{spam} | \text{contains “free money”})$ and similar probabilities for other words and features. If the overall probability of spam given all the features is high enough, the email goes to your spam folder.

This approach, called Naive Bayes classification, is one of the most successful applications of probability theory to real-world problems.

Weather Prediction

Weather forecasting relies heavily on conditional probability. Meteorologists calculate probabilities like:

  • $P(\text{rain tomorrow} | \text{low pressure system approaching})$
  • $P(\text{severe weather} | \text{certain atmospheric conditions})$

Modern forecasting combines historical data (experimental probability from similar past conditions) with physical models to produce conditional probability estimates. When you see “40% chance of rain,” that is a conditional probability given current atmospheric conditions.

In courtrooms, evidence must be evaluated carefully using conditional probability. Lawyers and judges deal with questions like:

  • $P(\text{evidence} | \text{guilty})$ vs. $P(\text{guilty} | \text{evidence})$

The “prosecutor’s fallacy” occurs when these are confused. Just because evidence would be very likely if the defendant were guilty does not mean the defendant is likely guilty given the evidence. The prior probability matters enormously.

DNA evidence is a famous example. A DNA match might have probability 1 in a million if the person is innocent. But this does not mean there is a 1 in a million chance of innocence, because we must also consider how likely it was that this particular person committed the crime before we saw the DNA evidence.

Self-Test Problems

Problem 1: A bag contains 4 red balls and 6 blue balls. You draw one ball and observe that it is blue. What is the probability that if you draw a second ball (without replacement), it will also be blue?

Show Answer

After drawing a blue ball, the bag contains 4 red and 5 blue balls (9 total).

$$P(\text{second blue} | \text{first blue}) = \frac{5}{9} \approx 0.556 = 55.6%$$

Problem 2: In a class of 40 students, 25 take Spanish, 20 take French, and 10 take both. If a student is selected at random and you learn they take Spanish, what is the probability they also take French?

Show Answer

Using the conditional probability formula: $$P(\text{French} | \text{Spanish}) = \frac{P(\text{French and Spanish})}{P(\text{Spanish})}$$

  • $P(\text{French and Spanish}) = \frac{10}{40} = \frac{1}{4}$
  • $P(\text{Spanish}) = \frac{25}{40} = \frac{5}{8}$

$$P(\text{French} | \text{Spanish}) = \frac{1/4}{5/8} = \frac{1}{4} \times \frac{8}{5} = \frac{8}{20} = \frac{2}{5} = 0.4 = 40%$$

Alternatively: Of the 25 Spanish students, 10 also take French, so $\frac{10}{25} = \frac{2}{5} = 40%$.

Problem 3: A factory has two shifts. The day shift produces 70% of items and the night shift produces 30%. Day shift items are defective 2% of the time; night shift items are defective 5% of the time.

a) What percentage of all items are defective? b) If an item is defective, what is the probability it was made during the night shift?

Show Answer

a) Total defect rate: $$P(\text{Def}) = P(\text{Def}|\text{Day}) \cdot P(\text{Day}) + P(\text{Def}|\text{Night}) \cdot P(\text{Night})$$ $$P(\text{Def}) = (0.02)(0.70) + (0.05)(0.30) = 0.014 + 0.015 = 0.029 = 2.9%$$

b) Probability defective item is from night shift: $$P(\text{Night}|\text{Def}) = \frac{P(\text{Def}|\text{Night}) \cdot P(\text{Night})}{P(\text{Def})} = \frac{(0.05)(0.30)}{0.029} = \frac{0.015}{0.029} \approx 0.517 = 51.7%$$

Even though the night shift produces only 30% of items, they account for about 52% of defects because of their higher defect rate.

Problem 4: The table below shows the results of a survey on smartphone usage by age group:

Uses Social Media Does Not Use Social Media Total
Under 30 180 20 200
30 and Over 150 150 300
Total 330 170 500

Are age group and social media usage independent? Justify your answer.

Show Answer

To test independence, compare $P(\text{Uses Social Media})$ with $P(\text{Uses Social Media} | \text{Under 30})$.

Unconditional probability: $$P(\text{Uses Social Media}) = \frac{330}{500} = 0.66 = 66%$$

Conditional probability (Under 30): $$P(\text{Uses Social Media} | \text{Under 30}) = \frac{180}{200} = 0.90 = 90%$$

Since $90% \neq 66%$, age and social media usage are NOT independent.

Young people are much more likely to use social media. We can also check: $$P(\text{Uses Social Media} | \text{30+}) = \frac{150}{300} = 0.50 = 50%$$

There is a clear dependence: 90% of under-30s use social media, but only 50% of 30+ do.

Problem 5: A rare disease affects 0.5% of the population. A test for this disease has 99% sensitivity (correctly identifies 99% of people with the disease) and 95% specificity (correctly identifies 95% of people without the disease).

If you test positive, what is the probability you actually have the disease?

Show Answer

Let D = disease and + = positive test.

Given:

  • $P(D) = 0.005$
  • $P(D^c) = 0.995$
  • $P(+|D) = 0.99$ (sensitivity)
  • $P(-|D^c) = 0.95$ (specificity), so $P(+|D^c) = 0.05$

Find $P(+)$: $$P(+) = P(+|D) \cdot P(D) + P(+|D^c) \cdot P(D^c)$$ $$P(+) = (0.99)(0.005) + (0.05)(0.995) = 0.00495 + 0.04975 = 0.0547$$

Apply Bayes’ Theorem: $$P(D|+) = \frac{P(+|D) \cdot P(D)}{P(+)} = \frac{(0.99)(0.005)}{0.0547} = \frac{0.00495}{0.0547} \approx 0.0905 = 9.05%$$

Despite the test being quite accurate, a positive result only means about a 9% chance of having the disease. This is because the disease is rare, so false positives (5% of the 99.5% without disease) outnumber true positives.

Problem 6: Roll two fair dice. Given that the sum is at least 10, what is the probability that at least one die shows a 6?

Show Answer

Let A = “at least one die shows 6” and B = “sum is at least 10.”

We need $P(A|B) = \frac{P(A \text{ and } B)}{P(B)}$.

Find outcomes where sum is at least 10: Sum = 10: (4,6), (5,5), (6,4) - 3 outcomes Sum = 11: (5,6), (6,5) - 2 outcomes Sum = 12: (6,6) - 1 outcome Total: 6 outcomes out of 36 possible

$$P(B) = \frac{6}{36} = \frac{1}{6}$$

Find outcomes where sum $\geq$ 10 AND at least one 6: From the list: (4,6), (6,4), (5,6), (6,5), (6,6) - 5 outcomes (Only (5,5) from the sum $\geq$ 10 outcomes has no 6)

$$P(A \text{ and } B) = \frac{5}{36}$$

Calculate conditional probability: $$P(A|B) = \frac{5/36}{6/36} = \frac{5}{6} \approx 0.833 = 83.3%$$

Given a sum of at least 10, there is an 83.3% chance at least one die shows 6.

Summary

  • Conditional probability $P(A|B)$ measures the probability of A given that B has occurred. It answers: “Now that I know B happened, what are the chances of A?”

  • The conditional probability formula is $P(A|B) = \frac{P(A \text{ and } B)}{P(B)}$. The condition restricts your sample space to only outcomes where B occurred.

  • Two-way tables make conditional probability calculations straightforward: the condition tells you which row or column to focus on.

  • Tree diagrams visualize sequential conditional probabilities. Multiply along branches to find path probabilities; add paths to find total probabilities.

  • Events are independent if $P(A|B) = P(A)$ - learning B happened does not change the probability of A. Test this by comparing conditional and unconditional probabilities.

  • Bayes’ Theorem reverses conditional probabilities: $P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}$. It is essential when you know one conditional probability but need the reverse.

  • Prior and posterior probability: The prior is your belief before new information; the posterior is your updated belief after learning new evidence.

  • $P(A|B)$ and $P(B|A)$ are different. Confusing them is a common and serious error. Always be clear about what you are conditioning on versus what you are finding the probability of.

  • Real-world applications include medical testing, spam filtering, weather prediction, and legal reasoning - anywhere that new information should update probability assessments.