## It’s all about what happened before!

Conditional probability answers one of the most interesting questions: How does the probability of an event change if we have new, additional information? Translated into real life examples the question would change to: How does the probability for a car accident change if I’m drunk? How does the probability for a increasing stock price change if the price/book value increases? How does the probability of having a disease change if a test for the disease is positive? All these questions can be answered with conditional probability.

Let us first talk about what we have to know before we deepen our understanding with an example:

- We denote the probability of A given B or in other words the probability that A happens given that B happened before with P(A|B)
- The P(A|B) is the proportion of the intersection of A and B to B:

P(B) can’t be equal to 0 because if P(B) can’t happen then A given that B happened before can also never happen.

**Example:** Suppose we toss a fair coin three times. Let the events be: A = “3 Heads” and B=”The first two tosses were heads”. How does the probability for A change if we take the information given by B into account?

**Answer: **If we toss a coin three times we have eight possible outcomes {HHH, HHT, HTT, HTH, THT, THH, TTH, TTT}. The probability for event A is therefore , but if we take in account that B happened before the sample space for A changes to {HHH, HHT}. The Probability for A given that B happened before is therefore . We could have calculated this with the formula from above as well. P(AB)= as the coin can either land head or tails on the third toss. P(B)= as there are two outcomes out of eight that have two heads in the first two tosses. If we put these probabilities in the formula from above we get the same answer as before.

## Multiplication Rule

I will just give the multiplication rule at this point as it is the conditional probability formula just rearranged:

## Law of Total Probability

The Law of Total Probability enables us to calculate the total probability of an event given that we have all the conditioned probabilities of that even. Wo do that by summing up all conditioned probabilities of that event. We need the total probability of an event for the Bayes Theorem that will follow shortly.

or

## Independence

Sometime the additional information doesn’t change the probability of an event. The events are then independent of each another:

or

**Example:** Let’s take the same events like above; A = “3 Heads” and B = “The first two tosses were heads”: Are events A and B independent?

**Answer: **P(A) = ; P(B) = and P(A|B) = ; Therefore P(A|B) P(A) and the events are therefore NOT independent.

## Bayes’ Theorem:

Bayes’ Theorem allows us to inverse the conditioned probability P(A|B) to P(B|A). Bayes’ Theorem is also the basis of some machine learning algorithms and is used in many cases of probability.

Some great examples with good explanations can be found on the Wikipedia page.