diff --git a/.DS_Store b/.DS_Store
index 5e131bb..d0cb6b4 100644
Binary files a/.DS_Store and b/.DS_Store differ
diff --git a/Data/SimulatedDataGroupProjectDynamics.ipynb b/Data/SimulatedDataGroupProjectDynamics.ipynb
index e6485e2..51802ef 100644
--- a/Data/SimulatedDataGroupProjectDynamics.ipynb
+++ b/Data/SimulatedDataGroupProjectDynamics.ipynb
@@ -195,7 +195,7 @@
},
{
"cell_type": "code",
- "execution_count": 19,
+ "execution_count": 7,
"metadata": {},
"outputs": [
{
@@ -216,7 +216,7 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 8,
"metadata": {},
"outputs": [
{
@@ -225,10 +225,10 @@
"$\\hat{y} = 4.712 +0.227 x_{1}$"
],
"text/plain": [
- "
Which is which, I cannot reveal to you.
Home with chance 7 or 73.
It depends on your choice and fate's decree.
Independent but certainty you lack.
Take now two draws before I turn thee back.*
+
+1. What is the probability the pilgrim opens a door that leads home on the first draw?
+
+2. The troll, old in his years, has seen 200 million other pilgrims pass through. Each has chosen a door randomly to start and then the other door second if the first didn't take them home. Finish filling in the table below with the expected counts.
+
+| | Door 7 second | Door 73 second | Home after first |
+|-------------------|---------------|----------------|------------------|
+| Door 7 first | 0 million | | |
+| Door 73 first | | 0 million | 73 million |
+
+3. If the first draw does not lead home, what is the probability the pilgrim opened the door that leads home with chance 7%? What is the probability the pilgrim opened the door that leads home with chance 73%?
+
+4. If the first draw does not lead home, should the pilgrim open a different door on the next draw or try the same door again? Or does it not matter?
+
+5. What is the probability that the pilgrim remains in exile?
+
+6. The pilgrim, alarmed by the risk of remaining in exile, bargains with the troll to replace the two doors with one 40% chance door. This averages the chances. Is this wise?
+
+```{exercise-end}
+```
+
+```{exercise-start}
+:label: bayesReview
+```
+
+Suppose that a product is sold on Amazon and it has either high quality ($H$) or low quality ($L$). We observe a single product review, which can either be good or bad. Reviewers can be of two types: fake or truth-teller. A fake reviewer always leaves a positive review, regardless of the product quality. A truth-teller reviewer leaves a positive review when the product is high quality and leaves a negative review if the product is low quality.
+
+Assume $\mathbb{P}(H) = \frac{1}{2}$ and that each type of reviewer is equally likely.
+
+- a.) What is $\mathbb{P}(\text{good review})$?
+- b.) What is $\mathbb{P}(\text{good review} \mid H)$?
+- c.) What is $\mathbb{P}(H \mid \text{good review})$?
+- d.) Draw a probability tree that summarizes the probabilities based on product quality, review type, and reviewer type.
+- e.) Are the events of "high quality product" and "good review" independent or dependent? Explain.
+- f.) Suppose the truth-teller is replaced by a joker who leaves a negative review if the product is high quality and a positive review if the product is low quality. What is $\mathbb{P}(H \mid \text{bad review})$?
+
+```{exercise-end}
+```
\ No newline at end of file
diff --git a/book/_build/html/_sources/probability.md b/book/_build/html/_sources/probability.md
index d34670d..f9475d2 100644
--- a/book/_build/html/_sources/probability.md
+++ b/book/_build/html/_sources/probability.md
@@ -333,8 +333,7 @@ $$ \frac{n!}{k!(n-k)!} p^k (1-p)^{n-k}.$$
Think of $p^k (1-p)^{n-k}$ as the probability of a sequence of $k$ heads followed by $n-k$ tails. The binomial coefficient in front then adjusts that probability to allow for all of the other ways to get $k$ heads–$n-k$ tails followed by $k$ heads for example. This only works for coin flips or similar processes where the individual trials are independent and the probability of a heads or some substitutable event of interest is the same from one trial to the next. These trial outcomes are said to be *independent and identically distributed*, or *iid*.
-**Example**
-A trick coin comes up heads with probability $p = \frac{2}{3}$. Out of four flips, what is the probability of two heads?
+**Example**: A trick coin comes up heads with probability $p = \frac{2}{3}$. Out of four flips, what is the probability of two heads?
```{dropdown} Two heads
@@ -355,6 +354,7 @@ $$ 4\cdot \frac{8}{27}\cdot\frac{1}{3} + \frac{16}{81} = \frac{48}{81} = \frac{1
```
+
## Exercises
```{exercise-start}
diff --git a/book/_build/html/bayes.html b/book/_build/html/bayes.html
index a382476..9213230 100644
--- a/book/_build/html/bayes.html
+++ b/book/_build/html/bayes.html
@@ -426,6 +426,7 @@ Contents
+Bayes Theorem with TreesFig. 42 can help us find the probability that a word starts with \(Q\), given that the second letter is \(U\). Maybe that’s helpful if you’re on Wheel of Fortune.
\(\mathbb{P}(\cdot U)\) is found by summing the probability for each of the paths that terminate in \(U\). This is \(\frac{1}{26} + \frac{25}{676}\).
+\(\mathbb{P}(\cdot U)\) is found by summing the probability for each of the paths that terminate in \(U\). This is \(\frac{1}{26} + \frac{25}{676}\),
+
A box contains two tickets, labeled \(H\) or \(T\). There is a 25% chance the box contains two \(H\)s. There is a 25% chance the box contains two \(T\)s. There is a 50% chance the box contains one \(H\) and one \(T\).
+What is the chance of drawing an \(H\)?
Suppose you draw an \(H\). What is the chance that the box contained two \(T\)s?
Suppose you draw an \(H\). What is the chance that the box contained two \(H\)s?
After replacing the \(H\), what is the chance of selecting another \(H\)?
+
Consider a rare disease that affects 1 in 10,000 people in a population. A medical test for the disease has a 99% chance of correctly identifying a diseased person (true positive) and a 99% chance of correctly identifying a non-diseased person (true negative).
+If a person from this population tests positive for the disease, what is the probability that they actually have the disease?
+Given:
++
You’re playing basketball at the park when your team picks up an unknown player. The unknown player is equally likely to be a scrub or a baller. A baller makes 90% of their shots and each shot is independent. A scrub makes 10% of their shots and each shot is independent.
+What is the chance an unknown makes their first shot?
What is the chance that the player makes their second shot if they made their first?
Are the first and second shot outcomes independent from your perspective?
+
A pilgrim, traveling home, is wandering through a strange land when a troll appears:
+++Woe, to pass, pilgrim choose of these doors two.
+
Which is which, I cannot reveal to you.
Home with chance 7 or 73.
It depends on your choice and fate’s decree.
Independent but certainty you lack.
Take now two draws before I turn thee back.
What is the probability the pilgrim opens a door that leads home on the first draw?
The troll, old in his years, has seen 200 million other pilgrims pass through. Each has chosen a door randomly to start and then the other door second if the first didn’t take them home. Finish filling in the table below with the expected counts.
+ | Door 7 second |
+Door 73 second |
+Home after first |
+
---|---|---|---|
Door 7 first |
+0 million |
++ | + |
Door 73 first |
++ | 0 million |
+73 million |
+
If the first draw does not lead home, what is the probability the pilgrim opened the door that leads home with chance 7%? What is the probability the pilgrim opened the door that leads home with chance 73%?
If the first draw does not lead home, should the pilgrim open a different door on the next draw or try the same door again? Or does it not matter?
What is the probability that the pilgrim remains in exile?
The pilgrim, alarmed by the risk of remaining in exile, bargains with the troll to replace the two doors with one 40% chance door. This averages the chances. Is this wise?
+
Suppose that a product is sold on Amazon and it has either high quality (\(H\)) or low quality (\(L\)). We observe a single product review, which can either be good or bad. Reviewers can be of two types: fake or truth-teller. A fake reviewer always leaves a positive review, regardless of the product quality. A truth-teller reviewer leaves a positive review when the product is high quality and leaves a negative review if the product is low quality.
+Assume \(\mathbb{P}(H) = \frac{1}{2}\) and that each type of reviewer is equally likely.
+a.) What is \(\mathbb{P}(\text{good review})\)?
b.) What is \(\mathbb{P}(\text{good review} \mid H)\)?
c.) What is \(\mathbb{P}(H \mid \text{good review})\)?
d.) Draw a probability tree that summarizes the probabilities based on product quality, review type, and reviewer type.
e.) Are the events of “high quality product” and “good review” independent or dependent? Explain.
f.) Suppose the truth-teller is replaced by a joker who leaves a negative review if the product is high quality and a positive review if the product is low quality. What is \(\mathbb{P}(H \mid \text{bad review})\)?