## Introduction to Probability Models

Lecture 7

Qi Wang, Department of Statistics

Sep 6, 2017

### Law of Total Probability

If \(B_1, B_2, \cdots, B_n\) forms a partition of \(S\), for any event A:
\begin{align}
P(A) = & P(A\cap B_1) + P(A\cap B_2) + \cdots + P(A \cap B_n) \\
= & P(A|B_1)\times P(B_1) + P(A|B_2) \times P(B_2) + \\
& \cdots + P(A|B_n) \times P(B_n) \\
= & \sum_{i = 1}^n P(A|B_i) \times P(B_i)
\end{align}

### Law of Total Probability

### Example 1

Acme Consumer Goods sells three brands of computers: Mac, Dell, and HP.
30% of the machines they sell are Mac, 50% are Dell, and 20% are HP.
Based on past experience Acme executives know that the purchasers of
Mac machines will need service repairs with probability .2, Dell machines
with probability .15, and HP machines with probability .25.

**Find the probability a customer will need service repairs on the computer they purchased from Acme.**

## Bayes Rule

If \(B_1, B_2, \cdots, B_n\) forms a partition of \(S\), for any event A:
\begin{align}
P(B_i|A) = & \frac{P(B_i\cap A)}{P(A)} \\
= & \frac{P(B_i\cap A)}{\sum_{i = 1}^n P(A|B_i) \times P(B_i)}
\end{align}

## Tree Diagrams

To Better represent the structure of the probability, tree diagrams can be pretty useful

### Example 2

After the first exam, a student will go to the beach
(event B) depending on whether they pass the exam (event A).
The probability a student will pass is 0.9. If a student passes,
they go to the beach with a probability of 0.8. However,
a student who fails the exam will only go to the beach with
a probability of 0.4.

- What is the probability that a student went to the beach?
- What is the probability that a student at the beach passed the test?
- What is the probability that a student not at the beach failed the test?
- Is going to the beach independent of whether the student passed the exam?