pumping-lemma

Pumping Lemma with Context Free Languages

杀马特。学长 韩版系。学妹 提交于 2020-01-10 19:42:09
问题 I have the language {a^i b^j c^k | i,j,k>=0 & i>j & j>k} I began by assuming some m is picked for me, such that a string z = a^m b^(m-1) c^(m-2) Then the string is split up into (z =) uvwxy so that vx are not empty and #(vwx)<=m Then when I get to pick an " i " I get confused. Say I pick i=1 then I have: uv^1wx^1y and I'm not entirely sure where to go from that because to me it looks like I could pick a vwx that IS in the language. Any suggestions? 回答1: I'd begin by picking a slightly better

Closure properties of context free languages

一个人想着一个人 提交于 2019-12-31 04:15:39
问题 I have the following problem: Languages L1 = {a^n * b^n : n>=0} and L2 = {b^n * a^n : n>=0} are context free languages so they are closed under the L1L2 so L={a^n * b^2n A^n : n>=0} must be context free too because it is generated by a closure property. I have to prove if this is true or not. So I checked the L language and I don’t think that it is context free then I also saw that L2 is just L1 reversed. Do I have to check if L1, L2 are deterministic? 回答1: L1={a n b n : n>=0} and L2={b n a n

Am using the pumping lemma correctly?

两盒软妹~` 提交于 2019-12-24 11:50:10
问题 I'm trying to prove that the following language is not regular via the Pumping Lemma. But I'm not truly sure if I have done it correctly. {L = a 2 n | n>= 0 } What I've done so far is the following: s = a 2 p x = a 2 i y = a 2 j z = a 2 p-i-j thus xy 2 z = a 2 p+j which means that a 2 p+j > a 2 p , making the language not regular Am I doing it correctly? or is there something I have wrong? 回答1: Not quite, you draw the correct conclusion, but the reasoning is a bit off. The Pumping lemma

Minimum pumping length for a regular language

假装没事ソ 提交于 2019-12-12 08:58:02
问题 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? 回答1: 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

Pumping Lemma in context-free languages

这一生的挚爱 提交于 2019-12-11 05:27:08
问题 A = {0^a 1^b 2^c | a < b < c} I need to show that A is not context-free. I'm guessing I have to use the Pumping Lemma for this, but how? 回答1: The goal is to prove that for any string with length >= a minimum pumping length, the string cannot be pumped. That is, if you split it into substrings uvxyz , the string that results from making copies (or removing copies) of v and y are still in language A . Note that you only have to show that one string in the language cannot be pumped (as long as

Pumping lemma (Regular language)

余生颓废 提交于 2019-12-07 05:04:05
问题 I need some help with a pumping lemma problem. L = { {a,b,c}* | #a(L) < #b(L) < #c(L) } This is what I got so far: y = uvw is the string from the pumping lemma. I let y = abbc^n, n is the length from the pumping lemma. y is in L because the number of a:s is less than the number of b:s, and the number of b:s is less than the number of c:s. I let u = a, v = bb and w = c^n. |uv| < y, as stated in pumping lemma. If I "pump" (bb)^2 then i get y = abbbbc^n which violates the rule #b(L) < #c(L). Is

generalizing the pumping lemma for UNIX-style regular expressions

爷,独闯天下 提交于 2019-12-06 02:06:15
问题 Most UNIX regular expressions have, besides the usual ** , + , ?* operators a backslash operator where \1,\2,... match whatever's in the last parentheses, so for example *L=(a*)b\1* matches the (non regular) language *a^n b a^n* . On one hand, this seems to be pretty powerful since you can create (a*)b\1b\1 to match the language *a^n b a^n b a^n* which can't even be recognized by a stack automaton. On the other hand, I'm pretty sure *a^n b^n* cannot be expressed this way. I have two questions

Pumping lemma (Regular language)

浪尽此生 提交于 2019-12-05 09:08:56
I need some help with a pumping lemma problem. L = { {a,b,c}* | #a(L) < #b(L) < #c(L) } This is what I got so far: y = uvw is the string from the pumping lemma. I let y = abbc^n, n is the length from the pumping lemma. y is in L because the number of a:s is less than the number of b:s, and the number of b:s is less than the number of c:s. I let u = a, v = bb and w = c^n. |uv| < y, as stated in pumping lemma. If I "pump" (bb)^2 then i get y = abbbbc^n which violates the rule #b(L) < #c(L). Is this right ? Am I on the "right path" ? Thanks The main idea of the pumping lemma is to tell you that

Minimum pumping length for a regular language

有些话、适合烂在心里 提交于 2019-12-04 12:52:54
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

generalizing the pumping lemma for UNIX-style regular expressions

你说的曾经没有我的故事 提交于 2019-12-04 06:54:44
Most UNIX regular expressions have, besides the usual ** , + , ?* operators a backslash operator where \1,\2,... match whatever's in the last parentheses, so for example *L=(a*)b\1* matches the (non regular) language *a^n b a^n* . On one hand, this seems to be pretty powerful since you can create (a*)b\1b\1 to match the language *a^n b a^n b a^n* which can't even be recognized by a stack automaton. On the other hand, I'm pretty sure *a^n b^n* cannot be expressed this way. I have two questions: Is there any literature on this family of languages (UNIX-y regular). In particular, is there a