简体   繁体   中英

Minimum pumping length for the following regular languages

What are the minimum pumping length for the following languages ?

  1. The empty language
  2. (01)*
  3. 10(11*0)*0
  4. 1011
  5. 011 U 0*1*

Here are my solutions. Please correct me if I'm wrong.

  1. p = 0 because the language has no pumpable strings
  2. p = 2 because 01 is the shortest string that can be pumped
  3. p = 5 because 10100 is the shortest string that can be pumped
  4. p = 0 because string cant be pumped
  5. p = 1 because the string 0 can be pumped

I am not sure about my answers, so any help is appreciated. Thanks a lot!

I think Simon's answer may be a little off. You do, in fact, need to take a cycle somewhere. The pumping lemma requires that the path taken to recognize the string include a cycle (this is the 'y' of the pumping lemma's 'xyz'). We can take this cycle as many times as we want, which pumps the string.

  1. This should be 1. The minimum pumping length must always be greater than 0, even if there are no strings in the language.
  2. This should be 2. If p = 1, we can't pump 01 (because y must equal 0, and 001 is not in the language).
  3. This should be 5.
  4. This should also be 5. If we set p=4, then we claim "1011" is pumpable (which it is not, as it is the only string in the language).
  5. p = 1.

According to Patrick87 , the minimum pumping length is defined as the maximum number of transitions you can make in a minimized DFA without visiting some state twice. The process then becomes to convert your regular expression to an NFA, convert the NFA to a DFA, minimize the DFA and count the longest path along the directed edges without visiting the same state twice. For an introduction to this conversion and minimization, see for example Torben Mogensen's free book, Basics of Compiler Design chapters 2.6, 2.8.

According to this definition,

  1. p = 0, since there are no transitions in the minimized DFA for the empty language.
  2. p = 1. A minimized DFA for (01)* has two states, and you can only make one transition without ending up at the initial, accepting state.
  3. p = 3. A minimized DFA for 10(11*0)*0 will have a state that has to be visited twice for the sub-expression (11*0)* to be a part of the derivation.
  4. p = 4. A minimized DFA for 1011 has exactly 4 edges and no recursion.
  5. p = 1. The language 011 is a subset of the language 0*1* , so 011 U 0*1* = 0*1* . And since neither 0 or 1 can be pumped, one can only follow one non-recursive edge.

最小化的DFA为2,3,4和5。

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