I am stuck on a question. Lets say there is a string that can be created from three alphabets a,b,c the condition is number of a<= number of b<= number of c. I can solve if there are a and b (two alphabets) but I am not able to solve for 3. Any help will be appreciated. Thanks
Asked
Active
Viewed 40 times
0
-
1Your language is not context free. – Yuval Filmus Nov 11 '17 at 22:15
-
2Possible duplicate of How to prove that a language is not context-free? – David Richerby Nov 12 '17 at 00:36
-
The title you have chosen is not well suited to representing your question. Please take some time to improve it; we have collected some advice here. Thank you! – Raphael Nov 12 '17 at 21:09
-
I have a hard time to find even a question here. People have been guessing you're trying to ask for a PDA for the given language. Is that what you want? – Raphael Nov 12 '17 at 21:11
1 Answers
1
The basic problem here is that context-free languages are not closed under intersection.
The example you give illustrates this. Thus, $\{ w\in\{a,b,c\}^* \mid |w|_a \le |w|_b\}$ is context-free, and similarly, so is $\{ w\in\{a,b,c\}^* \mid |w|_b \le |w|_c\}$. The intersection of these two languages $\{ w\in\{a,b,c\}^* \mid |w|_a \le |w|_b \le |w|_c\}$ is not context-free.

Hendrik Jan
- 30,578
- 1
- 51
- 105
-
So that is the reason I was not able to come up with a PDA for this. I had been trying for so long every time something or the other will not work. Thanks a lot for clarifying this. – user2943731 Nov 13 '17 at 21:13