Probability conditional

Probability conditional

The likelihood conditional of A given B with \Omega the sample space of A and B events with P(B)\not=0 will be the probability that A occurs knowing that event B has occurred:

P(A | B) = \frac{P(A \cup B)}{P(B)}

Properties

  1. P(\emptyset | A) = 0
  2. P(\Omega | A) = 1
  3. 0 \leq P(B | A) \leq 1
  4. P(B^c | A) = 1 - P(B | A)
  5. P(A \cup B | C) = P(A | C) + P(B | C) - P(A \cap B | C)
  6. P(A_1 \cap A_2) = P(A_1) \cdot P(A_2 | A_1)
  7. P(A_1 \cap A_2 \cap A_3) = P(A_1) \cdot P(A_2 | A_1) \cdot P(A_3) P(A_3 | A_1 \cap A_2)
  8. P(A_1 \cap \cdots \cap A_n) = P(A_1) \cdot P(A_2 | A_1) \cdots P(A_n) \cdot P(A_n | A_1 \cap A_2 \cap \cdots \cap A_{n-1})

Event independent

It \Omega sample space of A and B events, we will say that they are independent if any of the following equivalent properties hold:

  • P(A | B) = P(A)
  • P(B | A) = P(B)
  • P(A \cap B) = P(A) \cdot P(B)

So whenever \Omega the sample space of A_1, \cdots, A_n events, we will say that they are independent if and only if:

\text{1) }P(A_i \cap A_j) = P(A_i) P(A_j), \forall i \not= j
\text{2) }P(A_i \cap A_j \cap A_k) = P(A_i) P(A_j) P(A_k), \forall i \not= j, i \not= k, j \not= k
\cdots)
\text{n-1) }P(A_1 \cap \cdots \cap A_n) = P(A_1) \cdots P(A_n)

Dependent event

We will say that they are dependent if they are not dependent:

  • P(A | B) \not= P(A)
  • P(A | B) > P(A)
  • P(A | B) < P(A)

Dependency and incompatibility

If A and B have nonzero and incompatible probabilities, then they are dependent

Incompatible: A \cap B = \emptyset \Rightarrow P(A \cap B) = 0

Independent: P(A \cap B) = P(A) \cdot P(B)

Theorem of the probability

It \Omega the sample space of A_1, \cdots, A_n events, we will say that it forms a complete system of events (CSE) if and only if they fulfill:

  1. A_i \not= \emptyset, \forall i
  2. A_i \cap A_j \not= \emptyset, \forall i \not= j
  3. A_1 \cup \cdots \cup A_n = \Omega

Theorem of the probability total

It \Omega a sample space with A_1, \cdots, A_n a complete system of events and let B be another different event, then:

P(B) = P(B | A_1) \cdot P(A_1) + \cdots + P(B | A_n) \cdot P(A_n)

Demonstration

P(B) = P(B \cup A_1) + \cdots + P(B \cup A_n) \cdot P(B | A) = \frac{P(B \cup A)}{P(A)} P(B \cup A) = P(B | A) \cdot P(A) P(B) = P(B | A_1) \cdot P(A_1) + \cdots + P(B | A_n) \cdot P(A_n)

Bayes Theorem

It \Omega a sample space with A_1, \cdots, A_n a complete system of events and let B be another different event, then:

P(A_i | B) = \frac{P(B | A_i) P(A_i)}{P(B)}, \forall i \in \{1, \cdots, n\}

Example of Bayes Theorem

All the production of a company is carried out by 3 machines independently. The first does half the work, the second the fifth and the third the rest. These machines have so far produced 2%, 4% and 3% defective units, respectively. We want to calculate:

  1. The percentage of defective parts that the company produces
  2. If we pick a part at random and it turns out to be defective, what is the most likely machine to produce it?

Before making any calculations, we will sort the information that the problem gives us

Probability that a part is produced on a given machine:

Probability of the machine Result
P(M_1) \frac{1}{2} = 0.5
P(M_2) \frac{1}{5} = 0.2
P(M_3) 1 - \frac{1}{2} - \frac{1}{5} = \frac{10-5-2}{10}=\frac{3}{10}=0.3

Probability that a part is defective, depending on whether it is produced on a specific machine:

Probability to be faulty and the machine Result
P(D | M_1) 2\cdot \frac{1}{100} = 0.02
P(D | M_2) 4\cdot \frac{1}{100} = 0.04
P(D | M_3) 3\cdot \frac{1}{100} = 0.03

Now we move on to solve the questions

  1. We apply the theorem of the probability total

    P(D) = P(D | M_1) \cdot P(M_1) + P(D | M_2) \cdot P(M_2) + P(D | M_3) \cdot P(M_3)
    = 0.02 \cdot 0.5 + 0.04 \cdot 0.2 + 0.03 \cdot 0.3 = 0.027

    Therefore, the company produces a 0.027 \cdot 100 = 2.7\% of defective parts
  2. Before we can answer the question we need to calculate the probabilities of each machine individually and then choose the one that is greater. To do this, we will use Bayes Theorem

    P(M_1 | D) = \frac{P(D | M_1) \cdot P(M_1)}{P(D)} = \frac{0.02 \cdot 0.5}{0.027} = 0.3704

    P(M_2 | D) = \frac{P(D | M_2) \cdot P(M_2)}{P(D)} = \frac{0.04 \cdot 0.2}{0.027} = 0.2963

    P(M_3 | D) = \frac{P(D | M_3) \cdot P(M_3)}{P(D)} = \frac{0.03 \cdot 0.3}{0.027} = 0.3333

    Therefore, the most likely machine to produce the defective part is M_1