Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am initiating myself into TOC and using sort of random resources from the web. I was looking at this problem from a Berkeley problem set: Construct a PDA to accept $$ L = {a^ib^j|i \neq j , 2i \neq j} $$ And I don't understand the given solution here.(Problem 4) http://www.cs.berkeley.edu/~isabelle/cs302/ps3-solutions.pdf

When can we say this machine accepts a string? From my understanding, it seems to accept ab,aabb,aaabbb etc as well when it shouldn't.

share|improve this question

1 Answer 1

There are multiple different definitions of push-down automata that differ in the details of the acceptance condition. One common condition that is (presumably) in use here is that a word is accepted if:

  1. The push-down automaton arrives in an accepting state,
  2. The stack is empty.

If you follow the behaviour of the automaton in the answer, you will find that for words $a^ib^i$ or $a^ib^{2i}$, if you arrive in a final state, the stack will not be empty, so the word is not accepted.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.