##### Bayes' theorem Introduction

let's say we have two bags and each bag contains some red balls and some green balls. One ball is randomly chosen and we are asked to find the probability that the chosen ball is red.

It is very easy to answer this question. We need to apply total probability theorem and we will get our answer.

But what if they already mentioned that a red ball is chosen and we are asked to find the probability that the chosen ball is from the first bag.

let's understand this with an example:

1. let us say we have three bags : Question 1: What is the probability of choosing a red ball?

Question 2: What is the probability that the chosen red ball is from bag A?

Solution 1: In this, they are simply asking to find out how we are going to pick a red ball...

let's say the probability of selecting any bag is 1/3

So P(R) = P(BA and R) + P(Band R) ................ (1)

for Question 2:

They have already mentioned that a red ball is chosen already and we have to find out the probability that it is chosen from bag  'A'.

It can be written as P( A/R ).

P(A/R)= P(A ∩R)/ P(R)

= P(A ∩R) / { P(BA and R) + P(Band R)} ....... puting the value of P(R) from equation 1

The formal definition of Baye's Theorem: Derivation Of Baye's Theorem:- Now we will solve some numerical based on Baye's Theorem.