It appears two variations of the question are asked:
What is the confidence that there are no more than 16 black marbles?
What is the confidence that there are less than 16 black marbles?
The first variation is answered. This can be restated as:
What is the required sample size drawn from 320 marbles for a Confidence of at least 95% that there are at least 304 (320-16) white marbles, if no black marbles are drawn?
This involves the hypergeometric distribution and the null hypothesis. The two hypotheses are that:
There are at least 304 white.
There are less than 304 white.
The procedure is to draw a sample of sample size s and count the number of white or black marbles. If there are no black then the test succeeded, and the conclusion that there are at least 304 white (of 320) is true with at least X% Confidence. Sample size must be great enough that Confidence is at least 95%.
The hypergeometric probability (P) of selecting 0 black with a random sample of size s can be found if there are 304, 305, ... 320 white. But only 1 of these can be the case and there is no way to combine these P's for the desired result. Instead, the P that the number of white is less than 304 is found and subtracted from 1. If P = 5% that the number of white is less than 304, than 1 - P = 95% is the P that the number of white is at least 304. The number of white = 303 is used for the calculation to find the result, because that is the number (303 or less white) that will give the highest P that 0 black are selected, and thus the lowest 1- P (Confidence), of all the possible number of white less than 304. This gives the Confidence in the worst case scenario of 303 white.
Find the probability that 0 black are selected if there are less that 304 white (303 white), subtract from 1 for the confidence that the proportion white is at least 95%.
Try a calculation for a sample size.
TEST WITH SAMPLE SIZE = 55
number of successes (white) = 55
sample size s = 55
number of successes in the population = 303
population size = 320
Use Excel cell formula:
P=HYPGEOMDIST(55,55,303,320)=0.0369661
A sample size of 55 with all white will prove 95% white with 1-0.0369661 = 0.9630339 or 96.30339% confidence. This is higher than needed. Decrease until last value less than 0.05 is found.
TEST WITH SAMPLE SIZE = 51
number of successes = 51
sample size s = 51
number of successes in the population = 303
population size = 320
Use Excel cell formula:
P=HYPGEOMDIST(51,51,303,320)=0.0480695
A sample size of 51 with all white will prove 95% white with 1-0.0480695 = 0.9519305 or 95.19305% confidence.
TEST WITH SAMPLE SIZE = 50
P = 0.0512995 which is greater than 0.05 so confidence is too low (less than 0.95).
As sample size increases, sample size = 51 is the first sample size that gives a Confidence of at least 95%. Sample size = 51 is the answer.
There is a reference for this sampling calculation:
Frank et al, “Representative Sampling of Drug Seizures in Multiple Containers”, Journal of Forensic Sciences, 1991, 350-357.
https://www.astm.org/DIGITAL_LIBRARY/JOURNALS/FORENSIC/PAGES/JFS13037J.htm
The reference to an online calculator that refers to hypergeometric p-value has been deleted.