Bayes Theorem¶
Sample Space¶
Consider a random variable \(X\).
- The set of all possible outcomes of \(X\) is referred to as the sample space.
- We will denote the sample space as \(\mathcal{S}\).
- Each outcome, \(x\), of the random variable \(X\) is called a member of \(\mathcal{S}\).
- In notation \(x \in \mathcal{S}\).
Subsets¶
A subset of \(\mathcal{S}\) is a collection of outcomes.
- If \(A\) is a subset of \(\mathcal{S}\), we write \(A \subset \mathcal{S}\).
- If \(B\) is a subset of \(\mathcal{S}\) and \(A\) is a subset of \(B\), we write \(A \subset B\).
- We also say that \(A\) is contained in \(B\).
- We often refer to subsets of the sample space as events.
- The empty set is the subset with no elements and is denoted \(\emptyset\).
- The empty set is an impossible event.
Example of Subsets¶
Let \(X\) be the result of a fair die roll.
- The sample space is \(\{1,2,3,4,5,6\}\).
- Let \(B\) be the event that \(X\) is even: \(B = \{2,4,6\}\).
- Let \(A\) be the event that \(X\) is 2 or 4: \(A = \{2,4\}\).
- Clearly, \(A \subset B \subset \mathcal{S}\).
- Let \(C\) be the event that \(X\) is \(-1\).
- Clearly, \(C = \emptyset\).
Union¶
The union of two sets is the set containing all outcomes that belong to \(A\) or \(B\).
- We write the union of \(A\) and \(B\) as \(A \cup B\).
- For the die roll example, if \(A = \{2,5\}\) and \(B = \{2,4,6\}\), then \(A \cup B = \{2,4,5,6\}\).
- The union of many sets is written as
Intersection¶
The intersection of two sets is the set containing all outcomes that belong to \(A\) and \(B\).
- We write the intersection of \(A\) and \(B\) as \(A \cap B\).
- For the die roll example, if \(A = \{2,5\}\) and \(B = \{2,4,6\}\), then \(A \cap B = \{2\}\).
- The intersection of many sets is written as
Complements¶
The complement of \(A \subset \mathcal{S}\) is the subset that contains all outcomes in \(\mathcal{S}\) that are not in \(A\).
- We denote the complement by \(A^c\).
- For the die roll example, if \(A = \{2,4,6\}\), then \(A^c = \{1,3,5\}\).
Complements¶
Some important properties:
Disjoint Events¶
Two events are disjoint or mutually exclusive if they have no outcomes in common.
- \(A\) and \(B\) are disjoint if \(A \cap B = \emptyset\).
- By definition, any event and its complement are disjoint: \(A \cap A^c = \emptyset\).
- For the die roll example, if \(A = \{2,5\}\) and \(B = \{4,6\}\), then \(A \cap B = \emptyset\).
Probability¶
Given \(A \subset \mathcal{S}\), denote the probability \(P(X \subset A) = P(A)\).
- In the Venn diagram, \(P(A)\) is the ratio of the area of \(A\) to the area of \(\mathcal{S}\).
- Note that \(P(\mathcal{S}) = 1\).
- Note that \(P(\emptyset) = 0\).
Probability of Intersections¶
The probability that \(X\) is in \(A\) and \(B\) is:
- For the die roll example, if \(A = \{2,5\}\) and \(B = \{2,4,6\}\), then
Probability of Unions¶
The probability that \(X\) is in \(A\) or \(B\) is:
Probability of Unions¶
For the die roll example, if \(A = \{2,5\}\) and \(B = \{2,4,6\}\),
Probability of Unions¶
If \(A \cap B = \emptyset\),
since \(P(\emptyset) = 0\).
Probability of Unions¶
For the die roll example, if \(A = \{2,5\}\) and \(B = \{4,6\}\),
Conditional Probability¶
Suppose we know that event \(B\) has occurred - that is, one of the outcomes in the subset \(B \subset \mathcal{S}\) has occurred.
- How does this alter our view of the probability of event \(A\) occurring?
- Denote the probability of \(A\), conditional on \(B\) occurring, as \(P(A|B)\).
- If \(A \cap B = \emptyset\), we know \(P(A|B) = 0\). Why?
Conditional Probability¶
If \(A \cap B \neq \emptyset\)
- \(P(A|B)\) is the ratio of the area of \(A \cap B\) to the area of \(B\).
- That is, we reduce the sample space from \(\mathcal{S}\) to \(B\).
Conditional Probability¶
For the die roll example, if \(A = \{2,4\}\) and \(B = \{2,4,6\}\),
- Intuitively, if we know that 2,4 or 6 occurs, then the probability that a 2 or 4 occurs should be \(\frac{2}{3}\).
Bayes’ Theorem¶
From the definition of conditional probability,
Likewise
Bayes’ Theorem¶
Rearranging (3) gives Bayes’ Theorem:
Bayes’ Theorem¶
For the die roll example, if \(A = \{2,4\}\) and \(B = \{2,4,6\}\), we already know that
- \(P(A) = \frac{2}{6}\).
- \(P(B) = \frac{3}{6}\).
- \(P(A|B) = \frac{2}{3}\).
Thus,
Partitions¶
Let \(B_1, B_2, \ldots, B_K\) be \(K\) subsets of \(\mathcal{S}\): \(B_i \subset \mathcal{S}\) for \(i = 1, \ldots, K\).
- \(\{B_i\}_{i=1}^K\) is a partition of \(\mathcal{S}\) if
- Note that \(A = (A \cap B_1) \cup \cdots \cup (A \cap B_K)\).
Partitions¶
Since \((A \cap B_i) \cap (A \cap B_j) = \emptyset\) for \(i \neq j\),
Bayes’ Theorem Extended¶
Given a partition \(B_1, \ldots, B_K\) of \(\mathcal{S}\), we can applied Bayes’ Theorem to each subset of the partition: