简体   繁体   中英

Minimum pumping length for a regular language

How to calculate minimum pumping length of a regular language. For example if i have 0001* then minimum pumping length for this should be 4 ,that is 000 could not be pumped . Why it is so?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM