Recent questions tagged context-free-language

4 4 votes
2 2 answers
174
174 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...
2 2 votes
1 1 answer
100
100 views
Which CFG generates the language $L = \{a^m b^n \mid 2m=n \text{ or } m=2n\}$?$S \to aSbb \mid aaSb \mid \epsilon$ $S \to X \mid Y$$X \to aXbb \mid \epsilon$$Y \to aaYb \...
0 0 votes
0 0 answers
141
141 views
The intersection of a context free language and a regular languagea)need not be regularb)need not be context freec) is always regulard) is always context free  
1 1 vote
1 1 answer
111
111 views
Which of the following languages cannot be accepted by push down automata?$\mathrm{L}=\left\{\mathrm{a}^\mathrm{n} \mathrm{b}^{n} c^\mathrm{n}: \mathrm{n} \geq 0\right\}$...
8 8 votes
3 3 answers
2.1k
2.1k views
Let $\Sigma=\{a, b, c, d\}$ and let $L=\left\{a^{i} b^{j} c^{k} d^{\ell} \mid i, j, k, \ell \geq 0\right\}$.Which of the following constraints ensure(s) that the language...
13 13 votes
4 4 answers
1.6k
1.6k views
Consider the following context-free grammar $G$.\[\begin{array}{l}S \rightarrow a b a A B A b b a \\A \rightarrow a a B B A b \mid b B a b a a \\B \rightarrow a B b \mid ...
0 0 votes
0 0 answers
472
472 views
$$L = \{\, a^{n} b^{m} c^{k} \mid n,m,k 0 \text{ and } k = |n-m| \,\}$$Is it dcfl or cfl ?my approachWe can split the condition \(k = |n - m|\) into two cases:Case 1:\(n...
0 0 votes
0 0 answers
259
259 views
Which of the following Grammars is/are only Context Free?$\begin{array}{|l|l|l|l|} \hline \textbf{I} & \begin{array}{l} S \rightarrow A b \\ a S \rightarrow a A \\ A \ri...
5 5 votes
2 2 answers
474
474 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 ...
0 0 votes
0 0 answers
225
225 views
If $L_{1}$ and $L_{2}$ are context free languages, which of the following is True about $L_{1} \cap L_{2}$?$\mathrm{L}_{1} \cap \mathrm{~L}_{2}$ is context free$\mathrm{L...
0 0 votes
0 0 answers
165
165 views
Arrange the following Language Classes in ascending order according to their expressive power, as defined by Chomsky hierarchy:Context-free languagesContext-sensitive lan...
1 1 vote
1 1 answer
205
205 views
Which of the following are context free language?$\left\{\mathrm{w}^{\mathrm{i}} \mathrm{x}^{\mathrm{j}} \mathrm{y}^{\mathrm{k}} \mathrm{z}^{l} \mid \mathrm{i}+\mathrm{k}...
0 0 votes
1 1 answer
245
245 views
Let $\text{A}=\{a, b\}$ and $\text{L}=\text{A}^{*}$. Let $x=\left\{a^{n} b^{n}, n>0\right\}$. The languages $\text{L} \cup \text{X}$ and $\text{X}$ are respectively :Not ...
1 1 vote
2 answers 2 answers
703
703 views
Is {aⁿbᵐcᵖ | n ≠ m or m ≠ p} CFL? If so what is the Context Free Grammar for it? If not, what is the grammar for the language?
18 18 votes
3 3 answers
7.0k
7.0k views
Consider the following two languages over the alphabet $\{a, b, c\}$, where $m$ and $n$ are natural numbers.$$\begin{aligned} L_{1} & =\left\{a^{m} b^{m} c^{m+n} \mid m, ...
2 2 votes
1 answers 1 answer
681
681 views
Is the language $L = \{ 0^n1^n0^n | n >= 0 \text{ and n is even }\}$ a cfl ?I know if the n is even constraint is not added L is not a cflBut if n is even the language is...
1 1 vote
1 1 answer
755
755 views
3 3 votes
0 0 answers
382
382 views
Show that $L = \{a^nb^m,n< 2m \}$ is a deterministic context-free language.
1 1 vote
1 1 answer
585
585 views
Let $\Sigma=\{a, b\}$ be an alphabet. A palindrome is a word which reads the same when read from left-to-right, or from right-to-left. For example, the words $a b b a, a ...
0 0 votes
1 1 answer
218
218 views
Let $L$ be a regular language, and let $n=10$. Which of the following statements is true?$L \cup\left\{a^{n} b^{n}\right\}$ is regular$L \cup\left\{a^{n} b^{n}\right\}$ i...
1 1 vote
3 3 answers
886
886 views
Which f the following statements is FALSE?The intersection of a regular language and a context-free language is context=freeThe intersection of a regular language and con...
2 2 votes
1 answers 1 answer
634
634 views
Which of the following language is/are Turing decidable? 1. L = { <G1, G2 | G1 & G2 are regular grammar and L(G1) ⊆ L(G2)} 2. L = { <G, R | G is a CFG & R is a regular ex...
0 0 votes
1 1 answer
502
502 views
Is this language regular or not?xww^R | x,w E (a,b)*
1 1 vote
0 0 answers
427
427 views
Give a context-free grammar for each of the following languages. Consider, Σ={0,1}.A. The language of strings that start with 1B. The language of strings of the form WWR ...