Design a Context free grammar that contains equal number of a's and b's over input {a,b} i.e. no(a)=no(b)

 Design a Context free grammar that contains equal number of a's and b's over input {a,b} i.e. no(a)=no(b)

Answer-

The Context free grammar (G)=(V,Σ,P,S)

Where 

V={S}

Σ={a,b}

P={S→aSbS|bSaS|λ}

S={S}

Comments

Popular posts from this blog

भारतीय संविधान: बी.एन. राव से डॉ. अंबेडकर तक का सफर

भारत का सिंधु नदी संधि को रोकने का पाकिस्तान पर प्रभाव – एक विश्लेषण

QS वर्ल्ड यूनिवर्सिटी रैंकिंग 2026 में भारतीय विश्वविद्यालयों का प्रदर्शन