Optimal streaming and tracking distinct elements with high probability