Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
Theorem
3.
Proof
4.
FAQs
5.
Key Takeaways
Last Updated: Mar 27, 2024

Conditional Probability

Author Akash Nagpal
1 upvote

Introduction

The probability of event 'A' occurring assuming event 'B' has already occurred is known as conditional probability P(A | B).

Theorem

Assuming A and B are two independent occurrences, then P(A/B) is the probability of A occurring, given that B has already occurred. This probability is given by: 

P(A|B) = P(A⋂B) ⁄ P(B) ,

Where P(A⋂B) = P(B)  ⁄ P(A  ⁄ B).

Proof

Let us assume S be the sample space

Then we have, 

P(A∩B) = P(A∩B) ⁄ P(S) = P(A∩B) ⁄ P(A)×(P(A) ⁄ P(S))

= (P(A) ⁄ P(S)) × P(A∩B) ⁄ P(A)

Therefore, P(A∩B) ⁄ P(A) = P(B ⁄ A)

= P(A) × P(B ⁄ A)   —----------------------- Equation 1

Therefore when A nad B in equation-1 are interchanged,

We get,

P(B) × P(A  ⁄ B).


Example Question: When two dies are thrown simultaneously, the sum of the numbers obtained is found to be 7. Find out the probability that the number 3 has appeared at least once?

Solution:
The sample space S would be made up of all the numbers that might be generated by combining two dies. As a result, S will consist of 66 events or 36 total events.

Event A = Combination in which 3 has appeared at least once.

Event B = Combination of the numbers which sum up to 7.

A = {(3, 3)(3, 4)(3, 5)(3, 6)(1, 3)(2, 3)(4, 3)(5, 3)(6, 3)(3, 1), (3, 2)}

B = {(1, 6)(2, 5)(3, 4)(4, 3)(5, 2)(6, 1)}

P(A) = 11/36

P(B) = 6/36

Therefore,

A ∩ B = 2

P(A ∩ B) = 2/36

Applying the conditional probability formula we get,

P(A|B) = P(A⋂B)P(B) = 236636 = 13 .

 

FAQs

  1. Explain conditional probability with the help of a diagram.
    From the figure shown below, S specifies the sample space, while A and B are two events. In the case when event B has already occurred, our sample space S is limited to B since the probability of an event occurring is now contained within B.

Key Takeaways

In this article, we have discussed ‘Conditional Probability, Problem Solving with the help of an example. Check out the playlist Mathematical Induction for the following topics.
Check out this problem - Subarray Sum Divisible By K

We hope that this blog has helped you enhance your knowledge regarding Conditional Probability, and if you would like to learn more, check out our articles on Coding Ninjas Site and visit our Library for more. Do upvote our blog to help other ninjas grow. Happy Coding! 

Live masterclass