from a handpicked tutor in LIVE 1-to-1 classes

# Conditional Probability Formula

The concept of the conditional probability formula is primarily related to Bayes’ theorem, which is one of the most influential theories in statistics. Conditional probability is the probability for one event to occur with some relationship to one or more other events. For example:

- Event A: it's a 0.4 (40%) chance of raining today.
- Event B: I will go outside and it has a probability of 0.5 (50%).

A conditional probability looks at these two events in relationship with one another, the probability that it is both raining and I will go outside. Let us understand the conditional probability formula using solved examples. Please note that conditional probability doesn't state that there is always a causal relationship between the two events, also it does not indicate that both events occur simultaneously.

## What Is Conditional Probability Formula?

The concept of the conditional probability formula is one of the quintessential concepts in probability theory. The conditional probability formula gives the measure of the probability of an event, say B given that another event, say A has occurred.

The Bayes' theorem is used to determine the conditional probability of event A, given that event B has occurred, by knowing the conditional probability of event B, given that event A has occurred, also the individual probabilities of events A and B.

Note: In case P(B)=0, the conditional probability of P(A | B) is undefined. (the event B did not occur)

### Conditional Probability Formula

The formula for conditional probability is :

### P(A | B) = P(A and B)/P(B)

It can also be written as,

### P(A|B)=P(A∩B)P(B)

## Derivation of Conditional Probability Formula

The formula for conditional probability is derived from the probability multiplication rule. Let's have a look!

- P(A) = Probability of occurrence of event A
- P(B) = Probability of occurrence of event B
- P(A∩B) implies that both events, A and B have occurred or the common elements of the events.

Event A has already occurred.

If B has also occurred, then every outcome that is not contained in B but in A, is discarded and thus reducing the sample space to set B.

Then, the possible outcomes for A and B are restricted to those in which B occurs thus the only way that A can happen is when the outcome belongs to the set A∩B. Thus, we divide P(A ∩ B) by P(B), which can be visualized as restricting the sample space to situations in which B occurs

## Application of Conditional Probability Formula

A few of the most common applications of conditional probability formula include the prediction of the outcomes in the case of flipping a coin, choosing a card from the deck, and throwing dice. It also helps Data Scientists to get better results as they analyze the given data set. For machine learning engineers, it helps to prepare more accurate prediction models.

Let us understand the conditional probability formula using solved examples.

## Examples Using Conditional Probability Formula

**Example 1: **In a group of 10 people, 4 people bought apples, 3 bought oranges, and 2 bought apples and oranges. If a buyer chose randomly bought apples, using the conditional probability formula find out what is the probability they also bought oranges?

**Solution:**

Let people who bought apples are A and who bought oranges are O.

It’s given that

P(A) = 4 out of 10 = 40% = 0.4

P(O) = 3 out of 10 = 30% = 0.3

Hence,

P(A∩O) = 2 out of 10 = 20% = 0.2

Now, using the conditional probability formula

P(O|A) = P(A∩O) / P(A) = 0.2 / 0.4 = 0.5 = 50%

**Answer: The probability that a buyer bought oranges, given that they bought apples, is 50%.**

**Example 2:** My neighbor has 2 children. I learn that she has a son, Adam. What is the probability that Adam’s sibling is a boy?

**Solution:**

Let the boy child be B and the girl child is G.

The sample space is S = {BB,BG,GB,GG}

Assume that boys and girls are equally likely to be born, the 4 elements of S are equally likely.

The event, X, that the neighbor has a son is the set X = {BB,BG,GB}

Hence, P(X) = 3/4

The event, Y, that the neighbor has two sons is the set Y = {BB}

Then, P(Y ∩ X) = 1/4

Now, using the conditional probability formula

P(Y | X) = P(Y ∩ X) / P(X) = (1/4) / (3/4) = 1/3

**Answer: The probability that Adam’s sibling is a boy is 1/3.**

**Example 3: **A fair die is rolled. What is the probability of A given B where A is the event of getting an even number and B is the event of getting a number less than or equal to 2?

**Solution:**

To find: P(A | B) using the given information.

When a die is rolled, the sample space = {1, 2, 3, 4, 5, 6}.

A is the event of getting an even number. Thus, A = {2, 4, 6}.

B is the event of getting a number less than or equal to 3. Thus, B = {1, 2}.

Then, A ∩ B = {2}.

Now, using the conditional probability formula,

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

P(A | B) = (1/6)/(3/6) = 1/3

**Answer: The probability of A given B is 1/3.**

## FAQs on Conditional Probability Formula

### What Is Conditional Probability Formula?

The conditional probability formula refers to the formula that provides the measure of the probability of an event given that another event has occurred. It is calculated using the formula, P(A|B)=P(A∩B)/P(B)

### How To Derive Conditional Probability Formula?

To derive the formula of conditional probability, the probability multiplication rule is used, P(A and B) = P(A)*P(B|A).

### What Are the Applications of Conditional Probability Formula?

Applications of the conditional probability formula include the prediction of the outcomes

- flipping a coin
- choosing a card from the deck
- throwing dice
- used by Data Scientists as they analyze the given data set.
- used by Machine Learning Engineers to prepare more accurate prediction models.

### How To Use Conditional Probability Formula?

To use conditional probability formula

- Step 1: Find P(A)
- Step 2: Find P(B)
- Step 3: Find P(A∩B)
- Step 4: Put the values in the formula, P(A|B)=P(A∩B)P(B)

visual curriculum