Mathematics

Probability

Definition and laws of probability. Types of events, conditional probability, law of total probability and Bayes' theorem.

Definition of probability. Laplace's law
P(A)=Number of favorable cases of ATotal number of possible casesP(A) = \frac{\text{Number of favorable cases of A}}{\text{Total number of possible cases}}

Properties:
0P(A)1P(E)=1P()=0P(Aˉ)=1P(A)\begin{aligned} & 0 \le P(A) \le 1 \quad & P(E) = 1 \\ & P(\emptyset) = 0 \quad & P(\bar{A}) = 1 - P(A) \end{aligned}

Probability of the union:
P(AB)=P(A)+P(B)P(AB)P(A \cup B) = P(A) + P(B) - P(A \cap B)
Probability of the difference:
P(AB)=P(ABˉ)=P(A)P(AB)P(A - B) = P(A \cap \bar{B}) = P(A) - P(A \cap B)

De Morgan's laws of probability:
P(AB)=P(AˉBˉ)=1P(AB)P(AB)=P(AˉBˉ)=1P(AB)\begin{aligned} P(\overline{A \cap B}) &= P(\bar{A} \cup \bar{B}) = 1 - P(A \cap B) \\ P(\overline{A \cup B}) &= P(\bar{A} \cap \bar{B}) = 1 - P(A \cup B) \end{aligned}
Mutually exclusive events: We check if two events A and B are mutually exclusive if they verify:
AB=P(AB)=P(A)+P(B)\begin{aligned} A \cap B &= \emptyset \\ P(A \cup B) &= P(A) + P(B) \end{aligned}

Independent events: We check if two events A and B are independent if they verify:
P(AB)=P(A)P(B)P(A \cap B) = P(A) \cdot P(B)
If two events are mutually exclusive (they cannot occur at the same time), they CANNOT be independent.

Conditional probability:
P(A/B)=P(AB)P(B)P(B/A)=P(AB)P(A)P(A/B) = \frac{P(A \cap B)}{P(B)} \quad \quad P(B/A) = \frac{P(A \cap B)}{P(A)}
Law of total probability: Let (A1,A2,...,An)(A_1, A_2, ..., A_n) be pairwise mutually exclusive events whose union is the sample space (E), then, the probability of any other event B is given by:
P(B)=P(A1)P(B/A1)+P(A2)P(B/A2)+...+P(An)P(B/An)P(B) = P(A_1) \cdot P(B/A_1) + P(A_2) \cdot P(B/A_2) + ... + P(A_n) \cdot P(B/A_n)
Example: Out of 60 high school students, 25 are freshmen and 35 are sophomores. 60% of the freshmen pass physics, and 75% of the sophomores do. A student is chosen at random. What is the probability that they pass physics?
Solution: Let the events be:
  • A1\mathbf{A_1}: freshmen students, with P(A1)=25/60P(A_1) = 25/60
  • A2\mathbf{A_2}: sophomore students, with P(A2)=35/60P(A_2) = 35/60
  • B\mathbf{B}: students who pass physics, and P(B)\mathbf{P(B)} is what is asked:
P(B)=P(A1)P(B/A1)+P(A2)P(B/A2)P(B) = P(A_1) \cdot P(B/A_1) + P(A_2) \cdot P(B/A_2)
where
P(B/A1)P(B/A_1) Probability of passing physics if they are a freshman (0.6)(0.6)
P(B/A2)P(B/A_2) Probability of passing physics if they are a sophomore (0.75)(0.75). Then:
P(B)=25600.6+35600.75=0.6875P(B) = \frac{25}{60} \cdot 0.6 + \frac{35}{60} \cdot 0.75 = 0.6875

Bayes' Theorem, posterior probability: Let (A1,A2,...,An)(A_1, A_2, ..., A_n) be pairwise mutually exclusive whose union is the sample space, and let B be an event compatible with AiA_i. Then the posterior probability, that AiA_i occurs having occurred B will be:
P(Ai/B)=P(Ai)P(B/Ai)P(B)P(A_i/B) = \frac{P(A_i) \cdot P(B/A_i)}{P(B)}