Questions tagged [pushdown-automaton]

A pushdown automaton (PDA) is a finite-state automaton with added stack based memory. It is a mathematical description of an algorithm for parsing context-free languages.

PDAs extend finite automata via a stack-based memory, and transitions can push/pop symbols to/from the stack. Deterministic PDAs (ones for which there exists only one legal transition at any time) are strictly weaker than non-deterministic ones; such is not the case for finite automata (PDAs are more powerful) or Turing machines (PDAs are weaker).

186 questions
2
votes
2 answers

Pushdown automaton with unequal variables

I'm having trouble coming up with a proper automaton that succesfully accepts the following: A string composed of any number of {a, b, c}* in any order of course, but n(a) + n(b) != n(c) Initially, I had assigned 'x' to be pushed into the stack for…
TacoB0t
  • 329
  • 4
  • 19
2
votes
1 answer

For a context free grammar, how do i convert it to an equivalent push down automaton?

For a context-free grammar G over Σ = {0, 1, 2}, with start variable S: S → 0S0 | 1S1 | 2S2 | Y Y → 22 How do i turn this into an equivalent Push-Down automaton
2
votes
2 answers

Design a Push Down Automata to count the number of characters

The Alphabet: a, b, c I'm trying to define a PDA which accepts a^n b^m c^p : n + p = 2k for some integer k, m = k, and n, m, p, k >= 0 I think some strings that would be accepted are: #abc#; #aabbcc#; #aaabbbccc#; #abbccc#; #aaabbc# etc The number…
Bobby S
  • 4,006
  • 9
  • 42
  • 61
2
votes
1 answer

Pushdown Automata for Palindrones

So I've found this PDA to accept palindromes in the language {0,1}*. However, I'm failing to understand how it could could accept '1' or '0'. In B it can read a 1 or 0 and push the same symbol to the stack and then go to C. However once it's in C,…
2
votes
3 answers

Pushdown Automata (PDA)

I'm trying to write a pda pushdown automata that accept a^2n b^n, n>0 but I'm not sure if the last part is correct (p0, a, z0) = (p0, az0) (p0, a, a) = (p0, aa) (p0, b, a) = (p1, λ) (p1, λ, b) = (p2, λ) <= (p2, 0, b) = (p1, λ) <= (p2, λ, z0) =…
userNew
  • 81
  • 1
  • 3
  • 10
2
votes
3 answers

Deriving a state machine from a BNF grammar

I am trying to put together a proof of concept of an XSS-safe string interpolation scheme. Given a string with substitutions, "Hello $planetoid!" I want break it into literal portions and substitutions ("Hello" planetoid "!") and then…
Mike Samuel
  • 118,113
  • 30
  • 216
  • 245
2
votes
1 answer

DPDA to Turing Machine?

Is there a way to convert a deterministic pushdown automata into a turing machine? I thought about putting the stack after the input on the tape, with '#' between them. But it seems kind of impossible to prove it formally. Do you have any…
2
votes
2 answers

Failure to deploy application to mobile device

I got the following error message from Visual Studio at deploy stage to the mobile device: An operation was attempted on something that is not a socket The only solution that worked was removing entire application folder from the Program Files on…
2
votes
3 answers

Can a pushdown automata have zero final states?

As per the question, can a pushdown automata have zero final states?
KingFish
  • 8,773
  • 12
  • 53
  • 81
2
votes
1 answer

PDAs: how to check if the number of pops is even or odd

Let's say that we have the context-free language L={0^n0^n, n>=0}. For the PDA: Μ = {A, Q, H, δ, q0, h0, F} we have: A = {"0"} H = {X, I} Q = {S, T} q0 = S h0 = X F = {T} Then, the δ function is: …
gon1332
  • 1,930
  • 1
  • 24
  • 30
2
votes
1 answer

How to solve this context free grammar

Give a Context free grammar for {w | w is an element of {a, b, c, d}* such that # of a+ # of b = # of c + # of D} how do i approach this question...?
2
votes
1 answer

Finite automata, Pushdown automata and Turing machine examples

I'm looking for some good source of Finite automata, pushdown automata and Turing machine tasks examples (for solving manually, by hand). I was searching around but didn't find nothing special so I'm wondering if someone's got some good examples.…
dperitch
  • 1,869
  • 2
  • 17
  • 22
2
votes
3 answers

How do I design the transition functions for this pushdown automaton?

I'm studying for a test on PDA, and I want to know how to design a pushdown automaton that recognizes the following language: L = {a^max(0,n-m)b^n a^m| n,m >=0} How can I design a transition function to recognize if n-m is greater than 0? And…
andandandand
  • 21,946
  • 60
  • 170
  • 271
1
vote
1 answer

how to figure out what language a PDA recognizes

Im trying to figure out how to deduce what language a PDA recognizes, and feel like im close but am still missing out. Take the following PDA for example. I can make a transition chart to figure out what my delta (transitions) are but im lost from…
jfisk
  • 6,125
  • 20
  • 77
  • 113
1
vote
0 answers

Confusion on the Syntax of a Python Module named automata.pda.npda within automata -lib

I have been asked to construct a NPDA that accepts the following language L = {anb2n : n ≥ 1}. I have completed the written assignment portion and after testing it thoroughly i am sure that my NPDA is correct. Here is an image using JFLAP: …
1 2
3
12 13