Probability

Event and Probability

Experiment: Process that results in one or many observations.

Outcome: Observations of an experiment.

Sample Space (S): Set of all possible outcomes.

Event(s): Any subset of the sample space.

Example: Experiment: Toss a coin once.

Example: Experiment: Toss a coin twice.

Set Operators

Complement: A^c or \bar{A}

Union: A \cup B

Intersection: A \cap B

Disjoint Events: A \cap B = \emptyset

Example: Set operators

Q: Given

S = \{ 1, 2, 3, 4, 5, 6 \}

A = \{ 2, 4, 6 \}

B = \{ 3, 6 \}

Find:

  1. A^c
  2. B^c
  3. A \cup B
  4. A \cap B

A:

  1. A^c: { 1, 3, 5 }
  2. B^c: { 1, 2, 4, 5 }
  3. A \cup B: { 2, 3, 4, 6 }
  4. A \cap B { 6 }

Related Notes: Operations on Sets - CS1300

Probability Rules

\boxed{ P(E) = \frac{\text{\# of outcomes in $E$ occured}}{\text{\# of outcomes in $S$ occured}} } \\~\\ \small\textit{Given that all outcomes in $S$ are equally likely}

More Rules:

Disjoint Events v.s. Independent Events

Let A, B, and C be events.

A and B are disjoint (mutually exclusive) if and only if P(A \cap B) = 0

Example: Disjoint v.s. Independent

There’s a box containing 1 white ball and 3 black balls.

A = { The first ball is white } B = { The second ball is white }

Exp 1: Select two balls at random in a row with replacement.

Exp 2: Select two balls at random in a row without replacement.

  1. Exp 1:
    • Is not disjoint (A and B can happen).
    • Is independent (the result of the first pick has no effect on the second)
  2. Exp 2:
    • Is disjoint (A and B cannot both happen)
    • Is dependent (A affects the occurrence of B)

Marginal & Joint Probability

Marginal Probability: Probability of a single event without considering any other events.

Joint Probability: Probability of two events occurring simultaneously.

Note: Both probabilities are out of n.

Example: Marginal probability

Ex: Select one employee at random out of 100 employees.

SmokeNot Smoke
Male451560
Female103040
5545100
  1. P(Male) = 60/100 = 0.6
  2. P(Smoker) = 55/100 = 0.55
  3. P(Male \cup Smoker) = 45/100 = 0.45

Conditional Probability

Conditional Probability: P(A|B): Probability of A given B

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

Example: Marginal probability

Q: Construct the probability table from the following information

There are 30 students in class, 10 students are female and 12 students are from LA county. There are 3 female students from LA county.

FemaleMale
LA County
Other Counties

A:

FemaleMale
LA County312
Other Counties
1030
FemaleMale
LA County312
Other Counties18
102030
FemaleMale
LA County3912
Other Counties71118
102030

Q: One student will be selected at random, what is the probability that the selected student is:

  1. Male?
  2. From LA County?
  3. Male and from LA County.
  4. If a male is selected, what is the probability that he is from LA county.

A:

  1. 20/30
  2. 12/30
  3. 9/30
  4. 9/20

Conditional Probability and Independent Events

If A and B are independent, then P(A|B) = P(A) and P(B|A) = P(B), furthermore:

\boxed{ \text{If A and B are independent: } P(A) = P(A|B) = P(A | B^c ) }

Multiplication Rule

\boxed{ P(A \cap B) = P(A|B) P(B) \lor P(B|A) P(A) }

Example: Multiplication rule

Q: There are 10 students and 6 of them are women.

We take a sample of two students (w/out replacement), find the probability that both students are women.

A:

\begin{aligned} P(W_1 \cap W_2) &= P(W_1) P(W_2 | W_1) \\ &= \frac{6}{10} \times \frac{5}{9} \\ &= \frac{1}{3} \end{aligned}


Q: Find the probability that the first student is a woman and the second student is a man.

A:

\begin{aligned} P(W_1 \cap M_2) &= P(W_1) P(M_2 | W_1) \\ &= \frac{6}{10} \times \frac{4}{9} \\ &= \frac{4}{15} \end{aligned}
Example: Multiplication rule

Q: Let P(A)=0.7 and P(B|A)=0.4, find P(A \cap B)

A:

\begin{aligned} P(A \cap B) &= P(B|A)P(A) \\ &= 0.4 \times 0.7 \\ &= 0.28 \end{aligned}
Example: Multiplication rule

Q: 70% of a population are male. 40% of males smoke.

When a person is chosen at random from this population, find the probability that the person is a male smoke.

A:

Let A = Male and B = Smoker

We have been told that P(A)=0.7 and P(B|A)=0.4, so:

P(A \cap B) = P(B|A) P(A) = 0.4 \times 0.7 = 0.28

Rule of Total Probability

Rule of Total Probability:

\boxed{ \text{Rule of Total Probability: } P(A) = P(A|B)P(B) + P(A|B^c) P(B^c) }

Why?\begin{aligned} P(A) &= P{ (A \cap B) \cup (A \cap B^c) } \\ &= P(A \cap B) + P(A \cap B^c) \textit{(disjoint)} \\ &= P(A|B)P(B) + P(A|B^c) P(B^c) \textit{(multiplication rule)} \end{aligned}
Example: Rule of total probability

Q: There are 10 students and 6 of them are women.

Suppose we take a sample of two students (w/o replacement). Find the probability that the second student is a woman.

A:

We will consider two cases:

  1. First student is W_1
  2. First student is M_1
\begin{aligned} P(W_2) &= P(W_1 \cap W_2) + P(W_1^c \cap W_2) \\ &= P(W_2 | W_1) P(W_1) + P(W_2 | W_1^c) P(W_1^c) \\ &= P(W_2 | W_1) P(W_1) + P(W_2 | M_1) P(M_1) \\ &= \frac{5}{9} \times \frac{6}{10} + \frac{6}{9} \times \frac{4}{10} \\ &= \frac{3}{5} \end{aligned}
Example: Rule of total probability

Q: There is an urn containing three white balls and four black. One ball will be drawn at random and put back into the urn with another of a kind. Another ball will be drawn at random after adding another ball of the same color into the urn.

What is the probability the second ball is black?

A:

We will consider two cases:

  1. First ball is white (W_1).
  2. First ball is black (B_1).
\begin{aligned} P(B_2) &= P(B_1 \cap B_2) + P(W_1 \cap B_2) \\ &= P(B_2 | B_1) P(B_1) + P(B_2 | W_1) P(W_1) \\ &= \frac{5}{8} \times \frac{4}{7} + \frac{4}{8} \times \frac{3}{7} \\ &= \frac{4}{7} \end{aligned}

Bayes Rule

P(B|A) = \frac{P(B \cap A)}{P(A)} = \frac{P(A|B)P(B)}{P(A|B)P(B) + P(A|B^c)P(B^c)}

Example: Bayes Rule

Q:

\begin{aligned} P(W_1 | W_2) &= \frac{P(W_1 \cap W_2)}{P(W_2)} \\ &= \frac{P(W_2|W_1) P(W_1)}{P(W_2|W_1)P(W_1) + P(W_2|M_1)P(M_1)} \\ &= \frac{ \frac{5}{9} \times \frac{6}{10} }{ \frac{3}{5} } \\ &= \frac{5}{9} \end{aligned}