The total probability theorem finds the chance of an event A that can happen through several mutually exclusive and exhaustive causes E1,E2,…,En: P(A)=∑P(Ei)P(A∣Ei). Bayes' theorem works backwards: once A is observed, it gives the probability that a particular cause Ei produced it. Together, total probability and Bayes' theorem solve every "which bag, which machine, which plant" problem in JEE Main and JEE Advanced, with trees, priors, posteriors and a natural-frequency shortcut.
On this page1Partition2Total probability3Bayes' theorem4Priors and posteriors5Strategy6Solved examples
Key Formulas - Quick Reference
Partition: Ei∩Ej=ϕ for i=j and E1∪E2∪⋯∪En=S, so ∑P(Ei)=1
★ Must learnTotal probability: P(A)=∑i=1nP(Ei)P(A∣Ei)
★ Must learnTwo causes: P(A)=P(E)P(A∣E)+P(E′)P(A∣E′)
★ Must learnBayes' theorem: P(Ei∣A)=∑jP(Ej)P(A∣Ej)P(Ei)P(A∣Ei)
★ Must learnPosterior ∝ prior × likelihood, and ∑iP(Ei∣A)=1
Equal priors: P(Ei∣A)=∑jP(A∣Ej)P(A∣Ei)
miniP(A∣Ei)≤P(A)≤maxiP(A∣Ei): P(A) is a weighted average
1. Partition of a Sample Space
Events E1,E2,…,En form a partition of the sample spaceS if they are mutually exclusive and exhaustive:
Ei∩Ej=ϕ(i=j)andE1∪E2∪⋯∪En=S
so ∑i=1nP(Ei)=1.
Think of the Ei as the different "causes" or "routes" through which a result can come about: which bag was chosen, which machine made the item, which plant built the TV. Any event A is cut by the partition into disjoint pieces (Figure 1).
Figure 1: Every event A splits into disjoint pieces A∩Ei, one per cause. Adding the pieces gives the total probability theorem.
A single event and its complement always form a partition: E∪E′=S and E∩E′=ϕ. That is why two-cause problems (watered or not, leap year or not) need only one prior.
2. Theorem of Total Probability
If E1,E2,…,En partition S with each P(Ei)>0, then for any event A:
The term P(Ei)P(A∣Ei) is the contribution of cause Ei to the occurrence of A.
Proof. Write A=(E1∩A)∪(E2∩A)∪⋯∪(En∩A). The Ei are mutually exclusive, so the pieces Ei∩A are too. Adding them and using the multiplication theorem on each piece:
P(A)=i=1∑nP(Ei∩A)=i=1∑nP(Ei)P(A∣Ei)
On a tree the theorem reads: multiply along each path, then add all paths that end in A (Figure 2).
Figure 2: Total probability is "multiply along each path, add the paths": P(white)=103+165=8049.
2.1 A weighted average
Since the priors P(Ei) are non-negative and add to 1, P(A) is a weighted average of the likelihoods P(A∣Ei). It must lie between the smallest and largest of them, closer to the causes with bigger priors (Figure 3). This gives an instant sanity check.
Figure 3: P(D)=0.8(0.15)+0.2(0.35)=0.19 is the balance point of the conditional probabilities, weighted by the priors. It must lie between 0.15 and 0.35.
Exam Trick
Check every total probability answer against the range of the conditional probabilities: P(A) can never fall outside [minP(A∣Ei),maxP(A∣Ei)]. In the TV problem, 0.19 lies between 0.15 and 0.35; an answer of 0.5 would be wrong on sight.
Key idea
Total probability = multiply along each path, add the paths that end in the result. It is a weighted average of the P(A∣Ei).
Quick Recall: tap to checkBag I: 3 white, 2 black; Bag II: 5 white, 3 black. A bag is picked at random and a ball drawn. P(white)?
21⋅53+21⋅85=8049.
Why must the Ei be exhaustive for the theorem?
Otherwise some part of A lies outside every Ei and is never counted.
Can P(A) be 0.4 if P(A∣E1)=0.1 and P(A∣E2)=0.3?
No. P(A) must lie between 0.1 and 0.3.
3. Bayes' Theorem
Bayes' theorem, also called the inverse probability theorem, answers: event A can occur through causes E1,…,En; A is observed; what is the probability that cause Ei produced it?
Derivation. By the definition of conditional probability and the multiplication theorem,
P(Ei∣A)=P(A)P(Ei∩A)=P(A)P(Ei)P(A∣Ei)
and the denominator P(A) is exactly the total probability ∑jP(Ej)P(A∣Ej). On a tree: your path divided by all paths ending in A (Figure 4).
Figure 4: Total probability adds all paths ending in the result: P(D)=0.19. Bayes' theorem takes one path over that total: P(B∣D)=0.190.07=197.
Total probability (forward)
The result is not yet known.
"Find the probability that the ball is white."
Add all paths ending in A.
Bayes' theorem (backward)
The result is already observed; you want the cause.
"Given the ball is white, find the probability it came from Bag II."
One path divided by all paths.
3.1 Prior, likelihood, posterior
Term
Symbol
Meaning
Prior
P(Ei)
Belief in cause Ei before seeing the evidence
Likelihood
P(A∣Ei)
How likely the evidence is if cause Ei is true
Evidence
P(A)
Total probability of the observed result
Posterior
P(Ei∣A)
Updated belief in cause Ei after seeing the evidence
Since the denominator is the same for every cause, posterior ∝ prior × likelihood. A cause gains probability when the evidence is more likely under it than on average, and loses probability otherwise.
3.2 Natural-frequency shortcut
Imagine a round number of cases (100, 1000). Split them by cause using the priors, then keep only those showing the evidence. The answer is (evidence cases from that cause) ÷ (all evidence cases). Figure 5 solves the TV problem (Solved Example 11) this way with 1000 TVs.
Figure 5: Of 1000 TVs, 190 fail the standard and 70 of those come from plant B, so P(B∣defective)=19070=197.
The same picture explains the famous base-rate effect. When a cause is rare, even a good test produces more false alarms from the large group than true hits from the small one (Figure 6).
Figure 6: With a 2% base rate, false positives from the large healthy group swamp the true positives: P(ill∣+)=1170190=11719≈16%.
Exam Trick
When all priors are equal, skip them: each posterior is its likelihood divided by the sum of all likelihoods. Then check that the posteriors add to 1; this catches most arithmetic slips in Bayes problems.
JEE Advanced
Sequential updating. Today's posterior is tomorrow's prior. A bag holds one fair coin and one two-headed coin; one coin is picked at random and tossed. After one head, P(two-headed)=1/2⋅1+1/2⋅1/21/2⋅1=32. Using 32 as the new prior, a second head gives
P(two-headed∣HH)=32⋅1+31⋅2132⋅1=54
which is exactly what one update with both heads gives. After n heads, P=2n+12n: evidence piles up, one observation at a time.
Key idea
Bayes = your path ÷ all paths ending in the evidence. Posterior ∝ prior × likelihood.
Quick Recall: tap to checkEqual priors, likelihoods 0.2 and 0.6. Find the posteriors.
They have different denominators: P(E) and P(A). A test that is 95% sensitive can still give a small P(ill∣+).
4. A Four-Step Method
List the causes E1,…,En and check that they partition S (priors add to 1).
Write each prior P(Ei) and each likelihood P(A∣Ei). Update bag contents after any hidden transfer.
Find P(A)=∑P(Ei)P(A∣Ei). If the question asks for the chance of the result, stop here.
If the result is given, divide the required path by P(A) (Bayes), then check that the posteriors add to 1.
Figure 7: One set-up serves both theorems. Only the last question changes: are you predicting the result (total probability) or explaining it (Bayes)?Figure 8: Revision map: one partition, two theorems, and the shortcuts that make Bayes problems quick.
5. Solved Examples
5.1 Total probability
Solved Example 1
A bag contains 3 white and 2 black balls; another contains 5 white and 3 black balls. A bag is chosen at random and a ball is drawn from it. Find the probability that it is white.
Solution:
The first bag is chosen with probability 21 and then gives white with probability 53; the second route contributes 21⋅85. The two routes are mutually exclusive (Figure 2):
P(white)=21⋅53+21⋅85=8049
Solved Example 2
Find the probability that a year chosen at random has 53 Sundays.
Solution:
Let L: the year is a leap year. Taking the standard exam assumption, P(L)=41 and P(L′)=43. Let A: the year has 53 Sundays.
A leap year has 366 days = 52 weeks + 2 days. The extra pair is one of 7 equally likely pairs, 2 of which contain a Sunday, so P(A∣L)=72. A non-leap year has 1 extra day, so P(A∣L′)=71 (Figure 9).
P(A)=41⋅72+43⋅71=285
Figure 9: The causes are leap (41) and non-leap (43) years, with likelihoods 72 and 71: P=285.
Solved Example 3
One bag contains 4 white and 3 black balls, and a second bag contains 3 white and 5 black balls. One ball is drawn from the first bag and placed unseen in the second bag. What is the probability that a ball now drawn from the second bag is black?
Solution:
Let E1: a white ball is transferred, E2: a black ball is transferred. P(E1)=74, P(E2)=73.
Let A: a black ball is finally drawn. After E1, Bag II has 4 white and 5 black, so P(A∣E1)=95. After E2, it has 3 white and 6 black, so P(A∣E2)=96 (Figure 10).
P(A)=74⋅95+73⋅96=6338
Figure 10: A hidden transfer creates two cases. Update Bag II in each case, then combine: 74⋅95+73⋅96=6338.
Solved Example 4
A real estate agent has 8 master keys to open several new homes; only one master key opens any given house. If 40% of these homes are usually left unlocked, what is the probability that the agent can get into a specific home if he picks 3 master keys at random before leaving the office?
Solution:
Let E1: the home is unlocked, E2: the home is locked. P(E1)=0.4, P(E2)=0.6. Let A: he gets in.
P(A∣E1)=1. If locked, he needs the one correct key among his 3: P(A∣E2)=8C37C2=5621=83.
P(A)=0.4×1+0.6×83=104+8018=85
Solved Example 5
A die is thrown. If it shows a multiple of 3, a ball is drawn from Box I (5 red, 4 white); otherwise a ball is drawn from Box II (4 red, 2 white). Find the probability that the ball is white.
Solution:
Let E1: die shows 3 or 6, so Box I is used; E2: Box II is used. P(E1)=62, P(E2)=64. Let W: a white ball is drawn.
P(W∣E1)=94, P(W∣E2)=62.
P(W)=62⋅94+64⋅62=274+92=2710
Solved Example 6
A pack of 52 cards is split into two heaps of 26 cards each, and a card is drawn from one heap chosen at random. Find the probability that it is a king.
Solution:
Let E1, E2: heap I or heap II is chosen, each with probability 21. Suppose heap I holds x kings, so heap II holds 4−x.
P(K)=21⋅26x+21⋅264−x=524=131
The answer does not depend on how the kings are split.
Solved Example 7
Purse 1 contains 9 fifty-paise coins and one one-rupee coin; purse 2 contains 10 fifty-paise coins. Nine coins are transferred at random from purse 1 to purse 2, and then nine coins are transferred at random from purse 2 back to purse 1. Find the probability that the one-rupee coin is in purse 1 after both transfers.
Solution:
Let E1: the rupee coin is among the 9 coins moved to purse 2; E2: it is not. Let E: the rupee coin is in purse 1 at the end.
P(E1)=10C91C1⋅9C8=109 and P(E2)=10C99C9=101.
If E1 happened, purse 2 has 19 coins including the rupee, and 9 are sent back: P(E∣E1)=19C91C1⋅18C8=199. If E2 happened, the rupee never left: P(E∣E2)=1.
P(E)=109⋅199+101⋅1=19081+19=1910
Solved Example 8
An unbiased coin is tossed. If it shows a head, a pair of dice is rolled and the sum is noted. If it shows a tail, a card is picked from eleven cards numbered 2, 3, ..., 12 and its number is noted. Find the probability that the noted number is 7 or 8.
Solution:
Let E1: head, E2: tail, each with probability 21. Let A: the noted number is 7 or 8.
With dice, 7 occurs in 6 ways and 8 in 5 ways, so P(A∣E1)=3611. With the cards, P(A∣E2)=112.
P(A)=21(3611+112)=21⋅396121+72=792193
5.2 Bayes' theorem
Solved Example 9
Bag A contains 2 white and 3 red balls; bag B contains 4 white and 5 black balls. A bag is selected at random and a ball drawn from it is white. Find the probability that bag B was selected.
Solution:
Let E1: bag A selected, E2: bag B selected; P(E1)=P(E2)=21. Let A: a white ball is drawn. P(A∣E1)=52, P(A∣E2)=94.
P(A)=21(52+94)=9038
P(E2∣A)=38/90(1/2)(4/9)=18×3890×4=1910
Solved Example 10
A card from a pack of 52 is lost. From the remaining cards, two are drawn and both are found to be spades. Find the probability that the missing card is also a spade.
Solution:
Let E1: the lost card is a spade, E2: it is not. P(E1)=41, P(E2)=43. Let A: two spades are drawn from the remaining 51 cards.
P(A∣E1)=51C212C2 and P(A∣E2)=51C213C2. The common 51C2 cancels:
A company makes TVs at plants A and B. Plant A produces 80% and plant B 20% of the total. 85 out of 100 TVs from plant A and 65 out of 100 from plant B meet the quality standard. A TV chosen at random is found not to meet the standard. Find the probability that it was made at plant B.
Solution:
Let E1 (E2): the TV is from plant A (B). P(E1)=0.8, P(E2)=0.2. Let A: the TV does not meet the standard.
P(A∣E1)=1−10085=203 and P(A∣E2)=1−10065=207.
P(A)=0.8×203+0.2×207=203.8=0.19
P(E2∣A)=3.8/200.2×(7/20)=3814=197
Figure 5 gets the same answer by counting 1000 TVs.
Solved Example 12
A friend waters a plant with probability 32 before leaving on a trip. If watered, the plant dies with probability 21; if not watered, it dies with probability 43. On returning, you find the plant dead. Find the probability that the friend forgot to water it.
Solution:
Let E1: watered, E2: not watered. P(E1)=32, P(E2)=31. Let A: the plant dies. P(A∣E1)=21, P(A∣E2)=43.
P(E2∣A)=32⋅21+31⋅4331⋅43=1/3+1/41/4=73
The posterior 73 is larger than the prior 31: a dead plant is evidence that it was not watered.
Solved Example 13
In a class, 60% of students are boys. 5% of the boys and 10% of the girls have an IQ above 150. A student chosen at random has an IQ above 150. Find the probability that the student is a boy.
Solution:
Let E1: boy, E2: girl; P(E1)=0.6, P(E2)=0.4. Let A: IQ above 150; P(A∣E1)=0.05, P(A∣E2)=0.10.
P(E1∣A)=0.6×0.05+0.4×0.100.6×0.05=0.070.03=73
Even though boys are the majority, the evidence favours girls because their likelihood is twice as high.
Solved Example 14
A card is lost from a pack of 52. A card is then drawn from the remaining 51 cards and found to be red. Find the probability that the lost card was red.
Solution:
Let E1: lost card red, E2: lost card black; P(E1)=P(E2)=21. Let A: the drawn card is red.
If the lost card was red, 25 red cards remain: P(A∣E1)=5125. Otherwise P(A∣E2)=5126.
P(E1∣A)=21⋅5125+21⋅512621⋅5125=5125
Seeing a red card makes it slightly less likely that the lost card was red.
Solved Example 15
A bag holds 6 balls, each white or black. The number of black balls is equally likely to be 0, 1, 2 or 3. Two balls are drawn one after another with replacement, and both are white. Find the probability that the bag has exactly 3 black balls.
Solution:
Let E1,E2,E3,E4: the bag has 0, 1, 2, 3 black balls; each prior is 41. Let A: both draws are white.
Similarly P(E1∣A)=8636, P(E2∣A)=8625, P(E3∣A)=8616. They add to 1, a quick arithmetic check (Figure 11).
Figure 11: Equal priors of 0.25 become posteriors 8636,8625,8616,869: each posterior is proportional to its likelihood.
5.3 JEE-style problems
Solved Example 16
Machines A, B and C produce 25%, 35% and 40% of the bolts in a factory, and 5%, 4% and 2% of their output is defective. A bolt drawn at random is defective. The probability that it was made by machine B is (A) 28/69 (B) 25/69 (C) 16/69 (D) 14/69
Solution:
Paths ending in "defective": A: 0.25×0.05=0.0125; B: 0.35×0.04=0.014; C: 0.40×0.02=0.008.
Total P(D)=0.0345.
P(B∣D)=0.03450.014=6928. Check: 6925+28+16=1.
Answer: (A) 6928. Machine C makes the most bolts but the fewest defectives.
Solved Example 17
In an MCQ with 4 options, a student knows the answer with probability 43 and otherwise guesses at random. Given that the answer is correct, the probability that the student knew it is (A) 3/4 (B) 12/13 (C) 13/16 (D) 15/16
Solution:
Let K: knows, G: guesses. P(K)=43, P(G)=41; P(C∣K)=1, P(C∣G)=41.
P(K∣C)=43⋅1+41⋅4143⋅1=13/163/4=1312
Answer: (B) 1312. Option (C) is P(C) itself, the denominator.
Solved Example 18
A bag contains one fair coin and one two-headed coin. A coin is picked at random and tossed; it shows a head. Find (i) the probability that it is the two-headed coin (ii) the probability that the same coin shows a head again on a second toss.
Solution:
(i) Bayes, with T = two-headed coin:
P(T∣H)=21⋅1+21⋅2121⋅1=32,P(fair∣H)=31
(ii) Total probability with the updated beliefs as priors:
P(2nd head∣1st head)=32⋅1+31⋅21=65
Answer:32 and 65. Bayes first, then total probability: a common JEE Advanced two-step.
Solved Example 19
A disease affects 2% of a population. A test detects it in 95% of patients but also gives a positive result for 10% of healthy people. A person tests positive. Find the probability that the person has the disease.
Solution:
Let D: has the disease. P(D)=0.02, P(+∣D)=0.95, P(+∣D′)=0.10.
Answer:11719, only about 16%. Figure 6 shows why: out of 10 000 people, 980 healthy people test positive against only 190 patients.
Solved Example 20
A bag contains 4 balls. Two balls are drawn at random without replacement and both are white. Assuming all numbers of white balls in the bag (0 to 4) are equally likely, find the probability that all four balls are white.
Solution:
Let Ek: the bag has k white balls, k=0,…,4, each with prior 51. Let A: two white balls drawn. P(A∣Ek)=4C2kC2, which is 0 for k=0,1.
Likelihoods for k=2,3,4: 61, 63, 66. Equal priors cancel:
P(E4∣A)=1+3+66=53
Answer: 53, with P(E3∣A)=103 and P(E2∣A)=101 (total 1).
Practice Questions
Box I has 3 red and 2 blue balls; Box II has 2 red and 3 blue. A fair coin decides the box and one ball is drawn. Find P(red).Answer: 21
In the same set-up, the ball drawn is red. Find the probability that it came from Box II.Answer: 52
Machines A, B, C make 50%, 30% and 20% of a factory's output with defect rates 2%, 3% and 4%. Find P(defective), and the probability that a defective item came from C.Answer: 0.027; 278
A disease affects 1% of people. A test detects it in 99% of patients but also gives a positive result for 5% of healthy people. A person tests positive. Find the probability that the person has the disease.Answer: 61
A man speaks the truth 3 out of 4 times. He throws a die and reports that it is a six. Find the probability that it is actually a six.Answer: 83
Bag I has 2 white and 3 red balls, Bag II has 4 white and 5 red. One ball is moved unseen from Bag I to Bag II, and a ball then drawn from Bag II is red. Find the probability that the moved ball was white.Answer: 145
A doctor comes by train, bus, scooter or other means with probabilities 103,51,101,52. He is late with probabilities 41,31,121 and 0 respectively. He arrives late. Find the probability that he came by train.Answer: 21
Common Mistakes to Avoid
Watch out
Confusing P(A∣Ei) with P(Ei∣A). The chance of the evidence given a cause is not the chance of the cause given the evidence.
Using causes that are not exhaustive, such as forgetting a third machine or the "not watered" case. The priors must add to 1.
Assuming equal priors when the question gives unequal ones, such as production shares of 80% and 20%.
Forgetting to update a bag's contents after a hidden transfer. Each case changes the second bag differently.
Ignoring low base rates. With a rare disease, a positive test can still leave the chance of disease small.
Posteriors that do not add up to 1. Recheck the denominator; it must be the full total probability.
Taking P(A) as the simple average of the P(A∣Ei). It is a weighted average, weighted by the priors.
Using with-replacement likelihoods such as (65)2 when the balls are drawn without replacement, or the reverse.
Frequently Asked Questions
What is the theorem of total probability?
If causes E1,…,En are mutually exclusive and exhaustive, the probability of any event A is P(A)=∑P(Ei)P(A∣Ei). You add the contribution of each route by which A can happen. On a tree, multiply along each path and add the paths ending in A.
What is Bayes' theorem used for?
Bayes' theorem updates the probability of a cause after a result is observed: P(Ei∣A)=P(A)P(Ei)P(A∣Ei). It answers questions like which bag a ball came from, which machine made a defective item, or whether a positive test really means disease.
What is the difference between prior and posterior probability?
The prior P(Ei) is the probability of a cause before any evidence. The posterior P(Ei∣A) is the updated probability after event A is observed. Bayes' theorem connects them: the posterior is proportional to the prior times the likelihood P(A∣Ei).
How do I decide between total probability and Bayes' theorem?
Read what is known. If you must find the chance of a result, use total probability. If the result has already happened and you want the chance of a particular cause, use Bayes' theorem. Bayes' denominator is always the total probability, so both usually appear together.
Why is Bayes' theorem called inverse probability?
Problems usually give probabilities in the forward direction, from cause to effect, such as the defect rate of each machine. Bayes' theorem reverses that direction and gives the probability of the cause from the observed effect. That reversal is why it is also called the inverse probability theorem.
What is the natural frequency method for Bayes problems?
Imagine a round number of cases, such as 1000, split them by cause using the priors, and keep only the cases that show the evidence. The answer is the evidence cases from your cause divided by all evidence cases. For the TV problem this gives 19070=197 without fractions of fractions.
Is Bayes' theorem in the JEE Main 2026 syllabus?
Yes. The JEE Main syllabus under Statistics and Probability explicitly lists Bayes' theorem along with the addition and multiplication theorems. Typical questions involve two or three bags, boxes or machines, often with a transfer of balls before the final draw, and usually take under three minutes with a tree.
What kind of total probability questions appear in JEE Advanced?
The JEE Advanced 2026 syllabus lists total probability and Bayes' theorem, so expect multi-stage set-ups: hidden transfers between purses or bags, a lost card followed by draws, or several causes with unequal priors. Drawing a tree and checking that posteriors sum to 1 keeps such problems manageable.
Previous year questions on Total Probability Theorem And Bayes' Theorem
14 questions from past papers, each with a step-by-step solution.