# What Is Conditional Probability? (And How to Calculate It)

By using probability, it's possible to determine the odds of something happening. There are different types of probability, and each one measures the chance of something specific occurring. For example, conditional probability (CP) determines the likelihood of certain outcomes occurring because of another event, and you may use this concept in a variety of careers that involve math or statistics. In this article, we define CP, compare it to joint and marginal probability, and explain how to calculate it with examples to use as a guide.

## What is conditional probability?

Conditional probability (CP) is a measure of the likelihood of something happening based on the occurrence of a previous event. For the event you're measuring to happen, another event has got to precede it, creating the proper conditions for the outcome to occur. In statistics, CP uses the formula:

P(B|A) = P(A and B) Ã· P(A)

Where:

P represents the probability.

Variables A and B are the events where the formula measures the probability of event B occurring, given that event A occurs first.

The expression P(B|A) in the formula denotes the CP statement "the probability of event B given the probability of event A."

## What is joint probability?

Joint probability is a measure of the likelihood of two events occurring concurrently. This means you can only apply joint probability to situations in which one or more events can happen at the same time. One example of joint probability is calculating the probability of two or more natural phenomena, like rain and lightning during a thunderstorm. The joint probability measurement can be applicable in this case, as you can determine the likelihood of both lightning and rain occurring at the same time as the storm passes.

Related: Understanding How to Complete a Risk Analysis

## What is marginal probability?

Marginal probability is a measure of the likelihood of an event occurring, independent of whether another event occurs. This measurement is the opposite of CP, as the likelihood of an event occurring doesn't depend on a separate event taking place first. In statistical applications, marginal probability can apply when you want to compare different sets of data.

Related: How to Conduct a Risk Assessment (Tips and Definition)

## How to calculate CP

To calculate CP, follow these steps and use this formula:

P(B|A) = P(A and B) Ã· P(A)

### 1. Determine the probability of event A occurring

The first step when calculating the probability of a dependent variable is determining the probability of event A and using this value in the formula. As an example, assume a student has three options to choose from when answering a multiple-choice question. Supposing they don't know the answer, they have three options to choose between, each with the same likelihood of being correct. This gives the student a 1/3 chance of choosing correctly the first time, or a 33% chance. In the formula, the first answer choice probability represents the A value:

P(B given 0.33) = (0.33) x (B) Ã· (0.33)

Related: How to Calculate Growth Rate (With Formulas and Examples)

### 2. Calculate the probability of event B given event A

After calculating the probability of the first event, you can use the resulting value to determine the second probability. In the example, if the student chooses incorrectly the first time and eliminates one option, this means they have two remaining options they can choose from. This means they now have a 1/2 chance, or 50% chance, they choose the correct answer. Use this value for event B in the formula:

P(0.5 given 0.33) = (0.33) x (0.5) Ã· (0.33)

### 3. Multiply the first and second probabilities

After calculating the second event probability, multiply the two values in the formula. Using the previous examples, which results in:

P(0.5 given 0.33) = (0.33) x (0.5) Ã· (0.33) =

P(0.5 given 0.33) = (0.165) Ã· (0.33)

Related: How to Calculate Growth Percentage (With Examples)

### 4. Divide by the probability of event A

After multiplying the probabilities of events A and B in the formula, divide by the first probability. With the example multiple-choice questions, the CP of picking a correct answer after eliminating one choice gives the student:

P(0.5 given 0.33) = (0.33) x (0.5) Ã· (0.33) =

P(0.5 given 0.33) = (0.165) Ã· (0.33) = 0.5 or 50%

### 5. Evaluate the results

After calculating the probability with the formula for the example questions, the student finds that the chance of guessing correctly on their second choice is 50%. While this probability is apparent after eliminating one out of three choices, in more complex calculations, the formula becomes effective in organizing and computing the CP of events occurring within large data sets.

## How to calculate joint probability

If you're interested in calculating joint probability, use the formula:

P (A and B) = P (A) x P(B)

Here are the steps to follow to calculate joint probability with this formula:

### 1. Determine the events

Joint probability requires two independent events. That means the events can't influence each other. For example, two dependent events are the probability of rain falling and clouds being in the sky, as the probability of clouds has an impact on the probability of rain that day. An independent event is, for example, choosing between rock, paper, or scissors when playing the game with a friend.

### 2. Calculate the probability of event A

As with CP, calculate the probability of event A. Using the rock, paper, scissors example, the probability of the other person choosing rock over another option is 1/3 or 33%. Here's what the formula may look like at this point:

P (0.33 and B) = P (0.33) x P (B)

### 3. Calculate the probability of event B

Next, determine the probability of event B. As event A doesn't impact the probability of event B, the number may be the same. For example, the probability of someone choosing rock the first time doesn't impact the probability of them choosing rock again during the second game. That means the probability of event B, which is that they choose rock the second time, is 33%. Here's what the formula may look like now:

P (0.33 and 0.33) = P (0.33) x P (0.33)

### 4. Multiply event A and B

After calculating the probability of event B, multiply the two values in the formula. Here's what it may look like using the examples above:

P (0.33 and 0.33) = P (0.33) x P (0.33) = 0.1089

This means the joint probability of events A and B is 0.1089 or 10%

## How to calculate marginal probability

Marginal probability is typically the easiest to calculate as it only involves the probability of one event occurring. Use this formula to calculate marginal probability:

Marginal probability = (P(A))

Here are the steps to follow:

### 1. Determine the total number of variables

The first thing to do is determine the total number of variables within the data set. For example, if you're analyzing data from a recent poll about people's pet preferences, the number of variables is the total number of people you surveyed.

### 2. Count the number in each category

Then, determine the total number of each variable by category. Using the same example, count how many people prefer cats and how many people prefer dogs. If you surveyed 30 people, 17 may prefer dogs while 13 may prefer cats.

### 3. Calculate the probability

By using the data you collected, it's possible to calculate the probability of each option. Using the above examples, the formula may look something like this:

(P(cats) = 13/30 = 43)

(P(dogs) = 17/30 =56)

This means there's a 43% chance people may choose cats and a 56% chance people may choose dogs.

## Example of CP

To help understand CP better, consider the following additional example:

This example shows a way of determining the probability of picking out certain colours of marbles. A bag has a blue, red, and yellow marble in it. The aim is to determine what the chances are of choosing the red marble followed by the yellow marble. The probability of selecting the red marble first is 33% because there are three marbles. This is event A. There's now a 50% chance of choosing a yellow marble as there are only two left. Using this example, here's what the formula may look like:

P (B|A) = P (A and B) Ã· P(A) =

P (0.5 given 0.33) = (0.33 x 0.5) Ã· (0.33)

P (0.5 given 0.33 = (0.165) Ã· (0.33) = 0.5 or 50%

## Explore more articles

- Steps to Write a Technical Feasibility Study (With Tips)
- How to Type Exponents Using 5 Different Methods
- How To Be Happy at Work (And Why It's Important)
- What To Wear for a Headshot (Plus Tips)
- What Is a Prospective Client? (With Sales Conversion Tips)
- Siloed Data (Definition, Causes, and Effects on a Business)
- What Are Brand Activations? (And How to Implement One)
- 11 Types of Computer Ports and Their Uses in the Workplace
- Boss Vs. Leader (Key Differences With Examples)
- How to Learn SQL Skills (With Tips and Career Opportunities)
- What Is a Competency Framework? (With Types and Benefits)
- What Is the Innovation Matrix? (Plus Types of Innovation)