- Related Questions & Answers
- C++ Program for Zeckendorf's Theorem?
- C# Numeric Promotion for Conditional Expression
- C++ Program to Implement Euler Theorem
- Knight Probability in Chessboard in C++
- A matrix probability question in C?
- Airplane Seat Assignment Probability in C++
- Conditional ternary operator ( ?: ) in C++
- C++ Program Probability for three randomly chosen numbers to be in AP
- What are conditional attributes in C#?
- An application on Bertrandís ballot theorem in C/C++
- Bayes’ Rule in Data Structure
- C++ Program to Implement Fermat’s Little Theorem
- C++ Program to Implement the Vizing’s Theorem
- Advanced master theorem for divide and conquer recurrences
- How do I use the conditional operator in C/C++?

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

**Conditional probability** denoted by P(*A|B*) is the probability of occurrence of an event ‘A’ given that event ‘B’ has already occurred.

**Formula for conditional probability −**

P(A|B) = P( A⋂B ) / P(B)

It is the formula that shows the relation between probabilities of occurrences of mutually dependent events i.e. it given the relation between their conditional probabilities.

Given an event A and another event B, according to bayes’ theorem,

*P(A/B) = {P(B/A) * P(A)} / P(B)*

Lets derive the formula for Bayes’ theorem,

For this we will use the formula for conditional probability,

P(A|B) = P( A?B ) / P(B) —— 1 P(B|A) = P( B?A ) / P(A) —— 2

We know that A⋂B and B⋂A are the same, hence we can substitute the value of B⋂A with A⋂B equation 2.

P(B/A) = P(A⋂B) / P(A) P(B/A) * P(A) = P(A⋂B) —- 3

Now, using this value for A?B in equation 1, we will get the bayes’ theorem formula.

P(A/B) = {P(B/A) * P(A)} / P(B)

Some derivations for the **Bayes’ Theorem,**

depicted in equation 3, it says that the probability of both the events to occur in the same trials is equal to the product of conditional probability of the event and the probability of occurrence of evidence event.

P(A?B) = P(A/B) * P(B)

From this rule we can derive two important formulas −

If A⊆B i.e. A is the subset of B which means all the elements of set A are in set B, then

P(A⋂B) = P(A), then P(A/B) = P(A) / P(B)

If B⊆A i.e. B is the subset of A which means all the elements of set B are in set A, then

P(A⋂B) = P(B), then P(A/B) = 1

Bayes’ Theorem form more than three events −

If we have more that three mutually dependent events, their conditional probability will have the following relation,

P(X1/Y) = (P(X1)*P(Y/X1) / [P(X1 * P(Y/X1)) + P(X2 * P(Y/X2)) + P(X3 * P(Y/X3)) + …]

Advertisements