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!

L1= { xy: x,y {a,b}* and |x|=|y| }

L2 = { (ab)n anbn : n > 0 }

L3 = { x#y: x,y {0,1}* and x y }

Solution

A context-free grammar is ambiguous if there exists at least one word in the language generated by the grammar for which which there is more than one derivation tree, or, equivalently, for which there is more than one leftmost or more than one rightmost derivation.detailed account below for clarity. It is sufficient to just state the constraints according to the definitions and then simplify

A word is a finite sequence of symbols over a given alphabet .A language is a possibly infinite set of words over a given alphabet. An infinite language can be regular.

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. L1= { xy: x,y {a,b}* and |x|=|y| }

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. Thank

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site