You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix exercise pm_ex2 parts (a) and (b) to match their solutions
The question asked for the likelihood of "a sample of length n from
a binomial" but the solution gave the single-flip Bernoulli case.
Reword both the questions and solution headers so parts (a) and (b)
are explicitly about a single coin flip. The general n-step case is
already derived in the lecture text before the exercise.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: lectures/prob_meaning.md
+5-10Lines changed: 5 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -350,9 +350,9 @@ So the posterior is also a beta distribution — a consequence of the beta prior
350
350
```{exercise}
351
351
:label: pm_ex2
352
352
353
-
**a)** Please write down the **likelihood function** for a sample of length $n$ from a binomial distribution with parameter $\theta$.
353
+
**a)** Please write down the **likelihood function** for a single coin flip with outcome $Y \in \{0, 1\}$.
354
354
355
-
**b)** Please write down the **posterior** distribution for $\theta$ after observing one flip of the coin.
355
+
**b)** Please write down the **posterior** distribution for $\theta$ after observing that single flip.
356
356
357
357
**c)** Now pretend that the true value of $\theta = .4$ and that someone who doesn't know this has a beta prior distribution with parameters with $\beta = \alpha = .5$. Please write a Python class to simulate this person's personal posterior distribution for $\theta$ for a _single_ sequence of $n$ draws.
358
358
@@ -372,18 +372,13 @@ So the posterior is also a beta distribution — a consequence of the beta prior
372
372
:class: dropdown
373
373
```
374
374
375
-
**a)** Please write down the **likelihood function** and the **posterior** distribution for $\theta$ after observing one flip of our coin.
376
-
377
-
Suppose the outcome is __Y__.
378
-
379
-
The likelihood function is:
375
+
**a)** The **likelihood function** for a single coin flip with outcome $Y \in \{0, 1\}$ is
380
376
381
377
$$
382
-
L(Y|\theta)= \textrm{Prob}(X = Y | \theta) =
383
-
\theta^Y (1-\theta)^{1-Y}
378
+
L(Y|\theta) = \theta^Y (1-\theta)^{1-Y}
384
379
$$
385
380
386
-
**b)**Please write the **posterior** distribution for $\theta$ after observing one flip of our coin.
381
+
**b)**The **posterior** distribution for $\theta$ after observing that single flip:
0 commit comments