BrightChamps Logo
Login
Creative Math Ideas Image
Live Math Learners Count Icon1900 Learners

Last updated on June 18th, 2025

Math Whiteboard Illustration

Bayes' theorem

Professor Greenline Explaining Math Concepts

The theorem that helps determine the conditional probability of an event based on previous events is the Bayes theorem. It helps to identify how likely an event is based on another event. In this topic, we will learn more about Bayes' theorem.

Bayes' theorem for Saudi Students
Professor Greenline from BrightChamps

What is Bayes' Theorem

Bayes' theorem is a theorem in probability and statistics and is also known as Bayes rule and Bayes. It helps in determining the probability of event A based on the already occurred event B based on the probability of B given A, probability of A, and probability of B.   

 

Bayes’ theorem is used to calculate the conditional probability based on the hypothesis. That is Bayes' theorem is the conditional probability of the event A, given the occurrence of another event B is equal to the product of B given A and the probability of A divided by probability B, that is 


P (A|B) = P(B|A) × P(A) / P(B).

Struggling with Math?

Get 1:1 Coaching to Boost Grades Fast !

curious child
Professor Greenline from BrightChamps

Difference Between Conditional Probability and Bayes' theorem

Throughout the topic, we heard the words conditional probability and Bayes' theorem. Now let’s learn the difference between conditional probability and Bayes' theorem. 

 

Conditional Probability  Bayes' theorem
The probability of an event happening, given that another event has already taken place.  The probability of an event based on the previous event
Conditional probability is calculated using the formula, P(AB = P(A∩B)P(B) Bayes' theorem is calculated using the formula, P(A|B) = P(B|A) × P(A) / P(B)
It is used to measure the outcome of an event when we have known the dependence of another event is known  It is used in inferential statistics to make decisions based on the new data

 

Professor Greenline from BrightChamps

What is the statement for Bayes’ Theorem?

To find the statement for Bayes' theorem, let the sample space be S and the set of events can be E, E, E,..., En. Where all the events have a non-zero probability of occurrence and form a part of S. According to Bayes' theorem, 

 

P(Ei|A) = P(Ei) P(A|Ei) / ΣP(Ek) P(A|Ek), i = 1, 2, 3, … , n 

Professor Greenline from BrightChamps

What is the formula for Bayes' theorem?

For the events A and B, the formula for Bayes' theorem is 
P(A|B) = P(B|A) P(A) / P(B), 


where P(A) and P(B) is the probability of events A and B, P(A|B) is the probability of event A when event B happens, and P(B|A) is the probability of event B when A happens. 

 

Derivation: 

 

Based on conditional probability, P(A|B) = P(A ∩ B) / P(B), where, P(B) ≠ 0.


P (A ∩ B) = P (B ∩ A) = P(B|A) P(A), so
P(A|B) = P(B|A) P(A) / P(B)

Professor Greenline from BrightChamps

Real-world applications of Bayes' theorem

To update the probability of a hypothesis, condition, or event. Let’s discuss a few real-world applications of Bayes' theorem. 

 

To identify the spam emails in the system, we use Bayes' theorem.  

  • In weather forecasting, we use Bayes' theorem to improve the accuracy of weather forecasting
     
  • To interpret DNA evidence, we use Bayes' theorem in forensic science. 
     
  • In financial forecasting, Bayes' theorem we used to assess the risk and return of the investment portfolios.
Max Pointing Out Common Math Mistakes

Common Mistakes and How to Avoid Them in Bayes' Theorem

Mistakes are common when students work on Bayes' theorem, now let’s learn a few common mistakes.  These are a few common mistakes and ways to avoid them in Bayes' theorem.

Mistake 1

Red Cross Icon Indicating Mistakes to Avoid in This Math Topic

Confusing with P(A|B) with P(B|A)

Green Checkmark Icon Indicating Correct Solutions in This Math Topic

The confusion with P(A|B) with P(B|A) is common among the students. So it is important to understand the concept and what is P(A|B) and P(B|A). The probability of event A based on the occurred event B that is P(A|B). Whereas, P(B|A) is the probability that event B occurred in event A. 

Mistake 2

Red Cross Icon Indicating Mistakes to Avoid in This Math Topic

Using incorrect formula variation

Green Checkmark Icon Indicating Correct Solutions in This Math Topic

Students tend to use the wrong formula that does not divide the P(B|A) P(A) with P(B). Students should understand the definition of what is Bayes' theorem, the correct formula is P(A|B) = P(B|A) P(A) / P(B).

Mistake 3

Red Cross Icon Indicating Mistakes to Avoid in This Math Topic

Ignoring the prior probability P(A)

Green Checkmark Icon Indicating Correct Solutions in This Math Topic

The prior probability P(A) is the probability of event A occurring before the new event. So it is significant to list all the events P(A), P(B|B), and P(B) before adding the values into the formula.

Mistake 4

Red Cross Icon Indicating Mistakes to Avoid in This Math Topic

Unable to identify the given information

Green Checkmark Icon Indicating Correct Solutions in This Math Topic

Students sometimes find it difficult to understand the question to identify the components of Bayes' theorem. So it is important for the students to break down the problem and label the variables that are P(A), P(B|A), P(B). 

Mistake 5

Red Cross Icon Indicating Mistakes to Avoid in This Math Topic

Confusing joint and conditional probabilities  

Green Checkmark Icon Indicating Correct Solutions in This Math Topic

Confusing joint and conditional probabilities is common among students. Joint probability is P (A∩B) is the probability of both the events, whereas conditional probability P(A|B) is the probability of A occurring given that B has occurred. 

arrow-right

Level Up with a Math Certification!

2X Faster Learning (Grades 1-12)

curious child
Max from BrightChamps Saying "Hey"

Solved Examples of Bayes' theorem

Ray, the Character from BrightChamps Explaining Math Concepts
Max, the Girl Character from BrightChamps

Problem 1

A factory produces 60% of its products from Machine A and 40% from Machine B. Machine A produces 5% defective products, while Machine B produces 10% defective products. If a randomly selected product is defective, what is the probability that it was made by Machine A?

Ray, the Boy Character from BrightChamps Saying "Let’s Begin"

The probability that a defective product manufactured by machine A is 42.86%

Explanation

Here, 


A is the product from machine A 


B is the product from machine B


D is the defective product

 

So, P(A) = 0.6


P(B) = 0.4


P(D|A) = 0.05


P(D|B) = 0.10

 

Total probability of the defective product is P(D) = P(D|A) P(A) + P(D|B) P(B) 


= (0.05 × 0.6 ) + (0.10 × 0.4) = 0.03 + 0.04 = 0.07

 

Using Bayes' theorem to find P(A|D) 


P(A|D) = P(D|A) P(A) / P(D) 
= 0.05 × 0.6 / 0.07 = 0.4286 


Therefore, the probability of a definitive product is 42.86% 

Max from BrightChamps Praising Clear Math Explanations
Max, the Girl Character from BrightChamps

Problem 2

A test for a certain disease is 98% accurate for people who have the disease and 95% accurate for those who don’t. If 0.5% of the population has the disease, what is the probability that a person who tested positive actually has the disease?

Ray, the Boy Character from BrightChamps Saying "Let’s Begin"

The probability that a person who tested positive for the disease is 9%

Explanation

Here, 


D is the person has the disease


D is the person doesn’t have the disease


T is the positive test result

 

Given, 


P(D) = 0.005


P(D) = 0.995


P(positive | D) (P(+|D) = 0.98


The false positive rate, P(+| D) = 0.05

 

The total probability of testing positive: 


P(+) = P(+|D) × P(D)  + P(+|D) × P(D) 


= (0.98 × 0.005) + (0.05 × 0.995)

 
= 0.0049 + 0.04975 = 0.055

 

Using Bayes' theorem to find P(D|+), 


P(D|+) = P(+|D) P(D) / P(+) 
= 0.98 × 0.005 / 0.05465 = 0.0896


So, the probability that a person who tested positive is 9%

Max from BrightChamps Praising Clear Math Explanations
Max, the Girl Character from BrightChamps

Problem 3

In a school, 30% of the students study mathematics and 70% study biology. 80% of mathematics students pass an exam, while 90% of biology students pass. If a student is randomly selected and is found to have passed, what is the probability that they studied mathematics?

Ray, the Boy Character from BrightChamps Saying "Let’s Begin"

The probability that a student who passed studied mathematics is 27.59%

Explanation

Here, 
M is the student who studies mathematics
B is a student studies biology
P is the student passes the exam

Given, 


P(M) = 0.30


P(B) = 0.70


P(P|M) = 0.80


P(P|B) = 0.90


The total probability of passing;


P(P) = P(P|M) P(M) + P(P|B) P(B) 


= (0.80 × 0.30) + (0.90 × 0.70 


= 0.24 + 0.63 = 0.87

 

Using Bayes' theorem to find P(M|P),


P(M|P) = P(P|M) P(M) / P(P)


= 0.80 × 0.30 / 0.87 = 0.2759

 

So, the probability that a student who passed studied mathematics is 27.59%

Max from BrightChamps Praising Clear Math Explanations
Max, the Girl Character from BrightChamps

Problem 4

In a city, 60% of people own a car, and 40% do not. Among car owners, 70% have insurance, while only 30% of non-car owners have insurance. If a randomly chosen person has insurance, what is the probability that they own a car?

Ray, the Boy Character from BrightChamps Saying "Let’s Begin"

The probability that a person with insurance owns a car is 77.78%

Explanation

Here, C is the person who owns a car


N is the person who doesn't own a car


I is the person who has insurance

 

Given, 


P(C) = 0.60


P(N) = 0.40


P(I|C) = 0.70


P(I|N) = 0.30


Finding the total probability of having insurance


P(I) = P(I|C) P(C) + P(I|N)P(N) 


= (0.70 × 0.60) + (0.30 × 0.40) = 0.54


Using Bayes' theorem to find P(C|I) 


P(I) = P(I|C) P(C) / P(I) 


= 0.70 × 0.60 / 0.54 = 0.778


The probability that a person with insurance owns a car is 77.78%

Max from BrightChamps Praising Clear Math Explanations
Max, the Girl Character from BrightChamps

Problem 5

A company has three suppliers: S1 (50%), S2 (30%), and S3 (20%). They supply 10%, 5%, and 2% defective items, respectively. If an item is defective, what is the probability it came from S1?

Ray, the Boy Character from BrightChamps Saying "Let’s Begin"

The probability that a defective item came from supplier S1 is 72.46%

Explanation

Let


S1, S2, and S3 be the events that an item is from suppliers 1, 2, 3
D is it defective

 

Given, P(S1) = 0.50


P(S2) = 0.30


P(S3) = 0.20


P(D|S1) = 0.10


P(D|S2) = 0.05


P(D|S3) = 0.02


The total number of defective product is;


P(D) = P(D|S1)P(S1) + P(D|S2)P(S2) + P(D|S3)P(S3)
= (0.10 × 0.50) + (0.05 × 0.30) +(0.02 × 0.20) = 0.069

 

Using the Bayes' theorem to find P(S1|D) 


P(S1|D) = P(D|S1) P(S1) / P(D) = 0.10 × 0.50 / 0.069 = 0.05 / 0.069 = 0.7246

Max from BrightChamps Praising Clear Math Explanations

Turn your child into a math star!

#1 Math Hack Schools Won't Teach!

curious child
Ray Thinking Deeply About Math Problems

FAQs on Bayes' theorem

1.What is Bayes' theorem?

Math FAQ Answers Dropdown Arrow

2.What is the formula for Bayes' theorem?

Math FAQ Answers Dropdown Arrow

3.What is the difference between prior and posterior probabilities?

Math FAQ Answers Dropdown Arrow

4.Is conditional probability the same as the Bayes' theorem?

Math FAQ Answers Dropdown Arrow

5.What are the real-world applications of Bayes' theorem?

Math FAQ Answers Dropdown Arrow

Struggling with Math?

Get 1:1 Coaching to Boost Grades Fast !

curious child
INDONESIA - Axa Tower 45th floor, JL prof. Dr Satrio Kav. 18, Kel. Karet Kuningan, Kec. Setiabudi, Kota Adm. Jakarta Selatan, Prov. DKI Jakarta
INDIA - H.No. 8-2-699/1, SyNo. 346, Rd No. 12, Banjara Hills, Hyderabad, Telangana - 500034
SINGAPORE - 60 Paya Lebar Road #05-16, Paya Lebar Square, Singapore (409051)
USA - 251, Little Falls Drive, Wilmington, Delaware 19808
VIETNAM (Office 1) - Hung Vuong Building, 670 Ba Thang Hai, ward 14, district 10, Ho Chi Minh City
VIETNAM (Office 2) - 143 Nguyễn Thị Thập, Khu đô thị Him Lam, Quận 7, Thành phố Hồ Chí Minh 700000, Vietnam
Dubai - BrightChamps, 8W building 5th Floor, DAFZ, Dubai, United Arab Emirates
UK - Ground floor, Redwood House, Brotherswood Court, Almondsbury Business Park, Bristol, BS32 4QW, United Kingdom