Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 24

Conditional Probability and Bayes' Theorem

Recommended resources

Welcome to the final lesson in your Engineering Mathematics module. In our last session, we delved into the world of random variables and the key probability distributions that appear frequently in GATE. We learned how to identify the correct distribution for a given scenario—be it Binomial, Poisson, Uniform, Exponential, or Normal—and how to calculate probabilities using their respective functions and formulas.

Today, we will build directly on that foundation to tackle one of the most powerful concepts in probability theory: updating our beliefs in light of new evidence. This lesson covers conditional probability and Bayes' theorem, which are fundamental for solving a common class of GATE problems related to inference and diagnostics. We will also briefly cover the basic statistical measures used to describe data, as per the syllabus topic. By the end of this lesson, you will be able to dissect a complex probabilistic problem, identify the prior information and new evidence, and apply Bayes' theorem methodically to find the solution.

1. Describing Data: A Quick Look at Statistics

Before we dive into updating probabilities, let's briefly cover the fundamental tools for summarizing a set of data or a probability distribution. You have already encountered the concepts of Mean (Expectation) and Variance.

  • Mean (): The average value. For a set of data points , it's . For a probability distribution, it's the expected value .
  • Median: The middle value of a sorted dataset. If is odd, it's the middle element. If is even, it's the average of the two middle elements. The median is less sensitive to extreme outliers than the mean.
  • Mode: The value that appears most frequently in a dataset.
  • Variance (): Measures the average squared deviation from the mean, indicating the "spread" of the data. For a dataset, it's .
  • Standard Deviation (): The square root of the variance, . It is expressed in the same units as the data, making it more intuitive to interpret than variance.

For GATE, you should be familiar with these definitions, but the main focus of this topic is on the application of probability rules, which we will cover next.


2. Conditional Probability: Probability with New Information

The core of advanced probability lies in answering the question: "How does the likelihood of an event change if I know something else has already happened?" This is the essence of conditional probability.

The probability of event occurring, given that event has already occurred, is written as and is defined as:

where is the probability that both and occur, and we assume .

Think of it as narrowing your sample space. Instead of considering all possible outcomes, you are only considering the outcomes where is true. Within that new, smaller world, what is the chance that also happens?

This definition leads to the Multiplication Rule, a very useful tool for finding the probability of an intersection:

A crucial related concept is the Law of Total Probability. It allows you to find the total probability of an event by considering its probability across a set of mutually exclusive and exhaustive events that partition the sample space.

This is often visualized using a tree diagram, where you sum the probabilities of all paths leading to event .


3. Bayes' Theorem: Inverting Conditional Probabilities

Bayes' theorem is one of the most elegant and impactful results in probability. It provides a way to "invert" conditional probabilities. Often, we know the probability of an effect given a cause, , but what we really want to find is the probability of the cause given the effect, .

Derivation and Formula

Starting from the two forms of the multiplication rule:

Setting them equal gives . Rearranging for gives us Bayes' Theorem:

Let's break down the terms in a typical diagnostic scenario:

  • : The event that a patient has a disease (the "cause").
  • : The event that the patient's test is positive (the "effect").
  • (Posterior): The probability the patient has the disease given a positive test. This is what we want to find.
  • (Prior): The initial probability that a patient has the disease, based on general population statistics.
  • (Likelihood): The probability of a positive test given the patient has the disease (the test's sensitivity).
  • (Evidence): The overall probability of getting a positive test, regardless of whether the patient has the disease. We calculate this using the Law of Total Probability: .

So, the full form of Bayes' theorem for a simple two-case scenario (B or not B) is:

The following video provides an excellent walkthrough of these concepts with solved examples, which is the best way to master the application for GATE.

Engineering Mathematics 05 | Conditional Probability / Bayes Theorem 01 | GATE 2024 For All Branches

This video from GATE Wallah is a great resource for building your understanding from the ground up. It starts with conditional probability and logically progresses to Bayes' theorem, solving problems along the way.

Please watch the following segments: Conditional Probability: Start by watching the introduction to conditional probability from the beginning. This section explains the core formula and works through an initial example. Multiplication Rule and Examples: Continue with the section from this part to see more complex problems solved using conditional probability and the multiplication rule. Pay close attention to how the problem is broken down. Total Probability and Bayes' Theorem: The instructor introduces the Law of Total Probability and then Bayes' Theorem from this segment. Focus on the intuition behind the formulas. Bayes' Theorem Problem: Finally, watch the complete worked example of a classic Bayes' theorem problem from this example. This demonstrates the exact step-by-step process you should follow in the exam.


4. A Structured Approach to Solving GATE Problems

To consolidate what you've learned, let's walk through a typical GATE-style problem. The key is to be systematic.

Problem: A factory has two machines, M1 and M2. M1 produces 40% of the total bolts, and M2 produces 60%. Of the bolts produced by M1, 2% are defective. Of the bolts produced by M2, 5% are defective. A bolt is drawn at random from the total output and is found to be defective. What is the probability that it was produced by machine M2?

Solution Strategy:

  1. Define Events:

    • Let be the event that the bolt is from machine M1.
    • Let be the event that the bolt is from machine M2.
    • Let be the event that the bolt is defective.
  2. List Given Probabilities (Priors and Likelihoods):

    • (Prior probability of being from M1)
    • (Prior probability of being from M2)
    • (Likelihood of being defective given it's from M1)
    • (Likelihood of being defective given it's from M2)
  3. State the Goal (Posterior Probability):

    • We want to find – the probability it's from M2 given that it's defective.
  4. Apply Bayes' Theorem:

  5. Calculate the Denominator (Total Probability of Defect):

    • Using the Law of Total Probability:


  6. Calculate the Final Answer:

So, the probability that the defective bolt came from machine M2 is approximately 78.9%. Notice how our initial belief that a bolt is from M2 () was updated to a higher probability () once we gained the new evidence that the bolt was defective. This is because M2 has a higher defect rate.


Conclusion

This lesson concludes our journey through the Engineering Mathematics module. You've now covered the essential concepts of conditional probability and Bayes' theorem, which are critical for reasoning under uncertainty.

Key Takeaways:

  • Conditional Probability tells you how information about event changes the probability of event .
  • The Law of Total Probability is your tool for finding the overall probability of an event by summing its probabilities across different scenarios.
  • Bayes' Theorem, , allows you to formally update your initial beliefs (priors) with new evidence to arrive at a revised belief (posterior).
  • For GATE problems, a systematic approach is key: define events, list known probabilities, state the goal, and apply the appropriate formula (usually Bayes' theorem using the Law of Total Probability for the denominator).

You have now completed Module 3. We are about to shift gears significantly. Our next lesson will be the start of Module 4: Digital Logic, a core topic in Computer Science. We will begin with Topic 4.1: Boolean Algebra, the mathematical foundation for designing all digital circuits.