Lecture 8 - Pushdown Automata Flashcards

1
Q

What does a pushdown automata consist of?

A
  • a finite input alphabet
  • a finite set of states
  • a start state
  • a set of accepting states
  • control relations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does (Q1 , a , w) -> (q2 , v) mean?

A

if we are in q1 and a is at the head and w is on the top of the stack

then

move to q2 , push v onto stack and move head one position forward

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When does PDA accept an input?

A

if the input has been fully read , stack is empty and control is in the accepting state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can we check that the stack is empty?

A

There is no explicit check, however we can add a special symbol e.g. $ at the beginning, We know the stack is empty when we pop $

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is more powerful - deterministic or non-deterministic PDAs?

A

NDPDA

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What can be recognised by an NDPDA that cannot be recognised by a PDA?

A

language of palindromes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does it mean to be more ‘powerful’?

A

NDPDA recognises more languages that PDA.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a palindrome?

A

a sequence of characters that reads the same forwards and backwards

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How can we recognise palindromes with PDAs?

A

push first half onto stack
then as we read check each character is the same as the one in the top of the stack (also pop)
enter accepting state if all checks succeed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

aWhy do we need non-determinism for the palindrome problem?

A

as we need to guess where the middle of the stack is and also if the number of characters is even or odd

  • cannot be done first as we can only read the string once
  • also we may need an unbounded number of states as the string can be of any finite length
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is more powerful DFA or PDA?

A

PDA , as these can recognise more languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the language that is recognisable by a PDA?

A

context-free language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What cannot be recognised by a PDA?

A

a^nb^nc^n

How well did you know this?
1
Not at all
2
3
4
5
Perfectly