You are on page 1of 44
FORMAL LANGUAGE PUSHDOWN AUToMarin. xt Free Grammar e re 4.0 finite state autom: Sognized by WUT 201 ‘}push-down automata b) 2.way liner bounded automata, gone (A 4) both (b) & (c) posh down automation is different from a finite automation because of d head a aparend ne OF momary inthe form Uf stack qjase 4) all of these assver: (0) poAis the machine format of [WBUT 201: 2) Type Cenguegs b) Type 1 Language . ¢) Type 2 Language 4) Type 3 Language uaswer: (©) The difference between finite automata and PDA }UT 201; 2) Reading Head b) Input Tape Me e «Finite Control ay Stack answer: (d) Short Answer: tions {.Design a PDA which accepts the language. L={We (a, b)* |Whas equal number of a&b}. _ [WBUT 2006, 2008, 2012, 2018] OR, Construct a PDA accepting the set of all strings over {a,b} with equal number of asand b's. s [WBUT 2009, 2010} Answer: Counting the number of a’s and B’s, which is easily done with a stack. Here we need not een worry about the order of the a’s and b’s. We can insert a counter symbol, say 0, into te sack whenever an a is read, then pop one counter symbol from the stack when a } is (nod, The only difficulty with this'is that if there a prefix of w with more 6's than a's, Vewill not find a 0 to use. But this is easy to fix; we can use a negative counter symbol, ‘|, for counting the bs that are to be matched against a’s later. The complete solution SannPDA “=(/q.,q,},a,b},{0,1,2},5,0,2,{4/}) with deiven as Hay,2)={( ana)h, 5 (dys4s2) = {(4.9)}> 5(dorbs2) ={(dosl2)}} FAT-101 5(go.2,0) ={(,,00)}, 5(4)sb.0) ={(qosA)} 5(40144,1) ={(q,,)} 5 (dosb.1)={(qos11)} In processing the string baab, the nPDA makes the moves (qo.baab,2) | (q.,aab,12) |(qu.4b,2) + (qo>b,02) (4004.2) F(a).4.2) and hence the string is accepted. 2. Construct an NPDA that accepts the language generated by the Productions + aSa|bSb|c. Show an Instantaneous Description of this string abcba for this problem. [WBUT 2007, 2018) Answer: S>aSa => abSba => abcba 3. What are the nonempty transitions in an NPDA? [WBUT 2008, 2019] Answer: Each move an NPDA reads a symbol from the input, changes the contents of the stack (that is, pop a symbol off and/or push several symbols into the stack), and changes the internal state of the npda. Definition: An npda is M = def (Q; 3; P; +; q0; z; F), where Qis a (finite, nonempty) set of states, Dis the (finite, nonempty) input vocabulary, T is the (finite, nonempty) stack alphabet, +:Q£(E[fg) £1! finite subsets of Q£T 0 is the state transition function, q0 2 Qis the initial state, z2T is the initial stack symbol, and F 1 Qis the (finite, nonempty) set of accepting states. An npda may include ,-moves of the form +(q; ,; x). Note that every moves pops off exactly one symbol from the stack. 4. Construct a Push Down Automata equivalent o the following Context Free Grammar G =(Vn, Vt, P, S) with Vn ={S, E}, Vt={0,1} and P is define transition follows: S> 0S1/A A-> 1A0/S/e o Now check thi i not. low check the string 001011 is acceptable by this Push Down Autoe (OuT 20151 The PDA is defined as follows: at FAT-102 FORMAL LANGUAGE AND. ae({a}. {0.1}; {S.A.0,1},5,,q, 8, 4) § isdefined by the following rules:- (@ A, S)= (@0SD} (@ A, A)= {,180),(q,8)} (40.0) = {(@, AD} rt: 5(q,1,1) = {(@, AD} 7 Part: ; 1011,z) = (q, O1011, (ion Heese gia ham 5, Construct a PDA to accept the language Z={a"b'c"; n,m 21} by empty stack and by final state. Answer: be Construct a PDA to accept the Language L={a'b'c"; n,m>I} (c,z/2) A Ore (a, z/az) (a, a/aa) "Transition Functions: (Stack) (45,4, 2) = (4042) 6(q5,4,4) = (40,44 9(4,0,4) Sp pop whenever ‘b* comes 6(9,,b.a)=(406 4(4,,¢.2)=(4,+2) 2)=(4,,2) (4.0 (final ay - Here, no. of a’s are equal to No. of b’s => so, push for ‘a’ and Pop for *b” => approach is'used, push ‘a’ from the beginning do, nothing for *c’, accepted by the empty stack FAT-103 POPULAR PUBLICATIONS Long An: 1. Define Pushdown Automata. [WBUT 2006, 2009, 2010, 2011, 2012, 2018) Answer: A pushdown automaton is a finite automaton that can make use of a stack containing data. Pushdown automata differ from normal finite state machines in two ways: 1, They can use the top of the stack to decide which transition to take. 2. They can manipulate the stack as part of performing a transition. Pushdown automata choose a transition by indexing a table by input signal, current state, and the top of the stack. Normal finite state machines just look by input signal and current state: they have no stack to work with. Pushdown automata add the stack as a parameter for choice. Given an input signal, current state, and a given symbol at the top of the stack, a transition path is chosen. Pushdown automata can also manipulate the stack, as part of performing a transition. Normal finite state machines choose a new state, the result of following the transition. The manipulation can be to push a particular symbol to the top of the stack, or to pop off the top of the stack. The automaton can alternatively ignore the stack, and leave it as it is. The choice of manipulation (or no manipulation) is determined by the transition table. 2. Construct PDA for L={ww":w belongs to (0,1)"}. [WBUT 2011, 2012] OR, Construct a PDA to accept L = {WW*|W belongs to (a, b) and W" is reverse string of W} by empty stack and final state. [WBUT 2013] ‘Answer: Hear the main concept is that the symbols are retrieved from a stack in the reverse order of their insertion. When reading the first part of the string we push consecutive symbols on the stack. For the second part, we compare the current input symbol with the top of the stack, continuing as long as the two match. Since symbols are retrieved from the stack in reverse of the order in which they were inserted, a complete match will be achieved if and only if the input is of the form ww. An apparent difficulty with this suggestion is that we do not know the middle of the string, that is, where w ends and w" starts. But the nondeterministic nature of the automaton helps us with this; the nPDA correctly guesses where the middle is and Switches states at that point. A solution to the problem is given by M ={Q,%,0,6,4),2,F} = (do.4i.4), 2= {a,b}, ite T={a,b,2}, = oh ecPimGs) The transition function can be visualized as having several parts: a set to push w on the stack, 4(4v,4,a)= {(q,,aa)}, FAT-104 FOr RMALLANGUAGE 4 iD AUTOMATA THEORY ~~ 5(40,b,a) = {(q, pe vba), 8laaa.b)= (Gab), : A(Qb.8)= 0), . (40.4.2) = {(4, a2), 5(q.b,2) = {(q,b2)}, set to guess the middle of the String, (40.4.4) = {(g,,a)} 9(40»4,b) = {(q,,b)}, aset tO match w* against the contents 9(4.4.a)= (g,,2), 5(a,,5,0) = {(a,,4)}, 5(4,4,2)= {(q,,2)}, torecognize a successful match. The sequence of moves in accepting abba is (eabb0.2)F (ay, baa,az) F(g,,ba,baz) + (@,.ba,baz) + (q,.a,ae) H(@,4,2) K(g:.2) The nondeterministic altenative for locating the middle of the string is taken at the third move. At that stage, the PDA has the instantaneous descriptions (7,,ba, baz) and has two choices for its next move. One is to use 5(q,,b,b)= {(q,,bb)}, and make the move (q.,6aa,az) | (q,,a,bbaz) The second is the one used above, namely 5(g,,,6) = {(g,,b)}, only the latter leads to acceptance of the input. Where the PDA switches from state qo to q). of the stack, and finally 3.Construct an equivalent PDA for the following CFG. [WBUT 2013, 2016] S> aAB/bBA A>bS/a B-aS/b Show an ID for the string abbaaabbbab for the PDA generated with stack ‘escription. Answer: "Part: Constructing the PDA We note th i mmar is already in Greibach Normal Form. Hence erbDR oe ‘one state -- q (ie. Q = (q}); Which is also the start state and ‘iefinal state ((i.e., F = ©). ‘ ae Gs ok eae = {a, b} and the stack alphabet consists of only the non- “minals, ie. I= {S, A, B}, with S as the start symbol. [eauted PDA is , where is: ¢25)= (q, AB)} 'S)= {(q, BA)} FAT-105 POPULAR PUBLICATIONS (q, a, A) = Tae e)} (qb, A) = {(, S)} (q, a, B)= {(@, S)} (q, b, B) = {(q, )} 2™ Part: Instantaneous Descriptions (IDs) form string abbaaabbbab. (q, abbaaabbbab, S) F (q, bbaaabbbab, AB) F (q, baaabbbab, SB) k (q, aaabbbab, BAB) fF (q, aabbbab, SAB) k (q, abbbab, ABAB) Fb (q, bbbab, BAB) k (q, bbab, AB) k (q, bab, SB) F (q, ab, BAB) EE (q, b, SAB) te (q, €, BAAB) z z Since the ID is NOT (q, ¢, €) and there is no input to scan, the PDA rejects the string. Note: The above ID corresponds to the below mentioned left-most derivation in the given grammar: S@aAB é abSB é abbBAB é abbaSAB é abbaaABAB éabbaaaBAB é abbaaabAB é abbaaabbSB ¢ abbaaabbbBAB é abbaaabbbaSAB é abbaaabbbabBAAB (No further derivation possible). 4. D-fine PDA by giving a block diagram. [WBUT 2014, 2017] What is the difference between DPDA and NPDA? [WBUT 2014] Design a Non Deterministic Pushdown Automata for accepting the string L = {(Set of all palindromes over a, b)} by Empty stack [WBUT 2014] OR, Design a non-Deterministic Pushdown Automata for accepting the string L={WCW" \We(a,b)*} and W* is the reverse of W by Empty stack. [WBUT 2017] Construct an equivalent PDA for the following Context Free Grammar. S—aA A aABCibB/a Coc Show an ID for the string aabbbc for the PDA generated. [WBUT 2044, 2017] Answer: 1" Part: ( A pushdown automata (PDA) is a seven-tuple: P= OP, 2.1 ,8,40.29,F). where : © Qs a finite set of states + Lisa finite input alphabet, FAT-106 R : MAL LAN ‘AGE AND AUTOMA’ risa finite stack alphabet §:9xDU{e} xT 208 is the start state, ner is the start symbol for the stack, and FeQ isthe set of accepting states. isessentially an ©-NFA with a st oussati tack, ey Consumes an input symbol, Beate He State (or stays in the old). 3. Replaces the top of the stack b ‘sti i pushes a string onto the stack), Y any string (does nothing, Pops the stack, or OR) is a 's the transition function, Finite Input Tee atte Ei aceeheteet control y* Part: Stack Hfieence between DPDA and NPDA 1. The transition function 6 is atmost single-valued for DPDA, multi-valued for an NPDA. Formally: | 5(g,,.2,5)|=0 or 1, for every qeQ,aeZufe} and be F. 2. Both NPDA and DPDA may have ¢-transitions; but a DPDA may have a €-transition only if no other transition is possible. s*Part: ll string may belong to the Language set. The PDA will be designed in such a way that ul string can be accepted by the PDA. The transitional functions will be 5(4)+4, 2) > (4o>2120)> 9(40,; 2) > (40> 220)» 5 (4514, 2,) > (4952.2), (4+4)s 9(90,6;2,) > (do 214)» 9(4054, 2) > (dos 2122), ( ( ( ( 9(45b, 2) > (4032222): (44)» ( ( ( ( (4,4, 21)» (4.4), 9(4),5,2,) > (41,4) ; : 90+4, 2) >(q,, 2). // this function is for accepting null string, 4(4,,A,2,) > (q))) ‘accepted by empty stack, 8(4,, 4, z,) »(q, ,z) accepted by final state o FAT-107_ POPULAR PUBLICATIONS 4" Part: Question is wrong, 5. Explain how a string be accepted by a PDA? ONBUT 2047 Answer: oi There are two different ways to define PDA acceptability. Final State Acceptability é In final state acceptability, a PDA accepts a string when, after reading the entire String, the PDA is ina final state, From the starting state, we can make moves that end Up ing final state with any stack values. The stack values are irrelevant as long as we end up ing final state. For a PDA (Q, ¥, S, 8, qo, I, F), the language accepted by the set of final states F is ~ L(PDA) = {w | (qo, w, 1) F* (q, €, x), 4 € F} for any input stack string x. Empty Stack Acceptability eee Here a PDA accepts a string when, after reading the entire string, the PDA has empties its stack. For a PDA (Q, 5, S, 8, qo, I, F), the language accepted by the empty stack is — L(PDA) = {w | (qo, W, I) F* (g, €, €), dE Qh FAT-108 +} c ——————— FORMAL, LANGUAGE AND AUTOMATA THEORY 4, The intersection of CFL an " a) need not be regular [WBUT 2006, 2012] b) need not be CF always regular not ae moo 4) none of these LOR isa CFL So itis correct, but (iv) should be the answer, 2.The class of context free lan, a) concatenation Sage is not closed under [WBUT 2008, 2009, 2013] er: (C) d) repeated concatenation Answer: ¢) intersection b) union 3, The grammar G=({S},{0,1}, P,S) where P=(S—0S1, S0S, S-S1, SO} is a a) recursively enumerable language c) context sensitive language Answer: (d) b) regular language | [WBUT 2008] 4) context free language 4, Which of the following statements is wrong? [WBUT 2010] a) Aturning:machine cannot sol ve halting problem ) Set of recursively enumerable languages is closed under union ©) A finite state machine with 3 stacks is more powerful than infinite state machine with 2 stacks 4) Context sensitive grammar can be reco gnized by a linearly bounded memory machine Answer: (c) 5. The intersection of CFL & RE is always i [WBUT 2014, 2015] a) CFL. b) RE c) CSL d) CFLOR CSL Answer: (a) 6. Useless symbols in CFG are [WBUT 2018] 2) Non-generating symbol and non-reachable symbols ») Null alphabets and null string ©) Non-terminal symbols 4) All of the above Answer: (b) FAT-109 e ions Short Answer intersection and complement operation, 4. Prove that CFLs are not closed under [WBUT 2008, 2010, 2016) inguage and a regular language is 4 [WBUT 2008, 2010} Prove that the intersection of a context-fr context-free language. aa Explain Ogden's Lemma for CFL. [WBUT 2013, 2016) Answer: Ogden's Lemma In the theory of formal languages, ‘over the pumping lemma for context-free languages. 2 Ogden's lemma states that if a language L is context-free, then there exists some number p> 0 (where p may or may not be a pumping length) such that for any string w in L, we can mark p or more of the positions in w as "distinguished"; then w can be written as Ogden's lemma provides an extension of flexibility Ne ra . ie with strings u, v, x, y and z, such that v and y have at least one distinguished position between them, vxy has at most p distinguished positions, and uv ‘xy ‘zis in L for every i2 0. < Note that this is trivially true if the language is not infinite, since then p just needs to be longer than longest string in the language. Ogden's lemma can be used to show that certain languages are not context-free, in cases where the pumping lemma for context-free languages is not sufficient. Observe that when every position is marked as distinguished, this lemma is equivalent to the pumping lemma for context-free languages. Next Part: Let L, be a context-free language and L, be a regular language. Then we have to prove that L, 0 L, is context-free. Proof: g Let M, =(,2,1,6,,49,2,F,)be an npda which accepts J, and M, =(P,E,d,,p,,F,) be F) a dfa that accepts 1, We construct a pushdown automation M=(0,3,1°,5,4,, which simulates the parallel action of M, and M, ; whenever a symbol is read from the input string, Mf simultaneously executes the moves of M, and M,. To this end we let De OsOrP %=(9.Po), F=RXR, and define 5 such that ((4,,p,),x)€5((q,,p, ),a,b), if (4ux)€S (G45), and 8,(p,,a)= p, FAT-110 ORMAL LAN ator an arodney this, We also require that @ = A, then d no ee y= Py. In the other words, the states of M are beled with pairs (9,, p,), Tepresenting the res : an 2 Pective states in which AM and M, can te after reading a certain input string, tt jg “straightforward induction ane to show i ((goPs)-¥2) Fa((4esp,)s2), with EK, and p,€F,ifand only (2) F (G2), and OG ie5, therefore, a string is accepted by 47 if and only ifit is accepted by M, and M,,, that is, ifitis in 1(M)OL(M,) = 1, NL. FAT-LLL TURING MACHINE i i [WBUT 2013) 4. A shift register is a) Mealy M/C b) Turing M/C c) Moore M/C 4) All of these Answer: (d) 2, Difference between Turing Machine & Two way FA is in [WBUT 2014, 2015, 2017] a) Input Tape b) Read write head c) Finite Control d) All of these Answer: (d) 3. Which of the following statements is false? [WBUT 2014, 2015, 2017] a) The halting problem of Turing machine is undecidable : b) Determining whether a context free grammar is ambiguous is undecidable c) Given two arbitrary context free grammars G, and Gz. It is undecidable whether L(G,) = L(G2) 2 d) Given two regular grammars G, and Gz. It is undecidable whether L(G,) = L(G.) Answer: (d) 4, Which is not a part of the mechanical diagram of ‘Turing Machine’? [WBUT 2018] a) Input Tape b) Read-write head c) Finite control d) Stack Answer: (d) 5. Which of the string is accepted by Turing Machine? [WBUT 2018] a) L=a'c"b", where m,n>0 b) L=a"b"c', n,i>0 ) L=a"b'c, where n>0 4) All of these Answer: (d) Short Answer Juestions 1. What do you mean by Halting problem of a Turing machine? [WBUT 2008, 2013] OR, Why a Turing machine is called linear bounded Automata? [WBUT 2008] What is halting problem in Turing machine? [IWBUT 2015, 2016] Answer: 1" Part: A Turing Machine is a mathematical object to define “Computing”, It has a “doubly- infinite” tape for input and a state machine that governs its running. A Tuning Machine can behave like an algorithm, especially for problems with “yes/no” answer. In such @ case, the machine starts with the description of a problem on the input tape and comes to FAT-112 AND AUTOMA’ RY 8 Upon the ts and ing yes” halt or a “no” halt dependin, chine never comes to any of he hal related concept of “Universal Tyr Ce eee accel ) — ‘ Ther ete state machine of another Turing machine ‘M’ and ») x ~ The Universal Turing Machine then proceeds to ‘simulate’ qe halting problem of Turing Machine is the quring Machine that is given to sj angwer Yes / No depending upon wi pot halt, respectively, on input ‘a *, Tit Bove’ that the halting problem is Unsolvable i.e. there can be no such machine as descriDed. Tesult, However, it may happen that the 20 On running, Machine” is a ‘Turing machine that can take two 2 Part: A linear bounded automata is anon deterministic turing machine satisfying the following two conditions. |. Its input alphabet includes two special symbols ¢ and S, the left and right end markers respectively. 2. The LBA has no moves left from or ri over ¢ or $. The linear bounded automaton is simply a turning machine which instead of having potentially infinite tape on which to a i Compute, is restricted to the portion of the tape containing the input x plus the two tape squares holding the end -markers. An LBA will be denoted as M=(Q,2,T, 8, qo, ¢, S, F) where'Q, 5, I, 6, qo and F are as for a non-deterministic TM; ¢ and $ are symbols in ¥, the left and right end-markers. L(M), the language accepted by M, is {w|w is in (E-{¢, $)° and a¢wSt> a8 for some q in F} ight from $, nor may it print another symbol 2. Construct a Turing machine that accepts all strings over {0, 1} with an even number 0’s and even number of 1’s. . (WBUT 2011) Answer: The requited Turing Machine is M=({4o,492445s4suces Frat }-TrAs{0.1}.54or{4suce»4ear}) Where 6 is as given below: 9(45,0) = (4,,0,) (4051) = (q,,0,R) 9(qo,A) = (qSUCC}A, L) (4,0) =(q,,0,R) FAT-113 POPULAR PUBLICATIONS 6 (4,51) = (4208) 6 (4,4) = (GFAIL,A, L) 8 (43,0) =(43,0,R) 5(4zs1) =(2.0,R) 5(4,,A) = (QFAIL,A,L) 5(q3.0 R) (4501) =(G0,R) 6 (4,4) = (FAIL, A,R) 3. Design a Turing Machine that recognizes the language of all string of even length over the alphabet {a, b). [WBUT 2013) Answer: Let Turing Machine (7) =(Q,5,T, 6, qo, h) D={a,b} P={a,b,#} O={4.4,h} Here is h half state when machine halts after accepting the language, q, is initial state a tease 4 % (%4,L) (4,6, £) (1, #,N) % — (%4,L) (do., L) Undefined move h Undefined move Undefined move Accept a/(a,L),b/(b,L) 1. a) Design a TM that accepts {one} Fe bas (IWBUT 2013, 2016) b) Design a TM which can multiply two positive integers: #1!) [WBUT 2013) Answer: ‘) a) Let us now follow the working of TM M; with input 000111. FAT-114 a Ne ue FORMAL LANGUAGE AND AUTOMATA THEORY jnitial configuration is ; TiO ofthe pat sng, TH Mes he tie an tend poabe fost © of he i . a This corresponds to M, being as given in Fig - 1. The ent 1 OX rey i . i‘ ure Seon Presenting the finite control of the machit co LETT pT pl fig: | Machine Mf in Initial Configuration ev Aeon ig: 2M; After First Move ' ; hat the move is (B, X, R), i.e., the fs tape is overwritten by an X and the head moves right to Second) 0 of the input. This Bives us the next configuration $ ¢ pxBOOLLTD, as shown pictorially in Fig - 2 Following up with the next moves, we find that the su SXOBOLI1b followed by bXOOBII1b. two configurations is as seen in Fig - 3, PEPE EE “PEP PPppEpTy : | Fig: 3 Mi When on First 1 Fig: 4 M, After Marking First 1 to ¥ ‘Ee Tepepyp bye bsequent configurations are: The state of the machine in the last of the above I ic Fig: 5 M, After Matching One Pair of 0 and 1 At this point, we find the applicable move is (C, ¥, L) which means that the next configuration is bXOCOY11b. Observe in Fig - 4 that the machine has moved left after marking the first 1 to Y. At this point, the next applicable move. i.e., (C, 0, L), will effectively skip over the 0-s till the head is positioned on the first (up to now, the only) X encountered. The configurations leading to that ‘ ee nee ae BXCOOY11b followed by bCXOOY11b. The machine position now is as given in Fig-5, E The next move is (S).!R) and hence the next configuration is bXSOOY11b. Let us summarize what the machine has done up to ue point: |. Ithas marked the first 0 of the inputstringtoX = 2. Then it has skipped the following 0-s while moving right till it encountered the first | which was marked to ¥ and the machine moved left FAT-115S POPULAR PUBLICATIONS ‘ ine ski i i ill it got an X upon which j sw the machine skipped all 0-s while moving left til !pon ‘ moved Hatt fed ‘a condition similar to what was at the beginning of the | s 3 moved right and reached run as shown in Fig - 6. al Fig: 6 M, Back in State S Let us now augment the above summarization with the emphasized phrases: 1. Ithas marked the first 0 of the input string to X. However, if there is no 0 to mark but there is a Y below the head then it moves right over the Y -s till it reaches the end of input whence it halts with SUCCess 2. Then it has skipped the following 0-s or Y -s while moving right till it encountered the _rst 1 which was marked to Y and the machine moved left 3. Now the machine skipped all 0-s while moving left till it got an X upon which it moved right and reached a condition similar to what was at the beginning of the run. However, if there is no 0 to skip, it halts with SUCCess Ifyou properly visualize the moves, you will see that our Turing Machine M;: © Checks out one 0 to X and one | to Y in each zigzag movement over the input. © Declares SUCCess if and only if the number of 0-s marked as X is exacily the same as the number of I-s marked as Y Hence our TM recognizes only inputs that are of the form 0"l",n 21. b) Design a TM, which can multiply two positive integers We can use subroutines for design of TM which can multiply two positive integers 0" 10" [mxxn: operators are represented with 1] [If m=3,n=2, mxn=6] So at the final state the TM will halt with 6 zeros and all surrounded by Blank B. i) If First 0 is encountered by q, it is changed to Blank B B001001BBBB ii) Move right until first 1 is encountered, change the immediate next 0 to X B001X01BBBB . iii) Move right and skip all symbol until first blank is encountered, then change the blank to 0 (as if 0 is copied here) — it is called subroutine call B001X010BBB ‘iv) Move left until X is encountered, change the next 0 to X” B001XX10BBB ¥) Move right until B is eneountered and change B to 0 B001XX100BB FAT-116 FORI |EORY ,j) Move left until X reached al BO BOULDOLO OBB nd change consecutive X to 0's ji) Move to left until B is rea vii) BBO100100BH hed, change the next 0 to B ) Move right until 1 reach vill BBOIXOLOOR ie change the next 0 to X, (subroutine) x) Move right until B reached, ch " BBOLXO1000BB,.. ee hat B 100 Move left until X rea x) ey BOIS re on ie Next 0 to X and repeat the procedure as above. BBO1XX10000BB, BB010010000BR.... BBBI10010000BBB BBB1X010000BB. BBB1X0100000B... BBBIXX100000BBB... BBBIXX1000000BBB.... BBB1001000000BBBB BBB1001000000B.... So, now no more 0's encountered, then change all the 1 & 0’s on left to B. Halt > 0/B [BBBBBBB 000000[B......]. 2. Design a Turing Machine which performs addition of two integers. Write short note on Multi Tape and Multi Head Turing Machine. Prove that the problem “A string w halts on a Turing Machine M” is undecidable. [WBUT 2014] Answer: 1" Part: The turning machine will have 0"10" on its tape initially. Therefore it will start with the leftmost 0, so on scanning 0’s moving right keeping them as if, tll if get 1, if replace this | by O and then again so on. Scanning 0’s and moving right keeping them as it is. When it gets a B (blank), it moves left and replaces the right most 0 by B and halfs thereby leaving finally m+n 0's on the tape. Therefore, the moves of the Turing machine are 0 POPULAR PUBLICATIONS Therefore the Turing machine M=({9541s4+ du} {001}, (0.1, B}, 8, 40» Bs{4}) where 6 is given above. The transition diagram corresponding to the above table is 2" Part: A Multi-tape Turing machine is like an ordinary Turing machine with several tapes. Each tape has its own head for reading and writing, Initially the input appears on tape 1, and the others start out blank. A k-tape Turing machine can be described as a 6- M=(Q,T,s,b,F,5) where Q isa finite set of states T isa finite set of the tape alphabet s€Q is the initial state beT is the blank symbol F (Ix{L£, R, S})' is a partial function called the transition function, where k is the number of tapes, L is left shift, R is right shift and S is no shift. A multihead Turing machine can be visualized as a Turing machine with a single tape and a single control unit but with multitape. 3% Part: Here is a sketch of how you can prove that the Halting problem is undecidable. Assume that a TM capable of solving the halting problem exists. Call this TM halt. It takes, as input, the encoded representation of a TM and an input tape on which the encoded TM will run. Let's call this input pair (p, i): p for "program" (the encoded TM) and i for "input" (the input tape). If input TM p will halt on input i, then halt halts and outputs "true". If input TM p will not halt on i, then halt halts and outputs,"false". So, we can view halt as a function that takes parameters p and i and produces the output "true" or "false" depending on whether or not TM p halts on input i. FAT-118 P does not halt on | Based on hi we Can trivially Construct anew TM, whieh we eaneall eooble witch will seat tt ne duplicates the entire input tape q, creating two copies of the origina! ane ee a then Tuns halt, using one copy of the original input q as als he qouble T™M bel are Original input q as parameter i. If halt (q, q) outputs “false alts. Ifhalt (q, "true! lato ath infinite loop (and thus does not halt), (4, 4) outputs "true", then trouble goes into Hala 9) outputs “Fase” Can) Tal} tm Halt (q, q) outputs. eC) Any TM can be encoded as an initial tape. So, atape is called t. Consider what will happen when trouble is executed with t as its input tape, Does trouble halt? let's assume that the encoding of trouble as If trouble halts, that means that halt (t, t) answered "false". However, that means that trouble does not halt when given t as input, If trouble does not halt, that means that halt (t, t) answered "true". However, that means that trouble does halt when given t as input. In either case, halt gave the wrong answer. Therefore, given any TM that claims to solve the halting problem, it is possible to construct a program/input pair for which it will answer incorrectly. So, any claim that a particular TM solves the Halting problem can be proved false, meaning that the Halting Problem is undecidable. 3. a) Define Turing machine. [IWBUT 2015} b) Explain different types of Turing machine. : ¢) Design a Taring machine the accepts the language of all string which contain “aba” as a substring. Answer: sisi) )o1lt 4) A Turing machine 1s an'abstraet concept used to describe a type of machine that, given an indefinite amount of space and time, can be adapted to calculate anything, such as the digits of x or even a whole universe: FAT-119 ’ POPULAR PUBLICATIONS b) There are many different types of Turing machines that are often used to describe ecution. The two that are most often used are deterministic and non. certain kinds of deterministic Turing machines. pa json Automata are often used to represent Turing machines. This is a deterministic Turing machine which calculates the two's complement of some binary input. A deterministic Turing machine is one that uses the concept of determinism to calculate 4 solution to a problem, Determinism is the concept of being only in one state at a given time and determining what the next state will be from that state, In simpler terms, determinism would be being in state qo, and only holding that state until moving onto the next state, qi. In determinism we would be able to predict without any doubt that the head would move from state qo to state q). A Turing machine does not have to even halt, or stop execution, in order for it to be considered deterministic, A non-deterministic Turing machine is one that uses the concept of non-determinism to calculate a solution to a problem. A non-deterministic Turing Machine differs from a deterministic Turing Machine in the sense that a non-deterministic Turing Machine can have several possible states to which it can transition from any given state, qi. One way to think of it would be to think that, given the possibility of choosing from several subsequent states, the non-deterministic Turing machine guesses the next iteration that will bring it to a ‘yes’ answer. Put a different way, the non-deterministic Turing machine branches out into holding many states at the same time in a sort of tree fashion until one of the many paths leads it to a “yes answer. In perspective a non-deterministic Turing machine may, for instance, be in State qo and then hold both state qi, as one of the branches and state qi as another branch. ©) Strings in which aba is present as a substring. 4. Design a Turing Machine which accepts the languag short note on Multi-Tape and Multi Head Turing Machine. FAT-120 FORMAL, UAGE AND A\ 14 answer: part: "Pa a-ak ee Fig: 1 Let us now follow the working of TM M, with input aabb. The initial configuration is BaabbBB. This means that the TM is in state qo and the head is on the first a of the input string. This corresponds to M, being as given in Fig: 2(a). The current state is mentioned in the box representing the finite control of the machine. op Lela Blalale|o[als Bx Lol = a Fig: 2(a) Machine M, in Initial Configuration Fig: 2(6) M, After First Move After the first move, the head qo reads a, removes it with x and moves to right, thus changing the state from qo to q,. This gives us the next configuration as BxabbBB. Since there is another a in the second state, so we will overwrite the a with a and move to right (aa,R). a Fig: 2(c) M, After Second Move Fig: 2(4) ‘Afier the second move the configuration becomes BxabbBB with the head pointing to b. So it reads b, remoyes it with y and moves to left, thus changing the state from qy to qz. Following the same procedure he turing machine is designed. The next moves are as follows: nt a follows: ciated Blxlaly]>| a] Fig: 2() ba FAT-121 POPULAR PUBLICATIONS Bix|x[y}b] s/s TPT EPI au a Fig: 2(g) Fig: 2(h) Blx|xlyly[a[e ee a w Fig: 2(i) Fig: 24) Bix B\B Bix} xy 8 ® Fig: 2()) 8lx]xlyy]ele PPE EEL @ at Fig: 2(m) Fig: 2(n) 2" Part: Refer to Question No. 2 (2 Part) of Long Answer Type Questions. 5. Define turing machine. Explain Church’s hypothesis. What is Universal turing machine? ([WBUT 2018] Answer: 1 Part: Refer to Question No. 3.(a) of Long Answer Type Questions. 2" Part: Church’s Hypothesis: ©. This hypothesis has no practical proof. Weak form: A Turing Machine can compute anything that can be computed by digital computer. Strong form: A Turing Machine can perform any possible computation. . Church States that — A function on the natural numbers is computable by a human being fallowing an algorithm, ignoring resource limitations, if and only if it is computed by a Turing Machine. FAT-122 'UAGE AND 3 Part: : Universal Turing Machine .. Universal Turing Machine is 4 Turing Machine for all other turing machines. For = dre ={(M. 9) is a turing Machine and M accepts w} is Turing Recognizable. If M accepts w Halt & Accept M rejects w — Halt & Reject M loops on w —no Halt For Universal Turing Machine : Input: M =description of some Tay w=an input string for ay Action: — simulate Mf — Behave just like — Behave just like I (accept, reject or loop) FAT-123 QUESTION 2014 Group-A (Multiple Choice Type Questions) 1. Choose the correct alternatives for any ten of the following i) Consider the grammar S + aSAb/e A-bNe The grammar generates the strings of the form aibj for some i, j20. What is the conditions of the values of i and j? a)i=j b)js2i o)j22i VaiSj ii) Let N be an NFA with n states and let M be the minimized DFA with m states recognizing the same language. Which of the following is NECESSARILY true? Ya)ms2n bynsm c) M has one accept state d)m=2n iil) Compatible pairs are obtained from Ya) Merger Graph b) Compatible Graph —_c) Testing Table d) Testing Graph iv) The string 1101 does not belong to the set represented by a) 110°(0+1) b) 1(0#1)*101 Yc) (10)*(01)"(00+11)* 4d) (00+(11)*01)* v) Regular sets are closed under a) Union b) Concatenation ©) Kleene Closure 4d) All of these vi) The intersection of CFL & RE is always Ya) CFL b) RE o) CSL d) CFLOR CSL vil) Which of the following common in both CNF & GNF? a) (NT) — (Single T) (String of NT) b) (NT) —» (Single of exactly two NT) ¢) (NT) — (String of NT) Yd) (NT) — (Single T) vili) Consider the languages: 1, ={(ww"|w <(0,1)4} yadice L, ={07 W|I & (0,1) *}, where tis a special symbo)-, Year oat 1, = {WWW € {0,1} 4} Which one of the following is true? \TA THEORY 4) b, is @ deterministic CFL Yb) 1,18 a deterministic CFL ¢) [y18 8 CFL, but not a deterministic cp. 8 Guvau a deterministic CFL pifférence between Turing Machine & Two oe se, 5 tae write h ¢) Finite Control “aaa ee ese jy which of the following statements is false a) The halting problem of Turing machine is undecidable ; Cyst wo BU etext free grammar is ambiguous is undecidable uct =L(G2) ry Context free grammars G1 and G2. itis undecidable whether ¥4) Given two regular grammars G1 and G2. tis undecidable whether L(G1) = L(G2) Group-B (Short Answer ‘Type Questions) 2. What do you mean by Right invariant? Let R be an equivalence relation in {0}* with the following equivalence classes: tk? 0! (a= (0}" [BO = {0} v {0}° v (0}* Show that R is right invariant. See Topic: CLOSURE PROPERTIES OF REGULAR SETS, Short Answer ‘Type Question No. 6. 3. Construct grammar of the following. 2) Construct the grammar for the language atbmen, where 1+m=n b)alleven integers up to 998. See Topic: CONTEXT FREE GRAMMARS, Short Answer Type Question No. 10. 4, Define NFA. Construct equivalent DFA from the given NFA. Next State E Present State 0 1 = 90 90, qt q2 qt @ ai q a2 s See Topic: FINITE AUTOMATION, Short Answer Type Question No. 12, 5. Design a two input two output sequence detector which generates an output "1! every time the sequence 1001 is detected, And for all other cases output ‘0'is generated. Overlapping sequences 4 also counted. ; : (Denote State Graph, State Table and perform State assignment] See Topic; FINITE STATE MODELS, Short Answer Type Question No, FAT-125 POPULAR PUBLICATIONS 6. Consider the machine show in the following table Present State Next State X20. =1 A Al C4 B E,0 614 c 0,0 AO o c,0 B,O Es B14 AO Is this machine information lossless of finite order? If yes, find the order p. FINITE STATE MODELS, Long Answer Type Question No. 6(b). See Topic: Group-C (Long Answer Type Questions) 7. Find equivalent partitions and minimize the following Finite State Machine. NS,Z PS [520 A A B.0 Ha B C0 Gi Cc BO Fa D Ft C1 E B14 (eal F Bf 81 G C4 B, H D1 Ad Minimize the following incompletely specified machine. a NS,z 11 2 A Ai DES 8 A De c EO Al D EL Ai € BiOpen proms See Topic: FINITE AUTOMATION, Long Answer Type Question No. 6. 8. Convert the following Mealy machine to equivalent Moore machine. Present State WP. Fe WES Next State OP | Next State | O/P a0 ai eek a 7 qi 3 7 oO. fe qo. 1 @2 a 0 9 7 1 8 ai 0 af 0 at a2 1 a 0 FAT-126 For} FORMAL LANGUAGE AND rv {ta’ i=} i sn é equvaent othe Regular Expression, Leay ‘ot regular. Construct Finite Automata ytpart: See Topic: FINITE STATE Mopgy. pate)" : EL, Li ye part See Topic: CLOSURE PRoveieries or men ee Question No. 8, R SETS, sing Pumping lemma prove that 7 yet ‘#part: See Topic: FINITE AUT y OMATION, Short Answer ‘Type Questi ¢ Find @ reduced grammar equivalent t s—aka A bBB gab cB Convert the following grammar into GNF. s—ANa A= SSib Prove that Context Free Language are not closed under intersection, 1*Part: See Topic: CONTE FREE GRAMMARS, Long Answer Type Question No.3(b)- “at CONTEXT FREE GRAMMARS, Short Answer Type Question No- 11. 3" Part: See Topic: CONTEXT FREE GRAMMARS, Long Answer Type Question No. 5. Long Answer Type Question ion No. 13. 0 the grammar 10. Define PDA by giving a block diagram. What is the difference between DPDA and NPDA? Design 2 Non Deterministic Pushdown Automata for accepting the string L = {(Set of al palindromes over a, b)} by Empty stack Construct an equivalent PDA for the following Context Free Grammar. S—aA A aABC/bB/a a8 Coc g Show an ID for the string aabbbc forthe PDA generated. See Topic: PUSHDOWN AUTOMATION, Long Answer Type Question No. 4. 11. Design a Turing Machine which performs addition of two integers. Write short note on Multi Tape and Multi Head Turing Machine. Prove that the problem “A string w halts on a Turing Machine Mis undecidable. See Topic: TURING MACHINE, Long Answer Type Question No. 2. UESTION 2015 Group-A (Multiple Choice Type Questions)” 1. Choose the correct alternatives for any ten of the following: Consider the grammar S > aSAb/€ A> bAle PAT-127 The grammar generates the strings of the form a‘b’ for some i, / 20. What is the conditions of the values of i and? aisj b) f<2i 0) (221 Vdi (Single T) (String of NT) 'b) (NT) — (String of exactly two NT) c) (NT) — (String of NT) Yd) (NT) > (Single 1) vill) Consider the languages: L, = {ww*|we {0,1} *} L, = {witw"|w © {0,1}*}, where # is a special symbol L, ={ww|w € {0,1} *} Which one of the following is true? a) 1, isa deterministic CFL Y>) L, is a detetministic CFL ©) L, is aCFL, butnota deterministic CFL d) L; is a deterministic CFL '») Difference between Turing Machine & Two way FA is in @) input tape b) read write-head €) finite contro! d) all of these FAT-128 L LAI \GI which of the following statements is false? a) the halting problem of Turing machine is undecidable p) determining whether @ context-free grammar is ambiguous is undecidable a gwen (wo arbitrary: context tree grammarsG,andG,, i is undecidable “whether LG)=LG,) ¥d) given two regular grammars G, and G, , it is undecidable whether L(G.) = L(G,) Group-B 1 (Short Answer Type Questions) ,What do you mean by Right invariant? Let R be an equivalence relation in (0}* equivalence classes: (=O k= (0 Ok = (0) V0} U (0}" Show that R is right invariant. See Topic: CLOSURE PROPERTIES OF REGULAR SETS, Short Answer Type Question No. 6. with the following 3. Define NFA. Construct equivalent DFA from the given NFA. Present State Next State 0 i > 0 q.at | a2 ai @ a See Topic: FINITE AUTOMATION, Short Answer Type Question No. 12. » 4 Design a two input two output sequence detector which generates an output 1’ every time the sequence 1101 is detected. And for all other cases output 0’ is generated. Overlapping sequences ae also counted. [Denote State Graph, State Table and perform State assignment] See Topic: FINITE STATE MODELS, Short Answer Type Question No. 8. 5. Construct a Push Down Automata equivalent o the following Context Free Grammar G=(Vn, Vt, P, S) with Vn ={S, E}, Vt={0,1} and Pis define transition follows: S> Osta A> thos E ‘ Now check the string 001011 is acgeptable by this Push Down putas or not. See Topic: PUSHDOWN AUTOMATION, Short Answer Type Question No. + 5 a) What is parse tree? 5 Consider the CFG S-> aaB FAT-129 tad ‘gs ae ig; as tas oa ie ttdeead ads 43 io iG iy G07: gatgee Maddddidataa TI SS LITT SEEN ITN SSSR SS TENT SSS SSS Ss POPULAR PUBLICATIONS A-> bBb/ € B-> Aa Find the Parse tree for the string aabbababa Sce Topic: CONTENT FREE GRAMMARS, Short Answer Type Question No. 12. Group-C (Long Answer Type Questions) 7. a) A long sequence of pulses enters a synchronous sequential circuit, which is required produce an output pulse 7=1 whenever the sequence 1001 occurs. Overlapping sequences accepted. |) Draw a state diagram ii) Select an assignment and show the excitation and output tables. b) Minimize the machine using equivalent partitioning Present state Next state, ‘output X=0 X=4 A Eo D4 8 FO D.0 c E0 Bt D FO 8,0 E C0 Ft F BO C0 FINITE STATE MACHINE, Long Answer Type Question No. 2.a) : FINITE STATE MODEL, Short Answer Type Question No. 8. 8. a) Define and compare Moore and Mealy machines. b) Convert the following Mealy, machines into Moore machine FAT-130 “MAL LANGUAGE AND AUTOMATA THEORY consider the N.F.A given by the follow 0 ab 9 diagram 6 athe equivalent D.F.A without é-transition « consider the following state table Present state Next state, output fe i 2 A EO B80 B FO AO C ES C0 D Fd 0,0 E ioe Co = D,- 5.0 2)Draw the merger graph. »)Draw the merger table. «Draw the compatibility graph Find the minimal machine which covers that machine. See Topic: FINITE STATE MODEL, Long Answer Type Question No. 9. 10. Consider the following state table. Present state Next state, output X=0 X=1 A B,1 H,1 B Fit D.1 Cc D0 Et Peceata Co Fa E D1 CA 7 C1 Go Ct D4 € C0 Ad 2) Find the equivalence partition for the machine : diagram. ©) Show a standard form ofthe corresponding reduced machine end draw fe Sala 8 €Find a minimum length sequence that distinguishes state A for eH Se Topic: FINITE STATE MODEL, Long Answer Type Question Nos : 8) Define Turing machine. ) Explain different types of Turing machine FAT-131 PRL, SUNT SU Se NN Se ALTA SY SA Sve See RUNES SUNN UST T SR TTT SEEN TES SSN SS SNES STEN DENNEN LUNN TTT STEEN STS SENS é SSH SS SSS Se eS POPULAR PUBLICATIONS c) What is halting problem in Turing machine? one : 4) Design a Turing machine accepts the language of all string which contain ‘aba" as a substring. URING MACHINE, Long Answér Type Question No. 3()- URING MACHINE, Long Answer Type Question No. 3(b)- URING MACHINE, Short Answer Type Question No. 1. URING MACHINE, Long Answer Type Question No. 3(0)- QUESTION 2016 Group-A (Multiple Choice Type Questions) 1. Choose the correct alternatives for any ten of the following: |) Acontext free grammar is not closed under * a) Product Yc) Complementation b) Union d) Kleen star ii) Context sensitive grammar can be recognized by a) deterministic push down machine ) FSM b) non-deterministic push down machine ¥‘qd) linearly bounded memory machine ii) 4=(a+b)*a and B=b(a+5)* then A intersection 3 will be a) (a+b)*ab b) ab(a+b)* 0) a(a+b)*b Yd) b(a+b)*a iv) Which of the following is most general phase structured grammar? ¥b) Context sensitive a) Regular ©) PDA d) none of these v) The string 4101 does not belong to the set represented by a) 110*(0+1) b) 1(0+1)*101 * «) (10)*(01)*(00-+11)* ¥@) [00+(11)*0]* vi) Pumping lemma is generally used for a) a given grammar is regular ¥b) @ given grammar is not regular ‘c) whether two regular expressions are equivalent or not 4) none of these vil) The basic limitation of FSM is that Ya) it cannot remember arbitrary large amount of information ») it some times fail to recognize grammar that are regular ) it some times fail to recognizes grammar that are not regular d) all of these FAT-132 iy Recursive languages are ) closed under insertion, )dlosed under complementation 7 ecursively enumeration 4) all of these 1 evel equivalence is possibe between to nite autor a) if all equivalence above & ee “level exist between them Yb) if all level equivalence up to k=1 level aready exist y exist ‘Number of states Number of states ¢)if both contain at least & -d)if both contain exactly & sen device, ) acceptor only ») acceptor /rejector ©) rejector only d} generating 3) Which sof the following is comect? ~ a) Language can be derived from the FA , b) Regular expressions can be derived from the FA ©) FA can be derived from the language ¥¢) both (a) & (b) Group-B (Short Answer Type Questions) Design ¢ a two-input two-output sequence detector which generates an output ‘1’ every time the sequence 1010 is detected. And for all other cases output 0’ is generated. Overlapping sequences are also counted. Draw only state table and state diagram. ‘See Topic: FINITE STATE MODEL, Short Answer Type Question No. 8. 3. Convert the following NFA into an equivalent DFA. PS NS a=0 + a=l Go» % >| % POPULAR PUBLICATIONS: 5. Construct a minimum state automaton from the transition table given below: 4% q hb % h h b % % % _% % ee | % % Is % > Ges 4s ate final states. ‘See Topic: FINITE AUTOMATION, Short Answer Type Question No. 16. 6. Find the string which is applied on state ‘D’ producing output string 10011110 and finat state "D’for the machine given below: as NS,o/ p | x=0 xel A A,1 col B E,0 3 DO = Bil ‘See Topic: FINITE STATE MODEL, Short Answer Type Question No. 11. Group -C (Long Answer Type Questions) 7. @) Construct a regular grammar G generating the regular set represented by P=a*b(a+b)* b) Convert the following Mealy machine to Moore machine. FAT-134 ) What is Klenne's star? Give example. What is positive closure? Give example a) See Topic: CLOSURE PROPERTIES OF REGULAR SETS, Short Answer Type Question No. 5. see Topic: FINITE STATE MODEL, Short Answer Type Question No. 7. % 'RE PROPERTIES OF REGULAR SETS, Short Answer Type Question No. 10. 8.) Construct an equivalent PDA for the following CFG, $+ aAB/ DBA . A-bS/a poas/b show an ID for the string abbaaabbbab for the PDA generated description. with stack . b) Give the regular expression for the DFA using Arden theorem, START ) Convert the following grammar into GNF: S—ABb/a A aaA/B B— bAb. 4) See Topic: PUSHDOWN AUTOMATION, Long Answer Type Question No. 3. b) See Topic: CLOSURE PROPERTIES OF REGULAR SETS, Short Answer Type Question No. 10. «) See Topic: CONTEXT FREE GRAMMARS, Short Answer Type Question No. 11. 8 2) Let G be the grammar S —, aB|ba,B—> b|bS|aBB = For the string aaabbabbba find: i ’) left most derivation ji) rightmost derivation iil) parse tree ) Prove that CFLs are not closed under intersection and complement operation ©) Design an NFA which accepts set of all binary strings containing 1100 or 1010. 4) See Topic: CONTEXT FREE GRAMMARS, Short Answer Type Question Nos 13: 5) See Topic: CLOSURE PROPERTIES OF CFLS, Short Answer Type Question No. I; {) See Topic: FINITE AUTOMATION, Short Answer Type Question Nox 4: h and then minimize the following: ivr graph, Merger table, compatioity gr@ph and then minimize He SIONS, ‘Next State, o/p Input =9 Input=! Input= 2 Srl Bl 4 2 7 Present State FAT-135 — Group-A "(Multiple Choice Type Questions) 1, Choose the correct alternatives for the following: i) Regular grammar is 2) context free grammars ) context sensitive grammar ¢) non-context grammar ) none of these In Moore machine, output is associated with %a) present state only b) next state only ) present state and input d) none of these 4) Compatible pairs are obtained from Ya) Merger Graph i ») Compatible Graph ©) Testing Table ) Testing Graph 'v) The string 1101 does not belong to the set represented by a) 110" (0+1) b)1(0+ 1)" 401 ¥c) (10)* (01) * (00 + 11)* ) (00 + (11) * 01)" FAT-136 ND AUTOMATA THEORY v) Regular expression is accept a) Finite automata oe c) Pushdown automata a Mealy machine 4) all of these If Pand Qare regu uy a)R=Q*P i whee (P's not null) then R= @ + RP has the unique solution oe o)R=Q*p* 7d) R= OF vil Which ofthe following is common in both GNE & GNF? a) (NT) — (Single 7) (St ¢) (NT) + (String of nS ND b) (NT) -+ (String of exactly two WT) ¥4) (NT) —+ (Single 7) vil) Consider the languages: 1, ={ww" |we {0,1} 4 1, ={witw*| we{0,}*} L, ={ww| we {0,1} oh Which one of the following is true? a) L, is a deterministic CFL b) L, is a deterministic CFL ¢) Ly is ACFL, butnot a deterministic CFL" ) L, is a deterministic CFL » here #is a special symbol 'x) Difference between Turing Machine & Two way FA is‘in a) Input tape b) Read wire head ¢) Finite control ¥d) all of these x) Which of the following statements is false? a) The halting problem of Turing machine is undecidable b) Determining whether a context-free grammar is ambiguous is undecidable ©) Given two arbitrary context free grammars G1 and G,. It is undecidable whether L(G)=L(G) 4) Given two regular grammars G; and Gz. Itis undecidable whether L(G,) = L(G,) Group-B (Short Answer Type Questions) 2 What do you mean by unit production? Remove unit productions from the grammar S+AB, Aa, B>C, C+D, D-vb- i See Topic: CONTEXT. FREE GRAMMARS, Short Answer Type Question No. 14, + Construct grammar of the following: 2) For the language a"b" , where n >=0 b) Alle 8. : oe Lee GRAMMARS, Short Answer Type Question No, 1S, FAT-137 ‘See Topic: CONTEXT FREE GRAMMARS, Short Answer Type Question No. 16. Group-C (Long Answer Type Questions) 7. State and prove Arden's theorem in regular expression. Minimize the following incompletely specified machine: FINITE AUTOMATION, Long Answer Type Question No. 8 FINITE AUTOMATION, Long Answer Type Question No, 6 (2 Part), FAT-138 uP =4 Next Sate orp. a 1 % i & 7 % 0 | a 0 Using Pumping lemma prove that Z={a"ht [qs I} is not regular Construct Finite Automata equivalent to the R 1 =ab(a+b)(ab)*6 1" Part: See Topi 2" Part: See Topi No.5. 3" Part: See Topic; FINITE AUTOMATION, Long Answer Type Question No. 9. ‘egular Expression FINITE STATE MODELS, Long Answer Type Question No. 8, : CLOSURE PROPERTIES OF REGULAR SETS, Long Answer Type Question & Find a reduced grammar equivalent to the grammar Sada A> bBB Bab CoB Conver the following grammar into GNF. S>Adla A> SS/b Prove that Context Free Languages are not closed under intersection, I Part: See Topi ‘ONTEXT FREE. GRAMMARS, Long Answer ‘Type Quéstion No. 3b). 2 Part: See Topic: CONTEXT FREE GRAMMARS, Short Answer ‘Type Question No. Il. "Part: See Topie: CONTEXT FREE GRAMMARS, Long Answer Type Question No. s, 10. Define PDA by giving a block diagram. Explain how a String be accepted by a PDA? Design a "erDeterministic Pushdown Automata for accepting the string L = {WCW | We(a,b)*} ana W" isthe reverse of W by Empty stack. Construct an equivalent PDA for the following CONTEXT FREE GRAMMARS. Ss aa 4> aABC/bB/a Ces Show an ID for the string aabbbe for the PDA generated : 1. At: See Topie: PUSHDOWN AUTOMATA, Long Answer Type Question No. 4 (I" Part), "art: See Topic: PUSHDOWN AUTOMATA, Long Answer Type Question No. FAT-139 ~ Ree RSS ReNeeN Roane vee. FEeeeey: Revees Peeeee a Popt BL USHDOWN AUTOMATA, Long Answer Type Question No. 4 (3 Part). USHDOWN AUTOMATA, Long Answer Type Question No. 4 (4" Part). 3" Part: See Topi 4" Part: See Topi 11, Design a Turing Machine which accepts the language L={a"b”,n 21}. Write a short note on Multi-Tape and Multi Head Turing Machine See Topic: TURING MACHINE, Long Answer Type Question No. 4. JUESTION 201 Group-A (Multiple Choice Type Questions) joose the correct alternatives for. any fen of the following: AYA finite automata recognizes a)AnyLanguage - b) Context Sensitive Language c) Context Free Language Yd) Regular Language ii) Maximum number of states of a DFA converted from a NFA with n states is a)n b) n? vc) 2" d) None of these \ ji Regular Expression is accepted by : Se a) Finite Automata. ~_b) Push Down Automata ? ) Turing Machine 4 ¥6) All of these eons Lemma for Regular Expression is used to prove that a) Certain sets are Regular ~b) Certain sets are not Regular ©) Certain Regular Grammar produce Regular Expression d) Certain Regular Grammar does not produce Regular Expression f) CFLis language. a) Type 0 b) Type 1 Yc) Type 2 ) Type 3° Ds Useless symbols in CFG are \Z a) Non-generating symbol and non-reachable symbols ¥b) Null alphabets and null string ©) Non-terminal symbols 4) All of the above a) Type 0 Language b) Type 1 Language Yc) Type 2 Language d) Type 3 Language 40 FORMAL LANGuaG IND AUTOMATA THEORY yf difference between finite y oe ae automata and Pon, a) Rea Te r Finite Control veh Saar ihe nota pert ofthe mechenical aoram of Turing Machine’? a) input Tape b) Read-write head ©) Finite control 15 Vine Which ofthe string is accepted by Turin 9 Machine? a) L=a"c"b", where m,n 0 ») L=a"b"c!, n,i>0 ) L=a"b"c", where n> 4) All of these yi Number of vertices of a Merger graph ig Ya) The number of state of the m, @chineb) Number of compatible Pairs c) Number of states combinations 4) None of the above Number of vertices of a compatible graph ig 2) the number of states of the machine ¥b) number of compatible pairs ©) number of states combinations 4) None of the above Group—B (Short Answer Type Questions) 2 Construct the language for the grammar G =({5},(a,0), s, p) swith P_ given by SaSb Sa See Topic: CLOSURE PROPERTIES OF REGULAR SETS, Short Answer Type Question No. 14. 5 Define Deterministic Fi inite Automata. What do you mean by NFA with -moves. See Topie: FINITE STA’ TE MACHINE, Short Answer Type Question No, 3, é State and prove Erden's Theorem. See Topic: FINITE AUTOMATION, Long Answer Type Question No, 8. 5 Remove the UNIT productions from the following grammar: S> Aa\B BO Albb A>albe|B : Se Topic: ¢ ‘ONTEXT FREE GRAMMARS, Short Answer ‘Type Question No, 17, FAT-141 _ => E,E->a Remove the unit production. z See Topic: CONTEXT FREE GRAMMARS, Long Answer ‘Type Question No. 6.b). ‘¢) Design a PDA which accepts the language. L={Ws(a,b)*|W has equal no, of a & b} See Toy PUSHDOWN AUTOMATION, Short Answer ‘Type Question No. 1. 10, a) Construct @ minimum state automata equivalent to a given automata M which transition table is given below: FAT-142 see Topic: FINITE STATE MODELS, 1 % qs % FORMAL LANGUAGE AND AUTOMATA THEORY d 4 % % N % “ong Answer Type Question No. 10. b) Find the regular expression Corresponding to the following figure: 11. Construct the merger table, merg following Machine: Je graph, compatibility graph and minimal machine for the NSz PS h b A EO Bo 8 FO AO c E- C0 . Fd D0 E Git C0 F D- BO ‘See Topic: FINITE STATE MODELS, Long Answer Type Question No. 11. 2. Construct testing table, testing graph for the following machine and test whether it has finite ‘memory or Not, if yes then find the order. . FAT-143 Bast ig oli ii) 13={B"ab"|n>0, m>O} (CLOSURE PROPERTIES OF REGULAR SETS, Long Answer Type Question No. 2.b) €) Define turing machine. Explain Church's hypothesis. What is Universal turing machine?

You might also like