# unbiased estimator in a random sample

I Have a statistic statement here which I need to decide if it's true or false

Statement: "When the sample size is random, there is no way to get an unbiased estimator for the population average."

I think that the statement above is false since the Horvitz–Thompson estimator may be a counter example, but I'm not really sure.

Suppose the size $N\in\{1,2,3,\ldots\}$ of the sample is a random variable that is independent of the individual randomly chosen observations $X_1,X_2,X_3,\ldots$. Then \begin{align} & \mathbb E \left( \frac 1 N\sum_{n=1}^N X_n \right) = \mathbb E \left( \mathbb E\left( \frac 1 N \sum_{n=1}^N X_n \mid N \right) \right) = \mathbb E\left( \frac 1 N \sum_{n=1}^N \mathbb E(X_n\mid N) \right) \\[12pt] = {} & \mathbb E\left( \frac 1 N N\mathbb E(X_1) \right) = \mathbb E(X_1). \end{align} Thus the same mean in this case is an unbiased estimator of the population mean.
Here's one way: flip a coin (independent of the population) and take a random sample of size either $1$ (if Heads) or $2$ (if Tails). The sample mean is an unbiased estimator of the population average.