Minimum pumping length for a regular language

有些话、适合烂在心里 提交于 2019-12-04 12:52:54

It will be less than or equal to the number of states in a minimal DFA for the language, minus one. So convert the regular expression into a DFA, minimize it, and count the states. For your example:

0001*

SOURCE    SYMBOL    DESTINATION
q1        0         q2
q1        1         q5
q2        0         q3
q2        1         q5
q3        0         q4
q3        1         q5
q4        0         q5
q4        1         q4
q5        0         q5
q5        1         q5

Why is it equal to this? Because that's the maximum number of transitions you can take in the DFA without visiting some state twice. Once you visit a state twice, you have looped.

Of course, it's possible for a language's minimal DFA to lack a path of that length. In that case, you can find the longest path (from the start state) that doesn't visit a state twice by using something like depth-first search of the automaton's graph and seeing how long a path you can trace. That would be your real answer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!