从历史谜题到语法约束:循环划分、广义运行长度编码以及多项式时间可判定性
From Historical Puzzles to Grammatical Constraints: Circular Partitions, Generalized Run-Length Encodings, and Polynomial-Time Decidability
AI总结:
本文通过历史谜题启发,研究循环划分算法和广义运行长度编码,证明块语言在多项式时间内可判定。
摘要:
受一个类似经典约瑟夫问题的历史组合问题启发,我们研究了循环划分算法,并在确定性有限自动机中提出实际算法。该历史问题涉及将人排列成圆圈并消除每第k个人,直到留下期望的群体。我们分析了去除和非去除两种循环划分方法,建立了平衡划分的条件并提供了明确的算法。我们引入了在划分字母表上的广义运行长度编码,以捕捉交替字母模式,利用第二类斯特林数计算其基数。将这些组合结构与形式语言理论联系起来,我们提出了一个存在性问题:给定一个词法上的上下文无关文法和对字母的块模式约束,是否存在有效的句子?我们通过证明块语言是正则的并应用标准解析技术,证明了在多项式时间内可判定。提供了完整的算法及其复杂性分析,并通过在历史和合成实例上的实现进行验证。
英文摘要:
Motivated by a historical combinatorial problem that resembles the well-known Josephus problem, we investigate circular partition algorithms and formulate problems in deterministic finite automata with practical algorithms. The historical problem involves arranging individuals on a circle and eliminating every k-th person until a desired group remains. We analyze both removal and non-removal approaches to circular partitioning, establishing conditions for balanced partitions and providing explicit algorithms. We introduce generalized run-length encodings over partitioned alphabets to capture alternating letter patterns, computing their cardinalities using Stirling numbers of the second kind. Connecting these combinatorial structures to formal language theory, we formulate an existence problem: given a context-free grammar over a dictionary and block-pattern constraints on letters, does a valid sentence exist? We prove decidability in polynomial time by showing block languages are regular and applying standard parsing techniques. Complete algorithms with complexity analysis are provided and validated through implementation on both historical and synthetic instances.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。