我试图了解 HashMap 是如何在 Java 中实现的。我决定尝试理解该课程中的每一行(代码和注释),显然我很快就遇到了阻力。以下片段来自 HashMap 类并讨论了泊松分布:
Ideally, under random hashCodes, the frequency of
nodes in bins follows a Poisson distribution
(http://en.wikipedia.org/wiki/Poisson_distribution) with a
parameter of about 0.5 on average for the default resizing
threshold of 0.75, although with a large variance because of
resizing granularity. Ignoring variance, the expected
occurrences of list size k are (exp(-0.5) * pow(0.5, k) /
factorial(k)). The first values are:
0: 0.60653066
1: 0.30326533
2: 0.07581633
3: 0.01263606
4: 0.00157952
5: 0.00015795
6: 0.00001316
7: 0.00000094
8: 0.00000006
more: less than 1 in ten million
我是数学中的普通人,必须首先了解泊松分布是什么。感谢向我解释它的简单视频。
现在,即使在了解了如何使用泊松计算概率之后,我也无法理解上述内容。
如果可能的话,有人可以用更简单的语言和一个例子来解释这个吗?这将使我的任务更有趣。