3 ms·
By the way: the post ends with a conjecture that the maximum frequency is likely to be log n + 1 (with log here denoting the logarithm to base 10), but the more
by svat 7y ago
By the way: the post ends with a conjecture that the maximum frequency is likely to be log n + 1 (with log here denoting the logarithm to base 10), but the more precise result seems to be that the largest frequency is:
((ln n)/(ln ln n))(1 + o(1))
with high probability (i.e., probability 1 - o(1)), where ln denotes the natural logarithm (log to base e). Empirically, the maximum frequency for n=1000, 10000, 100000 often seems to be, respectively, 5, 6 or 7, and 7 or 8.
This problem has applications in studying hash tables etc., and can be found under terms like "maximum load" with balls in bins, and proving this doesn't seem to be very easy. As the post says “the solution is likely not as trivial as it first looks”. The analysis may be hard, but these days if faced with a problem like this in the real world (e.g. we have a hash table of size M that will receive N entries in it, and we're curious about the likely maximum load), we can likely just experiment to find out. Even when the numbers are too large to run simulations directly, an in-between solution is to get a tractable expression (a recurrence relation using dynamic programming or whatever) for the closed form, and write a program to compute it.