In this note we propose a new algorithm for checking whether two counting functions on a free monoid $M_r$ of rank $r$ are equivalent modulo a bounded function. The previously known algorithm has time complexity $O(n)$ for all ranks $r>2$, but for $r=2$ it was estimated only to be $O(n^2)$. We apply a new approach based on the explicit basis expansion and summation of weighted rectangles, which allows us to construct a much simpler algorithm with time complexity $O(n)$ for any $r\geq 2$. We work in the multi-tape Turing machine model with non-constant-time arithmetic operations.
翻译:本文提出一种新算法,用于检验自由幺半群 $M_r$(秩为 $r$)上两个计数函数在模有界函数意义下是否等价。已知算法在 $r>2$ 时时间复杂度为 $O(n)$,但对 $r=2$ 的情况仅估计为 $O(n^2)$。我们采用基于显式基展开与加权矩形求和的新方法,从而构建出更简洁的算法,使得对任意 $r\geq 2$ 时间复杂度均为 $O(n)$。本工作在支持非常数时间算术运算的多带图灵机模型下进行。