0
$\begingroup$

I measure the probability of getting heads on a coin flip, $p$, from $n$ trials. As I understand it (source), the variance of this measurement is $\sigma^2 = np(1-p)$.

The part I'm struggling to understand is how this would apply to a sample that has 0% or 100% heads. In these examples, if I put this value into the formula we would get $\sigma^2 = 0$, which wouldn't make sense [as a representation of my confidence in the measurement].

One possibility that occurred to me is that in the derivation of this formula, $p$ is the population expected value. So for a perfect coin that would mean the variance would be $\sigma^2=0.25n$. But, if that were the case, how would one apply this to an unknown expected value?

Edit: As in this answer, it has been pointed out that this formula for the variance does make sense as a representation of the spread of my sample. How then would I represent a level of confidence in my measurement?

$\endgroup$
8
  • 1
    $\begingroup$ Why doesn't that make sense? If only one value is possible, then the variance is $0$. $\endgroup$
    – lulu
    Commented Jul 1 at 19:21
  • $\begingroup$ As mike1994 helpfully pointed out, the variance of the sample is clearly zero. I think what I find confusing is more about how to represent a level of confidence in my measurement. $\endgroup$
    – Xorgon
    Commented Jul 1 at 19:23
  • $\begingroup$ Not following. If you have a prior as to $p$, if say, you know $p$ is chosen from some distribution, then you can use the sample data to update your estimate of $p$. Otherwise, if you just plan to use the sample probability as an estimator of the true $p$, then the answer is $0$. $\endgroup$
    – lulu
    Commented Jul 1 at 19:25
  • 1
    $\begingroup$ Off topic: it is $np(1-p)$ not $np(p-1)$. $\endgroup$
    – fGDu94
    Commented Jul 1 at 19:31
  • 2
    $\begingroup$ Of course, you can test any given $p$. That is, you could ask for the probability that, if the true probability is $p$, you get the observed results. It's not clear what you'd want to do with that, though, without some prior on the possible $p$. But, yes, you could "rule out" some choices for $p$, up to a confidence level of course. $\endgroup$
    – lulu
    Commented Jul 1 at 19:51

2 Answers 2

3
$\begingroup$

Variance is a measure of how spread out the distribution of results in an experiment is. If the coin is always landing on heads, or always landing on tails, then every experiment has the same result, so the "spread" or "width" of the distribution is zero, exactly as the formula predicts.

$\endgroup$
1
  • $\begingroup$ That makes sense, thank you! In that context then, how would I better represent a level of confidence in my measurement? In this example, if I got three heads in a row, I wouldn't confidently say that the coin only gives heads. $\endgroup$
    – Xorgon
    Commented Jul 1 at 19:22
2
$\begingroup$

Maybe you need to take a Bayesian perspective and encode your beliefs in a prior. I think this post provides a good example which uses conjugate priors. If you chose $\beta$ and $\alpha$ as non-zero, variance of your posterior will not collapse to zero too.

Edit: One should note that from this perspective, the uncertainty here is about the parameter $p$ and maybe this is not what you had in mind when speaking about confidence in measurement. Apologies if I misunderstood you.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .