Recent questions tagged peter-linz

0 0 votes
0 0 answers
375
375 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...
3 3 votes
0 0 answers
391
391 views
Show that $L = \{a^nb^m,n< 2m \}$ is a deterministic context-free language.
0 0 votes
0 0 answers
803
803 views
Find a regular grammar that generates the language L (aa ∗ (ab + a) ∗ ).
0 0 votes
1 1 answer
1.2k
1.2k views
Convert the nfa in Exercise 13, Section 2.2, into an equivalent dfa.
0 0 votes
1 1 answer
845
845 views
For Σ = {a, b}, construct dfa’s that accept the sets consisting of:(d) all strings with at least one b and exactly two a’s.(e) all the strings with exactly two a’s and mo...
2 2 votes
1 1 answer
2.3k
2.3k views
Find a NFA that accepts the complement of the language (ab*aa + bba*ab)
0 0 votes
0 0 answers
1.1k
1.1k views
Design an nfa with no more than five states for the set $\left \{ abab^n: n >0 \right \} \cup \left \{ ab{a}^n : n\geq 0 \right \}$
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
933
933 views
0 0 votes
0 0 answers
624
624 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
529
529 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
412
412 views
0 0 votes
0 0 answers
447
447 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
526
526 views
0 0 votes
0 0 answers
330
330 views
0 0 votes
1 1 answer
590
590 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
364
364 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
368
368 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
637
637 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
484
484 views
Show that every regular language is a deterministic context-free language.
3 3 votes
2 2 answers
607
607 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
574
574 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
532
532 views
0 0 votes
0 0 answers
494
494 views
Is the language $L =$ {$a^nb^m : n = m$ or $n = m + 2$} deterministic?
0 0 votes
0 0 answers
1.1k
1.1k 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
602
602 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
615
615 views
Is the language $L =$ {$a^nb^n : n ≥ 1$} $∪$ {$a$} deterministic?