Given the following language:
L = { bi | i > 0 } U {aibi | i > 0 }
Is this language context free? regular?
I tried thinking about it, but no results so far..
L =
{ bi | i > 0 } U {aibi | i > 0 }
is Context-Free or a Regular language?
Language L is 'Context Free Language', In language L {aibi | i > 0 }
is subset of strings that makes L a context free language that means if string starts with a
then string should have equal number of b
(in prefix), and for counting how many a
s has been come we need a PDS memory (this can't be processes using FA because of finite memory available in FA).
Grammar for L will be:
S --> A | B
B --> b | Bb
A --> ab | aAb
Hint for grammar: Either string can start with b
and can contains any number of b
(if string starts with b
then no a
allowed). If string starts with a
then string patter should be {aibi | i > 0 }
.
I suggest you to read: "What is a regular language?" What is basically a regular language? And Why a*b*
is regular? But language { anbn | n > 0 }
is not a regular language