# Conditional Probability: Formula and Real-Life Examples

![Conditional Probability](https://www.investopedia.com/thmb/T5w6BiHw-8Mn5NCWbgpqd1jebvg=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/Investopedia-terms-conditional-probability-f3cc2756d48049679c41b5ec03f4e9e0.jpg)

*— Investopedia / Madelyn Goodnight*

> **Definition**
>
> Conditional probability measures the probability of an event, based on the occurrence of other, related events.

## What Is Conditional Probability?

Conditional probability in statistics measures the probability that a certain event will occur based on the occurrence (or non-occurrence) of other, related events. It has wide applications in science and finance.

In the study of conditional probability, researchers examine two or more events with related probabilities, and ask, "If we know A has happened, what's the chance of B also happening?" The probability is calculated by multiplying the probability of the preceding event by the updated probability of the succeeding, or conditional, event. It is also possible to calculate the likelihood that a previous event occurred, based on the (known) occurrence of the subsequent event.

### Key Takeaways

*   Conditional probability refers to the chances that some outcome (A) occurs given that another event (B) has already occurred.
*   In probability, this is written as A given B, or as this formula: P(A|B), where the probability of A happening depends on that of B happening.
*   Conditional probability can be contrasted with unconditional probability.
*   Probabilities are classified as conditional, marginal (the base probability without any dependence on another event), or joint (the probability of two events occurring together).
*   Bayes' theorem is a mathematical formula that can calculate conditional probabilities dealing with uncertain events.

## Understanding Conditional Probability

Conditional probability measures the likelihood of a certain outcome (A), based on the occurrence of some earlier event (B).

Two events are said to be independent if one event occurring does not affect the probability that the other event will occur. However, if one event occurring (or not occurring) does affect the likelihood that the other event will happen, the two events are said to be dependent.

An example of dependent events is a company's stock price increasing after the company reports higher-than-expected earnings.

If events are independent, then the probability of event B occurring is not contingent on what happens with event A. For example, an increase in Apple's shares has little to do with a drop in wheat prices.

Conditional probability is often written as the "probability of A _given_ B" and notated as P(A|B).

### Other Types of Probabilities

*   Conditional probability can be contrasted with [unconditional probability](https://www.investopedia.com/terms/u/unconditional_probability.asp). The latter is also called marginal probability, which measures the chance of a single event without depending on any other. In contrast, conditional probability determines the likelihood of one event given that another event has occurred, linking them.
*   Independent probability doesn’t have that interconnectedness and instead looks at the probability of some event in isolation because it’s believed to be independent.
*   A [joint probability](https://www.investopedia.com/terms/j/jointprobability.asp) is the likelihood of two events occurring together. These concepts can be combined to derive Bayes’ Theorem, which provides a way to flip conditional probabilities mathematically. If you know the chance of event B happening given event A, you can reverse-calculate the conditional probability of A given B.

Overall, while marginal and joint probabilities measure individual and paired events, conditional probability can measure precedence and dependence between events.

> **Fast Fact**
>
> Conditional probability is used in a variety of fields, such as insurance, economics, politics, and different areas of mathematics.

## Conditional Probability Formula

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

Or:

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

Where:

*   P = Probability
*   A = Event A
*   B = Event B

> **Important**
>
> Unconditional probability, also known as marginal probability, measures the chance of something happening while ignoring any knowledge of previous or external events. Since this probability also ignores new information, it remains constant.

## Examples of Conditional Probability

### Example 1: Marbles in a Bag

An example of conditional probability using marbles is illustrated below. The steps are as follows:

**Step 1**: Understand the scenario

Initially, you're given a bag with six red marbles, three blue marbles, and one green marble. Thus, there are 10 marbles in the bag.

**Step 2**: Identify the events

Two events are defined:

*   Event A: Drawing a red marble from the bag
*   Event B: Drawing a marble that is not green

**Step 3**: Calculate the probability of event B: P(B)

Event B is drawing a marble that is not green. There are 10 marbles altogether, nine of which are not green: the six red and three blue marbles.

$P(B) = (Number of marbles that are not green)/(Total number of marbles) = 9/10$

**Step 4**: Identify the intersection of events A and B: P(A∩B)  

The intersection of events A and B involves drawing a red marble that is also not green. Since all red marbles are not green, the intersection is simple: the event of drawing a red marble.

**Step 5**: Calculate the probability of the intersection of events A and B: P(A∩B)

$P(A∩B) = (Number of red marbles)/(Total number of marbles) = 6/10 = 3/5$  

**Step 6**: Calculate the conditional probability: P(A|B)

Using the conditional probability formula, P(A|B), that is, the probability of drawing a red marble given that the marble drawn is not green, the probability is calculated.

$P(A|B) = P(A∩B)/P(B) = (3/5)/(9/10) = 2/3$  

**Result:** The conditional probability of drawing a red marble given that the marble drawn is not green, is 2/3.  

### Example 2: Rolling a Fair Die

Let's consider another example of conditional probability using a fair die. The steps are as follows:

**Step 1**: Understand the scenario

You have a fair six-sided die. You want to determine the probability of rolling an even number, given that the number rolled is greater than four.

**Step 2:** Identify the events

The possible outcomes (sample space) for a six-sided die are the numbers one through six. From this list, you can define the two events:

*   Event A: Rolling an even number. Event A would mean rolling {2,4,6}.
*   Event B: Rolling a number greater than four. Event B would mean rolling {5,6}.

**Step 3**: Calculate the probability of each event

The probability of each event can be calculated by dividing the number of favorable outcomes (the ones you're looking for) by the total number of outcomes in the sample space.

P(A) is the probability of rolling an even number. There are three even numbers {2,4,6} out of the six possible outcomes. Thus, P(A) = 3/6 = 1/2.

P(B) is the probability of rolling a number greater than four. Two numbers are greater than four {5,6} out of the six possible outcomes. Thus, P(B) = 2/6 = 1/3.  

**Step 4**: Identify the intersection of events A and B

The intersection of events A and B includes the outcomes that satisfy both conditions simultaneously. In this case, that means rolling a number that is even and also greater than four. The only outcome that does both is rolling a six.

**Step 5**: Calculate the probability of the intersection of events A and B

We'll spell this out, even if it's easy, given the above, because other examples might prove more difficult: P(A∩B) is the probability of rolling six, since six is the only outcome that is both even and greater than four. There is one outcome out of six possibilities. So P(A∩B) = 1/6.

**Step 6**: Calculate the conditional probability: P(B|A)

The formula for conditional probability is as follows:

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

When the values are substituted into the formula, here is the result:

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

**Result:** This means that given the die rolled is even, the probability that this number is also greater than four is 1/3.  

### Example 3: Multiple Conditional Probabilities

Another scenario involves a student applying for admission to a college who hopes to get a scholarship and a stipend for books, meals, and housing. The steps to determine the conditional probability of getting a stipend and the scholarship are as follows:

**Step 1**: Understand the scenario

First, the student wants to know the likelihood of being accepted to the university. Then, if accepted, the student would like to receive an academic scholarship. Moreover, if possible, the student would also like to receive a stipend for books, meals, and housing if they get the scholarship.  

**Step 2**: Identify the events

There are three events:

*   Event A: Being accepted to the university.
*   Event B: Receiving a scholarship upon acceptance
*   Event C: Receiving a stipend for books, meals, and housing upon receiving a scholarship

**Step 3**: Calculate the probability of being accepted (event A)

The university accepts 100 out of every 1,000 applicants who have applications similar to the student's. Thus, the probability of a student being accepted is P(A) = 100/1000 = 0.10 or 10%.

**Step 4**: Determine the probability of receiving a scholarship once accepted: P(B|A)

It's known that out of the students accepted, 10 out of every 500 receive a scholarship. Thus the probability of receiving a scholarship given acceptance is as follows:

$P(B|A) = 10/500 = 0.02 = 2%$%  

**Step 5**: Calculate the probability of being accepted and receiving a scholarship

To calculate the probability of being accepted and also receiving a scholarship, the likelihood of acceptance is multiplied by the conditional probability of receiving a scholarship given acceptance.

$P(A∩B)=P(A)×P(B∣A)=0.1×0.02=0.002=0.2$%  

**Step 6**: Determine the probability of receiving a stipend after receiving a scholarship: P(C|B)

It's also known that among the scholarship recipients, 50% receive a stipend for books, meals, and housing. Thus, P(C|B) = 0.5 = 50%.

**Step 7**: Calculate the probability of being accepted, receiving a scholarship, and receiving a stipend

To calculate the probability of a student being accepted, receiving a scholarship, and then also receiving a stipend, the probabilities of the events are multiplied.

$P(A∩B∩C)=P(A)×P(B∣A)×P(C∣B)=0.1×0.02×0.5=0.001=0.1%$%

This step-by-step breakdown illustrates how the probabilities for each scenario are calculated using basic probability formulas and conditional probability.

## Conditional Probability vs. Joint Probability and Marginal Probability

Let's now differentiate calculating conditional probability from other kinds of probability.

### Conditional Probability

The example this time is a regular deck of cards. Two events are defined:

*   Event A: Drawing a four
*   Event B: Drawing a red card

A standard deck has 52 cards divided into four suits (hearts, diamonds, clubs, and spades). Hearts and diamonds are red, and clubs and spades are black. Each suit has 13 cards: Ace, then two through 10, and then the face cards Jack, Queen, and King.

The deck contains 26 red cards, 13 hearts, and 13 diamonds. Thus, the probability of drawing a red card is P(B) = 26/52 = 1/2.

Within the red cards are a four of hearts and a four of diamonds. Therefore, if a red card has to be drawn, a subset of the deck that includes only these 26 red cards needs to be considered.

Given that a red card has been drawn, the probability of it being a four is calculated as follows:

$P(A|B) = (Number of red fours)/(Total number of red cards) = 2/26 = 1/13$  

> **Fast Fact**
>
> Bayes' theorem is widely used in machine learning.

### Marginal Probability

The marginal probability, P(A), is the probability of an event A happening on its own. It does not consider the occurrence of any other event.

Since event A is drawing a four, P(A) is calculated by dividing the number of fours by the total number of cards in the deck.

$P(A) = (Number of fours in the deck)/(Total number of cards in deck) = 4/52 = 1/13$

### Joint Probability

Joint probability is the likelihood of two or more events happening at the same time. This is denoted as P(A∩B), the probability of events A and B occurring.

Assuming that the previous events are the same, that is, event A is the occurrence of drawing a card that is a four and event B is drawing a red card, we can find the joint probability of drawing a card that is both a four and red.

There are two cards that meet both criteria, the four of hearts and the four of diamonds. Thus, the joint probability of drawing a card that is both a four and red is calculated as follows:

$P(A∩B) = (Number of red fours)/(Total number of cards) = 2/52 = 1/26$  

## Bayes' Theorem and Conditional Probability

[Bayes’ theorem](https://www.investopedia.com/terms/b/bayes-theorem.asp) is used to calculate conditional probabilities when dealing with uncertain events. In investing, this allows you to update your probability estimates of a market outcome when you get new relevant data.

For example, suppose you wanted to know the probability that the S&P 500 would return a positive percentage this year, given initial gross domestic product (GDP) figures. In that case, you’d start with Bayes’ theorem, considering the index’s historical return rates to get an initial estimate of projected economic expansion.

You would then revise this first probability using the latest GDP estimates. This would provide more refined probability assessments incorporating all evidence as the year progresses.

While a bit complex mathematically, Bayes’ theorem is quite logical. If an investor discovers new economic information relevant to potential market returns, it makes sense to integrate this data to get a more precise calculation.

The 18th-century English minister Thomas Bayes devised this statistical technique, which remains central in financial modeling and other fields requiring predictions under uncertain conditions.

## Explain Like I'm Five

Conditional probability studies the probability that something will happen, based on the occurrence of other, related events. If you want to know the probability that it will rain in the afternoon, it helps to know if it was cloudy in the morning. Conversely, if you know that it did _not_ rain in the afternoon, you could calculate the likelihood that it was sunny in the morning.

Investors use conditional probability to make financial forecasts, based on the known probability of related events. For example, some stocks perform well during a recession, and others tend to perform poorly. If you know the probability that a recession will happen, you can estimate whether a certain stock will perform well or not.  

## What Is a Conditional Probability Calculator?

A conditional probability calculator is an online tool that calculates conditional probability. It provides the probability of the first and second events occurring. A conditional probability calculator saves the user from doing the mathematics manually.

## What Is the Difference Between Probability and Conditional Probability?

[Probability](https://www.investopedia.com/terms/o/objective-probability.asp) looks at the likelihood of one event occurring. Conditional probability looks at two events occurring in relation to one another. More specifically, it looks at the probability of a second event occurring based on the probability of the first event occurring.

## What Is Prior Probability?

Prior probability is the probability of an event occurring before any data has been gathered. It is the probability as determined by a prior belief. Prior probability is a part of Bayesian statistical inference since you can revise these beliefs and arrive mathematically at a [posterior probability](https://www.investopedia.com/terms/p/posterior-probability.asp).

## What Is Compound Probability?

Compound probability looks to determine the likelihood of two independent events occurring. Compound probability multiplies the probability of the first event by the probability of the second event. The most common example is a coin flipped twice and finding if the second result will be the same as the first.

## The Bottom Line

Conditional probability examines the likelihood of an event occurring based on the likelihood of a preceding event occurring. The second event is dependent on the first event.

For example, we might want to know the probability that some stock will go up if the index for its sector is on the rise. The conditional probability is based on the likelihood of the first event (the stock rising in price), as well as the relationship between the two events.