Question

In: Computer Science

Give an example of a non-regular Context-Free Language that can be recognize by a Deterministic Pushdown...

Give an example of a non-regular Context-Free Language that can be recognize by a Deterministic Pushdown automata and one that cannot.

Solutions

Expert Solution

Non regular context free language (NRCFL) is that which is Context free but not regular.

a) L={an bn : n>0} is an example of NRCFL. It is not regular can be proved using pumping lemma for regular languages. It can be recognized by Deterministic push down automata. The steps would be push all a's to stack and pop a's for every corresponding b's. Empty stack or final state acceptability will hold.

b) L={w wr: w belongs to {a,b}+} is an example of NRCFL. It is not regular can be proved using pumping lemma for regular languages. It cannot be recognized by Deterministic push down automata because you would never know when the mid of input string occurs. Like w=abab wwr=ababbaba. You cant tell when mid occurs So deterministic PDA cannot recognize it.

For Non determistic PDA, the steps would be push characters to stack and when stack top and current character is same, there will be 2 paths, either to push character to stack assuming mid not reached or start popping character assuming this is the mid of input string.


Related Solutions

Regular => Context-Free Give a proof by induction on regular expressions that: For any language A,...
Regular => Context-Free Give a proof by induction on regular expressions that: For any language A, if A is regular, then A is also context-free. You may assume that the statements from the previous Closure under Context-Free Languages problem are proved. R is a regular expression if RR is: a for some a∈alphabet Σ, the empty string ε, the empty set ∅, R​1​​∪R​2​​, sometimes written R​1​​∣R​2​​, where R​1​​ and R​2​​ are regular expressions, R​1​​∘R​2​​, sometimes written R​1​​R​2​​, where R​1​​ and...
5 Regular => Context-Free Give a proof by induction on regular expressions that: For any language...
5 Regular => Context-Free Give a proof by induction on regular expressions that: For any language A, if A is regular, then A is also context-free. You may assume that the statements from the previous Closure under Context-Free Languages problem are proved.
What makes a deterministic context free grammar deterministic?
What makes a deterministic context free grammar deterministic?
Please write an example of a language that is Turing-decidable but not Context-Free. You can just...
Please write an example of a language that is Turing-decidable but not Context-Free. You can just state what the language is; no need to give a full TM algorithm for it. 1b) Please write an example of a language that is not Turing-decidable. You can just state what the language is; no need to give a full TM algorithm for it.
1. regular expressions as a mechanism to specify tokens, 2. defining context-free grammars for language constructs,...
1. regular expressions as a mechanism to specify tokens, 2. defining context-free grammars for language constructs, and 3. derivation of language terms and expressions based on a context-free grammar. 1 Regex 1. Define the regex for the following description of tokens: (a) Any string that starts with character t (b) Any string of at least length 3 that starts with t and ends with u (c) Any string that specifies the range of numbers between 11 and 23. (d) Any...
Can someone give me an example an non example of coefficient?
Can someone give me an example an non example of coefficient?
Determine whether or not the following languages are regular. If the language is regular then give...
Determine whether or not the following languages are regular. If the language is regular then give an NFA or regular expression for the language. Otherwise, use the pumping lemma for regular languages or closure properties to prove the language is not regular. 1) L = { 0 n1 k : k ≤ n ≤ 2k} 2) L = { 0 n1 k : n > 0, k > 0 } È { 1 k0 n : k > 0, n...
For each of the following grammars, first classify the grammar as Regular, Linear, Context-Free or Context-Sensitive,...
For each of the following grammars, first classify the grammar as Regular, Linear, Context-Free or Context-Sensitive, and then precisely describe the language generated by the grammar. (1) S → aRa R → aR | bR | є (2) S → A | B A → aaaA | є B → Bbb | b (3) S → RbR R → aRb | bRa | RR | bR | є (4)   S → aSbSaS | aSaSbS | bSaSaS | є    (5)...
Give reasons why one might conjecture that the following language is not deterministic. L = {anbmck:...
Give reasons why one might conjecture that the following language is not deterministic. L = {anbmck: n = m or m = k}.
a) Give 5 good examples of Regular language. b) Give 5 good examples of Regular Grammar.
a) Give 5 good examples of Regular language. b) Give 5 good examples of Regular Grammar.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT