0

I read from this question that counter automata is a push down automata with only one symbol allowed on the stack (plus a fixed bottom symbol).

My question is counter machine means counter coexist with stack? I mean "DFA $+ 1$ counter" is same thing with "DFA $+1$ stack" . For example to generate this language $\{a^n b^n \mid n\geq 0\}$ we need counter + stack.

I also from that question Languages recognized by one counter automata form a proper subset of the context free languages. What does it mean? Could you give one example.

S. M.
  • 317
  • 4
  • 17

1 Answers1

1

You can recognize $\{a^nb^n\}$ with just a counter (which is incremented by an $a$ and decremented by a $b$). No additional stack is needed. (If you used a stack, it would only contain $a$s; in general a counter is functionally equivalent to a stack whose alphabet consists of only one symbol.)

The answer to the question you link to provides an example of a deterministic context free language which cannot be recognised by a one-counter automaton: $\{a^nb^ma^mb^n\}$.

rici
  • 12,020
  • 21
  • 38
  • But "proper subset of the context free languages." this is not understanding.. Give one example which proper is what – S. M. Oct 15 '21 at 17:47
  • @punia: $A$ is a proper subset of $B$ means that everything in $A$ is also in $B$, but at least one thing in $B$ is not in $A$. The answer gives an example of such a thing. – rici Oct 15 '21 at 17:50
  • This is possible ${a^nb^m}$ could be proper subset of ${a^nb^ma^mb^n}$ ? – S. M. Oct 15 '21 at 17:53
  • @punia: that's not what this is about (although it's true). The claim is that the set of languages recognisable with a one-counter automaton is a subset of the set of languages recognisable with a context-free grammar. It says nothing about individual languages in those sets. (A set of languages is a set of sets.) – rici Oct 15 '21 at 17:57
  • please could you explain with example.. I am struggling to understand.. Please – S. M. Oct 15 '21 at 18:04
  • @punia: there is a perfect example in the answer. You are confusing languages with sets of languages. You need to try to understand the difference. I don't know how to say it more simply. I'm sorry. – rici Oct 15 '21 at 18:12
  • Understood ... Thank you.. – S. M. Oct 15 '21 at 18:19