IAE Academy

GATE DA

Conditional probability and Bayes' theorem

Conditional, marginal and joint probability, and Bayes' theorem

Conditional probability measures how likely an event is once you know another has occurred. Joint and marginal probabilities describe two or more events or variables together and one at a time. Bayes' theorem combines them to reverse a conditioning, from to . Typical problems of this kind (diagnostic tests, probability trees, sequential draws) reduce to the multiplication rule, the law of total probability and one division.

3 previous-year questions · 3 solved · 4 practice questions

Conditional probability and the multiplication rule

The conditional probability is the probability of given that has occurred. Knowing shrinks the sample space to , so we measure relative to . It is defined only when . Conventions used here: is read "probability of given "; is the complement of ; , the probability that both occur, is also written or . Probabilities are given as fractions or decimals, whichever the question asks for.

CONDITIONAL PROBABILITY

Defined when . For fixed , is itself a probability measure, so .

MULTIPLICATION RULE (TWO EVENTS)

The first form needs , the second needs . No independence is needed.

CHAIN RULE (MULTIPLICATION RULE FOR N EVENTS)

Used for sequential experiments such as draws without replacement. Needs , which makes every conditioning event positive.

COMPLEMENT AND SPLITTING

Always valid. The second identity splits by whether occurs; it is the two-part case of the law of total probability below.

UNION OF TWO EVENTS

Always valid. Given any three of , , and , it gives the fourth.

UNION OF THREE EVENTS (INCLUSION-EXCLUSION)

Always valid. Add the singles, subtract the pairs, add back the triple.

EXAM TIP

and are different quantities. They share the numerator but have different denominators. With and , they are equal exactly when or .

Joint and marginal probability from a table

For two discrete random variables and , the joint probability is the probability that both happen together. The marginal probability of ignores : add the joint probabilities across every value of . In a joint table the cells hold the joint probabilities and the marginals appear as row and column totals. Convention used here: rows are values of and columns are values of .

MARGINAL FROM THE JOINT

Sum over all values of the other variable. All cells of the table sum to 1.

CONDITIONAL FROM THE JOINT

Defined when . Fix the column of the conditioning value, then divide each cell in it by that column's total. For each fixed these conditionals sum to 1 over .

Quantity

How to read it from a joint table (rows = , columns = )

Joint

The single cell at row , column

Marginal

Total of row

Marginal

Total of column

Conditional

Cell divided by the total of column

Conditional

Cell divided by the total of row

INDEPENDENCE OF TWO DISCRETE RANDOM VARIABLES

Each cell must equal the product of its row total and column total. One cell that fails is enough to show and are dependent.

MARGINAL AND CONDITIONAL DENSITIES (CONTINUOUS CASE)

For jointly continuous with joint density . Sums become integrals. The conditional density is defined where . Densities are not probabilities: probabilities come from integrating them, and for a continuous .

EXAM TIP

When a table is given, first write the row and column totals and check that the cells sum to 1. A conditional probability is a cell divided by its row or column total, not by the grand total of 1.

EXAM TIP

To test independence, compare one cell with the product of its totals. For example, if while and , then , so and are dependent.

Law of total probability

A partition of the sample space is a set of events that are mutually exclusive ( for ) and exhaustive ( is the whole sample space), each with . Any event can be split by the partition, and its probability rebuilt as a weighted average of conditional probabilities.

LAW OF TOTAL PROBABILITY

The must be mutually exclusive and exhaustive with . The simplest partition is : .

  1. Identify the partition: the "cause" events (machine used, disease present or absent, urn chosen). Check that their probabilities sum to 1.

  2. Write the conditional probability of the observed event under each cause.

  3. Multiply each conditional by its cause probability, then add. This total is the denominator for Bayes' theorem.

EXAM TIP

The weights must sum to 1. A sum below 1 means a branch of the partition is missing. A sum above 1 means the events overlap, so they are not mutually exclusive.

Bayes' theorem, priors and posteriors

Bayes' theorem reverses a conditioning. We know how likely the evidence is under each cause (the likelihood ) and how likely each cause is beforehand (the prior ). After seeing , the updated probability of each cause is the posterior .

BAYES' THEOREM (TWO EVENTS)

Follows from the multiplication rule written both ways. Needs and .

BAYES' THEOREM OVER A PARTITION

is a partition with positive probabilities, and . The denominator is the law of total probability, so the posteriors sum to 1 over .

BAYES' THEOREM IN ODDS FORM

Posterior odds = likelihood ratio × prior odds. It needs , and . Convert back with probability = odds / (1 + odds).

Term

Meaning in a diagnostic test

Notation

Prior

Probability of the condition before testing (prevalence)

Sensitivity (true positive rate)

Positive test given the condition is present

False negative rate

Negative test given the condition is present

Specificity (true negative rate)

Negative test given the condition is absent

False positive rate

Positive test given the condition is absent

Posterior (positive predictive value)

Condition present given a positive test

  1. Name the cause events (a partition) and the observed event.

  2. Write the priors and the likelihoods from the problem. Convert rates such as the false positive rate or specificity into .

  3. Compute each product .

  4. Add the products to get .

  5. Divide the product for the cause you want by that total.

WORKED EXAMPLE

In a screening programme 2% of people have a condition . A test returns positive for 90% of people with and for 5% of people without . A person tests positive. Find .

Solution
  1. Priors: , .

  2. Likelihoods: , .

  3. Joint terms: and .

  4. Total: .

  5. Posterior: .

  6. Check with the odds form: likelihood ratio , prior odds , posterior odds , so .

Answer: . The test is fairly accurate, yet about 73% of positives () are false positives, because the condition is rare.

BAYES WITH TWO CONDITIONALLY INDEPENDENT PIECES OF EVIDENCE

Valid when and are conditionally independent given and also given . In the example above, two positive tests give . Equivalently, apply Bayes once and use the first posterior as the prior for the second test.

EXAM TIP

A low prior keeps the posterior small unless the false positive rate is small compared with the prior. Compare the two joint terms first: if is larger than , the posterior is below 0.5.

Independence and conditional independence

Events and are independent when knowing one does not change the probability of the other. Independence is a property of the probabilities, not of the events being physically unrelated, and it is different from being mutually exclusive.

INDEPENDENCE OF TWO EVENTS

The product form is the definition and needs no positivity condition. If and are independent, so are and , and , and and .

MUTUAL INDEPENDENCE OF THREE EVENTS

, , are mutually independent when this holds AND every pair is independent: , , . For events, the product rule must hold for every subcollection of two or more.

CONDITIONAL INDEPENDENCE

Events and are conditionally independent given when this holds, with . In general it neither implies nor is implied by ordinary independence.

Property

Independent

Mutually exclusive

Defining condition

, when

If and

and cannot be mutually exclusive

and cannot be independent

EXAM TIP

If and and the events are mutually exclusive, they are dependent: .

EXAM TIP

Pairwise independence does not imply mutual independence. Toss two fair coins. Let = first is heads, = second is heads, = both show the same face. Each has probability and each pairwise intersection has probability , so every pair is independent. But .

EXAM TIP

Two events can be dependent overall but independent once you condition on a third. An example is two test results that depend only on whether the person has the condition. Conditional independence is what lets you multiply likelihoods given the cause.

Sequential draws and probability trees

A probability tree shows a sequence of stages. Each branch carries the conditional probability of that step given the path so far. The probability of a full path is the product along its branches (the chain rule). The probability of an event is the sum over the paths that produce it (the law of total probability).

Draws

Conditional probabilities

Independent?

With replacement

The composition is restored, so each step has the same probabilities

Yes

Without replacement

The composition changes after each draw, so later probabilities depend on earlier results

No

WORKED EXAMPLE

A bag holds 5 red and 3 blue balls. Two balls are drawn at random one after the other without replacement. Find (a) the probability that the second ball is red, and (b) the probability that the first ball was red given that the second is red.

Solution
  1. Let , denote red on the first and second draw, and blue on the first draw.

  2. (a) Split by the first draw: .

  3. (b) By Bayes' theorem, .

Answer: (a) . (b) . Note that : before anything is observed, the second draw has the same probability of red as the first.

EXAM TIP

For random draws without replacement, the unconditional probability of a given colour at any position equals its probability at the first draw. Use this as a quick check, but use the conditional chain whenever the outcome of a draw is known.

EXAM TIP

Before applying Bayes' theorem to a tree question, check what is observed. The posterior is the total weight of the paths that match the observation and the cause, divided by the total weight of all paths consistent with the observation.

PREVIOUS-YEAR QUESTIONS

3 questions from the DA papers

Try each question first, then open the answer. We placed each question under a topic ourselves; the exam paper does not label topics.

See these papers in full: GATE DA 2026 · GATE DA 2025 · GATE DA 2024

GATE 2026 DA Q.57

GATE 2026 · DAQ.57 · 2 marks · NAT

A clinic specializes in testing for a disease D. The result of the test can be either positive or negative.

A study revealed that if a person suffers from the disease D, the test result in that clinic comes out positive 80% of the time, and negative 20% of the time. If a person is not suffering from the disease D, the test comes out positive 10% of the time and negative 90% of the time. It is also known that among the general population, the disease D occurs in 30% of the individuals.

If a person tests positive for D in that clinic, the probability that he/she actually suffers from the disease D is ________. (Rounded off to two decimal places)

Answer and solution
See the question in the paper
GATE 2026 DA Q.57: answer and solution

GATE 2025 DA Q.31

GATE 2025 · DAQ.31 · 1 mark · NAT

There are three boxes containing white balls and black balls.

Box-1 contains 2 black and 1 white balls.

Box-2 contains 1 black and 2 white balls.

Box-3 contains 3 black and 3 white balls.

In a random experiment, one of these boxes is selected, where the probability of choosing Box-1 is , Box-2 is , and Box-3 is . A ball is drawn at random from the selected box. Given that the ball drawn is white, the probability that it is drawn from Box-2 is ____________ (Round off to two decimal places)

Answer and solution
See the question in the paper
GATE 2025 DA Q.31: answer and solution

PRACTICE

4 questions to test yourself

PRACTICE 11 mark · MCQ

For events and , , and . What is ?

  1. (A)

  2. (B)

  3. (C)

  4. (D)

Answer and solution

Answer: (C)

  1. .

  2. .

  3. Since , the events happen to be independent. Option A is , not the conditional. Option C.

PRACTICE 21 mark · NAT

An urn holds 4 white and 6 black balls. Two balls are drawn at random one after the other without replacement. Find the probability that the two balls have different colours. Give the answer as a decimal rounded to two places.

Answer and solution

Answer: (accepted range )

  1. White then black: .

  2. Black then white: .

  3. Sum: , so 0.53.

  4. Check by counting: .

PRACTICE 32 marks · NAT

A factory has two machines. Machine 1 makes 60% of the items and 2% of its items are defective. Machine 2 makes the other 40% and 5% of its items are defective. An item is picked at random and found defective. Find the probability that it came from Machine 2. Give the answer as a decimal.

Answer and solution

Answer: (accepted range )

  1. .

  2. .

  3. .

  4. .

PRACTICE 42 marks · MCQ

Discrete random variables have the joint probabilities , , and . What is ?

  1. (A)

  2. (B)

  3. (C)

  4. (D)

Answer and solution

Answer: (B)

  1. The cells sum to .

  2. Marginal: .

  3. .

  4. Option A is the joint probability, not the conditional. Option C is . Option D is the marginal . Option B is correct.

OFFICIAL GATE 2027 SYLLABUS WORDING

Copied from the GATE 2027 syllabus; see all 2027 syllabi.

GATE DA

marginal, conditional and joint probability, Bayes Theorem

Preparing in Kolkata? IAE Academy's course for GATE DA.