the hyperloglog has three main operations: add to add a new element to the set, count to obtain the cardinality of the set and merge to obtain the union of two sets. some derived operations can be computed using the inclusion–exclusion principle like the cardinality of the intersection or the cardinality of the difference between two hyperloglogs combining the merge and count operations.