• edited by
9,934 views
35 35 votes

A push down automation (pda) is given in the following extended notation of finite state diagram:

The nodes denote the states while the edges denote the moves of the pda. The edge labels are of the form $d$, $s/s'$ where $d$ is the input symbol read and $s, s'$ are the stack contents before and after the move. For example the edge labeled $1, s/1.s$ denotes the move from state $q_0$ to $q_0$ in which the input symbol $1$ is read and pushed to the stack.

  1. Introduce two edges with appropriate labels in the above diagram so that the resulting pda accepts the language $\left\{x2x^{R} \mid x \in \left\{0,1\right\}^*,x^{R} \text{ denotes reverse of x}\right\}$, by empty stack.
  2. Describe a non-deterministic pda with three states in the above notation that accept the language $\left\{0^{n}1^{m} \mid n \leq m \leq 2n\right\}$ by empty stack

5 Answers

28 28 votes

(a) $x2x^R$  

Say for some word $0112110$ we have to push every thing into the stack till $2$ . then we get $1$ then $1$ will be at top of stack so pop it or if get $0$ then $0$ will at top of stack so pop it. For any word of language it is applicable. $2$ is a mark that tell now we have to pop $0$ for $0$ and $1$ for $1$.

So, on the edge $q_0$ to $q_0$ add $0,s/0.s$

and on edge $q_1$ to $q_1$ add $0,0.s/s$

• edited by
20 20 votes

Part(b)

($ \epsilon$ is used to denote pop operation, $Z$ is the starting symbol on stack)

  • $(q_0,0, Z) \vdash (q_0,0Z)$
  • $(q_0,0, Z) \vdash (q_0,00Z)$
  • $(q_0,0, 0) \vdash(q_0,000)$
  • $(q_0,0,0) \vdash (q_0,00)$
  • $(q_0,1,0) \vdash (q_1,\epsilon)$
  • $(q_1,1,0) \vdash (q_1,\epsilon)$
  • $(q_0,\epsilon, Z) \vdash (q_0,\epsilon)$
  • $(q_1,\epsilon, Z) \vdash (q_1,\epsilon)$
• edited by
16 16 votes

a)

b)

$\lambda$ in the stack part is used to indicate "whatever be the input". And the additional $(\lambda,Z,\lambda)$ was added to pop the initial symbol from the stack.

• edited by
Position:
Show:

Related questions

51 51 votes
8 answers 8 answers
17.8k
17.8k views
Kathleen asked Sep 14, 2014
17,829 views
A multiset is an unordered collection of elements where elements may repeat any number of times. The size of a multiset is the number of elements in it, counting repetiti...
41 41 votes
2 answers 2 answers
9.1k
9.1k views
Kathleen asked Sep 14, 2014
9,124 views
Construct as minimal finite state machine that accepts the language, over $\{0,1\}$, of all strings that contain neither the substring $00$ nor the substring $11$.Conside...
51 51 votes
9 answers 9 answers
16.1k
16.1k views
Kathleen asked Sep 14, 2014
16,132 views
What can be said about a regular language $L$ over $\{ a \}$ whose minimal finite state automaton has two states?$L$ must be $\{a^n \mid n \ \text{ is odd}\}$$L$ must be...
14 14 votes
2 2 answers
4.4k
4.4k views
Kathleen asked Sep 14, 2014
4,417 views
Consider a bank database with only one relation transaction (transno, acctno, date, amount)The amount attribute value is positive for deposits and negative for withdrawa...