How many samples are required to estimate the frequency of occurrence of an output (out of 8 different outputs)? I have $N$ marbles and to each of them corresponds  a 1 or 2 or 3 or ... or 8.(i.e., there's 8 different kinds of marbles)
How many samples are required to estimate the frequency of occurrence of each kind (within a given confidence interval and confidence level)?
( If the answer is lengthy, a hint or a link to an online reference suffices.)

This is quite straight forward in socio-economic statistics. An example in health care is given here. There also a general calculator.
Hope this helps.
