We consider the value 1 problem for probabilistic automata over finite words. This problem is known to be undecidable. However, different algorithms have been proposed to partially solve it. The aim of this paper is to prove that one such algorithm, called the Markov Monoid algorithm, is optimal. To this end, we develop a profinite theory for probabilistic automata. This new framework gives a t...