- This chapter establishes the basic terminology of sample spaces, events, probability, conditi8onal probability, and independence.
+ This chapter establishes the basic terminology of sample spaces, events, probability, conditional probability, and independence.
This language lets us model and talk about situations that involve randomness (or lack of knowledge which can sometimes be mathematically modeled in the same way).
-
- Set Theory
-
-
- When we perform an experiment, there are many results that we might see.
- We want to be able to quantify the likelihood of seeing certain results.
- For this, we need to develop some mathematical terminology.
-
-
-
-
-
- The sample space, often denoted \Omega, is the set of all possible results of an experiment.
- A single result is called an outcome, while a collection of results is called an event.
-
-
-
-
-
-
-
- An experiment consists of rolling a standard 6-sided die.
- The sample space is \Omega = \{1, 2, 3, 4, 5, 6\}.
- One possible event is A = \{2, 4, 6\}, i.e., the event that the result of the roll is even.
-
-
-
- What would the sample space look like if we roll the die two times and recorded the results?
-
- Let A be a set.
- The symbol \in means "is an element of", as in a \in A.
- Given another set B, we say A is a subset of B, written A\subset B, to mean that every element of the set A is also an element of the set B.
-
-
-
-
-
- The subset symbol includes the possibility that A and B are equal sets, i.e., that they contain precisely the same elements.
-
-
-
-
-
- Consider sets A and B, each contained inside \Omega.
- We can combine sets in a variety of ways:
-
- Union
-
-
- The union of A and B is the set A \cup B = \{x \mid x \in A \text{ or } x \in B\}.
-
-
-
-
- Intersection
-
-
- The intersection of A and B is the set A \cap B = \{x \mid x \in A \text{ and } x \in B\}.
-
-
-
-
- Difference
-
-
- The set differenceA-B is the set A - B = \{x \mid x \in A \text{ and } x \notin B\}.
-
-
-
-
- Complement
-
-
- The complement of A is the set A^c = \{x \in \Omega \mid x \notin A\}.
-
-
-
-
- Empty Set
-
-
- The empty set, usually written \emptyset or \{\}, is the set which contains no elements.
-
-
-
-
-
-
-
-
- It's useful sometimes to draw pictures called Venn diagrams representing sets:
-
-
-
-
Example Venn Diagram
-
-
-
- Venn diagram showing sets A, B, C with the region representing (A\cup B\cup C) - (A \cap C) shaded.
-
- Two sets A and B are disjoint if A \cap B = \emptyset.
-
-
-
-
-
-
-
- Given a finite set A, the cardinality of A, written |A|, is the number of elements in A.
-
-
-
-
-
-
-
-
- Consider the sets A = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}, B = \{2, 4, 9, 10, 12, 14, 19\}, and C = \{9, 10, 11, 14, 16, 17, 20\}, which are all subsets of \Omega = \{1, 2, 3, \dotsc, 20\}.
-
-
-
-
-
-
-
- Find A - (B \cap C).
-
-
-
-
-
- \{1, 2, 3, 4, 5, 6, 7, 8\}
-
-
-
-
-
-
-
-
- Find |A|, |B|, |C|, |A\cup B|, |A \cap B|, |B\cap C|, |A\cap C|, and |A\cup B\cup C|.
- Is it true that the size of the union of sets is equal to the sum of the sizes of the individual sets?
-
-
-
-
-
- |A| = 10, |B| = 7, |C| = 7, |A \cup B| = 13, |A \cap B| = 4, |B\cap C| = 3, |A\cap C| = 2, |A\cup B\cup C| = 17. In particular, note that |A\cup B| = 13 \neq 10 + 7 = |A| + |B|, so it is not true in general that the size of the union of sets is the sum of the sizes of the individual sets.
-
- Suppose we have a 6-sided die that's weighted to roll a 6 half of the time.
- We roll the die two times.
- List the set of all possible results.
- [Note: the result (2, 4)---rolling a 2 and then a 4---is different from the result (4, 2)---rolling a 4 and then a 2.]
-
-
-
-
-
-
- \Omega = \{\amp (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6),
- \amp (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6),
- \amp (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6),
- \amp (4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6),
- \amp (5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (5, 6),
- \amp (6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (6, 6)\}
-
- Note that \Omega simply lists outcomes with no reference to the probabilities.
- So the answer here is the same as in .
-
-
-
-
-
-
-
- Suppose we flip a coin two times.
- List the set of all possible results.
- What about flipping three times? Four times? If we flip the coin 10 times, how many possible results will there be?
-
-
-
-
-
- For two flips: \Omega = \{ HH, HT, TH, TT \}.
-
-
-
- For three flips: \Omega = \{ HHH, HHT, HTH, THH, HTT, THT, TTH, TTT \}.
-
- Each additional flip doubles the number of outcomes.
- So, with ten flips, we'll have |\Omega| = 2^{10} = 1024.
-
-
-
-
-
-
-
- If we roll a 6-sided die ten times, how many possible results will there be?
-
-
-
-
-
- Each additional roll will multiply the number of outcomes by 6.
- So, with 10 rolls, we'll have |\Omega| = 6^{10}.
-
-
-
-
-
-
-
- Definition of Probability
-
-
- Now that we have the language to refer to outcomes and events of an experiment, we want to start quantifying how likely those outcomes/events are to occur.
-
-
-
-
-
- A probability distribution on a sample space \Omega assigns probabilities to every event, satisfying the following conditions:
-
-
-
- \Pr(\Omega) = 1.
-
-
-
-
-
- 0 \leq \Pr(A) \leq 1 for any event A.
-
-
-
-
-
- If A \cap B = \emptyset, then \Pr(A\cup B) = \Pr(A) + \Pr(B).
-
-
-
-
-
-
-
-
- For small probability spaces (i.e., with finitely many outcomes in the sample space), we'll usually assign probabilities to each individual outcome, and perhaps list them in a table.
- Then, to find the probability of any event, simply add together the probabilities of each outcome in that event.
-
-
-
-
-
- An experiment consists of rolling a standard 6-sided die.
- The sample space is \Omega = \{1, 2, 3, 4, 5, 6\}.
- The probability distribution (assuming a fair die) is shown below.
-
- One possible event is A = \{2, 4, 6\}, i.e., the event that the result of the roll is even.
- The probability of A is:
-
- \Pr(A) = \Pr(2) + \Pr(4) + \Pr(6) = \frac{1}{6} + \frac{1}{6} + \frac{1}{6} = \frac{3}{6} = \frac{1}{2}
-
-
-
-
-
-
-
-
- Let \Omega = \{x_1, x_2, \dotsc, x_n\} be a sample space and A\subset \Omega an event.
- We refer to the distribution in which \Pr(x_i) = \frac{1}{n} for all i as the uniform distribution.
- In this case, it follows that \Pr(A) = \frac{|A|}{|\Omega|}.
-
-
-
-
-
- When we talk about a fair coin flip or a fair die roll, the word "fair" is indicating a uniform distribution.
- However, don't make the mistake of assuming that all distributions are uniform by default.
-
-
-
-
-
- A person picks a random number from 1 to 10.
- What is the probability that they picked 3?
-
-
-
-
-
- Without assuming the distribution is fair (i.e., that each value 1, 2, \dotsc, 10) has probability 1/10 of occurring), we don't have enough information to answer this question.
-
-
-
- In fact, the situation is even more vague than that: the sample space itself is unclear.
- Are we only allowed to pick integer values? What about fractions like 7/2? What about irrational numbers like \pi?
-
-
-
-
-
-
-
-
- Consider the sample space \Omega = \{1, 2, 3, 4, 5, 6, 7, 8\} with probability distribution below.
- Calculate the probabilities of A = \{1, 3, 7, 8\}, B = \{2, 3, 6, 7\}, A\cup B, and A \cap B.
-
- Make a probability distribution table for \Omega assuming the die is fair.
-
-
-
-
-
- We'll avoid an overly large table and note that, since the die is fair, every outcome is equally likely.
- Therefore, \Pr(x) = \frac{1}{36} for every x\in \Omega.
-
-
-
-
-
-
-
-
- Let A be the event that the second roll is higher than the first, and let B be the event that the first roll is even.
- Find \Pr(A), \Pr(B), and \Pr(A \cap B).
-
- Suppose a die has the values 1, 2, 3, 4, 5, 6 on the faces, but the die is not fair.
- Instead, the probabilities scale by the same amount as the face values.
- For example, a result of 4 is twice as likely as a result of 2, since 4 is twice as large as 2; a result of 6 is six times more likely than a result of 1; and so on.
- Write a probability distribution table for this die.
-
- Suppose a die has the values 1, 2, 3, 4, 5, 6 on the faces, but the die is not fair.
- Instead, each even value has an equal probability, each odd value has an equal probability, and the even values are each twice as likely as the odd values to appear on a roll.
- Write a probability distribution table for this die.
-
-
-
-
- Probability Distribution for an Even-biased Die
-
-
-
- x
- \Pr(x)
-
-
-
- 1
- 1/9
-
-
-
- 2
- 2/9
-
-
-
- 3
- 1/9
-
-
-
- 4
- 2/9
-
-
-
- 5
- 1/9
-
-
-
- 6
- 2/9
-
-
-
-
-
-
-
-
-
-
- A toxin molecule inside a cell has a 0.3 probability of leaving the cell during a 1-minute period.
- For each value of n = 1, 2, 3, \dotsc, find the probability of the toxin molecule leaving the cell during the nth minute.
- What is the probability of the molecule leaving the cell during the first 3 minutes?
-
-
-
-
-
- For short, write \Pr(n) to mean the probability of the toxin molecule leaving during the nth minute.
- Then \Pr(n) = (0.7)^{n - 1} (0.3).
-
-
-
- The probability of leaving during the first 3 minutes is \Pr(1) + \Pr(2) + \Pr(3) = 0.657.
-
-
-
-
-
-
-
-
-
- Conditional Probability
-
-
- Conditional Probability
-
-
-
-
- Let A and B be events.
- The conditional probability of A given B is
-
- \Pr(A \mid B) = \frac{\Pr(A\cap B)}{\Pr(B)}.
-
-
-
-
-
-
-
-
- An experiment consists of rolling a fair 6-sided die two times.
- Let A be the event that the sum of the rolls is at least 10.
- To find \Pr(A), we note that A = \{(4, 6), (5, 5), (5, 6), (6, 4), (6, 5), (6, 6)\}, which has 6 elements.
- Since |\Omega| = 36, we have
-
- \Pr(A) = \frac{|A|}{|\Omega|} = \frac{6}{36} = \frac{1}{6}
- .
-
-
-
- Let B be the event that the first roll is 6.
- If we pause after the first die roll seeing the value of 6, we might be more inclined to expect a sum of at least 10.
- The evidence that we've already seen changes our understanding of the situation.
- Since |B| = 6, \Pr(B) = \frac{6}{36} = \frac{1}{6}.
- Also, A\cap B = \{(6, 4), (6, 5), (6, 6)\}, so \Pr(A\cap B) = \frac{3}{36} = \frac{1}{12}.
- Finally:
-
- \Pr(A \mid B) = \frac{\Pr(A\cap B)}{\Pr(B)} = \frac{1/12}{1/6} = \frac{1}{2}
-
-
-
-
-
-
-
-
- Diagnostic Testing
-
-
- Diagnostic tests for diseases aren't perfect.
- When a test comes back positive or negative, a patient will want to understand the (conditional) probability that they have or don't have the disease based on the evidence (the diagnostic test result).
-
-
-
-
-
- The sensitivity of a diagnostic test is the probability that a patient who has the disease will see a positive test result.
- The specificity is the probability that a patient who does not have the disease will see a negative test result.
-
-
-
-
-
- Introducing event notation, let D be the event that a patient has the disease, and let P be the event that they receive a positive test result.
- Then the sensitivity of the diagnostic test is \Pr(P \mid D), and the specificity is \Pr(P^c \mid D^c).
- However, when the patient takes a diagnostic test, the conditional probabilities they would be most interested in would be \Pr(D \mid P) and \Pr(D^c \mid P^c).
-
-
-
- Bayes' Theorem expresses the relationship between a conditional probability \Pr(A \mid B) and the flipped conditional probability \Pr(B \mid A).
-
- For example, if a patient sees a positive diagnostic test result, they might try to calculate:
-
- \Pr(D \mid P) = \frac{\Pr(P \mid D)\Pr(D)}{\Pr(P)}
-
- It will take some work to be able to use this formula.
- We likely don't have direct access to \Pr(P) or \Pr(D).
-
-
-
- Let's consider \Pr(P), the probability of receiving a positive test result.
- The sensitivity \Pr(P \mid D) tells us this probability under the condition that the patient has the disease.
- For a patient who doesn't have the disease, the specificity isn't quite the number we're looking for.
- However, consider the complementary probability:
-
- \Pr(P \mid D^c) = 1 - \Pr(P^c \mid D^c)
-
- The total \Pr(P) can be divided into two categories: patients who have the disease and test positive, and patients who don't have the disease and test positive.
- So:
-
- \Pr(P) \amp = \Pr(P\cap D) + \Pr(P\cap D^c)
- \amp = \Pr(P\mid D)\Pr(D) + \Pr(P \mid D^c)\Pr(D^c)
- \amp = \Pr(P\mid D)\Pr(D) + (1 - \Pr(P^c \mid D^c))\Pr(D^c)
- \amp = (\text{sensitivity})\Pr(D) + (1 - \text{ specificity})\Pr(D^c)
-
- We can take this breakdown of \Pr(P) and write a new version of Bayes' Theorem:
-
- We're still missing a crucial piece of information: \Pr(D), the probability (not conditioned on any evidence) that the patient has the disease.
- This is often referred to as the prior, as in, our prior understanding of the probability of something before we gained some new information from evidence.
- The conditional probability calculated using Bayes' Theorem is usually called the posterior (i.e., after taking evidence into account).
- There isn't always one single number that's reasonable to use as the prior probability.
- For example, in a diagnostic testing situation, the prevalence of the diseasei.e., the proportion of the population who have the diseasemight feel like a natural number to use as the prior.
- However, what prevalence should you use? During the COVID-19 pandemic, the prevalence of COVID in a particular country, state, and city might be different.
- There's also the possibility of applying Bayes' Theorem multiple times to take into account multiple pieces of evidence, using the posterior probability from one application of Bayes' Theorem to play the role of the prior probability in the next.
- This idea would apply if, for example, a patient took a second diagnostic test to double-check.
-
-
-
-
-
- A 50-year old woman with no symptoms is screened for breast cancer and tests positive.
- If the prevalence of breast cancer for women in her age group is 1% and the particular screening process used has a sensitivity of 90% and a specificity of 91%, what is the probability that the woman has breast cancer given her positive result?
-
-
-
-
-
- Let P be the event of testing positive and D the event of having the disease.
- Then the prevalence \Pr(D) is given as 1%, or 0.01.
- The sensitivity is \Pr(P\mid D) = 0.9, and the specificity is \Pr(P^c\mid D^c) = 0.91.
- So, according to Bayes' Theorem:
-
- \Pr(D\mid P) \amp = \frac{\Pr(P\mid D)\Pr(D)}{\Pr(P\mid D)\Pr(D) + (1 - \Pr(P^c\mid D^c))\Pr(D^c)}
- \amp = \frac{(0.9)(0.01)}{(0.9)(0.01) + (1 - 0.91)(1 - 0.01)}
- \amp \approx 0.092
-
-
-
-
-
-
-
-
-
- In each of the following scenarios with given events A and B, alculate \Pr(A), \Pr(B), \Pr(A\cap B), \Pr(A \mid B), and \Pr(B \mid A).
-
-
-
-
-
-
- An experiment consists of rolling a fair die two times.
- Let A be the event that the sum is even, and let B be the event that the second roll is higher than the first.
-
-
-
-
-
-
-
- An experiment consists of flipping a fair coin three times.
- Let A be the event that the first and second flips match.
- Let B be the event that there are at least two heads.
-
-
-
-
-
-
-
-
- A diagnostic test is developed to detect a disease present in 3.2% of the population.
- For a patient who has the disease, the test will accurately give a positive result 65% of the time.
- When the patient does not have the disease, the test will accurately give a negative result 99.9% of the time.
-
-
-
-
-
-
-
- For a patient who receives a positive test, what is the probability they have the disease?
-
-
-
-
-
- TODO
-
-
-
-
-
-
-
-
- For a patient who receives a negative test, what is the probability they do not have the disease?
-
-
-
-
-
- TODO
-
-
-
-
-
-
-
-
- Independent Events
-
-
- The idea of conditional probability is that knowledge of one event can change our understanding of the probability of another.
- But it's also important to understand when this is not the case.
-
-
-
-
-
- Events A, B are independent if \Pr(A \mid B) = \Pr(A).
-
-
-
-
-
- The equation \Pr(A\mid B) = \Pr(A) very concretely says: knowledge that the event B has occurred does not change our understanding of \Pr(A).
- Assuming \Pr(A) \neq 0, this is equivalent to \Pr(A\cap B) = \Pr(A)\Pr(B), since:
-
- \Pr(A\mid B) \amp = \Pr(A)
- \frac{\Pr(A\cap B)}{\Pr(B)} \amp = \Pr(A)
- \Pr(A\cap B) \amp = \Pr(A)\Pr(B)
-
- This latter form of the equation is often more useful in calculations.
-
-
-
-
-
- In , we considered an experiment in which we rolled a fair 6-sided die twice.
- We defined events A that the sum of the rolls is at least 10 and B that the first roll is a 6, and we found that \Pr(A \mid B) \neq \Pr(A), so A and B are not independent.
-
-
-
- Now consider the event C that the sum of the rolls is 7, which sounds very similar to the event A.
- We have:
-
- C \amp = \{(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)\}
- \Pr(C) \amp = \frac{6}{36} = \frac{1}{6}
- B\cap C \amp = \{(6, 1)\}
- \Pr(B\cap C) \amp = \frac{1}{36}
- \text{therefore: } \Pr(C\mid B) \amp = \frac{\Pr(C\cap B)}{\Pr(B)} = \frac{1/36}{1/6} = \frac{1}{6} = \Pr(C)
-
- So, even though the descriptions of events A and C are very similar, the event C is independent with B, while A is not.
-
-
-
-
-
-
-
-
- An experiment consists of rolling a fair die two times.
- Let A be the event that the sum is even, and let B be the event that the second roll is higher than the first.
- Are A and B independent?
-
-
-
-
-
-
-
- An experiment consists of flipping a fair coin three times.
- Let A be the event that the first and second flips match.
- Let B be the event that there are at least two heads.
- Are A and B independent?
-
-
-
-
-
-
-
- Let A = \{1, 2, 3\} and B = \{3, 4, 5\} be events in the sample space \Omega = \{1, 2, 3, 4, 5, 6\}.
- Create a probability distribution for \Omega so that A, B are independent.
-
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/source/sec-Conditional-Probability.ptx b/source/sec-Conditional-Probability.ptx
new file mode 100644
index 0000000..490fb88
--- /dev/null
+++ b/source/sec-Conditional-Probability.ptx
@@ -0,0 +1,228 @@
+
+ Conditional Probability
+
+
+ Conditional Probability
+
+
+
+
+ Let A and B be events.
+ The conditional probability of A given B is
+
+ \Pr(A \mid B) = \frac{\Pr(A\cap B)}{\Pr(B)}.
+
+
+
+
+
+
+
+
+ An experiment consists of rolling a fair 6-sided die two times.
+ Let A be the event that the sum of the rolls is at least 10.
+ To find \Pr(A), we note that A = \{(4, 6), (5, 5), (5, 6), (6, 4), (6, 5), (6, 6)\}, which has 6 elements.
+ Since |\Omega| = 36, we have
+
+ \Pr(A) = \frac{|A|}{|\Omega|} = \frac{6}{36} = \frac{1}{6}
+ .
+
+
+
+ Let B be the event that the first roll is 6.
+ If we pause after the first die roll seeing the value of 6, we might be more inclined to expect a sum of at least 10.
+ The evidence that we've already seen changes our understanding of the situation.
+ Since |B| = 6, \Pr(B) = \frac{6}{36} = \frac{1}{6}.
+ Also, A\cap B = \{(6, 4), (6, 5), (6, 6)\}, so \Pr(A\cap B) = \frac{3}{36} = \frac{1}{12}.
+ Finally:
+
+ \Pr(A \mid B) = \frac{\Pr(A\cap B)}{\Pr(B)} = \frac{1/12}{1/6} = \frac{1}{2}
+
+
+
+
+
+
+
+
+ Diagnostic Testing
+
+
+ Diagnostic tests for diseases aren't perfect.
+ When a test comes back positive or negative, a patient will want to understand the (conditional) probability that they have or don't have the disease based on the evidence (the diagnostic test result).
+
+
+
+
+
+ The sensitivity of a diagnostic test is the probability that a patient who has the disease will see a positive test result.
+ The specificity is the probability that a patient who does not have the disease will see a negative test result.
+
+
+
+
+
+ Introducing event notation, let D be the event that a patient has the disease, and let P be the event that they receive a positive test result.
+ Then the sensitivity of the diagnostic test is \Pr(P \mid D), and the specificity is \Pr(P^c \mid D^c).
+ However, when the patient takes a diagnostic test, the conditional probabilities they would be most interested in would be \Pr(D \mid P) and \Pr(D^c \mid P^c).
+
+
+
+ Bayes' Theorem expresses the relationship between a conditional probability \Pr(A \mid B) and the flipped conditional probability \Pr(B \mid A).
+
+ For example, if a patient sees a positive diagnostic test result, they might try to calculate:
+
+ \Pr(D \mid P) = \frac{\Pr(P \mid D)\Pr(D)}{\Pr(P)}
+
+ It will take some work to be able to use this formula.
+ We likely don't have direct access to \Pr(P) or \Pr(D).
+
+
+
+ Let's consider \Pr(P), the probability of receiving a positive test result.
+ The sensitivity \Pr(P \mid D) tells us this probability under the condition that the patient has the disease.
+ For a patient who doesn't have the disease, the specificity isn't quite the number we're looking for.
+ However, consider the complementary probability:
+
+ \Pr(P \mid D^c) = 1 - \Pr(P^c \mid D^c)
+
+ The total \Pr(P) can be divided into two categories: patients who have the disease and test positive, and patients who don't have the disease and test positive.
+ So:
+
+ \Pr(P) \amp = \Pr(P\cap D) + \Pr(P\cap D^c)
+ \amp = \Pr(P\mid D)\Pr(D) + \Pr(P \mid D^c)\Pr(D^c)
+ \amp = \Pr(P\mid D)\Pr(D) + (1 - \Pr(P^c \mid D^c))\Pr(D^c)
+ \amp = (\text{sensitivity})\Pr(D) + (1 - \text{ specificity})\Pr(D^c)
+
+ We can take this breakdown of \Pr(P) and write a new version of Bayes' Theorem:
+
+ We're still missing a crucial piece of information: \Pr(D), the probability (not conditioned on any evidence) that the patient has the disease.
+ This is often referred to as the prior, as in, our prior understanding of the probability of something before we gained some new information from evidence.
+ The conditional probability calculated using Bayes' Theorem is usually called the posterior (i.e., after taking evidence into account).
+ There isn't always one single number that's reasonable to use as the prior probability.
+ For example, in a diagnostic testing situation, the prevalence of the diseasei.e., the proportion of the population who have the diseasemight feel like a natural number to use as the prior.
+ However, what prevalence should you use? During the COVID-19 pandemic, the prevalence of COVID in a particular country, state, and city might be different.
+ There's also the possibility of applying Bayes' Theorem multiple times to take into account multiple pieces of evidence, using the posterior probability from one application of Bayes' Theorem to play the role of the prior probability in the next.
+ This idea would apply if, for example, a patient took a second diagnostic test to double-check.
+
+
+
+
+
+ A 50-year old woman with no symptoms is screened for breast cancer and tests positive.
+ If the prevalence of breast cancer for women in her age group is 1% and the particular screening process used has a sensitivity of 90% and a specificity of 91%, what is the probability that the woman has breast cancer given her positive result?
+
+
+
+
+
+ Let P be the event of testing positive and D the event of having the disease.
+ Then the prevalence \Pr(D) is given as 1%, or 0.01.
+ The sensitivity is \Pr(P\mid D) = 0.9, and the specificity is \Pr(P^c\mid D^c) = 0.91.
+ So, according to Bayes' Theorem:
+
+ \Pr(D\mid P) \amp = \frac{\Pr(P\mid D)\Pr(D)}{\Pr(P\mid D)\Pr(D) + (1 - \Pr(P^c\mid D^c))\Pr(D^c)}
+ \amp = \frac{(0.9)(0.01)}{(0.9)(0.01) + (1 - 0.91)(1 - 0.01)}
+ \amp \approx 0.092
+
+
+
+
+
+
+
+
+
+ In each of the following scenarios with given events A and B, alculate \Pr(A), \Pr(B), \Pr(A\cap B), \Pr(A \mid B), and \Pr(B \mid A).
+
+
+
+
+
+
+ An experiment consists of rolling a fair die two times.
+ Let A be the event that the sum is even, and let B be the event that the second roll is higher than the first.
+
+
+
+
+
+
+
+ An experiment consists of flipping a fair coin three times.
+ Let A be the event that the first and second flips match.
+ Let B be the event that there are at least two heads.
+
+
+
+
+
+
+
+
+ A diagnostic test is developed to detect a disease present in 3.2% of the population.
+ For a patient who has the disease, the test will accurately give a positive result 65% of the time.
+ When the patient does not have the disease, the test will accurately give a negative result 99.9% of the time.
+
+
+
+
+
+
+
+ For a patient who receives a positive test, what is the probability they have the disease?
+
+
+
+
+
+ TODO
+
+
+
+
+
+
+
+
+ For a patient who receives a negative test, what is the probability they do not have the disease?
+
+
+
+
+
+ TODO
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source/sec-Independent-Events.ptx b/source/sec-Independent-Events.ptx
new file mode 100644
index 0000000..b0c156c
--- /dev/null
+++ b/source/sec-Independent-Events.ptx
@@ -0,0 +1,81 @@
+
+ Independent Events
+
+
+ The idea of conditional probability is that knowledge of one event can change our understanding of the probability of another.
+ But it's also important to understand when this is not the case.
+
+
+
+
+
+ Events A, B are independent if \Pr(A \mid B) = \Pr(A).
+
+
+
+
+
+ The equation \Pr(A\mid B) = \Pr(A) very concretely says: knowledge that the event B has occurred does not change our understanding of \Pr(A).
+ Assuming \Pr(A) \neq 0, this is equivalent to \Pr(A\cap B) = \Pr(A)\Pr(B), since:
+
+ \Pr(A\mid B) \amp = \Pr(A)
+ \frac{\Pr(A\cap B)}{\Pr(B)} \amp = \Pr(A)
+ \Pr(A\cap B) \amp = \Pr(A)\Pr(B)
+
+ This latter form of the equation is often more useful in calculations.
+
+
+
+
+
+ In , we considered an experiment in which we rolled a fair 6-sided die twice.
+ We defined events A that the sum of the rolls is at least 10 and B that the first roll is a 6, and we found that \Pr(A \mid B) \neq \Pr(A), so A and B are not independent.
+
+
+
+ Now consider the event C that the sum of the rolls is 7, which sounds very similar to the event A.
+ We have:
+
+ C \amp = \{(1, 6), (2, 5), (3, 4), (4, 3), (5, 2), (6, 1)\}
+ \Pr(C) \amp = \frac{6}{36} = \frac{1}{6}
+ B\cap C \amp = \{(6, 1)\}
+ \Pr(B\cap C) \amp = \frac{1}{36}
+ \text{therefore: } \Pr(C\mid B) \amp = \frac{\Pr(C\cap B)}{\Pr(B)} = \frac{1/36}{1/6} = \frac{1}{6} = \Pr(C)
+
+ So, even though the descriptions of events A and C are very similar, the event C is independent with B, while A is not.
+
+
+
+
+
+
+
+
+ An experiment consists of rolling a fair die two times.
+ Let A be the event that the sum is even, and let B be the event that the second roll is higher than the first.
+ Are A and B independent?
+
+
+
+
+
+
+
+ An experiment consists of flipping a fair coin three times.
+ Let A be the event that the first and second flips match.
+ Let B be the event that there are at least two heads.
+ Are A and B independent?
+
+
+
+
+
+
+
+ Let A = \{1, 2, 3\} and B = \{3, 4, 5\} be events in the sample space \Omega = \{1, 2, 3, 4, 5, 6\}.
+ Create a probability distribution for \Omega so that A, B are independent.
+
+
+
+
+
\ No newline at end of file
diff --git a/source/sec-Probability.ptx b/source/sec-Probability.ptx
new file mode 100644
index 0000000..15722b3
--- /dev/null
+++ b/source/sec-Probability.ptx
@@ -0,0 +1,527 @@
+
+ Definition of Probability
+
+
+ Now that we have the language to refer to outcomes and events of an experiment, we want to start quantifying how likely those outcomes/events are to occur.
+
+
+
+
+
+ A probability distribution on a sample space \Omega assigns probabilities to every event, satisfying the following conditions:
+
+
+
+ \Pr(\Omega) = 1.
+
+
+
+
+
+ 0 \leq \Pr(A) \leq 1 for any event A.
+
+
+
+
+
+ If A \cap B = \emptyset, then \Pr(A\cup B) = \Pr(A) + \Pr(B).
+
+
+
+
+
+
+
+
+ For small probability spaces (i.e., with finitely many outcomes in the sample space), we'll usually assign probabilities to each individual outcome, and perhaps list them in a table.
+ Then, to find the probability of any event, simply add together the probabilities of each outcome in that event.
+
+
+
+
+
+ An experiment consists of rolling a standard 6-sided die.
+ The sample space is \Omega = \{1, 2, 3, 4, 5, 6\}.
+ The probability distribution (assuming a fair die) is shown below.
+
+ One possible event is A = \{2, 4, 6\}, i.e., the event that the result of the roll is even.
+ The probability of A is:
+
+ \Pr(A) = \Pr(2) + \Pr(4) + \Pr(6) = \frac{1}{6} + \frac{1}{6} + \frac{1}{6} = \frac{3}{6} = \frac{1}{2}
+
+
+
+
+
+
+
+
+ Let \Omega = \{x_1, x_2, \dotsc, x_n\} be a sample space and A\subset \Omega an event.
+ We refer to the distribution in which \Pr(x_i) = \frac{1}{n} for all i as the uniform distribution.
+ In this case, it follows that \Pr(A) = \frac{|A|}{|\Omega|}.
+
+
+
+
+
+ When we talk about a fair coin flip or a fair die roll, the word "fair" is indicating a uniform distribution.
+ However, don't make the mistake of assuming that all distributions are uniform by default.
+
+
+
+
+
+ A person picks a random number from 1 to 10.
+ What is the probability that they picked 3?
+
+
+
+
+
+ Without assuming the distribution is fair (i.e., that each value 1, 2, \dotsc, 10) has probability 1/10 of occurring), we don't have enough information to answer this question.
+
+
+
+ In fact, the situation is even more vague than that: the sample space itself is unclear.
+ Are we only allowed to pick integer values? What about fractions like 7/2? What about irrational numbers like \pi?
+
+
+
+
+
+
+
+
+ Consider the sample space \Omega = \{1, 2, 3, 4, 5, 6, 7, 8\} with probability distribution below.
+ Calculate the probabilities of A = \{1, 3, 7, 8\}, B = \{2, 3, 6, 7\}, A\cup B, and A \cap B.
+
+ Make a probability distribution table for \Omega assuming the die is fair.
+
+
+
+
+
+ We'll avoid an overly large table and note that, since the die is fair, every outcome is equally likely.
+ Therefore, \Pr(x) = \frac{1}{36} for every x\in \Omega.
+
+
+
+
+
+
+
+
+ Let A be the event that the second roll is higher than the first, and let B be the event that the first roll is even.
+ Find \Pr(A), \Pr(B), and \Pr(A \cap B).
+
+ Suppose a die has the values 1, 2, 3, 4, 5, 6 on the faces, but the die is not fair.
+ Instead, the probabilities scale by the same amount as the face values.
+ For example, a result of 4 is twice as likely as a result of 2, since 4 is twice as large as 2; a result of 6 is six times more likely than a result of 1; and so on.
+ Write a probability distribution table for this die.
+
+
+
+
+
+ Probability Distribution for a Linearly Scaled Die
+
+
+
+ x
+ \Pr(x)
+
+
+
+ 1
+ 1/21
+
+
+
+ 2
+ 2/21
+
+
+
+ 3
+ 3/21
+
+
+
+ 4
+ 4/21
+
+
+
+ 5
+ 5/21
+
+
+
+ 6
+ 6/21
+
+
+
+
+
+
+
+
+
+ Suppose a die has the values 1, 2, 3, 4, 5, 6 on the faces, but the die is not fair.
+ Instead, each even value has an equal probability, each odd value has an equal probability, and the even values are each twice as likely as the odd values to appear on a roll.
+ Write a probability distribution table for this die.
+
+
+
+
+
+ Probability Distribution for an Even-biased Die
+
+
+
+ x
+ \Pr(x)
+
+
+
+ 1
+ 1/9
+
+
+
+ 2
+ 2/9
+
+
+
+ 3
+ 1/9
+
+
+
+ 4
+ 2/9
+
+
+
+ 5
+ 1/9
+
+
+
+ 6
+ 2/9
+
+
+
+
+
+
+
+
+
+ A toxin molecule inside a cell has a 0.3 probability of leaving the cell during a 1-minute period.
+ For each value of n = 1, 2, 3, \dotsc, find the probability of the toxin molecule leaving the cell during the nth minute.
+ What is the probability of the molecule leaving the cell during the first 3 minutes?
+
+
+
+
+
+ For short, write \Pr(n) to mean the probability of the toxin molecule leaving during the nth minute.
+ Then \Pr(n) = (0.7)^{n - 1} (0.3).
+
+
+
+ The probability of leaving during the first 3 minutes is \Pr(1) + \Pr(2) + \Pr(3) = 0.657.
+
+
+
+
+
\ No newline at end of file
diff --git a/source/sec-Set-Theory.ptx b/source/sec-Set-Theory.ptx
new file mode 100644
index 0000000..e472641
--- /dev/null
+++ b/source/sec-Set-Theory.ptx
@@ -0,0 +1,291 @@
+
+ Set Theory
+
+
+ When we perform an experiment, there are many results that we might see.
+ We want to be able to quantify the likelihood of seeing certain results.
+ For this, we need to develop some mathematical terminology.
+
+
+
+
+
+ The sample space, often denoted \Omega, is the set of all possible results of an experiment.
+ A single result is called an outcome, while a collection of results is called an event.
+
+
+
+
+
+
+
+ An experiment consists of rolling a standard 6-sided die.
+ The sample space is \Omega = \{1, 2, 3, 4, 5, 6\}.
+ One possible event is A = \{2, 4, 6\}, i.e., the event that the result of the roll is even.
+
+
+
+ What would the sample space look like if we roll the die two times and recorded the results?
+
+ Let A be a set.
+ The symbol \in means "is an element of", as in a \in A.
+ Given another set B, we say A is a subset of B, written A\subset B, to mean that every element of the set A is also an element of the set B.
+
+
+
+
+
+ The subset symbol includes the possibility that A and B are equal sets, i.e., that they contain precisely the same elements.
+
+
+
+
+
+ Consider sets A and B, each contained inside \Omega.
+ We can combine sets in a variety of ways:
+
+ Union
+
+
+ The union of A and B is the set A \cup B = \{x \mid x \in A \text{ or } x \in B\}.
+
+
+
+
+ Intersection
+
+
+ The intersection of A and B is the set A \cap B = \{x \mid x \in A \text{ and } x \in B\}.
+
+
+
+
+ Difference
+
+
+ The set differenceA-B is the set A - B = \{x \mid x \in A \text{ and } x \notin B\}.
+
+
+
+
+ Complement
+
+
+ The complement of A is the set A^c = \{x \in \Omega \mid x \notin A\}.
+
+
+
+
+ Empty Set
+
+
+ The empty set, usually written \emptyset or \{\}, is the set which contains no elements.
+
+
+
+
+
+
+
+
+ It's useful sometimes to draw pictures called Venn diagrams representing sets:
+
+
+
+
Example Venn Diagram
+
+
+
+ Venn diagram showing sets A, B, C with the region representing (A\cup B\cup C) - (A \cap C) shaded.
+
+ Two sets A and B are disjoint if A \cap B = \emptyset.
+
+
+
+
+
+
+
+ Given a finite set A, the cardinality of A, written |A|, is the number of elements in A.
+
+
+
+
+
+
+
+
+ Consider the sets A = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}, B = \{2, 4, 9, 10, 12, 14, 19\}, and C = \{9, 10, 11, 14, 16, 17, 20\}, which are all subsets of \Omega = \{1, 2, 3, \dotsc, 20\}.
+
+
+
+
+
+
+
+ Find A - (B \cap C).
+
+
+
+
+
+ \{1, 2, 3, 4, 5, 6, 7, 8\}
+
+
+
+
+
+
+
+
+ Find |A|, |B|, |C|, |A\cup B|, |A \cap B|, |B\cap C|, |A\cap C|, and |A\cup B\cup C|.
+ Is it true that the size of the union of sets is equal to the sum of the sizes of the individual sets?
+
+
+
+
+
+ |A| = 10, |B| = 7, |C| = 7, |A \cup B| = 13, |A \cap B| = 4, |B\cap C| = 3, |A\cap C| = 2, |A\cup B\cup C| = 17. In particular, note that |A\cup B| = 13 \neq 10 + 7 = |A| + |B|, so it is not true in general that the size of the union of sets is the sum of the sizes of the individual sets.
+
+ Suppose we have a 6-sided die that's weighted to roll a 6 half of the time.
+ We roll the die two times.
+ List the set of all possible results.
+ [Note: the result (2, 4)---rolling a 2 and then a 4---is different from the result (4, 2)---rolling a 4 and then a 2.]
+
+
+
+
+
+
+ \Omega = \{\amp (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6),
+ \amp (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6),
+ \amp (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6),
+ \amp (4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6),
+ \amp (5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (5, 6),
+ \amp (6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (6, 6)\}
+
+ Note that \Omega simply lists outcomes with no reference to the probabilities.
+ So the answer here is the same as in .
+
+
+
+
+
+
+
+ Suppose we flip a coin two times.
+ List the set of all possible results.
+ What about flipping three times? Four times? If we flip the coin 10 times, how many possible results will there be?
+
+
+
+
+
+ For two flips: \Omega = \{ HH, HT, TH, TT \}.
+
+
+
+ For three flips: \Omega = \{ HHH, HHT, HTH, THH, HTT, THT, TTH, TTT \}.
+