Suponha que você tem k cores, onde k ≤ N . Deixe- b i denotam o número de bolas de cores i tão Σ b i = N . Deixe B = { b 1 , ... , b k } e deixou E i ( B ) Notate o conjunto que consiste nos i subconjuntos elemento de B . Seja Q n , c denota o número de maneiras pelas quais podemos escolher nkk ≤ NbEuEu∑ bEu= NB = { b1 1, … , Bk}EEu( B )EuBQn , cnelementos do conjunto acima, de modo que o número de cores diferentes no conjunto escolhido seja c . Para c = 1, a fórmula é simples:cc = 1
Q n , 1 = ∑ E ∈ E 1 ( B ) ( ∑ e ∈ E en )
Qn,1=∑E∈E1(B)(∑e∈Een)
Para c = 2 , podemos contar conjuntos de bolas de tamanho n com no máximo 2 cores menos o número de conjuntos com exatamente 1 cor:c=2n1
Q n , 2 = ∑ E ∈ E 2 ( B ) ( ∑ e ∈ E en ) - ( k-11 ) Qn,1
Qn,2=∑E∈E2(B)(∑e∈Een)−(k−11)Qn,1
( k-11)(k−11) is the number of ways you can add a color to a fixed color such that you will have 2 colors if you have kk colors in total. The generic formula is if you have c1c1 fixed colors and you want to make c2c2 colors out of it while having kk colors in total(c1≤c2≤kc1≤c2≤k) is (k−c1c2−c1)(k−c1c2−c1). Now we have everything to derive the generic formula for Qn,cQn,c:
Qn,c=∑E∈Ec(B)(∑e∈Een)−c−1∑i=1(k−ic−i)Qn,i
Qn,c=∑E∈Ec(B)(∑e∈Een)−∑i=1c−1(k−ic−i)Qn,i
The probability that you will have exactly cc colors if you draw nn balls is:
Pn,c=Qn,c/(Nn)
Pn,c=Qn,c/(Nn)
Also note that (xy)=0(xy)=0 if y>xy>x.
Probably there are special cases where the formula can be simplified. I didn't bother to find those simplifications this time.
The expected value you're looking for the number of colors dependent on nn is the following:
γn=k∑i=1Pn,i∗i
γn=∑i=1kPn,i∗i