Bayes Theorem
The following article will make you familiar with the basics of Bayes Theorem.
What is Conditional Probability?
It is basically a measure to find the probability of an event given that, an another event has already taken place.
P(A|B) = P(A∩B)/P(B)
So, to understand this let's understand what is:
- Independent Events.
- Dependent Events.
Let's take Two coins and then toss the two coins individually irrespective to each other.
Now upon tossing the first coin the outcomes of the first coin will be either Head or Tail.
The probability of getting Head will be P(H) = 1/2.
The probability of getting Tail will be P(H) = 1/2.
Similarly, upon tossing the second coin the outcomes of the second coin will be either Head or Tail.
The probability of getting Head will be P(H) = 1/2.
The probability of getting Tail will be P(H) = 1/2.
Note that the Two coins are tossed one after the other and so the outputs of both the coins are independent to each other, they are not dependent to each other.
Therefore we will consider them it as independent events.
Dependent Events:
Let us take a bag of seven objects having 4 triangles and 3 circles.
In the first event what will be the probability of getting a circle out the bag?
Obviously, the probability of picking up a circle will be 3/7.
How?
The total items in the bag are seven and out of those seven items three are circles, so 3/7.
Now in the next event if I again want to pick up a circle out of six items.
Why six items?
Because I have already picked up a circle in the previous event so remaining items are six.
So, out of six items if I pick up a circle what will be the probability ?
The probability will definitely change in the second event.
The probability of picking up a circle will be 2/6 which is equal to 1/3.
How?
One circle is already picked up in the previous event remaining are circles are two, and now I will pick up from these two circle.
And the remaining total number of items in the bag will be six as one item is already selected.
This is just like dependent events.
In this case the probability keeps on changing because every time the number of items or the objects are becoming less after being selected.
That's an example of dependent events as the one event is linked with another event.
Conditional Probability:
P(A|B) = P(A∩B)/P(B)
A : event 1 B : event 2
In the above example of items what will be the probability of picking up two circles continuously? One circle after the other.
P(B|A) = 2/6 = 1/3
Now, P(A∩B) = 3/7 * 1/3
= 3/21
= 1/7
This is the probability of both Event A and Event B taking place.
Conditional Probability says to find the probability of an event given an event has already taken place.
P(B|A) = P(A∩B)/P(B)
= (1/7)/(3/7)
= 1/3
P(A|B) = P(A∩B)/P(B)
P(B|A) = P(B∩A)/P(A)
This will be same, P(A∩B) = P(B∩A)
P(A∩B) = P(A|B)*P(B)
P(B∩A) = P(B|A)*P(A)
P(A|B) * P(B) = P(B|A) * P(A)
P(A|B) = P(B|A) * P(A) / P(B)
Comments
Post a Comment