Probability, Statistics, Distributed Systems, Software Engineering, Interview Questions.
cum_probs[mid] >= u: p = mid right = mid-1 else: left = mid+1 return p def experiment(requests, num_trials=5000): for i in range(num_trials): server = load_balancer(requests) # Update requests for the server that was chosen requests[server] += 1 A good reference for this approach : Darts, Dice, and