Bayes’ Theorem and Examples | Data Science & AI

 

Bayes’ Theorem and Examples

Formula

The formula for Bayes’ Theorem is given by:

P(Ei|A)=P(Ei)P(A|Ei)j=1nP(Ej)P(A|Ej)

Key Terminology

  • Ei are hypotheses or possible causes.
  • P(Ei) is the prior probability of Ei.
  • P(Ei|A) is the posterior probability of Ei.
  • The denominator ensures normalization over all possible hypotheses.

Example 1: Probability of a Red Ball from Bag II

Problem: Suppose we have two bags:

  • Bag I: 3 red, 4 black
  • Bag II: 5 red, 6 black
  • A bag is randomly chosen, and a red ball is drawn. Find the probability that it was from Bag II.

Step 1: Define Probabilities

P(B1)=12,P(B2)=12

P(R|B1)=37,P(R|B2)=511

Step 2: Apply Bayes’ Theorem

P(B2|R)=P(B2)P(R|B2)P(B1)P(R|B1)+P(B2)P(R|B2)

=12×51112×37+12×511=58

Example 2: Probability of Another Gold Coin

Problem: Three boxes contain:

  • Box I: 2 gold coins
  • Box II: 2 silver coins
  • Box III: 1 gold, 1 silver
  • A box is randomly selected, and a gold coin is drawn. Find the probability that the other coin is also gold.

Step 1: Assign Probabilities

P(B1)=P(B2)=P(B3)=13

P(G|B1)=1,P(G|B2)=0,P(G|B3)=12

Step 2: Apply Bayes’ Theorem

P(B1|G)=P(B1)P(G|B1)P(B1)P(G|B1)+P(B3)P(G|B3)

=13×113×1+13×12=23

PDF

Loading...

Video

Connect with PostNetwork Academy

Thank You!

 

©Postnetwork-All rights reserved.