For each of the following languages L state whether L is reg
For each of the following languages L, state whether L is regular, context-free but not regular, or not context-free. Please explain or give valid reason. Thanks for your help!
L19= { bajb: j = n2 for some n 0 }. For example, baaaab L.
L20 = { w {a,b,c,d}* : nb(w) nc(w) nd(w) 0 }
Solution
The language accepted by the automaton A is all words over that contains each of the letters a, b, b, a at least once in that order.
L19= { bajb: j = n2 for some n 0 }..
The automaton is an NFA since more than one transition sometimes are possible for some states and alphabet symbols, bacabca / L(A) since it is not possible to reach any accepting state on this word.
L20 = { w {a,b,c,d}* : nb(w) nc(w) nd(w) 0 }
, where = {0, 1}, By definition, L for any language L, including the empty language
v {a} is an example of a non-empty language that does not contain the empty word .
The following is one possible grammar. It has been stratified to capture the desired precedence levels, and left recursion is used to impart left associativity
