Algorithm to determine an estimation of the cardinality of a set using analytic combinatorics