Conditional Probability

Definition

When it comes to two events A and B, if P(B) > 0, then the probability of A given B is

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

Example

Rolling a dice with two events:

  • A: Outcomes is an even number
  • B: Outcomes is greater than 3

The sample space for rolling a dice is: $\{1,2,3,4,5,6\}$

  • Event A: $\{2,4,6\}$(even number)
  • Event B: $\{4,5,6\}$(greater than 3)
  • Intersection $A \cap B: \{4,6\}$(numbers that even and greater than 3)

Based on the formula of $P(A|B)$

The probability of $A \cap B$is:

$$ P(A \cap B) = \frac{\text{Number of outcomes in } A \cap B}{\text{Total outcomes}} = \frac{2}{6} = \frac{1}{3} $$

Probability of B is:

$$ P(B) = \frac{\text{Number of outcomes in } B}{\text{Total outcomes}} = \frac{3}{6} = \frac{1}{3} $$

The conditional probability $P(A|B)$is:

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

Cards Deck

Set A: (AH, AD, AC, AS), which represents the set of all Aces in a standard deck of cards:

  • AH: Ace of Hearts
  • AD: Ace of Diamonds
  • AC: Ace of Clubs
  • AS: Ace of Spades

Set C: (2C, 3C, 4C, 5, 6, 7, 8, 9, 10, J, Q, K, AC), which represents a set of cards that includes:

  • Clubs (including: 2C, 3C, 4C, AC)
  • The rest is other unspecified cards (5, 6, 7, 8, 9, 10, J, Q, K)

Intersection $A \cap C$

  • The intersection of A and C includes cards that are common to both sets.
  • From A: AH, AD, AC, AS
  • From C: 2C, 3C, 4C, AC
  • The common of both sets is AC (Ace of Clubs)

Result: $P(A \cup C) = AC$

Exercise

Scenario: Rolling a Pair of Dice

You roll two six-sided dice. Let:

  • A: The event that the sum of the dice is 7.
  • B: The event that at least one dice shows an even number

Find:

  1. $$ P(A), P(B) $$
  2. The probability that the sum is 7, and at least one dice shows an even number
  3. The probability that the sum is 7, or at least one dice shows an even number
  4. The probability that the sum is 7, given that at least one dice shows an even number
  5. The probability that the sum is 7, given that both dice show odd numbers
  6. The probability that the sum is 7, given that the first dice shows a 4

Solve:

  1. The possible outcomes of two dice are $6 \cdot 6 = 36$

In event $A$, when the event that sum of the dice is 7, we have:

$$ (1, 6);(6,1);(2,5);(5,2);(3,4);(4,3) $$

Count that there are 6 outcomes for event A

So the possibilities of A is:

$$ P(A) = \frac{\text{Number of favorable outcomes for A}}{\text{Total Outcomes}} = \frac{6}{36} = \frac{1}{6} $$

In P(B), there are two ways to solve:

Way 1:

Calculating the Probability of the Complement (Both Dice are odd)

  • Possible odd numbers on a single dice: 1, 3, 5 (3 possibilities)
  • Total possible outcomes on a single dice: 1,2,3,4,5,6 (6 possibilities)
  • Probability of rolling an odd number on one dice: $\frac{3}{6} = \frac{1}{2}$
  • Probability of rolling an odd number in both dice: $(\frac{1}{2})^2 = \frac{1}{4}$

Calculate P(B):

By using Complement Rule, we have:

$P(B^c)$is probability of complement (odd numbers in both dice)

$P(B)$is probability (at least one even number)

$$ P(B) = 1 - P(B^c) = 1 - \frac{1}{4} = \frac{3}{4} $$

Way 2:

Like the way 1, we have possible outcomes of two dice are 36

List the outcomes that have both odd numbers: (1, 1); (1, 3); (3, 1); (3, 3); (1, 5); (5, 1); (3, 5); (5, 3); (5, 5) => 9 outcomes

Outcomes when one dice is even: 36 - 9 = 27 outcomes

So probability of at least one even: $\frac{27}{36} = \frac{3}{4}$

Before doing 2, 3, we need to recognize what it said:

  1. the sign words is “and”, it means that the intersection of both A and B uses. $A \cap B$
  2. the sign words is “or”, it means that A or B values can be taken, except the intersection one between A and B. $A \cup B$

Conditional probabilities:

  1. the sign words is “given that” means that $P(A|B)$
  2. the sign words is same as 4. , but given that both dice show odd numbers $P(A|\text{2 dice odd})$
  3. the sign words is same as 4. , but given that first dice shows a 4 $P(A|\text{1st dice: 4})$

Look at /fundamental-of-probability in the diagram below the post to have a visual look.

Returning the solve:

  1. A intersection B, means we have all of the A events are having at least an even number:

The probability of $A \cap B$is:

$$ P(A \cap B) = \frac{\text{Number of outcomes in } A \cap B}{\text{Total outcomes}} = \frac{6}{36} = \frac{1}{6} $$

  1. Using /fundamental-of-probability at inclusion-exclusion principle for probabilities is:

$$ P(A \cup B) = \frac{1}{6} + \frac{3}{4} - \frac{1}{6} = \frac{3}{4} $$

  1. The conditional probability $P(A|B)$:

$$ P(A|B) = \frac{P(A\cap B)}{P(B)} = \frac{\frac{1}{6}}{\frac{3}{4}} = \frac{2}{9} $$

  1. Both dice shows odds numbers, means we have: (2,2);(4,4);(6;6) => means there are 3 outcomes

Combine with A: $(1, 6);(6,1);(2,5);(5,2);(3,4);(4,3)$, in $P(A|\text{2 dice odd})$= 0 cause there is no intersection between A and dice shows odds numbers, which means that $P(\text{2 dice odd}) = 0$

Therefore: $P(A|\text{2 dice odd}) = \frac{P(A\cap B)}{P(B)} = \frac{0}{0} = 0$

  1. First dice shows a 4, means: (4,1), (4,2),…,(4,6) => 6 outcomes

Combine with A $(1, 6);(6,1);(2,5);(5,2);(3,4);(4,3)$, in $P(A|\text{1st dice: 4})$= 1 cause there is only 1 at A which is same as the first dice shows a 4 $(4;3)$

So, $P(\text{1st dice: 4}) = 1$

Therefore, $P(A|\text{1st dice: 4}) = \frac{P(A\cap B)}{P(B)} = \frac{1}{1} = 1$

Summary of results:

  1. $P(A) = \frac{1}{6}$, $P(B) = \frac{3}{4}$
  2. $$ P(A \cap B) = \frac{1}{6} $$
  3. $$ P(A \cup B) = \frac{3}{4} $$
  4. $$ P(A|B) = \frac{2}{9} $$
  5. $$ P(A|\text{2 dice odd}) = 0 $$
  6. $$ P(A|\text{1st dice: 4}) = 1 $$

Independent events

Definition: The independent A and B events when A has no affected on the probability of B, and vice versa:
$P(A|B) = P(A)$and$P(B|A) = P(B)$
Therefore, $P(A \cap B) = P(A) \cdot P(B)$if the events A and B are independent

Proof of Equivalence

When $P(A \cap B) = P(A) \cdot P(B)$, then:

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

So, the proof of equivalence same as definition of independent events.

Example:

Considering two dice roll independently, how about the probability of two dice gets 6?

P(6|1) = P(A) =$\frac{1}{6}$, P(6|2) = P(B) =$\frac{1}{6}$, so A and B are independent

=> P(dice 2 times 6) = $P (A\cap B) = (\frac{1}{6})^2 = \frac{1}{36}$

Tossing coin with H(Heads), and T(Tails), what is probability when toss 2 times?

4 ways: HH, HT, TH, HH

Head and Tails when toss 2 times, the first one does not affect the second one.

In one toss, chance getting tail or head are $\frac{1}{2}$

So toss two times means getting $\frac{1}{2} \cdot \frac{1}{2} = \frac{1}{4}$same as in every 4 ways