This paper, based on the content of the axioms for the randomized algorithm, considers the collection of using correct algorithms at synthesis for solving the problem of probabilistic hidden Markov model. Application of this model allows forming algorithm with its flexibility according to a substantial situation for ensuring structural and functional stability of the program realizing this algorithm. We found that randomization of the algorithm, increasing its flexibility and efficiency, does not improve its risk compared with the corresponding deterministic algorithm. The synthesis of the algorithm based on hidden Markov model implies that the available observed data is used to determine hidden parameters of the most likely sequence of states, determining the synthesized algorithm. At the first strategy step, the "back and forth" algorithm is used to evaluate how well the model matches with the input data of the synthesized algorithm. At the second stage, the given hidden Markov model with the space of hidden states, initial probabilities of presence in state i and probabilities of transition from state i to state j, and basing on the observed states and using the Viterbi algorithm, the Viterbi path is found. At the third strategy stage, the hidden Markov models are corrected by optimizing the parameters of the model using the Baum-Welch algorithm.