Skip to content

Commit 53bd65a

Browse files
jstacclaude
andcommitted
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>
1 parent 556e31a commit 53bd65a

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

lectures/prob_meaning.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ So the posterior is also a beta distribution — a consequence of the beta prior
350350
```{exercise}
351351
:label: pm_ex2
352352
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\}$.
354354
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.
356356
357357
**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.
358358
@@ -372,18 +372,13 @@ So the posterior is also a beta distribution — a consequence of the beta prior
372372
:class: dropdown
373373
```
374374

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
380376

381377
$$
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}
384379
$$
385380

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:
387382

388383
The prior distribution is
389384

0 commit comments

Comments
 (0)