Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)

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|cite|improve this question

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|cite|improve this answer

Your Answer


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.