Solution (source code)

= Solution

\b[A fixed proposal-count budget does not <bias> the accepted values.] For each trial, acceptance has probability $a$, and conditional on acceptance its label has law $p$ independently of the other trials. Conditional on the full accept/reject pattern among the first $N^*$ proposals, the successful labels are <independent> with common law $p$. Therefore $K\sim\operatorname{Binomial}(N^*,a)$, and conditional on $K=k$, the $k$ retained samples are <independent> draws from $p$. When $K=0$ there is simply no sample. This concerns a budget fixed independently of the proposal values; it does not assert that an empirical average is defined on an empty output.