In mathematics, probability theory is one of the important branches concerned with probability. Random variables, events and stochastic processes are the central objects of probability theory. The concept of conditional probability is one of the most fundamental and one of the most important concepts in probability theory.
It is measures the probability of an event if another event has already occurred. In other words, we can say that conditional probability of an event is the probability of that event given that another event has already taken place before it. Let $A\  and\  B$ be two events associated with an experiment.Then the occurrence of B is restricted by the fact that A will have occurred before B and will affect B. So the condition of occurrence of B given that A has taken place is written as $A \cap B$.

Formula

The following formula is used to find the conditional probability of an event:

$P (B|A)$ = $\frac{P (A \cap B)}{P(A)}$

or $P (A \cap B)$ = $P (A) P (B|A)$

Where, $P (A)$ is the probability of event $A$, $P (B|A$) is the probability of event B with the condition that event A has already taken place.

When A and B are independent events that is when the occurrence of A does not at all affect occurrence of B then P (B|A) is equal to P (B) only.

We also make use of:

$P (B|A)$ = $\frac{P (A \cap B)}{P (A)}$

This is only applicable if $P (A) > 0$. Otherwise $P (B|A)$ = 0.

But how do we judge for conditional probability? Let us take an example. Let A & B be two events of drawing two cards one after another from a deck of 52 cards. Now there are two cases. First case is when we have drawn another card after replacing the first one back in the deck. Here the first event will not affect the occurrence of next event in line as the card is placed back and no change in deck is there now. 

The second case is when we have kept the first card aside and then drawn another card. Here the event next in line will always be affected as we have decreased the number of cards of new pick along with the change in as of which card is picked will surely make a difference.

Example

Below are some examples on conditional probability:

Example 1: A bucket contains 5 red balls and 5 blue balls. Two balls are drawn without replacement. If the first ball is blue find the probability that the second ball is also blue.

Solution: Let A be the event of drawing first blue ball. Then $P (A)$ = $\frac{5}{10}$.

Let B be the event of drawing another blue ball. Now we have not replaced back the first ball. So number of blue balls is 4 now and total balls are 9.

Hence, $P (B|A)$ = $\frac{4}{9}$.

Example 2: We have drawn two cards from a given deck of 52 cards that too without replacement. Find the probability that both are kings.

Solution: Let $A$ be event of drawing first king. Then $P (A)$ = $\frac{4}{52}$ = $\frac{1}{13}$.

Let $B$ be the event of drawing next king. Then, $P (B|A)$ = $\frac{3}{51}$ = $\frac{1}{17}$.

So, $P (A\ and\ B)$ = $P (A) P (B|A)$ = $\frac{1}{13}$ * $\frac{1}{17}$ = $\frac{1}{221}$.

Example 3: Two dice are rolled. If the first one top with 5 then find the probability that the total of the two will be greater than 7.

Solution: Let $A$ be the event of getting a 5 on first die. Then $P (A)$ = $\frac{1}{6}$

Let B be the event of getting a total greater that 7 given first die top with 5.

$A\ and\ B$ = {(5, 3), (5, 4), (5, 5), (5, 6)}. Hence, $P (A\ and\  B)$ = $\frac{4}{36}$ = $\frac{1}{9}$.

So, $P (B|A)$ = $\frac{P (A\ and\ B)}{P (A)}$ = $\frac{(\frac{1}{9})}{ (\frac{1}{6})}$ = $\frac{6}{9}$ = $\frac{2}{3}$.