From 3000a8ecff6f14dea16bfee08dd51b160a03df8a Mon Sep 17 00:00:00 2001 From: andyeisenberg Date: Sun, 11 Jan 2026 14:43:18 -0500 Subject: [PATCH] Latest build deployed. --- index.html | 2 +- knowl/xref/example-rolls-conditional.html | 1 + lunr-pretext-search-index.js | 31 ++++--- sec-Conditional-Probability.html | 103 ++++++++++++++++++---- sec-Independent-Events.html | 88 ++++++++++++++++++ 5 files changed, 196 insertions(+), 29 deletions(-) diff --git a/index.html b/index.html index 062ed6b..a1db667 100755 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + diff --git a/knowl/xref/example-rolls-conditional.html b/knowl/xref/example-rolls-conditional.html index fe969d4..acedba2 100755 --- a/knowl/xref/example-rolls-conditional.html +++ b/knowl/xref/example-rolls-conditional.html @@ -36,6 +36,7 @@ \Pr(A \mid B) = \frac{\Pr(A\cap B)}{\Pr(B)} = \frac{1/12}{1/6} = \frac{1}{2} \end{gather*} +
Before the experiment, we would have said there was only a \(\frac{1}{6}\) chance that the sum of the rolls is at least 10. However, with the additional knowledge of seeing the first roll of 6, we find the probability of a sum of at least 10 to be \(\frac{1}{2}\text{,}\) substantially more likely than before.
in-context diff --git a/lunr-pretext-search-index.js b/lunr-pretext-search-index.js index 3491cf5..3bb11fd 100755 --- a/lunr-pretext-search-index.js +++ b/lunr-pretext-search-index.js @@ -241,7 +241,7 @@ var ptx_lunr_docs = [ "type": "Section", "number": "1.3", "title": "Conditional Probability", - "body": " Conditional Probability Conditional Probability Let and be events. The conditional probability of given is An experiment consists of rolling a fair 6-sided die two times. Let be the event that the sum of the rolls is at least 10. To find , we note that , which has 6 elements. Since , we have . Let 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 , . Also, , so . Finally: 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 be the event that a patient has the disease, and let be the event that they receive a positive test result. Then the sensitivity of the diagnostic test is , and the specificity is . However, when the patient takes a diagnostic test, the conditional probabilities they would be most interested in would be and . Bayes' Theorem expresses the relationship between a conditional probability and the flipped conditional probability . Bayes' Theorem (v1) For example, if a patient sees a positive diagnostic test result, they might try to calculate: It will take some work to be able to use this formula. We likely don't have direct access to or . Let's consider , the probability of receiving a positive test result. The sensitivity 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: The total 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: We can take this breakdown of and write a new version of Bayes' Theorem: Bayes' Theorem (v2) We're still missing a crucial piece of information: , 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 disease i.e., the proportion of the population who have the disease might 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 be the event of testing positive and the event of having the disease. Then the prevalence is given as 1%, or 0.01. The sensitivity is , and the specificity is . So, according to Bayes' Theorem: In each of the following scenarios with given events and , alculate , , , and . An experiment consists of rolling a fair die two times. Let be the event that the sum is even, and let be the event that the second roll is higher than the first. An experiment consists of flipping a fair coin three times. Let be the event that the first and second flips match. Let 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 " + "body": " Conditional Probability Conditional Probability Sometimes events can interact with each other. We would like to have the language to talk about a scenario in which evidence that one event has occurred can alter our understanding of the probability of another event occurring. We would also like to develop the mathematical tools to quantify exactly how much that probability changes. Let and be events. The conditional probability of given is An experiment consists of rolling a fair 6-sided die two times. Let be the event that the sum of the rolls is at least 10. To find , we note that , which has 6 elements. Since , we have . Let 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 , . Also, , so . Finally: Before the experiment, we would have said there was only a chance that the sum of the rolls is at least 10. However, with the additional knowledge of seeing the first roll of 6, we find the probability of a sum of at least 10 to be , substantially more likely than before. 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 be the event that a patient has the disease, and let be the event that they receive a positive test result. Then the sensitivity of the diagnostic test is , and the specificity is . However, when the patient takes a diagnostic test, the conditional probabilities they would be most interested in would be and . Bayes' Theorem expresses the relationship between a conditional probability and the flipped conditional probability . Bayes' Theorem (v1) For example, if a patient sees a positive diagnostic test result, they might try to calculate: It will take some work to be able to use this formula. We likely don't have direct access to or . Let's consider , the probability of receiving a positive test result. The sensitivity 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: The total 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: We can take this breakdown of and write a new version of Bayes' Theorem: Bayes' Theorem (v2) We're still missing a crucial piece of information: , 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 disease i.e., the proportion of the population who have the disease might 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. (Complicating the issue further, the developers of diagnostic tests often publish two or even more sets of sensitivity and specificity values, depending on whether a patient is already showing certain symptoms.) 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 be the event of testing positive and the event of having the disease. Then the prevalence is given as 1%, or 0.01. The sensitivity is , and the specificity is . So, according to Bayes' Theorem: This may seem like a surprising result. Despite sensitivity and specificty values around 90%, it turns out a positive test result only indicates a less than 10% chance of actually having the disease. Keep in mind that many ideas in probability and statistics can be highly counterintuitive. It's important to be very precise with statements and calculations. In each of the following scenarios with given events and , alculate , , , and . An experiment consists of rolling a fair die two times. Let be the event that the sum is even, and let be the event that the second roll is higher than the first. So , , and . Finally: An experiment consists of flipping a fair coin three times. Let be the event that the first and second flips match. Let be the event that there are at least two heads. So , , and . Finally: 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? Let be the event of testing positive and the event of having the disease. Then the prevalence is given as 3.2%, or 0.032. The sensitivity is , and the specificity is . So, according to Bayes' Theorem: For a patient who receives a negative test, what is the probability they do not have the disease? " }, { "id": "def-conditional-probability", @@ -259,7 +259,7 @@ var ptx_lunr_docs = [ "type": "Example", "number": "1.3.2", "title": "", - "body": " An experiment consists of rolling a fair 6-sided die two times. Let be the event that the sum of the rolls is at least 10. To find , we note that , which has 6 elements. Since , we have . Let 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 , . Also, , so . Finally: " + "body": " An experiment consists of rolling a fair 6-sided die two times. Let be the event that the sum of the rolls is at least 10. To find , we note that , which has 6 elements. Since , we have . Let 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 , . Also, , so . Finally: Before the experiment, we would have said there was only a chance that the sum of the rolls is at least 10. However, with the additional knowledge of seeing the first roll of 6, we find the probability of a sum of at least 10 to be , substantially more likely than before. " }, { "id": "def-sensitivity-specificity", @@ -295,16 +295,25 @@ var ptx_lunr_docs = [ "type": "Paragraph (with a defined term)", "number": "", "title": "", - "body": "prior posterior prevalence " + "body": "prior posterior " }, { "id": "subsec-diagnostic-testing-11", "level": "2", "url": "sec-Conditional-Probability.html#subsec-diagnostic-testing-11", + "type": "Paragraph (with a defined term)", + "number": "", + "title": "", + "body": "prevalence " +}, +{ + "id": "subsec-diagnostic-testing-12", + "level": "2", + "url": "sec-Conditional-Probability.html#subsec-diagnostic-testing-12", "type": "Example", "number": "1.3.6", "title": "", - "body": " 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 be the event of testing positive and the event of having the disease. Then the prevalence is given as 1%, or 0.01. The sensitivity is , and the specificity is . So, according to Bayes' Theorem: " + "body": " 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 be the event of testing positive and the event of having the disease. Then the prevalence is given as 1%, or 0.01. The sensitivity is , and the specificity is . So, according to Bayes' Theorem: This may seem like a surprising result. Despite sensitivity and specificty values around 90%, it turns out a positive test result only indicates a less than 10% chance of actually having the disease. Keep in mind that many ideas in probability and statistics can be highly counterintuitive. It's important to be very precise with statements and calculations. " }, { "id": "exercises-Conditional-Probability-1-2", @@ -313,7 +322,7 @@ var ptx_lunr_docs = [ "type": "Exercise", "number": "1.3.3.1", "title": "", - "body": " An experiment consists of rolling a fair die two times. Let be the event that the sum is even, and let be the event that the second roll is higher than the first. " + "body": " An experiment consists of rolling a fair die two times. Let be the event that the sum is even, and let be the event that the second roll is higher than the first. So , , and . Finally: " }, { "id": "exercises-Conditional-Probability-1-3", @@ -322,7 +331,7 @@ var ptx_lunr_docs = [ "type": "Exercise", "number": "1.3.3.2", "title": "", - "body": " An experiment consists of flipping a fair coin three times. Let be the event that the first and second flips match. Let be the event that there are at least two heads. " + "body": " An experiment consists of flipping a fair coin three times. Let be the event that the first and second flips match. Let be the event that there are at least two heads. So , , and . Finally: " }, { "id": "exercises-Conditional-Probability-2", @@ -331,7 +340,7 @@ var ptx_lunr_docs = [ "type": "Exercise", "number": "1.3.3.3", "title": "", - "body": " 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 " + "body": " 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? Let be the event of testing positive and the event of having the disease. Then the prevalence is given as 3.2%, or 0.032. The sensitivity is , and the specificity is . So, according to Bayes' Theorem: For a patient who receives a negative test, what is the probability they do not have the disease? " }, { "id": "sec-Independent-Events", @@ -340,7 +349,7 @@ var ptx_lunr_docs = [ "type": "Section", "number": "1.4", "title": "Independent Events", - "body": " 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 are independent if . The equation very concretely says: knowledge that the event has occurred does not change our understanding of . Assuming , this is equivalent to , since: 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 that the sum of the rolls is at least 10 and that the first roll is a 6, and we found that , so and are not independent. Now consider the event that the sum of the rolls is 7, which sounds very similar to the event . We have: So, even though the descriptions of events and are very similar, the event is independent with , while is not. An experiment consists of rolling a fair die two times. Let be the event that the sum is even, and let be the event that the second roll is higher than the first. Are and independent? An experiment consists of flipping a fair coin three times. Let be the event that the first and second flips match. Let be the event that there are at least two heads. Are and independent? Let and be events in the sample space . Create a probability distribution for so that are independent. " + "body": " 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 are independent if . The equation very concretely says: knowledge that the event has occurred does not change our understanding of . Assuming , this is equivalent to , since: 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 that the sum of the rolls is at least 10 and that the first roll is a 6, and we found that , so and are not independent. Now consider the event that the sum of the rolls is 7, which sounds very similar to the event . We have: So, even though the descriptions of events and are very similar, the event is independent with , while is not. An experiment consists of rolling a fair die two times. Let be the event that the sum is even, and let be the event that the second roll is higher than the first. Are and independent? So , , and . Finally: so and are not independent. An experiment consists of flipping a fair coin three times. Let be the event that the first and second flips match. Let be the event that there are at least two heads. Are and independent? So , , and . Finally: so and are independent. Let and be events in the sample space . Create a probability distribution for so that are independent. Example Distribution 1 0.1 2 0.2 3 0.2 4 0.1 5 0.1 6 0.3 Now , , and so and are independent. " }, { "id": "def-independent-events", @@ -367,7 +376,7 @@ var ptx_lunr_docs = [ "type": "Exercise", "number": "1.4.1", "title": "", - "body": " An experiment consists of rolling a fair die two times. Let be the event that the sum is even, and let be the event that the second roll is higher than the first. Are and independent? " + "body": " An experiment consists of rolling a fair die two times. Let be the event that the sum is even, and let be the event that the second roll is higher than the first. Are and independent? So , , and . Finally: so and are not independent. " }, { "id": "exercises-Independent-Events-2", @@ -376,7 +385,7 @@ var ptx_lunr_docs = [ "type": "Exercise", "number": "1.4.2", "title": "", - "body": " An experiment consists of flipping a fair coin three times. Let be the event that the first and second flips match. Let be the event that there are at least two heads. Are and independent? " + "body": " An experiment consists of flipping a fair coin three times. Let be the event that the first and second flips match. Let be the event that there are at least two heads. Are and independent? So , , and . Finally: so and are independent. " }, { "id": "exercises-Independent-Events-3", @@ -385,7 +394,7 @@ var ptx_lunr_docs = [ "type": "Exercise", "number": "1.4.3", "title": "", - "body": " Let and be events in the sample space . Create a probability distribution for so that are independent. " + "body": " Let and be events in the sample space . Create a probability distribution for so that are independent. Example Distribution 1 0.1 2 0.2 3 0.2 4 0.1 5 0.1 6 0.3 Now , , and so and are independent. " }, { "id": "sec-Discrete-RVs", diff --git a/sec-Conditional-Probability.html b/sec-Conditional-Probability.html index d91f5dd..3020b71 100755 --- a/sec-Conditional-Probability.html +++ b/sec-Conditional-Probability.html @@ -295,6 +295,8 @@ eBookConfig.enable_chatcodes = false;

Subsection 1.3.1 Conditional Probability

+
Sometimes events can interact with each other. We would like to have the language to talk about a scenario in which evidence that one event has occurred can alter our understanding of the probability of another event occurring. We would also like to develop the mathematical tools to quantify exactly how much that probability changes. +

Definition 1.3.1.

@@ -325,6 +327,7 @@ eBookConfig.enable_chatcodes = false; \Pr(A \mid B) = \frac{\Pr(A\cap B)}{\Pr(B)} = \frac{1/12}{1/6} = \frac{1}{2} \end{gather*} +
Before the experiment, we would have said there was only a \(\frac{1}{6}\) chance that the sum of the rolls is at least 10. However, with the additional knowledge of seeing the first roll of 6, we find the probability of a sum of at least 10 to be \(\frac{1}{2}\text{,}\) substantially more likely than before.

@@ -372,12 +375,12 @@ eBookConfig.enable_chatcodes = false;
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:
-\begin{align} -\Pr(P) \amp = \Pr(P\cap D) + \Pr(P\cap D^c) \tag{1.3.1}\\ -\amp = \Pr(P\mid D)\Pr(D) + \Pr(P \mid D^c)\Pr(D^c) \tag{1.3.2}\\ -\amp = \Pr(P\mid D)\Pr(D) + (1 - \Pr(P^c \mid D^c))\Pr(D^c) \tag{1.3.3}\\ -\amp = (\text{sensitivity})\Pr(D) + (1 - \text{ specificity})\Pr(D^c) \tag{1.3.4} -\end{align} +\begin{align*} +\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) +\end{align*}
We can take this breakdown of \(\Pr(P)\) and write a new version of Bayesโ€™ Theorem:
@@ -393,28 +396,31 @@ eBookConfig.enable_chatcodes = false; -
Weโ€™re still missing a crucial piece of information: \(\Pr(D)\text{,}\) 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 diseaseโ€”i.e., the proportion of the population who have the diseaseโ€”might 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. +
Weโ€™re still missing a crucial piece of information: \(\Pr(D)\text{,}\) 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 diseaseโ€”i.e., the proportion of the population who have the diseaseโ€”might 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. (Complicating the issue further, the developers of diagnostic tests often publish two or even more sets of sensitivity and specificity values, depending on whether a patient is already showing certain symptoms.) +
+

Example 1.3.6.

-
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? +
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?
-
Solution.
-
+
Solution.
+
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\text{,}\) and the specificity is \(\Pr(P^c\mid D^c) = 0.91\text{.}\) So, according to Bayesโ€™ Theorem:
-
+
\begin{align*} \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 \end{align*}
- +
This may seem like a surprising result. Despite sensitivity and specificty values around 90%, it turns out a positive test result only indicates a less than 10% chance of actually having the disease. Keep in mind that many ideas in probability and statistics can be highly counterintuitive. Itโ€™s important to be very precise with statements and calculations.
+
- +
-

+

Exercises 1.3.3 Exercises

@@ -425,9 +431,55 @@ eBookConfig.enable_chatcodes = false;
1.
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.
+
Answer.
+
+
+\begin{align*} +A = \{ \amp (1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (2, 6), \\ +\amp (3, 1), (3, 3), (3, 5), (4, 2), (4, 4), (4, 6), \\ +\amp (5, 1), (5, 3), (5, 5), (6, 2), (6, 4), (6, 6)\} \\ +B = \{ \amp (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), \\ +\amp (2, 3), (2, 4), (2, 5), (2, 6), \\ +\amp (3, 4), (3, 5), (3, 6), \\ +\amp (4, 5), (4, 6), \\ +\amp (5, 6)\} \\ +A \cap B = \{ \amp (1, 3), (1, 5), (2, 4), (2, 6), (3, 5), (4, 6)\} +\end{align*} +
+
So \(\Pr(A) = \frac{18}{36} = \frac{1}{2}\text{,}\) \(\Pr(B) = \frac{15}{36} = \frac{5}{12}\text{,}\) and \(\Pr(A\cap B) = \frac{6}{36} = \frac{1}{6}\text{.}\) Finally:
+
+\begin{align*} +\Pr(A \mid B) \amp = \frac{\Pr(A\cap B)}{\Pr(B)} = \frac{6/36}{15/36} = \frac{6}{15} = \frac{2}{5} \\ +\Pr(B \mid A) \amp = \frac{\Pr(B\cap A)}{\Pr(A)} = \frac{6/36}{18/36} = \frac{6}{18} = \frac{1}{3} +\end{align*} +
+ +
+ +
2.
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.
+
Answer.
+
+
+\begin{align*} +A \amp = \{ HHH, HHT, TTH, TTT \} \\ +B \amp = \{ HHH, HHT, HTH, THH \} \\ +A\cap B \amp = \{HHH, HHT\} +\end{align*} +
+
So \(\Pr(A) = \frac{4}{8} = \frac{1}{2}\text{,}\) \(\Pr(B) = \frac{4}{8} = \frac{1}{2}\text{,}\) and \(\Pr(A\cap B) = \frac{2}{8} = \frac{1}{4}\text{.}\) Finally:
+
+\begin{align*} +\Pr(A \mid B) \amp = \frac{\Pr(A\cap B)}{\Pr(B)} = \frac{2/8}{4/8} = \frac{2}{4} = \frac{1}{2} \\ +\Pr(B \mid A) \amp = \frac{\Pr(B\cap A)}{\Pr(A)} = \frac{2/8}{4/8} = \frac{2}{4} = \frac{1}{2} +\end{align*} +
+ +
+ +
@@ -439,7 +491,16 @@ eBookConfig.enable_chatcodes = false;
For a patient who receives a positive test, what is the probability they have the disease?
Answer.
-
TODO +
+
Let \(P\) be the event of testing positive and \(D\) the event of having the disease. Then the prevalence \(\Pr(D)\) is given as 3.2%, or 0.032. The sensitivity is \(\Pr(P\mid D) = 0.65\text{,}\) and the specificity is \(\Pr(P^c\mid D^c) = 0.999\text{.}\) So, according to Bayesโ€™ Theorem:
+
+\begin{align*} +\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.65)(0.032)}{(0.65)(0.032) + (1 - 0.999)(1 - 0.032)} \\ +\amp \approx 0.96 +\end{align*} +
+
@@ -447,7 +508,15 @@ eBookConfig.enable_chatcodes = false;
For a patient who receives a negative test, what is the probability they do not have the disease?
Answer.
-
TODO +
+
+\begin{align*} +\Pr(D^c\mid P^c) \amp = \frac{\Pr(P^c\mid D^c)\Pr(D^c)}{\Pr(P^c\mid D^c)\Pr(D^c) + (1 - \Pr(P\mid D))\Pr(D)} \\ +\amp = \frac{(0.999)(1 - 0.032)}{(0.999)(1 - 0.032) + (1 - 0.65)(0.032)} \\ +\amp \approx 0.99 +\end{align*} +
+
diff --git a/sec-Independent-Events.html b/sec-Independent-Events.html index 3bc359a..4fd50f6 100755 --- a/sec-Independent-Events.html +++ b/sec-Independent-Events.html @@ -335,12 +335,100 @@ B\cap C \amp = \{(6, 1)\} \\

1.

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?
+
Answer.
+
+
+\begin{align*} +A = \{ \amp (1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (2, 6), \\ +\amp (3, 1), (3, 3), (3, 5), (4, 2), (4, 4), (4, 6), \\ +\amp (5, 1), (5, 3), (5, 5), (6, 2), (6, 4), (6, 6)\} \\ +B = \{ \amp (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), \\ +\amp (2, 3), (2, 4), (2, 5), (2, 6), \\ +\amp (3, 4), (3, 5), (3, 6), \\ +\amp (4, 5), (4, 6), \\ +\amp (5, 6)\} \\ +A \cap B = \{ \amp (1, 3), (1, 5), (2, 4), (2, 6), (3, 5), (4, 6)\} +\end{align*} +
+
So \(\Pr(A) = \frac{18}{36} = \frac{1}{2}\text{,}\) \(\Pr(B) = \frac{15}{36} = \frac{5}{12}\text{,}\) and \(\Pr(A\cap B) = \frac{6}{36} = \frac{1}{6}\text{.}\) Finally:
+
+\begin{align*} +\Pr(A \mid B) \amp = \frac{\Pr(A\cap B)}{\Pr(B)} = \frac{6/36}{15/36} = \frac{6}{15} = \frac{2}{5} \neq \Pr(A), +\end{align*} +
+
so \(A\) and \(B\) are not independent.
+ +
+ +

2.

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?
+
Answer.
+
+
+\begin{align*} +A \amp = \{ HHH, HHT, TTH, TTT \} \\ +B \amp = \{ HHH, HHT, HTH, THH \} \\ +A\cap B \amp = \{HHH, HHT\} +\end{align*} +
+
So \(\Pr(A) = \frac{4}{8} = \frac{1}{2}\text{,}\) \(\Pr(B) = \frac{4}{8} = \frac{1}{2}\text{,}\) and \(\Pr(A\cap B) = \frac{2}{8} = \frac{1}{4}\text{.}\) Finally:
+
+\begin{align*} +\Pr(A \mid B) \amp = \frac{\Pr(A\cap B)}{\Pr(B)} = \frac{2/8}{4/8} = \frac{2}{4} = \frac{1}{2} = \Pr(A), +\end{align*} +
+
so \(A\) and \(B\) are independent.
+ +
+ +

3.

Let \(A = \{1, 2, 3\}\) and \(B = \{3, 4, 5\}\) be events in the sample space \(\Omega = \{1, 2, 3, 4, 5, 6\}\text{.}\) Create a probability distribution for \(\Omega\) so that \(A, B\) are independent.
+
Answer.
+
Table 1.4.3. Example Distribution
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
\(x\)\(\Pr(x)\)
10.1
20.2
30.2
40.1
50.1
60.3
+
Now \(\Pr(A) = 0.5\text{,}\) \(\Pr(B) = 0.4\text{,}\) and
+
+\begin{gather*} +\Pr(A\cap B) = 0.2 = (0.5)(0.4) = \Pr(A)\Pr(B), +\end{gather*} +
+
so \(A\) and \(B\) are independent.
+ +
+ +