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

I could not verify the statement

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.

Trying to reverse engineer what they might have done, we could have
$$\frac{0.8}{\sqrt{246}} \approx 0.05$$
But that expression makes no sense.

Say, the true probability is 0.8 and you sample 246, then the outcome of your experiment will be binomial distributed (given that you performed the experiment well like sampling independently and without bias as mentioned in the video).
Below is a plot how this distribution looks like and what the probability is to be 5% of the true value.

So, if the true value would be 80% then there is a 11.09 % probability that the observed percentage in the sample would be more than 5% away from the true value.

Note that this is only one way to make the computation. The computation of the interval that contains the true value 95% of the time (19 out of 20 cases), also known as a confidence interval can be done in different ways (by using different approaches or viewpoints). For the estimate of a percentage/proportion, the different ways are summarized on this Wikipedia page: https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval
But in any case, the number of 246 seems too low (although it is not a large difference, with the method that created the image the correct size would be $n=367$).

R-code to make the figure:
### settings
n = 246
#n = 367
p = 0.8
q = 1-p
x = 0:n

### plot binomial distribution
plot(x,dbinom(x,n,p), xlim = c(n*0.6,n), 
     pch = 21, col = 1, bg = 1, cex = 0.7, ylim = c(0,0.1),
     ylab = "P(X = x)", xlab = "x", main = "distribution for number of cats that like Whiskas \n among sample of size 246 \n If true percentage would be 80%")

### add upper and lower 5% boundaries
upper = n*p*1.05
lower = n*p*0.95
lines(upper * c(1,1), c(0,1), lty = 2)
lines(lower * c(1,1), c(0,1), lty = 2)
text(upper, 0.03, "5% above true vale", pos = 4, srt = 90, cex = 0.8)
text(lower, 0.03, "5% below true vale", pos = 2, srt = -90, cex = 0.8)


### compute percentages and add to plot
x3 = round((1-pbinom(upper, n, p))*100,2)
x1 = round((pbinom(lower, n, p))*100,2)
x2 = round(100 - (1-pbinom(upper, n, p))*100 - (pbinom(lower, n, p))*100,2)

text(n*p, 0.1, paste0(x2, " %"))
text(n*p*1.1, 0.1, paste0(x3, " %"))
text(n*p*0.9, 0.1, paste0(x1, " %"))

