Consider the language L1 a b i m n 0 Construct a context f
Solution
2)
Languages generated by L(G) = {ambn |m > 0 and n > 0} are L = {aa*bb*}
Regular Grammar is ->
S -> a A
A -> aA | B
B -> b | bB
1)
Its a known fact that \"Every regular language L is also Context Free\".
Therefore the context free grammar for L(G) = {ambn |m > 0 and n > 0} is
S -> a A
A -> aA | B
B -> b | bB
3)
Languages generated by L(G) = { anbn | n > 0 } is equal number of a\'s and b\'s.
For example, L = {ab, aabb, aaaabbbb ...}
Context free Grammar is ->
S -> aSb
S -> ab
4)
Assume Regular grammar exists, and it has N states. What happens when the input string has N+1 a\'s in it, followed by N+1 b\'s?
Since the FA only has N states, we must visit some state sT twice on seeing N+1 a\'s.
The FA cannot know whether we are entering sT for the first time, when we\'ve seen i < N a\'s, or the second time, when we\'ve seen j > i a\'s.
There must be a path from sT to an accepting state, since the input string is in the language.
The FA will accept an input string without an equal number of zeros and ones, since i != j, and there is a path to an accepting state from sT on the remaining input.
