| ▲ | Why Fibonacci?(evilgeniuslabs.org) | |
| 29 points by _Microft 3 hours ago | 2 comments | ||
| ▲ | sph an hour ago | parent | next [-] | |
I just learned about Fibonacci hashing, where you multiply a hash function by a certain factor derived from the golden ratio, which gives you better distribution than a bare integer modulo. https://probablydance.com/2018/06/16/fibonacci-hashing-the-o... The graph of the distribution is indeed very similar to the LEDs in this article: https://book.huihoo.com/data-structures-and-algorithms-with-... So if you find yourself doing:
Consider introducing Fibonacci hashing. And the reason this works, and provides uniform distribution is this: https://en.wikipedia.org/wiki/Equidistribution_theorem | ||
| ▲ | mbf1 3 hours ago | parent | prev [-] | |
I noticed in step 5 of this that you get spirals at Fibonacci numbers like 55 and 89 (which are 34 apart). However, if you pick 72 which is half way between the spirals, you see something interesting happen. | ||