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:

Rendered by QuickLaTeX.com

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 A_1, A_2, \dots, A_n forms a partition of a set \Omega if they satisfy two absolute mathematical rules:

  • Pairwise Disjoint (No Overlap): No two distinct subsets share an element in common:

        \[A_i \cap A_j = \emptyset \quad \text{for all } i \neq y\]

  • Mutually Exhaustive (Complete Coverage): The union of all subsets perfectly equals the entire universal set:

        \[A_1 \cup A_2 \cup \dots \cup A_n = \Omega\]

Example: If we roll a standard six-sided die once, the complete sample space is \Omega = \{1, 2, 3, 4, 5, 6\}. We can partition this sample space into three distinct subsets:

    \[\{1, 2, 3\}, \quad \{4, 5\}, \quad \text{and} \quad \{6\}\]

Notice that no number appears in more than one group, and combining all three groups recreates the exact original sample space \Omega.

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 B=(A\cap B)\cup(A'\cap B). We are partitioning B into B with A and B with “not A”. This will make our calculations easier:

Example: Three boxes contain each 100 tokens in the following colors:

  • Box 1 (B_1) has 80 green and 20 yellow tokens;
  • Box 2 (B_2) has 50 green and 50 yellow tokens;
  • Box 3 (B_3) has 35 green and 65 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 (G).

Let us see another example.

Example: A local tech distributor sources its electronics from three separate overseas manufacturing facilities. Factory 1 (F_1) manufactures 40\% of the total incoming inventory, and 2\% of its electronics are found to be defective. Factory 2 (F_2) handles 35\% of the total inventory, and 4\% of its components are defective. Factory 3 (F_3) handles the remaining 25\% of the total inventory, and 6\% 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 \mathbb{P}(A|B) by using \mathbb{P}(B|A). 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 A and B within a sample space \Omega, where \mathbb{P}(A) > 0 and \mathbb{P}(B) > 0, the conditional probability of event A occurring given that event B has already occurred is given by the formula:

    \[\mathbb{P}(A \mid B) = \frac{\mathbb{P}(B \mid A) \times \mathbb{P}(A)}{\mathbb{P}(B)}\]

Bayes’ Theorem provides a foundational algebraic method to invert conditional probabilities, allowing you to calculate \mathbb{P}(A \mid B) when only the inverse conditional probability \mathbb{P}(B \mid A) is explicitly known.

Here is how we use it:

Example: A credit card fraud detection system monitors transaction patterns. Data shows that 2\% of all processed transactions are actually fraudulent (F). When a transaction is fraudulent, the security software correctly flags it as suspicious with a probability of 0.90 (true positive). However, if a transaction is legitimate (F'), the system incorrectly flags it as suspicious with a probability of 0.05 (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.

Rendered by QuickLaTeX.com

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 1\% of the population actually has this condition. If a person has the condition, the test correctly returns a positive result with a probability of 0.98 (true positive). If a person does not have the condition, the test returns a positive result with a probability of 0.03 (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.

Rendered by QuickLaTeX.com

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 (T_1) contains 60\% of all clients, and the probability of a client in this tier filing a claim within a year is 0.05. Tier 2 (T_2) contains 30\% of all clients, with an annual claim probability of 0.12. Tier 3 (T_3) contains the remaining 10\% of high-risk clients, with an annual claim probability of 0.30. 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 (V_1) covers 45\% of the cultivated land, and the probability of a plant from this crop contracting a fungal blight is 0.08. Variety B (V_2) covers 35\% of the land, with a blight probability of 0.15. Variety C (V_3) covers the remaining 20\% of the land, with a blight probability of 0.25. 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 (L). Data shows that only 0.5\% (0.005) of bags contain these liquids. If a bag has prohibited liquids, the scanner triggers an alarm with a probability of 0.98. If a bag does not contain prohibited liquids (L'), the scanner triggers a false alarm with a probability of 0.02. 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 8\% of all incoming emails are spam (S). If an email is spam, the filter correctly flags it as suspicious with a probability of 0.95 (true positive). If an email is legitimate (S'), the filter incorrectly flags it as suspicious with a probability of 0.04 (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 1.5\% (0.015) of the population carried the active virus (\text{Virus}). When a patient has the infection, the test correctly identifies it with a probability of 0.96 (true positive). If a patient is healthy and free of the infection (\text{Virus}'), the test returns a positive result with a probability of 0.04 (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 (\text{Marker}). Data shows that 3\% (0.03) 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 0.99. If a patient does not carry the marker (\text{Marker}'), the panel still returns a positive match with a probability of 0.02. If a patient’s screening panel registers a positive match, determine the probability that they actually carry the underlying hereditary marker.

error: Content is protected!