Assume we have m groups of n balls and the balls in the same group have the same color. So there are m*n balls in total. Now, suppose we randomly choose k>(2*n) balls from the set of m*n balls. How much is the probability that the chosen k balls contain all balls of at least two different colors (entirely all balls of two groups)?
In other words, the unchosen set of balls contains the balls of different m-2 colors at most (instead of m colors).
To grasp better, notice the picture of 3*4 ( = n*m) balls. Each group of 3 balls has the same color. The probability I am looking for is to choose k balls containing the balls of two entire groups. For example, choosing balls 1, 5, 9, 3, 7, 11, 8 (contains all yellow and blue balls).
I hope I could explain the problem clearly. I have implemented a simulator for testing different scenarios. Then I tested the simulated results with different combinatorial/binomial solutions. But I get different results every time and now I'm lost.
This is my simulator in python testing different choices many times:
from random import sample
from collections import Counter
m = 4
n = 3
k = 5
it = 100000
balls = range(m*n)
cf = 0
for i in range(it):
choices = sample(balls, k)
samecolors = map(lambda x:x%m, choices)
cnt = Counter(samecolors)
mc = cnt.most_common(2)
if (mc[-1][-1] == n): // if the second most common chosen color has *n* balls
cf += 1
print(float(cf)/float(it))