Bayes theorem turns a probability round. If you know how likely a clue is when something is true, it tells you how likely that thing is once you see the clue. The formula is P(A|B) = P(B|A) × P(A) ÷ P(B).
P(faulty | flagged) = 18 ÷ 67 ≈ 27%
Hello, curious mind!
What is Bayes theorem?
Bayes theorem finds the chance of a cause when you can see its effect. The bar “|” means “given”: P(A|B) is the probability of A, given B.
P(A|B) = P(B|A) × P(A) ÷ P(B)
- P(A): the chance before the clue (the prior).
- P(B|A): how likely the clue is when A is true.
- P(B): how likely the clue is from every cause.
- P(A|B): the chance after the clue (the posterior).
Why it works: P(A and B) = P(A) × P(B|A) = P(B) × P(A|B). Divide by P(B). The bottom line is usually not given, so build it from each cause:
P(B) = P(B|A) × P(A) + P(B|not A) × P(not A)
New to probability? Start with our guide to probability.
Remember this
New chance = your path ÷ all paths to the clue.
How to use Bayes theorem in 4 steps
Name the events. A is the cause you want. B is the clue you saw.
List each cause. P(A) and P(not A) must add up to 1.
Find each path to the clue. Cause × chance of the clue. Add the paths to get P(B).
Divide. Your path ÷ all paths.
Stuck? Picture 1,000 real cases and count them. It gives the same answer.
Bayes theorem: 3 worked examples
Example 1: two bakeries
A café gets 60% of its croissants from bakery A and 40% from bakery B. 5% of A’s are burnt, and 10% of B’s. A croissant is burnt. What is P(from B)?
Path through A: 0.6 × 0.05 = 0.03. Path through B: 0.4 × 0.10 = 0.04.
All paths: P(burnt) = 0.03 + 0.04 = 0.07.
P(B | burnt) = 0.04 ÷ 0.07 = 4/7 ≈ 57.1%.
Count check: of 100 croissants, 3 burnt ones come from A and 4 from B. B sends fewer, but it is the likely cause.
Example 2: a battery check that flags faults
2% of a shop’s phone batteries are faulty. A check flags 90% of faulty batteries, and 5% of good ones by mistake. A battery is flagged. How likely is it faulty?
| Out of 1,000 batteries | Flagged | Not flagged | Total |
|---|---|---|---|
| Faulty | 18 | 2 | 20 |
| Good | 49 | 931 | 980 |
| Total | 67 | 933 | 1,000 |
Faulty path: 0.02 × 0.90 = 0.018. Good path: 0.98 × 0.05 = 0.049.
P(flagged) = 0.018 + 0.049 = 0.067.
P(faulty | flagged) = 0.018 ÷ 0.067 = 18/67 ≈ 26.9%.
The check catches 90% of faults. Yet the 49 false flags outnumber the 18 real ones.
Example 3: check the same battery again
A second, separate check with the same rates flags the battery again. Now what is the chance it is faulty?
The last answer becomes the new start: P(faulty) = 18/67.
Faulty path: 18/67 × 0.9. Good path: 49/67 × 0.05.
P(faulty | two flags) = 16.2 ÷ (16.2 + 2.45) = 324/373 ≈ 86.9%.
Count check: of 100,000 batteries, 1,620 faulty and 245 good ones get two flags. 1,620 ÷ 1,865 ≈ 86.9%. Each new clue updates the last answer.
Why the starting chance matters
Keep the same check. Change only how common faults are.
| Faulty to start with | P(faulty | flagged) |
|---|---|
| 2% | 26.9% |
| 20% | 81.8% |
| 50% | 94.7% |
When the cause is rare, most alarms are false. So a good test is not enough on its own.
Common Bayes theorem mistakes
- Turning P(B|A) into P(A|B). “Flags 90% of faulty batteries” is not “90% of flagged batteries are faulty”. That was 26.9%.
- Ignoring the starting chance. Answering 90% skips P(A). Faults were only 2%.
- Leaving a path off the bottom line. P(flagged) = 0.018 forgets the 49 false flags, so the answer comes out as 1.
- Mixing percents and decimals. 2 × 0.90 next to 0.98 × 0.05 gives nonsense. Use one form.
- Rounding too early. Using 0.3 for 18/67 in Example 3 gives 88.5%, not 86.9%.
Check this with the Free BMI Maths Test
- Swaps P(B|A) and P(A|B): CNC, concept not clear.
- Skips the starting chance: CNC, concept not clear.
- Leaves the false flags out of P(B): DRC, did not read carefully.
- Mixes 2 and 0.02 in one line: CWV, copied a wrong value.
- Rounds 18/67 to 0.3 too early: CMT, calculation mistake.
The Free BMI Maths Test finds which of the 6 mistake types your child makes, and their real maths level. About the Free BMI Maths Test
Test prep corner
Bayes theorem in JEE Main and the SAT
NTA’s JEE Main 2027 maths topic list names “Baye’s theorem” (its spelling) in Unit 13, Statistics and Probability. The SAT does not name it, but College Board lists “probability and conditional probability” as an SAT skill. These are JEE-style questions, not real past questions.
JEE-style: Bag I has 3 red and 2 black balls. Bag II has 2 red and 4 black. A coin toss picks the bag. A red ball is drawn. Find P(Bag I | red).
Bag I path: ½ × 3/5 = 3/10. Bag II path: ½ × 2/6 = 1/6. P(red) = 3/10 + 1/6 = 7/15. P(Bag I | red) = (3/10) ÷ (7/15) = 9/14. Trap: 3/5 is P(red | Bag I), the wrong way round.
JEE-style: A student knows an answer with probability 3/4, and otherwise guesses from 4 options. The answer is right. Find P(knew it).
Knew path: 3/4 × 1 = 3/4. Guess path: 1/4 × 1/4 = 1/16. P(right) = 13/16. P(knew | right) = (3/4) ÷ (13/16) = 12/13. Trap: answering 3/4 ignores the lucky guesses.
For a longer mixed set, try our JEE-style maths questions with answers.
Facts checked on 14 November 2026 on nta.ac.in (JEE Main 2027 topic list) and satsuite.collegeboard.org.
Quick check: 3 Bayes theorem questions
1. P(A) = 0.3, P(B|A) = 0.5 and P(B) = 0.25. What is P(A|B)?
Not quite. 0.15 is the top line. Divide by 0.25.
Yes! 0.15 ÷ 0.25 = 0.6.
Not quite. 0.5 is P(B|A), the other way round.
2. Box 1 holds 2 gold coins. Box 2 holds 1 gold and 1 silver coin. You pick a box at random and draw a gold coin. What is P(Box 1)?
Not quite. That is the chance before the clue.
Not quite. 3/4 is P(gold), not P(Box 1 | gold).
Yes! ½ ÷ (½ + ¼) = 2/3.
3. P(A) = 0.4, P(B|A) = 0.5 and P(B|not A) = 0.25. What is P(B)?
Not quite. Weight each part before you add.
Not quite. Add the “not A” path too.
Yes! 0.4 × 0.5 + 0.6 × 0.25 = 0.35.
Got 1 or none right? Book the Free BMI Maths Test to find the cause.
Questions people ask about Bayes theorem
What is the Bayes theorem formula?
P(A|B) = P(B|A) × P(A) ÷ P(B).
How is Bayes theorem different from conditional probability?
Conditional probability is the chance of one event given another. Bayes theorem turns P(B|A) round into P(A|B).
Why is a positive result from a good test often wrong?
When the cause is rare, false alarms outnumber real cases: 49 false flags against 18 real ones above.
Keep exploring
Does your child turn P(B|A) the wrong way round?
The Free BMI Maths Test finds your child’s real maths level and the reason for each mistake.
