# Why are p-values from the binomial test in R non-monotonic in trials?

The R function binom.test performs an exact binomial test. In trying to understand how many trails would be necessary to reject the null given zero successes, I plotted the p-value as follows

p <- 1/16
n <- seq(2,200)
pval <- lapply(n, function(x) binom.test(0,x,p)\$p.value)
plot(n, pval)


I was surprised to see that the p-value did not decrease monotonically with increasing trials. What is the reason for this and is it accurate?

• It is because the binomial random variable is discrete. See my paper in the American Statistician coauthored with Christine Liu. "The Saw-toothed Behavior of Power vs Sample Size and Software Solutions: Single Binomial Proportions using Exact Methods. American Statistician (2002) Vol. 56 pp 149-155. Mar 15, 2018 at 0:25
• I took @StephanKolassa advice. I realize that the result is counter-intuitive and it may take more detailed accounts in the references to get a clear picture. Mar 15, 2018 at 14:31