Изменения
→Псевдокод
'''for''' <tex>\mathtt{j} = 1</tex> '''to''' <tex>\mathtt {K}</tex>
<tex>\mathtt{TIndex}[\mathtt{j}, \mathtt{i}] = \arg\max_{1 \leqslant \mathtt{k}\leqslant \mathtt{K}} \limits (\mathtt{TState}[\mathtt{k}, \mathtt{i} - 1] * \mathtt{A}[\mathtt{k}, \mathtt{j}] * \mathtt{B}[\mathtt{j}, \mathtt{Y}[\mathtt{i}]])</tex>
''<font color=green>// функция arg max() ищет максимум выражения в скобках и возвращает аргумент(в нашем случае <tex>\mathtt{k}</tex>), при котором достигается этот максимум</font>''
<tex>\mathtt{TState}[\mathtt{j}, \mathtt{i}] = \mathtt{TState}[\mathtt{TIndex}[\mathtt{j}, \mathtt{i}], \mathtt{i} - 1] * \mathtt{A}[\mathtt{k}, \mathtt{j}] * \mathtt{B}[\mathtt{j}, \mathtt{Y}[\mathtt{i}]]</tex>
<tex>\mathtt{X}[\mathtt{T}] = \arg\max_{1 \leqslant \mathtt{k}\leqslant \mathtt{K}} \limits (\mathtt{TState}[\mathtt{k}, \mathtt{T}])</tex>