4

I have talked to my friend and he said this is the only place somebody could know how to solve it. It is the only exercise(from around 80) from exam revise I just do not know how to do at all.

Create pushdown automation for {w: #a(w) >= 2#b(w)}; and simulate it for the word ababaaa

# means number

Does any one of you is fluent enought in automation to solve it?

Greg
  • 203
  • 1
  • 5

1 Answers1

1

General strategy:

What you want to do is every time you read an input symbol a, if the stack has a b on it delete the b, and if the stack is empty/has a's, add an a. Every time you read a b, if the stack is empty/has b's add bb, if the stack has one a, remove the a and add a b, and if the stack has two or more a's, delete two of them. You're in an accepting state as long as the stack has no b's on it.

You can implement this strategy if you use epsilon transitions and intermediate states in a fairly straightforward way.

Greg
  • 203
  • 1
  • 5