14  Homework: Bootstrap

Download this assignment — unzip it, open homework-bootstrap.qmd in Positron, and answer inside the answer blocks.

What Changes If You Change This

The derivation had two stages, and each one needed something to be true. Stage 1 needed every roll sequence to be equally likely, so that adding them up was counting them. Stage 2 needed every response sequence with the same sum to carry the same probability, so that adding those was counting too. Change the setup and you can ask which of those two survives.

ExerciseThe Only Die You Have Is A d12

Ten voters, and no ten-sided die in the drawer. So you roll a twelve-sided one and agree that an \(11\) or a \(12\) counts as a \(10\). Every call is still made the same way, independently of the ones before it.

Which of the two stages still works, and what happens to the answer?

Stage 1 stops being counting. There are twelve equally likely rolls but only ten people, and the tenth of them owns three of those rolls, so the call sequences under one response sequence no longer weigh the same as each other. You can’t get their total by counting them; you have to add up their weights.

But adding up those weights still gives you a probability that depends only on what you heard, one factor per call. The factor for ‘Yes’ is the share of the twelve rolls that reach somebody who’d say Yes — so if the tenth voter is a Yes it’s \((m_1 + 2)/12\), and if not it’s \(m_1/12\). Call that \(\theta_1\) and everything downstream is untouched: rows with the same sum still match each other, stage 2 is still counting, and the answer is still \(\binom{n}{s}\theta_1^s\theta_0^{n-s}\).

So the machinery changed and the shape of the answer didn’t. What moved is which number \(\theta_1\) is. You get a perfectly good estimate of the frequency in a population where the tenth voter has been counted three times, and nothing in the data tells you that’s what you did.

ExerciseA Third Answer

Now suppose people can say Yes, No, or Undecided, and you’re still after the number of Yeses.

Which of the two stages still works?

Stage 1 is fine. The die is unloaded, every roll sequence is still equally likely, and the count under a response sequence is still one factor per call — there are just three kinds of factor now instead of two.

Stage 2 breaks, and it’s worth seeing exactly where. Hearing ‘Yes,No,No’ and hearing ‘Yes,Undecided,Undecided’ both give you one Yes, so they belong to the same row of the collapsed table. Their probabilities are \(\theta_1\theta_0^2\) and \(\theta_1\theta_{\text{u}}^2\), which are not the same number. The summand isn’t constant on the group any more, so adding is no longer counting.

The fix is to group by more: not by how many Yeses, but by how many of each. Then the summand is constant again and you’re counting once more — a different count, because there are more ways to arrange three symbols than two.

And if all you wanted was the number of Yeses, there’s a shorter way. Call Undecided a No. Every call is then a Yes or a not-Yes, which is the problem you already solved, and the number of Yeses is Binomial with \(\theta_1\) the frequency of Yeses in the population. What you lose is everything the third answer was telling you.

Appendix: Throwing Rolls Away

The d12 has a fix, and it’s the obvious one. Instead of counting an \(11\) or a \(12\) as a ten, roll again. Keep rolling until you get a number you can use.

Every roll you keep is equally likely to be any of the ten, because the rule for throwing one away treats all ten usable faces alike — an \(11\) and a \(12\) go in the bin no matter who you were about to call. So stage 1 is counting again, \(\theta_1\) is the population frequency again, and the answer is the one we derived.

You’ve paid for it in rolls rather than in bias: a sixth of them go in the bin. That trade has a name — rejection sampling — and it’s how you draw from a distribution you want using a tool that gives you a different one. Keep what fits, discard what doesn’t, and the ones you keep come out right.