Predicting the Number of Distinct Elements in a Multiset

The bounds of the number of comparisons are obtained for the problem of determining whether the number of distinct elements in a given multiset is no more than a given threshold value. Those bounds are asymptotically optimal within constant factors. Two models of the algorithm are considered to derive those bounds.