Let L = {aibjbjai:i, j 1}. Examples of strings in L include abbbba and aabbbbbaa. Prove that L is context-free by informally describing a PDA that recognizes this language.
Answer-
A language is context-free grammar iff there exists a
pushdown automaton recognizes the context free
grammar.
L={{aibjbjai:i, j >=1}
Context free grammar for language L
G=(V,∑,P,S)
V={S,A}
∑={a,b}
P={S → aSa, S →A, A→bAb, A →bb }
S={S}
CFG to PDA Conversion-
Procedure-
Let G=(V,∑,P,S) be a context free grammar, we can construct a PDA
corresponding to given CFG as
PDA (A)=({q},∑,δ, Γ,q,Z,ϕ)
Where δ is defined by the following rules
R1: δ(q, λ,A)={(q,α)|for all A→α is in P}
R2: δ(q, a,a)={(q, λ)} for each terminal a in T
Grammar G=(V,∑,P,S)
V={S,A}
∑={a,b}
P={S → aSa,S →A,A→bAb,A →bb }
S={S}
PDA corresponding to given CFG
PDA(A)=({q},{a,b},δ,{a,b,S,A},{q},{S},{ϕ})
where
q-{q}
∑-{a,b}
Γ-Stack symbols {a,b,S,A}
q-{q}
Z-{S}-starting symbol of grammar will become starting symbol of
stack
Where δ is defined by the following rules
R1: δ(q, λ,S)={(q,aSa),(q,A)}
R2:δ(q, λ,A)={(q,bAb),(q,bb)}
R3: δ(q, a,a)={(q, λ)}
R4:δ(q, b,b)={(q, λ)}
Input-abbbba
δ(q, abbbba,S)
Rule R1|-δ(q, abbbba,aSa)
Rule R3|-δ(q, bbbba,Sa)
Rule R1|-δ(q, bbbba,Aa)
Rule R2|-δ(q, bbbba,bAba)
Rule R4|-δ(q, bbba,Aba)
Rule R2|-δ(q, bbba,bbba)
Rule R4|-δ(q, bba,bba)
Rule R4|-δ(q, ba,ba)
Rule R4|-δ(q, a,a)
Rule R3|-δ(q,λ ,λ)
The string abbbba accepted by PDA. Therefore language L
is context-free describing a PDA that recognizes this language.
Let L = {aibjbjai:i, j 1}. Examples of strings in L include abbbba and aabbbbbaa. Prove...
DO NUMBER 4 AND 5 2. Let {acgt} and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg, gc. Construct both a DFSM to accept the language and a regular expression that represents the language 3. Let a,b. For a string w E X", let W denote the string w with the a's and b's flipped. For example, for w aabbab: w bbaaba wR babbaa abaabb {wwR Construct a PDA to accept...
DO NUMBER 3 2. Let {acgt} and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg, gc. Construct both a DFSM to accept the language and a regular expression that represents the language 3. Let a,b. For a string w E X", let W denote the string w with the a's and b's flipped. For example, for w aabbab: w bbaaba wR babbaa abaabb {wwR Construct a PDA to accept the language:...
1. Give a context-free grammar for the set BAL of balanced strings of delimiters of three types (), and . For example, (OOis in BAL but [) is not. Give a nondeterministic pushdown automata that recognizes the set of strings in BAL as defined in problem 1 above. Acceptance should be by accept state. 2. Give a context free grammar for the language L where L-(a"b'am I n>-o and there exists k>-o such that m-2*ktn) 3. Give a nondeterministic pushdown...
Give a context free grammar for the language L where L = {a"bam I n>:O and there exists k>-o such that m=2"k+n) 3. Give a nondeterministic pushdown automata that recognizes the set of strings in L from question 3 above. Acceptance should be by accept state. 4. 5 Give a context-free grammar for the set (abc il j or j -k) ie, the set of strings of a's followed by b's followed by c's, such that there are either a...
1. Construct a DFSM to accept the language: L = {w € {a,b}*: w contains at least 3 a's and no more than 3 b's} 2. Let acgt} and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg, gc. Construct both a DFSM to accept the language and a regular expression that represents the language 3. Let a,b. For a string w E ', let W denote the string w with the...
1. Construct a DFSM to accept the language: L w E ab): w contains at least 3 as and no more than 3 bs) 2. Let E (acgt and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg. ge. Construct both a DFSM to accept the language and a regular expression that represents the language. 3. Let ab. For a string w E , let w denote the string w with the...
true/false 21 Uncountable infinity (for example, the cardinality of the real numbers). No Countable infinity (for example, the cardinality of the integers) ? All strings over the alphabet ?. CFG Context-free Grammar CFL Context-free Language L(G) The language generated by a CFG G. L(M) The language accepted by the automaton M. PDA Pushdown Automaton/Automata ISI The cardinality of set S. For example, I01 -o, and if S is an infinite set, ISI could be No or J1 L <M> L(M)...
(20) Let L be the language over {a,b,c} accepting all strings so that: 1. No b's occur before the first c. 2. No a's occur after the first c. 3. The last symbol of the string is b. 4. Each b that is not the last symbol is immediately followed by at least two c's. 5. There are exactly as many a's as b's. Construct a context-free grammar generating L. You do not need an inductive proof, but you should...
Let L = {ai bj ck | i, j,k > 0 and (i = j or i = k)}. On the board is the beginning of an NPDA that recognizes the language. Complete the NPDA using just three more states.