MHB Show that language is accepted by a pushdown automaton

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Language
AI Thread Summary
The discussion revolves around demonstrating that the language { w ∈ {a,b}*: w = a^m b^n, m ≠ n } is accepted by a pushdown automaton (PDA). Participants clarify that a string is accepted by a PDA if it starts with an initial stack symbol and ends in an accepting state after reading the entire string. They explore constructing a grammar to represent the language, considering both the conditions for acceptance and the need for asymmetry in the counts of 'a's and 'b's. Suggestions include drawing a PDA and providing formal specifications, with a focus on ensuring the grammar correctly reflects the language's requirements. Ultimately, the conversation emphasizes the necessity of constructing a PDA or a context-free grammar to validate the acceptance of the language.
  • #51
Evgeny.Makarov said:
The textbook by Lewis and Papadimitriou also does not have anything on deterministic context-free grammars, though it has a section on deterministic PDAs. Even Wikipedia, which has a detailed article on regular context-free grammars, does not give the definition of deterministic CFGs, though it has a small article about them. So, do you plan to undertake a little research project to study deterministic CFGs as a part of solving one problem?

I try to describe the function of the PDA:
For each $a$ that is read,we put an $a$ in the stack.
When,the first $b$ is read,we begin to pop an $a$ for each $b$.
But..how can the stack get empty,if we know that the number of $a$ that is read shouldn't be equal to the number of $b$ ??
 
Technology news on Phys.org
  • #52
evinda said:
I try to describe the function of the PDA:
For each $a$ that is read,we put an $a$ in the stack.
When,the first $b$ is read,we begin to pop an $a$ for each $b$.
But..how can the stack get empty,if we know that the number of $a$ that is read shouldn't be equal to the number of $b$ ??

Is it maybe like that:when the stack gets empty,we will have an accepting state and then it will be allowed that the automaton reads more $b$s??But,if it is like that,isn't it possible that the number of $a$ is equal to the number of $b$ ?? :confused:
 
  • #53
evinda said:
I try to describe the function of the PDA:
For each $a$ that is read,we put an $a$ in the stack.
When,the first $b$ is read,we begin to pop an $a$ for each $b$.
But..how can the stack get empty,if we know that the number of $a$ that is read shouldn't be equal to the number of $b$ ??

evinda said:
Is it maybe like that:when the stack gets empty,we will have an accepting state and then it will be allowed that the automaton reads more $b$s??But,if it is like that,isn't it possible that the number of $a$ is equal to the number of $b$ ?? :confused:

Indeed.
So if the stack gets empty (except for the initial stack symbol), we should make sure we're not in an accepting state.
Either we have to accept the string before that happens, or we have to make sure we read more $b$'s after it happens.
 
  • #54
I like Serena said:
Indeed.
So if the stack gets empty (except for the initial stack symbol), we should make sure we're not in an accepting state.
Either we have to accept the string before that happens, or we have to make sure we read more $b$'s after it happens.

Nice...Thank you very much for your help! :D
 
Back
Top