Probability, Statistics, Distributed Systems, Software Engineering, Interview Questions.
consistent_hash(m, n, q=0.9): # Computes the nCr values using dynamic programming as seen above cache = ncr(m) # q is the fraction of keys in the same slot, here q=0.9 u = int(q*m) p = recursion(m, n, u, cache, {})/(n**m) return 1-p def recursion(m, n, h, cache, dp): # base case if n == 1: return 0