Theory of Computation - Part - A - Questions Bank

5
Rajalakshmi Institute of Technology Department of Computer Science and Engineering – Theory of Computation – Part – A Questions Compiled By – B. Udaya, AP / CSE, RIT Page No : 1 THEORY OF COMPUTATION UNIT – I 1. What is a finite automaton? Give two examples. 2. Is it true the language accepted by NFA is different from the regular language? Justify your answer. 3. Define NFA with - transition. Is the NFA’s with - transition are more powerful than the NFA’s without - transition? 4. Enumerate the difference between DFA and NFA 5. List any four ways of theorem proving 6. What is the principle of mathematical induction? 7. Define the Language described by NFA and DFA 8. State the relation among regular expression, DFA, NFA and FA with transition 9. What is inductive proof? 10. Differentiate between proof by contradiction and proof by contra positive. 11. What is structural induction? 12. What is epsilon transition in finite automata? 13. Define Transition Diagram 14. Obtain the DFA equivalent to the following NFA 15. Obtain an NFA without transition to the following NFA with transition 16. Describe the following sets by regular expression a. L 1 = Set of all strings of 0’s and 1’s ending in 00 b. L 2 = Set of all strings of 0’s and 1’s beginning with 0 and ending with 1 17. Obtain the - closure of states q 0 and q 1 in the following NFA with transition 18. Find the language accepted by the following automaton 19. Obtain the - closure of each state in the following NFA with - moves Find the language accepted by the DFA given below 20. Find the - closure of states 1, 2, and 4 in the following transition diagram 21. Construct a finite automata for the language {0 n | n mod 3=2 n> 0} 22. Construct a DFA over = { a, b } which produces not more than 3a’s 23. Construct an NFA for all strings over alphabet = { a, b } that contains a substring ab. 24. Construct a DFA to recognize odd number of 1’s and even number 0’s 25. Find the set of strings accepted by the finite automata.

description

Theory of Computation - Part - A - Questions Bank

Transcript of Theory of Computation - Part - A - Questions Bank

Page 1: Theory of Computation - Part - A - Questions Bank

Rajalakshmi Institute of Technology

Department of Computer Science and Engineering – Theory of Computation – Part – A Questions

Compiled By – B. Udaya, AP / CSE, RIT Page No : 1

THEORY OF COMPUTATION

UNIT – I

1. What is a finite automaton? Give two examples.

2. Is it true the language accepted by NFA is different from the regular language?

Justify your answer.

3. Define NFA with - transition. Is the NFA’s with - transition are more powerful

than the NFA’s without - transition?

4. Enumerate the difference between DFA and NFA

5. List any four ways of theorem proving

6. What is the principle of mathematical induction?

7. Define the Language described by NFA and DFA

8. State the relation among regular expression, DFA, NFA and FA with transition

9. What is inductive proof?

10. Differentiate between proof by contradiction and proof by contra positive.

11. What is structural induction?

12. What is epsilon transition in finite automata?

13. Define Transition Diagram

14. Obtain the DFA equivalent to the following NFA

15. Obtain an NFA without transition to the

following NFA with transition

16. Describe the following sets by regular

expression

a. L1 = Set of all strings of 0’s and 1’s ending in 00

b. L2 = Set of all strings of 0’s and 1’s beginning with 0 and ending

with 1

17. Obtain the - closure of states q0 and q1 in

the following NFA with transition

18. Find the language accepted by the following

automaton

19. Obtain the - closure of each state in the

following NFA with - moves

Find the language accepted by the DFA given

below

20. Find the - closure of states 1, 2,

and 4 in the following transition

diagram

21. Construct a finite automata for the

language {0n | n mod 3=2 n>0}

22. Construct a DFA over = { a, b } which produces not more than 3a’s

23. Construct an NFA for all strings over alphabet = { a, b } that contains a

substring ab.

24. Construct a DFA to recognize odd number of 1’s and even number 0’s

25. Find the set of strings accepted by the finite automata.

Page 2: Theory of Computation - Part - A - Questions Bank

Rajalakshmi Institute of Technology

Department of Computer Science and Engineering – Theory of Computation – Part – A Questions

Compiled By – B. Udaya, AP / CSE, RIT Page No : 2

26. Construct a DFA for the language over {0, 1}* such that it contains "000" as a

substring.

27. Construct a DFA for the following

a. All strings that contain exactly 4 zeros.

b. All strings that don’t contain the substring 110.

UNIT – II

1. What is a regular expression? Give an example

2. Show that the complement of a regular language is regular.

3. State pumping lemma and its advantages.

4. What is meant by equivalent states in DFA?

5. Prove or disprove that the regular languages are closed under concatenation and

complement.

6. What is minimization of automaton?

7. Differentiate regular expression and regular language.

8. Name any four closure properties of regular languages.

9. Show that ( r*)* = r* for a regular expression r.

10. Let R be any set of regular language. Is U R1 regular? Prove it.

11. Consider the alphabet = {a, b, (, ), +, *, ., }. Construct a context free grammar

that generated all strings in * that are regular expression over the alphabet {a, b }.

12. Verify whether L = { a2n | n > 1 } is regular.

13. Construct a DFA fro the regular expression aa* | bb*

14. Show that * is by constructing its NFA using Thomson’s construction.

15. Write regular expression for the following language over the alphabet = { 0, 1 }

“ The set of all strings not containing 101 as substring”. Provide justification that

your Regular Expression is correct.

16. Prove or disprove the following for regular expression ( a + b )* cd for = { a, b,

c, d }

17. What is ( 10, 11 )*?

18. Let L = { w | w { 0, 1 }* w does not contain 00 and is not empty }. Construct a

regular expression that generates L.

19. Give the regular expression for set of all strings ending in 00.

20. Prove by pumping lemma, that the language 0n1

n is not regular.

21. Is the set of strings over the alphabet { 0 } of the form 0n where n is not a prime is

regular? Prove or disprove.

22. Is the language L = { 02n | n > 1 } is regular? Justify.

23. Give the regular expression for the following

a. L1 = set of all strings of 0 and 1 ending in 00

b. L2 = set of all strings of 0 and 1 beginning with 0 and ending with 1.

UNIT – III

1. State the definition for PDA. Give an example of PDA

2. What are the different types of languages acceptances by a PDA and define them

3. Define derivation tree for a CFG.

4. Define the language generated by a PDA using final state of the PDA and empty

state of that PDA.

5. Is it true that the language accepted by a PDA by empty stack or that of final states

are different language.

6. What is the additional feature PDA has when compared with NFA? Is PDA

superior over NFA in the sense of language accepted? Justify your answer.

7. Is it true that non deterministic PDA is more powerful than that of deterministic

PDA? Justify your answer.

Page 3: Theory of Computation - Part - A - Questions Bank

Rajalakshmi Institute of Technology

Department of Computer Science and Engineering – Theory of Computation – Part – A Questions

Compiled By – B. Udaya, AP / CSE, RIT Page No : 3

8. Define instantaneous description of Pushdown automata.

9. What is meant by empty production removal in PDA?

10. What is a CFG?

11. Define the term ambiguity in grammars.

12. Mention the use of context free grammar.

13. Is the language of Deterministic PDA and Non – deterministic PDA same? Justify.

a. What is the height of the parse tree to represent a string of length n using

Chomsky normal form?

14. What do you mean by expressive power of a grammar?

15. Let G = ({S,C}, { a, b }, P, S ) where P consist of S aCa C aCa | b find L(G)

16. Consider G whose productions are S aAS | a, A SbA | SS | ba. Show that S

aabbaa and construct a derivation tree whose yield in aabbaa.

17. Find L( G ) where G = ( { S }, { 0, 1 }, { S 0S1, S }, S }

18. Construct a context free grammar for generating the language L = { an bn | n > 1 }

or Construct a CFG over {a, b} generating a language consisting of equal number

of a's and b's.

19. Let G be the grammar S aB | bA, A a | aS | bAA, B b | S | aBB. For the

string aaabbabbba find leftmost derivation.

20. Explain what actions take place in the PDA by the transitions

( q, a, Z ) = { ( p1, 1 ), ( p2, 2 ) . . . ( pm, m )}

( q, , Z ) = { ( p1, 1 ), ( p2, 2 ) . . . ( pm, m )}

21. Find the language generated by the grammar S aB | bA , A a | aS | bAA, B

b | bS | aBB.

22. Show that id + id * id can be generated by two distinct leftmost derivation in the

grammar E E + E | E * E | ( E ) | id

23. For the grammar S A | B, A 0A | , B 0B | 1 B | give the leftmost and

rightmost derivation of the following string 00101.

24. Write a context free grammar to generate the set { ambncp | m + n = p and p > 1 }

25. Let the production of a grammar be S 0B | 1A, A 0 | 0S | 1AA, B 1 | 1S |

0BB. For the string 0110 find the rightmost derivation.

26. Find whether the language { ambmcm | m > 0 } is context free or not.

27. Show that the grammar S a | Sa | bSS | SSb | SbS is ambiguous.

28. Find out the context free language S aSb | aAb, A bAa | ba.

29. Construct a PDA to accept the language { (ab)n | n > 1 } by empty stack.

30. Give a semi – three grammar generating { ai | i is a positive power of 3 }

31. Consider the following grammar G with productions, S ABC | BaB, A aA |

BaC | aaa, B bBB | a, C CA | AC. Give the CFG with no useless variables

that generates the same language.

32. Is the grammar id | E E E + → is ambiguous? Justify.

33. Is the grammar below ambiguous S SS | ( S ) | S ( S ) | E?

UNIT – IV

1. Define Turing machine.

2. Define instantaneous description and move of a Turing machine.

3. When a recursively enumerable language is said to be recursive. Is it true that the

language accepted by a non deterministic Turing machine is different from

recursively enumerable language?

4. Define Multitape Turing machine

5. Explain the basic Turing machine model and explain in one move. What are the

actions take place in a Turing Machine.

6. Describe multitape Turing machine and explain in a single move, what are the

action that take place in it.

7. Explain how a Turing machine can be regarded as a computing device to compute

integer function.

Page 4: Theory of Computation - Part - A - Questions Bank

Rajalakshmi Institute of Technology

Department of Computer Science and Engineering – Theory of Computation – Part – A Questions

Compiled By – B. Udaya, AP / CSE, RIT Page No : 4

8. Describe the non deterministic Turing machine model. Is it true the non

deterministic Turing Machine models are more powerful than the basic Turing

Machine?

9. When a language is said to be recursive? Is it true that every regular set is not

recursive?

10. Explain the multitape Turing machine model. Is it more powerful than the basic

Turing machine? Justify your answer.

11. Can you say the language generated by a Context Free Grammar in CNF is finite

or infinite? If so how? If not why?

12. What is the language for which the Turing Machine has both accepting and

rejecting configuration? Can this be called CFL?

13. The binary equivalent of a positive integer is stored in a tape. Write the necessary

transitions to multiply that integer by 2.

14. State the pumping lemma for context free language.

15. What are the useless symbols in a grammar?

16. Differentiate multitape and multitrack Turing machine.

17. What is the minimum number of stacks needed for simulating a Turing machine

using multi stack machine?

18. Define Greibach Normal Form.

19. Construct a Turing machine for zero function f : N N, f( x ) = 0

20. When does a Turing machine become an algorithm?

21. Convert the following grammar in Greibach Normal Form

S ABb | a, A aaA | B, B bAb

22. Design a Turing machine with no more than three states that accepts the language

a(a+b)*. Assume = { a, b }

23. Is the language { } 1 | ≥ = n c b a L n n n is context free? Justify.

24. What is the height of the parse tree to represent a string of length 'n' using

Chomsky normal form?

25. Construct a Turing machine to compute 'n mod 2' where 'n' is represented in the

tape in unary form consisting of only 0's.

26. Design a TM that accepts the language of odd integers written in binary.

27. State the two normal forms and give an example.

28. Convert the following grammar into an equivalent one with no unit productions

and no useless symbols S ABA, A aAA | aBC | bB, B A | bB | Cb, C

CC | cC.

29. What is Chomsky normal form?

30. Is the context free language is closed under complementation? Justify.

31. What are the applications of Turing machine?

32. List the closure properties of Context free Languages?

UNIT – V

1. When we say a problem is decidable? Give an example of undecidable problem

2. Explain the modified Post’s correspondence problem

3. Give two properties of recursively enumerable sets which are undecidable.

4. Give two examples of undecidable problem

5. Is it true that complement of a recursive language is recursive? Justify your

answer.

6. When a language is said to be recursive or recursively enumerable?

7. Show that complement of a recursive language is recursive

8. When a problem is said to be decidable or undecidable? Give an example of an

undecidable.

9. What do you mean by universal Turing Machine?

10. Show that union of recursive language is recursive.

Page 5: Theory of Computation - Part - A - Questions Bank

Rajalakshmi Institute of Technology

Department of Computer Science and Engineering – Theory of Computation – Part – A Questions

Compiled By – B. Udaya, AP / CSE, RIT Page No : 5

11. Show that the following problem is undecidable “Given two Context Free

Grammar G1 and G2. Is L(G1) L ( G2 ) = ”?

12. Define Diagonal Language Ld.

13. Differentiate between recursive and recursively enumerable language.

14. Mention any two undecidable properties for recursively enumerable language.

15. What is meant be halting problem?

16. What is post correspondence problem?

17. Prove the theorem “If L is a language generated by some TM M1, then L is

recursively enumerable set”.

18. When do you say a problem is NP – Hard?

19. State two languages which are not recursively enumerable.

20. State Rice’s Theorem

21. Show that the collection of all Turing machine is countable.

22. Mention the difference between decidable and undecidable problems.

23. Define the classes P and NP.

24. How to prove that the post Correspondence Problem is Undecidable?

25. Show that any PSPACE hard language is also NP – hard.

26. Mention any two decidable problems.