Gate2017 cs Q65

0. Consider the context-free grammars over the alphabet {a,b,c} given below. S and T are non-terminals
G1: S → aSb|T,T → cT|∈
G2: S → bSa|T,T → cT|∈
The language L(G1)∩L(G2) is

  • Option : B
  • Explanation :
    The Context free grammar given over alphabets ∑{a, b, c} with S and T as non terminals are:
    G1: S → aSb|T,T → cT|∈
    G2: S → bSa|T,T → cT|∈
    Lets L(G1) is the language for grammar G1 and L(G2) is the language for grammar G2
    L(G1) = {ancmbn|n,m ≥ 0}
    L(G2) = {bncman|n,m ≥ 0}
    L(G1) ∩ L(G1) = {cman|m ≥ 0}; which is infinite and regular
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *