0
Design a PDA that accepts all the strings containing equal number of a and b

Mumbai university > Comp > SEM 4 > TCS

Marks: 10M

Year: Dec 2014

0  upvotes
0

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, ε,z_0) = (F, ε)$

enter image description here

0  upvotes
Please log in to add an answer.

Next up

Read More Questions

If you are looking for answer to specific questions, you can search them here. We'll find the best answer for you.

Search

Study Full Subject

If you are looking for good study material, you can checkout our subjects. Hundreds of important topics are covered in them.

Know More