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. 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. 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 Theory of Computation gatecse-2000 theory-of-computation descriptive pushdown-automata + – Kathleen 9.9k views answer comment Share Follow Print See 1 comment 1 1 comment reply svas7246 commented Jul 24, 2021 reply Follow flag A Thing to note here is s is anything or like any symbol on the top of the stack so whatever the top of the stack .S represents in that way not any special symbol of the language AND the transition on qo is 1,s/1.s 3 3 replyShare Please log in or register to add a comment.
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$ Praveen Saini answered Apr 23, 2015 • edited Jun 15, 2018 by Milicevic3306 Praveen Saini comment Share Follow See all 6 Comments 6 6 Comments reply Show 3 previous comments shraddha priya commented Nov 26, 2017 reply Follow flag In the diagram of a PDA which accepts by empty stack, there's no accept state, right? 1 1 replyShare Manu Thakur commented Nov 27, 2017 reply Follow flag @shraddha there should be one more transition on q2, eps| stackSymbol| eps, but seems it's some hypothetical PDA and they don't have any stack symbol at the bottom of the stack. so once input is a member of the language and when input is finished stack will be empty. 3 3 replyShare Akshatgupta0698 commented Oct 22, 2024 reply Follow flag Hello Everyone, @joshi_nitish, yes you are correct that s is not a stack symbol. But I think in the question they have used 'S' to just depict that whatever is on stack read it and push it back again and push another symbol along with it i.e., 0 in move 0, s/0.sSimilarly they wanted to depict on seeing 2 on input tape read the top and push just that symbol back, no change on stack via move 2, s/s 0 0 replyShare Please log in or register to add a comment.
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)$ saurav04 answered Nov 6, 2015 • edited May 9, 2021 by gatecse saurav04 comment Share Follow See all 15 Comments 15 15 Comments reply Show 12 previous comments KUSHAGRA गुप्ता commented Dec 5, 2019 reply Follow flag Just drawing what's written in answer by @@saurav04 sir. 2 2 replyShare avraw commented May 16, 2020 reply Follow flag The question asks for a 3 state PDA so this shouldn't be an acceptable answer isn't it? 1 1 replyShare Manu Shaurya commented Jul 6, 2021 reply Follow flag @avraw In that case one can simply add another state q2 from q1 where ∊,z/∊. 2 2 replyShare Please log in or register to add a comment.
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. krish__ answered Jan 5, 2018 • edited Jan 5, 2018 by krish__ krish__ comment Share Follow See all 2 Comments 2 2 Comments reply commenter commenter commented Jul 21, 2019 reply Follow flag What software did you use to construct this? 0 0 replyShare russkie commented Nov 2, 2019 reply Follow flag This is mentioned in Peter Linz's book: http://www.jflap.org/ 1 1 replyShare Please log in or register to add a comment.
13 13 votes a on the state q0 edge from q0 to q0 add 0,s/0.s0,s/0.s and on state q1 edge from q1 to q1 add 0,0.s/s akshita_jain answered Sep 5, 2020 akshita_jain comment Share Follow See 1 comment 1 1 comment reply P0535_Yedidyah_Sagar commented Oct 1, 2025 reply Follow flag The only perfect answer 1 1 replyShare Please log in or register to add a comment.
0 0 votes For part b :- Gajendra Raturi answered Nov 17, 2024 Gajendra Raturi comment Share Follow 0 reply Please log in or register to add a comment.