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?


