Chapter 1 answers.
This commit is contained in:
@@ -4,6 +4,12 @@
|
||||
<subsection xml:id="subsec-conditional-probability">
|
||||
<title>Conditional Probability</title>
|
||||
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
|
||||
<definition xml:id="def-conditional-probability">
|
||||
<statement>
|
||||
<p>
|
||||
@@ -38,6 +44,8 @@
|
||||
<md>
|
||||
<mrow>\Pr(A \mid B) = \frac{\Pr(A\cap B)}{\Pr(B)} = \frac{1/12}{1/6} = \frac{1}{2}</mrow>
|
||||
</md>
|
||||
Before the experiment, we would have said there was only a <m>\frac{1}{6}</m> 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 <m>\frac{1}{2}</m>, substantially more likely than before.
|
||||
</p>
|
||||
</statement>
|
||||
</example>
|
||||
@@ -102,7 +110,7 @@
|
||||
</md>
|
||||
The total <m>\Pr(P)</m> 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:
|
||||
<md number="yes">
|
||||
<md>
|
||||
<mrow> \Pr(P) \amp = \Pr(P\cap D) + \Pr(P\cap D^c) </mrow>
|
||||
<mrow> \amp = \Pr(P\mid D)\Pr(D) + \Pr(P \mid D^c)\Pr(D^c) </mrow>
|
||||
<mrow> \amp = \Pr(P\mid D)\Pr(D) + (1 - \Pr(P^c \mid D^c))\Pr(D^c) </mrow>
|
||||
@@ -127,11 +135,15 @@
|
||||
We're still missing a crucial piece of information: <m>\Pr(D)</m>, the probability (not conditioned on any evidence) that the patient has the disease.
|
||||
This is often referred to as the <term>prior</term>, 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 <term>posterior</term> (i.e., after taking evidence into account).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
There isn't always one single number that's reasonable to use as the prior probability.
|
||||
For example, in a diagnostic testing situation, the <term>prevalence</term> of the disease<mdash/>i.e., the proportion of the population who have the disease<mdash/>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.)
|
||||
</p>
|
||||
|
||||
<example>
|
||||
@@ -153,6 +165,10 @@
|
||||
<mrow> \amp = \frac{(0.9)(0.01)}{(0.9)(0.01) + (1 - 0.91)(1 - 0.01)} </mrow>
|
||||
<mrow> \amp \approx 0.092 </mrow>
|
||||
</md>
|
||||
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.
|
||||
</p>
|
||||
</solution>
|
||||
</example>
|
||||
@@ -172,6 +188,29 @@
|
||||
Let <m>A</m> be the event that the sum is even, and let <m>B</m> be the event that the second roll is higher than the first.
|
||||
</p>
|
||||
</statement>
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
<md>
|
||||
<mrow> A = \{ \amp (1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (2, 6), </mrow>
|
||||
<mrow> \amp (3, 1), (3, 3), (3, 5), (4, 2), (4, 4), (4, 6), </mrow>
|
||||
<mrow> \amp (5, 1), (5, 3), (5, 5), (6, 2), (6, 4), (6, 6)\} </mrow>
|
||||
<mrow> B = \{ \amp (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), </mrow>
|
||||
<mrow> \amp (2, 3), (2, 4), (2, 5), (2, 6), </mrow>
|
||||
<mrow> \amp (3, 4), (3, 5), (3, 6), </mrow>
|
||||
<mrow> \amp (4, 5), (4, 6), </mrow>
|
||||
<mrow> \amp (5, 6)\} </mrow>
|
||||
<mrow> A \cap B = \{ \amp (1, 3), (1, 5), (2, 4), (2, 6), (3, 5), (4, 6)\} </mrow>
|
||||
</md>
|
||||
So <m>\Pr(A) = \frac{18}{36} = \frac{1}{2}</m>, <m>\Pr(B) = \frac{15}{36} = \frac{5}{12}</m>, and <m>\Pr(A\cap B) = \frac{6}{36} = \frac{1}{6}</m>.
|
||||
Finally:
|
||||
<md>
|
||||
<mrow> \Pr(A \mid B) \amp = \frac{\Pr(A\cap B)}{\Pr(B)} = \frac{6/36}{15/36} = \frac{6}{15} = \frac{2}{5} </mrow>
|
||||
<mrow> \Pr(B \mid A) \amp = \frac{\Pr(B\cap A)}{\Pr(A)} = \frac{6/36}{18/36} = \frac{6}{18} = \frac{1}{3} </mrow>
|
||||
</md>
|
||||
|
||||
</p>
|
||||
</answer>
|
||||
</exercise>
|
||||
|
||||
<exercise>
|
||||
@@ -182,6 +221,22 @@
|
||||
Let <m>B</m> be the event that there are at least two heads.
|
||||
</p>
|
||||
</statement>
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
<md>
|
||||
<mrow> A \amp = \{ HHH, HHT, TTH, TTT \} </mrow>
|
||||
<mrow> B \amp = \{ HHH, HHT, HTH, THH \} </mrow>
|
||||
<mrow> A\cap B \amp = \{HHH, HHT\} </mrow>
|
||||
</md>
|
||||
So <m>\Pr(A) = \frac{4}{8} = \frac{1}{2}</m>, <m>\Pr(B) = \frac{4}{8} = \frac{1}{2}</m>, and <m>\Pr(A\cap B) = \frac{2}{8} = \frac{1}{4}</m>.
|
||||
Finally:
|
||||
<md>
|
||||
<mrow> \Pr(A \mid B) \amp = \frac{\Pr(A\cap B)}{\Pr(B)} = \frac{2/8}{4/8} = \frac{2}{4} = \frac{1}{2} </mrow>
|
||||
<mrow> \Pr(B \mid A) \amp = \frac{\Pr(B\cap A)}{\Pr(A)} = \frac{2/8}{4/8} = \frac{2}{4} = \frac{1}{2} </mrow>
|
||||
</md>
|
||||
</p>
|
||||
</answer>
|
||||
</exercise>
|
||||
</exercisegroup>
|
||||
|
||||
@@ -204,7 +259,15 @@
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
TODO
|
||||
Let <m>P</m> be the event of testing positive and <m>D</m> the event of having the disease.
|
||||
Then the prevalence <m>\Pr(D)</m> is given as 3.2%, or 0.032.
|
||||
The sensitivity is <m>\Pr(P\mid D) = 0.65</m>, and the specificity is <m>\Pr(P^c\mid D^c) = 0.999</m>.
|
||||
So, according to Bayes' Theorem:
|
||||
<md>
|
||||
<mrow> \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)} </mrow>
|
||||
<mrow> \amp = \frac{(0.65)(0.032)}{(0.65)(0.032) + (1 - 0.999)(1 - 0.032)} </mrow>
|
||||
<mrow> \amp \approx 0.96 </mrow>
|
||||
</md>
|
||||
</p>
|
||||
</answer>
|
||||
</task>
|
||||
@@ -219,10 +282,14 @@
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
TODO
|
||||
<md>
|
||||
<mrow> \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)} </mrow>
|
||||
<mrow> \amp = \frac{(0.999)(1 - 0.032)}{(0.999)(1 - 0.032) + (1 - 0.65)(0.032)} </mrow>
|
||||
<mrow> \amp \approx 0.99 </mrow>
|
||||
</md>
|
||||
</p>
|
||||
</answer>
|
||||
</task>
|
||||
</exercise>
|
||||
</exercises>
|
||||
</section>
|
||||
</section>
|
||||
@@ -56,6 +56,28 @@
|
||||
Are <m>A</m> and <m>B</m> independent?
|
||||
</p>
|
||||
</statement>
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
<md>
|
||||
<mrow> A = \{ \amp (1, 1), (1, 3), (1, 5), (2, 2), (2, 4), (2, 6), </mrow>
|
||||
<mrow> \amp (3, 1), (3, 3), (3, 5), (4, 2), (4, 4), (4, 6), </mrow>
|
||||
<mrow> \amp (5, 1), (5, 3), (5, 5), (6, 2), (6, 4), (6, 6)\} </mrow>
|
||||
<mrow> B = \{ \amp (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), </mrow>
|
||||
<mrow> \amp (2, 3), (2, 4), (2, 5), (2, 6), </mrow>
|
||||
<mrow> \amp (3, 4), (3, 5), (3, 6), </mrow>
|
||||
<mrow> \amp (4, 5), (4, 6), </mrow>
|
||||
<mrow> \amp (5, 6)\} </mrow>
|
||||
<mrow> A \cap B = \{ \amp (1, 3), (1, 5), (2, 4), (2, 6), (3, 5), (4, 6)\} </mrow>
|
||||
</md>
|
||||
So <m>\Pr(A) = \frac{18}{36} = \frac{1}{2}</m>, <m>\Pr(B) = \frac{15}{36} = \frac{5}{12}</m>, and <m>\Pr(A\cap B) = \frac{6}{36} = \frac{1}{6}</m>.
|
||||
Finally:
|
||||
<md>
|
||||
<mrow> \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), </mrow>
|
||||
</md>
|
||||
so <m>A</m> and <m>B</m> are not independent.
|
||||
</p>
|
||||
</answer>
|
||||
</exercise>
|
||||
|
||||
<exercise>
|
||||
@@ -67,6 +89,22 @@
|
||||
Are <m>A</m> and <m>B</m> independent?
|
||||
</p>
|
||||
</statement>
|
||||
|
||||
<answer>
|
||||
<p>
|
||||
<md>
|
||||
<mrow> A \amp = \{ HHH, HHT, TTH, TTT \} </mrow>
|
||||
<mrow> B \amp = \{ HHH, HHT, HTH, THH \} </mrow>
|
||||
<mrow> A\cap B \amp = \{HHH, HHT\} </mrow>
|
||||
</md>
|
||||
So <m>\Pr(A) = \frac{4}{8} = \frac{1}{2}</m>, <m>\Pr(B) = \frac{4}{8} = \frac{1}{2}</m>, and <m>\Pr(A\cap B) = \frac{2}{8} = \frac{1}{4}</m>.
|
||||
Finally:
|
||||
<md>
|
||||
<mrow> \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), </mrow>
|
||||
</md>
|
||||
so <m>A</m> and <m>B</m> are independent.
|
||||
</p>
|
||||
</answer>
|
||||
</exercise>
|
||||
|
||||
<exercise>
|
||||
@@ -76,6 +114,57 @@
|
||||
Create a probability distribution for <m>\Omega</m> so that <m>A, B</m> are independent.
|
||||
</p>
|
||||
</statement>
|
||||
|
||||
<answer>
|
||||
<table>
|
||||
<title>Example Distribution</title>
|
||||
|
||||
<tabular halign="center">
|
||||
<row bottom="minor">
|
||||
<cell><m>x</m></cell>
|
||||
<cell><m>\Pr(x)</m></cell>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<cell>1</cell>
|
||||
<cell>0.1</cell>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<cell>2</cell>
|
||||
<cell>0.2</cell>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<cell>3</cell>
|
||||
<cell>0.2</cell>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<cell>4</cell>
|
||||
<cell>0.1</cell>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<cell>5</cell>
|
||||
<cell>0.1</cell>
|
||||
</row>
|
||||
|
||||
<row>
|
||||
<cell>6</cell>
|
||||
<cell>0.3</cell>
|
||||
</row>
|
||||
</tabular>
|
||||
</table>
|
||||
|
||||
<p>
|
||||
Now <m>\Pr(A) = 0.5</m>, <m>\Pr(B) = 0.4</m>, and
|
||||
<md>
|
||||
<mrow>\Pr(A\cap B) = 0.2 = (0.5)(0.4) = \Pr(A)\Pr(B),</mrow>
|
||||
</md>
|
||||
so <m>A</m> and <m>B</m> are independent.
|
||||
</p>
|
||||
</answer>
|
||||
</exercise>
|
||||
</exercises>
|
||||
</section>
|
||||
</section>
|
||||
Reference in New Issue
Block a user