/Balls-Bins

Primary LanguageJupyter Notebook

Balls and Bins

Simulates the following scenario. Suppose we have n balls, k bins. Each ball goes to bin 1 with probability p, and with probability 1-p to a bin chosen uniformly at random from 1 to k. What is the probability of a tie between the heaviest and the second heaviest bin? Mainly interested in p<<1/sqrt(n), k constant (or a very slowly growing function of n).