8 out of 10 Cats - Optimal Sample I was watching a lecture earlier by Marcus du Sautoy called: 'Thinking Better with Mathematics.'
Marcus discusses the statistical sample sizes to verify statements about the population. In his own example, he addresses a statement about cat food.
In particular, a cat food brand in the 1970s/80s argued that "8 out of 10 cats preferred this cat food."
The population size (in the UK) at that time was 7 million. But to verify this statement, only a relatively small sample of 246 would be required.
The statement from that video is: For a population of 7 million cats, if we sample 246 cats, then 19 out of 20 times the sample is within 5% of the true value.
I wondered if someone could derive this, given the the limited information? Or if not, provide a link/direction on this type of information.
The video lecture with the information is here at 13:30 to 15:20 mins. https://www.youtube.com/watch?v=4PlmsnyWXMw

Because the variance of a binomial distribution depends on the success probability $p,$ one must be specific about the
null and alternative values of $p$ in order to find the power
of an exact binomial test of $H_0: p = p_0$ against $H_a: p = p_a.$
One experiment. Suppose you have $p_0 = 0.4, p_a = 0.5, n = 246.$ For one performance of the experiment, we reject $H_0$ at the 0.2% level of significance. Exact binomial test in R:
set.seed(2021)
x = rbinom(1, 246, .5); x
x/246
[1] 0.5


binom.test(x, 246, p=.4)

    Exact binomial test

data:  x and 246
number of successes = 123, number of trials = 246, p-value = 0.001731
alternative hypothesis: 
  true probability of success is not equal to 0.4
95 percent confidence interval:
 0.4358163 0.5641837
sample estimates:
probability of success 
                   0.5 

Simulated power. To approximate the power of the test, we look at the
proportion of rejections among 100,000 performances of
the experiment. The power is about 89%.
n = 246; p.0 = .4; p.a = .5
set.seed(405)
pv = replicate(10^5, binom.test(rbinom(1,n,p.a), n, p=p.0)$p.val)
mean(pv <+ .05)
[1] 0.8863

However, $n = 246$ would give power about 96% distinguishing between $p_0 = 0.8$ and $p_a = 0.7,$ because binomial distributions have less variability for these relatively large success probabilities (or for relatively small ones).
n = 246; p.0 = .8; p.a = .7
set.seed(406)
pv = replicate(10^5, binom.test(rbinom(1,n,p.a), n, p=p.0)$p.val)
mean(pv <+ .05)
[1] 0.95787


Note: Various statistical software programs have 'power and sample size' procedures. Here is output from a recent release of Minitab, to find
the sample sizes required to get 95% power for $p_0 = 0.8, p_a = 0.75$ and for
$p_0 = 0.8, p_a = 0.75,$ for tests that use normal approximations to binomial distributions. (Of course somewhat larger samples are required for 96% power as in my simulation.)
Power and Sample Size 

Test for One Proportion

Testing p = 0.8 (versus < 0.8)
α = 0.05

              Sample  Target
Comparison p    Size   Power  Actual Power
        0.75     751    0.95      0.950008
        0.70     200    0.95      0.950561


