automata pyq[1]
automata pyq[1]
Design a PDA to accept the strings of language L = {aflbflcmd m In & m > O} and trace the
strings abbcd, aabbcccddd using instantaneous description.
I Reg. No. I I I I I I I I I I I I I I I I
(OR) B.Tech. DEGREE EXAMINATION, JANUARY 20'23
b. Construct a PDA for the language L ={ww R I WE {a, I}} using empty stack.
Fifth Semester
5. The language generated by the grammar G = { {S}, {a, b}, P : S ~ aSb lab, {S}}
(A) (abt (8) {allbll:n;?:O}
12. To accept L::;:: {anbnc n : n ~ 1} by a PDA, how many stacks are needed 25. Define a Turing machine and list the techniques for Turing machine construction.
(A) 1 (8) 2
(C) 3 (D) 4 26. Compare the relation between NP hard and NP complete.
13. Turing machine uses 27. State time and space complexity ofTming machines.
(A) UnalY (rotation) representation (8) Binary representation
(C) Ternruy representation (D) Normal number system PART - C (5 x 12 = 60 Marks)
Answer ALL Questions
14. Next move function (5 of a Turing machine M = (Q,2:, r,5,qo,B, F) .is mapping of
(A) 8:QxW - >Qxr (8) 8:Qxr-tQxrx{L,R} 28. <l. Let 2: = {O,l} construct a deterministic automata which will accept the following language
(C) 8:QXL->Qxf'x{L,R} (D) 8:Q x r-tQx2:x{L,R}
L = {vII E {O, I} * I w starts either with OJ or 10}.
15. Recursively enumerable languages are not closed under
(A) Unlon (B) lotersection (OR)
(C) Complement (D) Concatenation b. Let 'r' be a regular expression. Then prove that three exists an NDFA with E-transitioll that
accepts L(r).
16. Which of the following problem is not NP-Hard?
(A) Hamiltonian circuit problem (B) Oil Knapsack problem 29. a.i. Let G = (V,T, P,S) be in CFG. If there exists a derivation tree with yield '0(' then show
(C) Finding biconnected component of a (D) The graph colouring :;:
17. Which of the following problems is undecidable 11. Eliminate null productions, unit productions and usdess symbols from the grammar
(A) Membership problem for CFG's (B) Ambiguity problem for CFG S -t aA I aBB
(C) Finiteness problem for FSA's (D) Equivalence problem for FSA's A -> acull [;
(4 Marks)
18. Travelling sales person problem is B ->bB I bbC
(A) P-complete (B) NP-complete C->B
(C) NP-hard (D) PCP
(OR)
19. A is undecidable if A is reduced to 8 and B is
b. Convert the following grammar G into GNF.
(A) Undecidable (8) Decidable
S -t XA I BE
(C) Hard (D) Complete
B -t blAB
20. If P = NP then NP-complete problem is in
X -t b
(A) P (B) NP hard
(C) Complex (D) Reducibility A-ta
1. Construct a turing machine for the above scenario. 4 3 .5 4 I. Abi has red and blue color balls and wanted to playa game. She puts all the
balls in a bag and she wanted to pick the balls in the specified order. If she
II. Convert the above turing machine into modified post correspondence 8 3 .5 4 picks the reu ball, bluf~ bait, and red ball in a sequence at least once, it is a
problem (MPCP). Show the 10 and MPCP solution for the input string success.
" ! 00".
I. Write a regular expression (RE) for the above scenario. 3 4
v. If LI problem has no algorithm to answer it, we call it 4 5 2 v. Which of the following are true 2
- --
(A) Decidable (B) Solved (A) A language accepted by a DFA (8) A Janguage accepted by a DFA is
(C) Recognizable (D) None of the mentioned is also accepted by some NF A also accepted by some NF A and
but not vice versa vice versa
(C) NFA is a 6 tuple (D) DFA is 5 tuple but not NFA .
***** 4 2
VI. A transition ii·om a state to another state without reading any input is allowed
111
(A) DFA (B) NFA
(C) E-NFA (D) RE
2. Babu has to travel from his office to his home every day. He can use four
routes, A, B, C and D. Each month he has to take route A and route D
equally, and route B and route C equally. He has to travel in all the routes at
least once. In each given duration be needs to take route A first for n number
of days followed by taking up route B for m number of days, followed by
route C and route D as per the given condition.
(OR)
b.i. Explain NP-type problem with an example. 3. __ is regular expression represents equal number of 'a' followed by 'b'
(A) a = b (B) ab
11. Explain NP-complete type problems with an example. (C) (ab)Il (D) allbIl
4. IdentifY from the list below the regular expression over the alphabet {O, I} that generates all
::~ =:: *** strings that end with 1.
(A) (0*+ 1*)* 1 (B) (0*+ 1*)+
(C) (0+ 1)* 10* (D) 1*0*1
7. is the set ofterminal strings that have derivations from start symbol.
(A) Language (B) Tenninal
(C) Variable (D) Alphabet
12. The acceptance ofPDA by empty stack is given by 25. Define PCP with example.
(A) * (B) *
{w I (qo' w,zo)l-(q,E,E)} {w I (qo' w,zo)I-(Zo,E,E)} 26. What are the ways of modifying a Turing machine?
(C) * (D) *
{w I(zo' w;qo)l-(q,E,a)} {w I(x o' w,zo)l-(q,E,¢)} 27. What do you mean by useless symbol? Give example.
PART - C (5 x 12 = 60 Marks)
13. ofa turing machine is a fWlction of state of finite control and tape symbol scanned Answer ALL Questions
(A) Move (B) Input
(C) Sequence (D) Scan 28. a. Minimize the following DFA
I
14. The device that manipulate symbols
(A) PDA
OIl a stripe of tape according to a table of rules
(B) Turing machine
~ qo ql q5
ql q6 q2
°
(C) Finite automate (D) CFG
* q2 qo q2
q3 q2 q6
15. Proper subtraction is defined by _ _ _ q4 q7 q5
(A) m ..:..n= max(n - 111,1) (B) 111..:..n =min(m-n,O) q5 q2 q6
(C) m .kn =max(m-n,O) (D) n..:..m=max(n-m,O) q6 q6 q4
q7 q6 q2
16. The set of 1anguages accepted by Turing machine is (8 Marks)
(A) Recursive (D) Recursively enumerable 11. Convert the following i·egular expression to finite automata 01* + 1. (4 Marks)
(C) Enwnerable (D) Non-recursively enumerable
(OR)
17. A problem L is called ___ ifitis recursive language b. Convert the following finite automata to regular expression
(A) Recursive (B) Enumerable
(C) Undecidable (D) Decidable
1
18. is a machine which accepts the languages Lu = L(u).
(A) Universal Turing machine (B) Turing machine
(C) Push down automata (D) Context free grammar
29. a. Give the relationship between derivation and derivation tree.
19. Every non-trivial property ofRE language is (OR)
(A) Recursive (B) Undecidable bj. Convert the following into CNF
(C) Enwnerable (D) Decidable S ->ABI CA
B--+BCI AB
20. To reduce Lu to PCP the is used
(A) Lisp (B) PCP A->a
(C) MPCP (D) SAT solver C --+ aB I b
(10 Marks)
4. A regular language over an alphabet 'a' is one that can be obtained form
(A) Union (B) Intersection
(C) Segmentation (D) Partition
12. Which of the following does not have left: recursions? 25. Define multitape Turing machine and multiple track Turing "machines.
(A) Chomsky normal form (B) Greibach normal form
(C) Backus naur form (D) Regular normal. form 26. Is it possible that a Turing machine could be considered as a computer of functions from
integer to integer? If yes justify.
13. The context free languages are closed Ullder
(A) Intersection (B) Complement 27. When a problem is said to be decidable and give an example of undecidable problem.
(C) Kleene (D) Segment
PART - C (5 x 12 = 60 Marl{s)
14. A tllring machine that is able to simulate other turing machines?· Answer ALL Questions
(A) Nested. hIring machines (B) Universal turing machine
(C) Counter machine (D) Mutlitape turing machine 28. a. Describe purpping lemma and prove that the language L = an bn is not regular when 11 ~ 1?
15. While applying pumpjng lemma over a language we consider a. string 'W' that belong to 'L' (OR)
and fragment it into parts?
(A) 2 b. Convert regular expression to E-NF A and from E-NFA to DFA for the expression (a I b)* abo
(B) 5
(C) 3 (D) 6
29" a. Convert the grammar
16. A grammar with more than one parse tree is called? S--ABBIBa
(A) Unambiguous (B) Ambiguous A->BaIElca
(C) Regular (D) Irregular B--BblbiA
C->CaqCa
17. Recursive languages are also known as D->Dala
(A) Decidable (B) Undecidable into Chomsky normal form.
(C) Sometimes decidable (D) Sometimes undecidable
(OR)
18. The language accepted by a Turing machine is called b. Convert the grammar
(A) Rccursive enumerable (B) Recursive S~AB
32. a. Prove that M PCP is undecidable. 6. The language generated by the following CFG is S ~ aSa I bSb IE
(A) Even palindrome (B) Odd palindrome
(OR) (C) a bl1
l1 (D) bl1 a l1
b. Explain the following with suitable examples
(i) NP type problem 7. An ambiguous grammar is one which has
(ii) NP complete type problem (A) One LMD (B) OneRMD
(iii) NP hard type problem (C) One LMD and one RMD (D) More than one LMD or RMD
11. PDA is powerful than 23. Construct a context free grammar which negates the language L(G) = {a l1 b2f1 c 17 : n;:;: I}.
(A) TM (B) FSA
(C) Both (D) Moore machine 24. Construct PDA for the language L( G) = {an b2n c 1'1 : n ;:;: l} .
12. The symbol Zo in PDA definition is denoting 25. Design a TM that will compute 4 n for given any integer 11 in binary form.
(A) Initial state (B) Stack content
(C) Variable (D) Initial stack alphabet 26. State 4 examples of undecidable problem.
13. TM accepts which type of grammar in Chomsky hierarchy 27. Deftne post correspondence problem. Explain with a suitable example.
(A) Type 0 (B) Type 1
(C) Type 2 (D) Type 3 PART - C (5 x 12 = 60 Marks)
Answer ALL Questions
14. Which of the following is the restricted model of TM
(A) TM with semi-infinite tape (B) Multi stack machine 28. aj. Find DFA for the following
(C) Offline TM (D) Both (A) and (B) E
, ~I c
~p ¢ {r}
1.5. IfTJ and T2 are two macruJleS the composite can be represented by
I (
(A) TI T2 (B) TI x T2
(C) TI U T2 (D) TI - T2
q {p} ell
(r
16. NDTM is one which has
(A) No transition (B) Multiple transitions for the same input
*r { q} ( {p}
(C) One transition (D) Empty transition
r