0
5.7kviews
Design a PDA that accepts all the strings containing equal number of a and b
1 Answer
0
441views

The branch has been created keeping in mind that the string can start either with a or b.

Transitions for input abab:

$δ(S,a) = (A)$

$δ(A,a,z_0) = (A,az_0)$

$δ(A,b) = (B)$

$δ(B,b,a) = (B, ε)$

$δ(B,a,z_0) = (A)$

$δ(A,a,z_0) = (A, az_0)$

$δ(A,b) = (B)$

$δ(B,b,a) = (B, ε)$

$δ(B, …

Create a free account to keep reading this post.

and 5 others joined a min ago.

Please log in to add an answer.