Math behind estimating the frequency of entries without storing every entry

Imagine you are working on a firewall service where you want to see how many times the service got a request from a particular ip and make…