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

The python program allows the user to enter the Sales amount and Actual cost of a Product. Next, Python calculates the Loss Amount or profit Amount based on those two values using if-elif-else Statement

Mealy and Moore Machine

Context free grammar