edited by
1,407 views
3 3 votes

Is this Language a CFL?

If yes, Can you please explain the implementation.

2 Answers

0 0 votes

Yes it is CFL,in fact a much stronger statement would be a DCFL. why so ? You keep on pushing whatever is the input into the stack,the moment you see C , it gives u a hint to start popping off the symbols. And u start popping off the symbols, just see at the end if the stack becomes empty,here you should get non empty for it to get accepted 

0 0 votes

As given in Peter Linz Book:

This language is CFL. Construct an NPDA that counts to some value k (by putting k tokens on the stack) and remembers the kth symbol. It then examines the kth symbol in w2w2. If this does not match the remembered symbol, the string is accepted.

If w ϵ Lw ϵ L , there must be some k for which this happens. This npda chooses the non-deteministically.

So Applied Ans is correct. So many places the ans is given as Non-CFL but its CFL. 

Link: chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/viewer.html?pdfurl=https%3A%2F%2Ffall14cs.files.wordpress.com%2F2017%2F04%2Fan-introduction-to-formal-languages-and-automata-5th-edition-2011.pdf&clen=8631548&chunk=true 

edited by
Position:
Show:

Related questions

5 5 votes
2 2 answers
479
479 views
GO Classes asked Sep 9, 2025
479 views
Consider the following CFG $G$ over $\Sigma = \{\mathbf{a},\mathbf{b},\mathbf{c},\mathbf{d}\}$:\[\begin{array}{rcl}S & \rightarrow & S\mathbf{a} \;\mid\; \mathbf{d}T \\T ...
1 1 vote
1 1 answer
2.2k
2.2k views
Applied Course asked Jan 16, 2019
2,248 views
Which of the following statement is not correct?$a^nb^nc^m$ is not CFG$a^mb^nc^n$ is deterministic CFG$a^nb^n$ is CFG$a^{800}b^{800}c^{800}$ is CFG
0 0 votes
1 1 answer
567
567 views
Dknights asked Sep 12, 2023
567 views
is this correct DFA ?
4 4 votes
2 2 answers
187
187 views
GO Classes asked Sep 1
187 views
Consider the CFG$$\begin{aligned}S &\to VS \mid cT \\T &\to VT \mid cU \\U &\to \epsilon \mid VU \\V &\to a \mid b\end{aligned} $$Which language is generated by this gram...