Recent questions tagged peter-linz-edition4

0 0 votes
0 0 answers
362
362 views
A run in a string is a substring of length at least two, as long as possible and consisting entirely of the same symbol. For instance, the string abbbaab contains a run o...
1 1 vote
0 0 answers
1.2k
1.2k views
Determine whether or not the following languages are context-free.(a) $L=$ {$a^nww^Ra^n : n ≥ 0, w ∈$ {$a,b$}*}(b) $L=$ {$a^nb^ja^nb^j : n ≥ 0, j ≥ 0$}.(C) $L=$ {$a^nb^ja...
2 2 votes
2 2 answers
1.3k
1.3k views
1 1 vote
2 2 answers
920
920 views
0 0 votes
0 0 answers
621
621 views
Give LL grammars for the following languages, assuming $Σ =$ {$a,b, c$}.(i) $L=$ {$a^nb^mc^{n+m}:n\geq0,m\geq0$} .(ii) $L=$ {$a^{n+2}b^mc^{n+m}:n\geq0,m\geq0$} .(iii) $L=...
1 1 vote
1 1 answer
524
524 views
Let G be a context-free grammar in Greibach normal form. Describe an algorithm which, for anygiven k, determines whether or not G is an LL (k) grammar.
0 0 votes
0 0 answers
407
407 views
0 0 votes
0 0 answers
443
443 views
Show that if G is an LL (k) grammar, then L (G) is a deterministic context-free language.
0 0 votes
1 1 answer
519
519 views
0 0 votes
0 0 answers
329
329 views
0 0 votes
1 1 answer
579
579 views
Show that the grammar for L = {$w : n_a (w) = n_b (w)$} which is, $S\rightarrow SS,S\rightarrow \lambda,S\rightarrow aSb,S\rightarrow bSa$ is not an LL grammar.
0 0 votes
0 0 answers
360
360 views
Show that the grammar $S_0\rightarrow aSbS,S\rightarrow aSbS|\lambda$ is an LL grammar and that it is equivalent to the grammar $S\rightarrow SS|aSb|ab$.
0 0 votes
0 0 answers
1.1k
1.1k views
Give an example of a deterministic context-free language whose reverse is not deterministic.
0 0 votes
0 0 answers
363
363 views
Show that under the conditions of Exercise 16, $L_1 ∩ L_2$ is a deterministic context-free language.
0 0 votes
1 1 answer
629
629 views
Show that if $L_1$ is deterministic context-free and $L_2$ is regular, then the language $L_1 ∪ L_2$ isdeterministic context-free.
0 0 votes
1 1 answer
472
472 views
Show that every regular language is a deterministic context-free language.
3 3 votes
2 2 answers
605
605 views
Show that $L =$ {$w ∈$ {$a, b$}$^* : n_a (w) ≠ n_b (w)$} is a deterministic context-free language.
0 0 votes
1 1 answer
568
568 views
While the language in Exercise 9 is deterministic, the closely related language $L =$ {$ww^R : w ∈${$a,b$}$^*$} is known to be nondeterministic. Give arguments that make ...
0 0 votes
1 1 answer
524
524 views
0 0 votes
0 0 answers
486
486 views
Is the language $L =$ {$a^nb^m : n = m$ or $n = m + 2$} deterministic?
0 0 votes
0 0 answers
1.0k
1.0k views
Give reasons why one might conjecture that the following language is not deterministic. $L =$ { $a^nb^mc^k : n = m$ or $m = k...
1 1 vote
1 1 answer
591
591 views
For the language $L =$ {$a^nb^{2n} : n ≥ 0$}, show that $L^*$ is a deterministic context-free language.
0 0 votes
1 1 answer
602
602 views
Is the language $L =$ {$a^nb^n : n ≥ 1$} $∪$ {$a$} deterministic?
1 1 vote
1 1 answer
690
690 views
Is the language $L =$ {$a^nb^n : n ≥ 1$} $∪$ {$b$} deterministic?
0 0 votes
0 0 answers
328
328 views
0 0 votes
0 0 answers
334
334 views
Show that $L =$ {$a^nb^{2n} : n ≥ 0$} is a deterministic context-free language.
0 0 votes
0 0 answers
610
610 views
Give a construction by which an arbitrary context-free grammar can be used in the proof of Theorem 7.1.Theorem 7.1: For any context-free language L, there exists an npda ...
0 0 votes
0 0 answers
531
531 views
Give full details of the proof of Theorem 7.2 .Theorem 7.2 : If L = L (M) for some npda M, then L is a context-free language.
0 0 votes
0 0 answers
529
529 views
Find a context-free grammar that generates the language accepted by the npda $M =$ ({$q_0,q_1$}, {$a,b$}, {$A, z$}$,δ, q_0, z,$ {$q_1$}), with transitions ...