On optimal discrete estimation