OXFORD ENGINEERING COLLEGE (NAAC ACCREDITED WITH B GRADE) DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING LIST OF QUESTIONS YEAR/SEM: III/V STAFF NAME: Dr. Sangeetha Senthilkumar SUB.CODE: CS6503 SUB.NAME: Theory of Computation UNIT I PART A 1. Define proof by contra positive and induction principle 2. Define Pumping lemma for regular language. 3. State Arden s theorem. 4. Prove that L = { 0 n 1 2n / n>=1} is not regular.(apr/may 08) 5. Write RE which denotes the language L over the set = {a,b} such that all the strings do not contain the substring ab. 6. Write regular expressions for the following.(apr/may 10) (i)binary numbers that are multiple of 2. (ii)strings of a s and b s with no consecutive a s (iii)strings of a s and b s containing a s 7. How a Non deterministic finite state automaton (NFA) differs from a Deterministic finite state automaton (DFA). 8. Define the languages described by DFA and NFA. 9. Define extended transition function for a DFA. 10. Define extended transition function for a NFA. (nov/dec 06) 11. Define extended transition function for a ᶓ-NFA. 12. Define ᶓ - closure of a state. 13. Find the ᶓ - closure of states 1, 2 and 4 in the following transition diagram. 14. Define regular expression and give an example. 15. Construct a finite state machine that accepts exactly those input strings of 0 s and 1 s that ends with 11 (nov/dec 07) 16. Give a regular expression for the set of all strings having odd number of 1 s 17. Construct a DFA for the language L = {a n b, n 0}. 18. Construct a DFA which accepts all strings over Σ = {0,1} ending with 00. 19. Give the regular expression for the set of all strings ending in 00.(apr/may 08) 20. When two states are equivalent and distinguishable? 21. What are the applications of regular expression? 22. Is it true that the language accepted by any NFA is different from the regular language?.justify your answer. 23. Prove that Q+RP= QP*(nov/dec 08) 24. Differentiate Deductive proof and Inductive proof. 25. Define Finite Automata. PART B 1. State and prove the pumping lemma for regular languages 2. Using pumping lemma for regular sets. Prove that the language L = {a n b n /n>1} is not regular(nov/dec 10) 3. Prove that 1 2 +2 2 +3 2 + + n 2 = Σn 2 = (n(n+1)(2n+1))/6..(apr/may 06) 4. Prove that for every integer n 0 the number 4 2n+1 + 3 n+2 is multiple of 13. 5. Show that if L be a set accepted by an NFA then there exists a DFA that accepts L.
6. (a)design FA which accepts even number of 0 s and even no of 1 s. (b)convert an NFA to a DFA given NFA M = (Σ,Q,δ,q0, F) Σ={0,1}, Q = { q0, q1, q2,q3},f= { q0}(nov/dec 11) 0 1 q0 q0 q0, q1 q1 q2 q2 q2 q3 q3 q3 ⱷ ⱷ UNIT - II PART-A First half 1. Let G = {{s, c}, {a, b}, P, s} where P consists of S->aca, C ->aca / b,find L(G). 2. Find L(G),where G = {{s}, {0,1}, s-> s1, s->ᶓ, s}(nov/dec 13) 3. What is Chomsky Normal form? 4. Find L(G),where P consists of S->asb, s->ab. 5. What is substitution rule? 6. Convert the following grammar G in GNF form S ->ABb / a, A ->aaa / B, B ->bab (nov/dec 14) 7. Define a derivation tree for a CFG. 8. Define Grammar with an example. 9. Write the relationship between derivation and derivation tree. 10. Define Parse Tree. 11. What are the types of grammar. 12. What are the closure properties of context- free Language? PART A Second half 13. Is context free language is closed under complementation? Justify. 14. Find L(G) for CFG S->asb / aab, A->bAa, A->ba. 15. Find the derivation tree for the grammar, G = {{s, A, B }, {a, b}, P, s},where P = {S->bA/bB, A ->ab, B->aBb/a} 16. Define Parse diagram. 17. What are the two major normal forms for context free grammar? 18. Eliminate the ᶓ (null) production from the CFG given below A->0 B 1 1 B 1 B->0 B 1 B ᶓ (nov/dec 09) 19. If the CFG is as below S->0A 1B C A->0S 00 B->1 A C->01 then remove the unit productions. 20. Let G = {{s, c}, {a, b}, P, s},p=s->asb / a, A->SbA /ss/ba.find a derivation tree whose yield aabbaa. (nov/dec 10) 21. Show that id+id*id can be generated by two distinct leftmost derivation in the grammar E->E+E/ E*E/ (E)/id 22. Let G = (N,T,P,S), P ={S->A1B/a, A->0A/ᶓ, B->0 B/1B/ᶓ give a leftmost and rightmost derivation for the string 00101. 23. Write CFG for L(G) = {a m b n c p / m +n=p, p >=1}(nov/dec 12)
24. What is ambiguous grammar. (nov/dec 11) 25. What is a useful production? PART B First half 1. Show that the grammar S ->a / absb / aab, A->bs / aaab is ambiguous. 2. Show the context free language are closed under union operation but not under intersection.(nov/dec 06) 3. (i) Find a grammar in Chomsky normal form equivalent to S ->AB / ab, A->aab/ᶓ, B->bbA form. (ii) Obtain the Greibach Normal form A1->A2 A3, A2->A3 A1/ b, A3->A1A2/ a PART B Second half 4. Let G=(V,T,P,S) be a CFG. If the recursive inference procedure tells that the terminal W is in the language of variable A, then there is a parse tree with root A and yield W. And Prove the vice versa also. 5. Find a grammar in Chomsky normal form equivalent to CFG(nov/dec 12) S ->aabb, A->aA a, B->bB b 6. Begin with the grammar (nov/dec 07) S->0A0 1B1 BB A->C B ->S A C->S ᶓ and simplify using safe order UNIT III Part - A 1. Define pushdown Automaton. 2. What are the different ways of language accepted by a PDA and define them. 3. Define the instantaneous descriptions(id) of pushdown Automaton. 4. Define Acceptance of PDA by Final State. 5. Define Acceptance of PDA by Empty stack. (nov/dec 08) 6. Define equivalence of acceptance by final state and empty stack. 7. Define rules for the conversion of Grammars to PDA. 8. Convert the given expression to PDA (apr/may 06) I -> a b Ia Ib I0 I1 9. Define Deterministic PDA. 10. What is the additional feature a PDA has when compared with NFA? 11. State the pumping lemma for CFL s? 12. State the equivalence of PDA and CFG. 13. Construct a PDA for the context free grammar(apr/may 11) S -> asa a A -> bb B -> b 14. Define Non Deterministic PDA.
15. Is it true that Non deterministic PDA is more powerful than that of Deterministic PDA. Justify. 16. Define the rule for construction of CFG from given PDA. 17. What are the main applications of pumping lemma in CFL s? 18. Design a PDA for accepting a language {L= a n b n n >=1}(apr/may 06) 19. Design a PDA for accepting a language {L= a n b 2n n >=1} 20. Show that the language {0 n 1 n 2 n } is not a context free language. 21. Differentiate ambiguous and unambiguous Grammar. 22. State formal definition of PDA. (nov/dec 07) 23. Define the languages generated by a PDA using the two methods of accepting a language. 24. Construct a PDA for the CFG S ->AB / ab, A->aab/ᶓ, B->bbA 25. Construct a PDA for the CFG S ->a / absb / aab, A->bs / aaab (apr/may 10) UNIT III PART - B 1. (i) Construct a PDA accepting by empty stack the languages {a m b m c n /m,n>=1} (ii) Find PDA for the given grammar S ->0S1 / 00 / 11 2. Give the CFG generating the language accepted by the following PDA M=({q0,q1,},{0,1},{z0,x},,q0, z0, ᶓ),with transactions ( q0, 1,z0 ) = {( q0, xz0 )}, ( q0, 1,x ) = {( q0, xx )}, ( q0, 0, x ) = {( q1,x)}, ( q0, ᶓ, z0 ) = {( q0, ᶓ)}, ( q1, 1, x ) = {( q1, ᶓ}, ( q1, 0,z0 ) = {( q0, z0)} (nov/dec 11) 3. Show that if a language L is accepted by a PDA then there exists a CFG generating L. 4. If L= N(P N) for some PDA P N =( Q,,, N,q0, Z0 ) then there is a PDA P F such that L= L(P F) [From empty stack to final state P F] (nov/dec 12) 5. Let L be L(P F) for some PDA P F = (Q,,, N,q0, Z0,F). Then there is a PDA P N such that L = N(P N) [From final state to empty stack] 6. (i)construct a PDA for set of palindrome over the alphabet{ a, b} L(M) = {WcW R } 7. (ii)if L is a context free language then prove that there exists a PDA M such that L = N(M) (nov/dec 12) UNIT IV Part A 1. What is a Turing machine? 2. What are the required fields of an ID or configuration of a TM. 3. Define Instantaneous description of Turing machine 4. Represent the ID for the transition function (q, Xi) = (p, Y, L). 5. Define the language of Turing machine. (nov/dec 09) 6. When a recursively enumerable language is said to be recursive? Is it true that the language accepted by a non deterministic TM is different from recursively enumerable language? 7. What is a multiple track Turing machine? 8. When a function f is is said to be Turing Computable? 9. List out different types of TMs. 10. Define Multi tape Turing machine. 11. Differentiate Multi head and Multi tape Turing machine..(apr/may 10) 12. What does Multi tape Turing machine contain?
13. Define Subroutines in Turing machine. 14. Define Non Deterministic Turing machine. 15. Define Halting Problem. (apr/may 08) 16. Is Halting problem decidable or undecidable problem. 17. Define Chomsky Hierarchy. 18. Is it possible that a Turing machine could be considered as a computer of functions from integers to integers? If yes justify.(nov/dec 11) 19. Define Rules of Context sensitive languages. 20. Compare FM, PDA and TM. 21. Define LBA. 22. Draw a transition diagram for a turning machine to compute n mod 2. (nov/dec 14) 23. What are applications of Turing Machine. 24. What is the role of checking off symbols in a Turing machine. 25. Mention any two problems that can be solved by Turing machine. PART - B 1. Construct a Turing machine for the language L={a n b n c n /n 0}.(nov/dec 12) 2. Explain the programming techniques of Turing machine. 3. Design a Turing machine which recognizes palindrome over alphabet {0,1}.(apr/may 10) 4. Construct a Turing machine which computes multiplication with subroutine copy. 5. Construct a Turing machine for language L={a n, b n, n 1} (nov/dec 10) 6. Construct a Turing machine to compute a function f(w)= W R where W ε {a,b} + (nov/dec 13) UNIT V Part - A 1. What do you mean by Universal TM. 2. What are the Features of Universal TM.(apr/may 11) 3. When a problem is said to be decidable and give an example of undecidable problem? (nov/dec 10) 4. When a language is said to be recursively enumerable? 5. When a language is said to be recursive? 6. State two languages, which are not recursively enumerable. 7. Define problem solvable in polynomial time. 8. Define the classes P and NP. 9. Define NP complete problem. (nov/dec 10) 10. What are tractable problems? 11. What are the properties of recursive and recursively enumerable languages?. 12. When do you say a problem is NP - hard? 13. Define Primitive Recursive function. 14. Is it true that the language accepted by a NDTM is different from recursively enumerable languages. 15. Define intractable problems. 16. Define Bounded quantification. 17. Define Polynomial Time reduction. 18. Show that union of recursive language is recursive. (nov/dec 11) 19. Define posts correspondence problem. 20. Define modified posts correspondence problem. 21. Define the classes P and NP.
22. Show that the following problem is undecidable. Given two CFG s G1 and G2 is L(G1) L(G2)=ⱷ 23. Differentiate between Initial and composition function. 24. Show that the union of recursive language is recursive. 25. Mention the difference between P and NP problems UNIT V Part - B 1. Show that for two recursive language L1 and L2 each of the following is recursive (i) L1UL2 (ii) L1 L2(iii) L1 2. Explain Universal Turing machine and Show that the universal language is recursively enumerable but not recursive. (nov/dec 12) 3. (i)show that the complement of recursive language is recursive. (ii)if language L and its complement L' are both recursively enumerable then show that L and L' is recursive. 4. Explain polynomial time reductions with relevant findings. 5. Write short notes on tractable and intractable problems.(apr/may 10) 6. Write a brief note on Primitive recursive function.