Describe a language accepted by a pushdown automata.

In summary, when an A is pushed on the stack, it will stay in the initial state, and will only accept $a$ after that. If an A is popped from the stack, it will move to the final state and will still accept $a$.
  • #1
JamesBwoii
74
0
View attachment 3640

That's the question. I've had a go at drawing a diagram to help me explain it.

View attachment 3641

My understand is that from the start state, an A pushes an A to the stack and stays in the initial state s. Getting a B whilst in state s pops an A from the stack and moves to final state f. Getting a B whilst in state s also pops an A from the stack and remains in state f. And getting an A in the final state whilst A is on the stack remains pops an A from the stack.

How do I describe this language?

I initially thought it might be:

${a^n b^n ∈ {a, b}∗| n ≥ 0}$

but I'm pretty sure that's wrong now.
 

Attachments

  • Capture.PNG
    Capture.PNG
    6.5 KB · Views: 65
  • SOzGksL.jpg
    SOzGksL.jpg
    92.3 KB · Views: 60
Technology news on Phys.org
  • #2
JaAnTr said:
View attachment 3640

That's the question. I've had a go at drawing a diagram to help me explain it.

View attachment 3641

My understand is that from the start state, an A pushes an A to the stack and stays in the initial state s. Getting a B whilst in state s pops an A from the stack and moves to final state f. Getting a B whilst in state s also pops an A from the stack and remains in state f. And getting an A in the final state whilst A is on the stack remains pops an A from the stack.

How do I describe this language?

I initially thought it might be:

${a^n b^n ∈ {a, b}∗| n ≥ 0}$

but I'm pretty sure that's wrong now.

Hi JaAnTr,

Your drawing looks good to me!

Initially the stack is empty.
That means only $a$ will be accepted, which will also push $a$ on the stack.
After that $a$ will not be accepted any more, since the top of the stack holds $a$.

So we can only continue with $b$, which will pop $a$ from the stack, leaving the stack empty.

From there there is no valid transition any more, since the stack is empty.
Luckily we're in a final state when that happens.
 
  • #3
How would I go about describing the language?

I think it needs to be in the same form as this $ {a^m {b}^{2m} ∈ {a, b}∗| m ≥ 0}$ but obviously it will be a different language.

Thanks!
 
Last edited:
  • #4
JaAnTr said:
How would I go about describing the language?

I think it needs to be in the same form as this $ {a^m {b}^{2m} ∈ {a, b}∗| m ≥ 0}$ but obviously it will be a different language.

Thanks!

At the start we can only accept $a$, and after that only $b$, and then nothing anymore.
So I believe that the language is $\{ab\}$.
 
  • #5
Oh ok thanks, that makes sense. :D
 

1. What is a pushdown automata?

A pushdown automata is a theoretical computational model that is used to recognize context-free languages. It is composed of a finite set of states, an input alphabet, a stack, and a transition function. The automata reads input symbols one at a time and can push or pop symbols from its stack, allowing it to remember previously read input symbols.

2. How is a language accepted by a pushdown automata?

A language is accepted by a pushdown automata if, starting from the initial state with an empty stack, it can reach an accepting state by reading the input symbols and manipulating its stack according to the transition function. If the automata reaches an accepting state, it accepts the input string as a valid string in the language.

3. Can any language be accepted by a pushdown automata?

No, not all languages can be accepted by a pushdown automata. Only context-free languages, which can be described by a context-free grammar, can be accepted by a pushdown automata. Regular languages, which can be described by a regular expression or a finite automata, can also be accepted by a pushdown automata as they are a subset of context-free languages.

4. How does a pushdown automata differ from a Turing machine?

The main difference between a pushdown automata and a Turing machine is the memory they use. A pushdown automata uses a stack, which has a limited memory, whereas a Turing machine uses an infinite tape for memory. This allows a Turing machine to recognize more complex languages, including non-context-free languages.

5. What are some real-world applications of pushdown automata?

Pushdown automata are used in a variety of fields, including programming languages, natural language processing, and artificial intelligence. They can be used to validate the syntax of a programming language, analyze the structure of sentences in natural language, and model decision-making processes in AI systems.

Similar threads

  • Programming and Computer Science
2
Replies
53
Views
9K
  • Programming and Computer Science
Replies
10
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
558
  • Introductory Physics Homework Help
Replies
19
Views
1K
  • Programming and Computer Science
Replies
1
Views
650
  • Precalculus Mathematics Homework Help
Replies
4
Views
750
  • Atomic and Condensed Matter
Replies
3
Views
879
Replies
13
Views
2K
Replies
16
Views
1K
Back
Top