formula for relating number of successes to number of tries Imagine we have a jar of marbles, where there are 10 different colors of marbles in the jar.
Let N be the number of marbles drawn in a sample and
K be the number of distinct colors in the sample.
Let C be the total number of colors in the jar (which is 10 in this example).
We know that:
K = F(C,N) + chance.
Intuitively, the more marbles we draw at a time, the more colors we are likely to obtain, up to the maximum.
This strikes me as a binomial. I am looking for a formula to express in more detail how
K = F(C,N).
An obvious feature is that C is the maximum value. So I figure this is a model where K is an increasing proportion of C as N increases.
I already know how to simulate the data, but wish to provide an expression of K depending on C and N.
Any suggestions will be appreciated.
Simulated data for the situation I intend will be as follows. I assume sampling with replacement. For this example, we have 10 colors in the jar (C=10). Note that we start by drawing one marble from the jar, which gives us a sample where N=1 and K=1. The number of colors found in a sample depends on the size of the sample. In this case it is seq(1:20). In this particular simulation, we have an equal representation for each color. The snip of R code I use to simulate the data is:
###snip of modified code for stack exchange exchange
T <- c(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10)
for (i in 1:N){
for (s in 1:n.sims) {
plot.sample <- sample(T, size=N[i])
K[s,i] <- length(unique(plot.sample))
}
}

Note that the line is just a loess plot at this point and the proper function would level off at C, the maximum number of colors.
If I use the suggested formula
K=N*C/(N+C-1)
I get the figure on the right, which has the right shape, but finds colors very slowly.

If I estimate the function with a scaling coefficient, I get the following graph. Excellent fit: explained variance = 97%, though the visual suggests there could be a better function?

 A: I'll assume the jar contains a sufficiently large number of balls equally distributed among the colors. If we don't assume equi-distribution of colors or if we take into account the fact we are drawing without replacement the problem becomes significantly more complicated. Supposing we draw $n$ balls from a jar containing $c$ colors, what is the distribution of the random variable $K$, the number of colors in the sample?  (assuming $\boldsymbol{n\geq c}$)
This is a stars-and-bars calculation. Given $c$ different colors possible and our sample being of size $n$, the number of different samples we can get is
$$\mathrm{C}(n+c-1,c-1)$$
With $\mathrm{C}$ being of course the binomial coefficient. Of these possible samples, how many of them contain exactly $k$ different colors? Well, we basically don't get to pick the first $k$ balls - they have to be the $k$ distinct colors. But, the remaining $n-k$ balls can be any mixture of the $k$ colors we already have. The number of ways of selecting $n-k$ balls when we have $k$ color choices is
$$\mathrm{C}(n-1,k-1)$$
Finally, the number of ways of selecting which $k$ colors out of a pool of $c$ our sample will consist of is precisely
$$\mathrm{C}(c,k)$$
Meaning that the number of ways of picking a sample of size $n$ that has exactly $k$ different colors out of a possible $c$ is exactly
$$\mathrm{C}(c,k)\mathrm{C}(n-1,k-1)$$
Meaning that
$$\Pr(K=k)=\frac{\mathrm{C}(c,k)\mathrm{C}(n-1,k-1)}{\mathrm{C}(n+c-1,c-1)}$$
As a sanity check, it can be verified that
$$\sum_{k=1}^c \frac{\mathrm{C}(c,k)\mathrm{C}(n-1,k-1)}{\mathrm{C}(n+c-1,c-1)}=1$$
As long as $n\geq c$. Here is a plot for the $n=50,c=20$ case:

It can also be computed directly that
$$\mathrm{E}[K]=\frac{nc}{n+c-1}$$
And
$$\operatorname{Var}[K]=\frac{nc(nc-1)}{(n+c-1)(n+c-2)}-\left(\frac{nc}{n+c-1}\right)^2$$
EDIT: Numerical evidence seems to suggest my probability mass function gives correct results even for $n<c$.
A: When you talk of asymptotic expressions, you seem to be assuming a large number of draws, where it is likely you have seen all the colors.  This simplifies the problem considerably.  It also helps if the draws are with replacement or if there are so many marbles that the number you draw does not change the mix appreciably.  If there are equal numbers of each type of marble, the chance that a particular type is not drawn is $\left(\frac{C-1}C\right)^N$.  When $N$ is large, the chance you have not seen a specific color is small, as you think.  The chance you have not seen two different colors is roughly the square of small, which is very small.  In that case, the chance you have missed some color is just $C\left(\frac{C-1}C\right)^N$.  Is this at all what you were looking for?
A: Let $m_1,m_2,\dots,m_C$ be the numbers of murbles of the corresponding color, so that
$$\sum_{i=1}^C m_i=M,
$$
where $M $ is the total number of marbles in the jar (not given in the problem).
Then the probability that a sample of $N $ marbles will contain marbles of $K $ distinct colors is:
$$p_K(N,m_1,m_2,\dots,m_C)=\frac {[x^N]:\sum_{\mathbf a}^{ |\mathbf a|=K}\prod_{i=1}^C[(1+x)^{a_im_i}-a_i]}{\binom MN},
$$
where the operator $[x^n]: $ extracts the coefficient at $x^n $ in the subsequent expression and we have introduced binary vectors $\mathbf a=(a_1,a_2,\cdots, a_C) $ with $a_i=0,1$ equipped with the weight $|\mathbf a|\equiv \sum_i a_i $.
The expected value can then be computed as:
$$\bar K(N,m_1,m_2,\dots,m_C)=\sum_{K=0}^CKp_K(N,m_1,m_2,\dots,m_C).
$$
The expression can be drastically simplified if one assumes that the numbers of marbles of each color in the jar are equal, but this was not confirmed by the author.
