This is the first exposure to a new topic in probability that you may not have seen in previous years. Take the typical example of rain and being late:

Assuming it rains or it does not, we can understand what the likelihood is of being late. What about the other way around? If the teacher is late, can we conclude something about the chances of it raining? Since the teacher is so rarely late, you could intuitively understand that it could be raining.
This is the nature of Bayes’ theorem. Conditional probability can change the probability of an outcome/event, even if what we are assuming happens after the event in question.
Total Probability Formula
We begin with a simple definition.
Definition (Partition of a Set): A partition of a set is a collection of non-empty subsets that completely reconstructs the original universal set, such that no two subsets have any elements in common. Formally, a collection of subsets
forms a partition of a set
if they satisfy two absolute mathematical rules:
- Pairwise Disjoint (No Overlap): No two distinct subsets share an element in common:
![Rendered by QuickLaTeX.com \[A_i \cap A_j = \emptyset \quad \text{for all } i \neq y\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-fb2d0c5a3a70977ec4ee10877c3bb816_l3.png)
- Mutually Exhaustive (Complete Coverage): The union of all subsets perfectly equals the entire universal set:
![Rendered by QuickLaTeX.com \[A_1 \cup A_2 \cup \dots \cup A_n = \Omega\]](https://mathematics.lu/wp-content/ql-cache/quicklatex.com-13d501f1c5f90a0ce71b511c49f390eb_l3.png)
Example: If we roll a standard six-sided die once, the complete sample space is
. We can partition this sample space into three distinct subsets:
![]()
The idea behind the total probability formula is that in order to find the probability of some event B, it may be easier to intersect it with A and A’ (the complement). This is because
. We are partitioning B into B with A and B with “not A”. This will make our calculations easier:
Example: Three boxes contain each
tokens in the following colors:
- Box 1 (
) has
green and
yellow tokens; - Box 2 (
) has
green and
yellow tokens; - Box 3 (
) has
green and
yellow tokens.
A box is chosen at random and then a single token is drawn from the chosen box, also at random. Use the Law of Total Probability and partitions to determine the probability that the chosen token is green (
).
Let us see another example.
Example: A local tech distributor sources its electronics from three separate overseas manufacturing facilities. Factory
(
) manufactures
of the total incoming inventory, and
of its electronics are found to be defective. Factory
(
) handles
of the total inventory, and
of its components are defective. Factory
(
) handles the remaining
of the total inventory, and
of its components are defective.
If we randomly select an electronic item from the incoming warehouse shipment, what is the probability that it will be defective?
Bayes’ Law/Theorem
Bayes’ theorem allows us to find
by using
. That is, in any exercise where we are asked for a conditional probability where “the order is backwards”, we should suspect that Bayes’ should be used. Below is the theorem:
Theorem (Bayes’ Theorem): For any two events
and
within a sample space
, where
and
, the conditional probability of event
occurring given that event
has already occurred is given by the formula:
![]()
Bayes’ Theorem provides a foundational algebraic method to invert conditional probabilities, allowing you to calculate
when only the inverse conditional probability
is explicitly known.
Here is how we use it:
Example: A credit card fraud detection system monitors transaction patterns. Data shows that
of all processed transactions are actually fraudulent (
). When a transaction is fraudulent, the security software correctly flags it as suspicious with a probability of
(true positive). However, if a transaction is legitimate (
), the system incorrectly flags it as suspicious with a probability of
(false positive).
If a new transaction is flagged by the software as suspicious, what is the probability that it is actually fraudulent? Solve this using Bayes’ Theorem.

False Positives
False positives (or false negatives) are when we get the wrong positive (respectively negative) result in a test. For example: A few years ago, we used COVID rapid tests that were not as efficient as PCR test. The relevant question is: If this “less reliable” test comes back positive, what is the likelihood I have COVID?
This is a classic example of Bayes’ Law. Below is another example:
Example: A medical diagnostic test evaluates patients for a rare health condition. Statistics show that
of the population actually has this condition. If a person has the condition, the test correctly returns a positive result with a probability of
(true positive). If a person does not have the condition, the test returns a positive result with a probability of
(false positive).
If a randomly selected individual takes the diagnostic test and receives a positive result, what is the probability that they actually have the condition? Solve this using Bayes’ Theorem.

The main skill necessary is concluding each probability from the instructions. Then, we use Bayes’ theorem and draw our relevant conclusion.
Exercises
An insurance provider classifies its policyholders into three distinct risk tiers. Tier 1 (
) contains
of all clients, and the probability of a client in this tier filing a claim within a year is
. Tier 2 (
) contains
of all clients, with an annual claim probability of
. Tier 3 (
) contains the remaining
of high-risk clients, with an annual claim probability of
. If an analyst selects a client profile at random, calculate the total probability that this client will file an insurance claim within the year.
A large agricultural farm grows three varieties of tomatoes distributed across different fields. Variety A (
) covers
of the cultivated land, and the probability of a plant from this crop contracting a fungal blight is
. Variety B (
) covers
of the land, with a blight probability of
. Variety C (
) covers the remaining
of the land, with a blight probability of
. If a field inspector picks a tomato plant at random from the ground, find the probability that it is infected with the fungal blight.
An airport security scanner checks luggage for prohibited liquids (
). Data shows that only
(
) of bags contain these liquids. If a bag has prohibited liquids, the scanner triggers an alarm with a probability of
. If a bag does not contain prohibited liquids (
), the scanner triggers a false alarm with a probability of
. If a bag triggers the security alarm, find the probability that it actually contains prohibited liquids.
An automated email spam filter scans incoming messages. Records show that
of all incoming emails are spam (
). If an email is spam, the filter correctly flags it as suspicious with a probability of
(true positive). If an email is legitimate (
), the filter incorrectly flags it as suspicious with a probability of
(false positive). If a randomly arrived email is flagged as suspicious, calculate the conditional probability that it is actually spam.
A newly developed laboratory blood test screens patients for a rare viral infection. Statistical records indicate that
(
) of the population carried the active virus (
). When a patient has the infection, the test correctly identifies it with a probability of
(true positive). If a patient is healthy and free of the infection (
), the test returns a positive result with a probability of
(false positive). If a randomly selected individual takes this blood screening and tests positive, calculate the probability that they actually carry the active virus.
A specialized clinic runs genetic screening panels for a specific hereditary marker (
). Data shows that
(
) of patients in the high-risk pool carry this genetic marker. If the marker is present, the screening panel correctly registers a positive match with a probability of
. If a patient does not carry the marker (
), the panel still returns a positive match with a probability of
. If a patient’s screening panel registers a positive match, determine the probability that they actually carry the underlying hereditary marker.