calculate num buckets based on error rate