Question Bank Marks UNIT I - Siddhivinayak Technical …stc.org.in/image/banner/Theory of...

7
Siddhivinayak Technical Campus School of Engineering & Research Technology Department of computer science and Engineering Session 2016 -2017 Subject Name- Theory of Computation Subject Code-4KS05 Sr No. Question Bank UNIT I Marks 1. Design a DFA that contain a set of all string containing 1bb as a substring over ∑={1,b} 08 2. Construct DFA to accept the following languages Over alphabet (0,1 I. (i)The set of all strings ended with 011 (ii)The set of all strings which do not Contain three consecutive „0‟s‟. 08 3. Define DFA. Construct DFA for set of string over{a,b,c} having bca as substring 06 4. Convert following NFA into DFA δ a b q 0 q 0, q 1 q 1 q 1 q 2 q 2 *q 2 q 2 ,q 3 q 2 q 3 q 2 Ф 5. Construct a deterministic automata(DFA) equivalent to NFA M=({q 0, q 1 },{0,1},δ,q 0, {q 0 }} whose transition diagram is given below Q 0 1 ->(q 0) q 0 q 1 q 1 q 1 {q 0 ,q 1 } 07 6. Construct a deterministic automata equivalent to NFA, M=({q 0 ,q 1 ,q 2 ,q 3 },{a,b},δ,q 0, {q 3 }) Where δ is defined by its state table . Q 0 1 ->q 0 q 0, q 1 q 0 q 1 q 2 q 1 q 2 q 3 q 3 (q 3) Ø q 2 7. Prove that if L is accepted by an NFA, then there exists a DFA that accepts L 04 8. Covert the following NFA with transitions to equivalent NFA without 08

Transcript of Question Bank Marks UNIT I - Siddhivinayak Technical …stc.org.in/image/banner/Theory of...

Page 1: Question Bank Marks UNIT I - Siddhivinayak Technical …stc.org.in/image/banner/Theory of Computation.pdf4. Convert following NFA into DFA δ a b q 0 q 0, q 1 q 1 q 1 q 2 q 2 *q 2

Siddhivinayak Technical Campus

School of Engineering & Research Technology

Department of computer science and Engineering

Session 2016 -2017

Subject Name- Theory of Computation

Subject Code-4KS05

Sr No. Question Bank

UNIT – I

Marks

1. Design a DFA that contain a set of all string containing 1bb as a substring over

∑={1,b}

08

2. Construct DFA to accept the following languages

Over alphabet (0,1 I. (i)The set of all strings ended with 011

(ii)The set of all strings which do not Contain three consecutive „0‟s‟.

08

3. Define DFA. Construct DFA for set of string over{a,b,c} having bca as substring

06

4. Convert following NFA into DFA

δ a b

q0 q0, q1 q1

q1 q2 q2

*q2 q2,q3 q2

q3 q2 Ф

5. Construct a deterministic automata(DFA) equivalent to NFA M=({q0, q1},{0,1},δ,q0,

{q0}} whose transition diagram is given below

Q ∑

0 1

->(q0) q0 q1

q1 q1 {q0,q1}

07

6.

Construct a deterministic automata equivalent to NFA,

M=({q0,q1,q2,q3},{a,b},δ,q0,{q3}) Where δ is defined by its state table .

Q ∑

0 1

->q0 q0,q1 q0

q1 q2 q1

q2 q3 q3

(q3) Ø q2

7. Prove that if L is accepted by an NFA, then there exists a DFA that accepts L

04

8. Covert the following NFA with transitions to equivalent NFA without 08

Page 2: Question Bank Marks UNIT I - Siddhivinayak Technical …stc.org.in/image/banner/Theory of Computation.pdf4. Convert following NFA into DFA δ a b q 0 q 0, q 1 q 1 q 1 q 2 q 2 *q 2

transitions for following diagram

9. Find equivalent NFA without transitions for following diagram

05

10. Construct Moore machine from following mealy machine

06

11. Construct Moore machine from following mealy machine

06

12. Construct Moore machine to convert each occurrence of substring 100 by101

06

13. Design a Moore machine to determine residue mod 2 for each binary string treated as

binary integer.

Page 3: Question Bank Marks UNIT I - Siddhivinayak Technical …stc.org.in/image/banner/Theory of Computation.pdf4. Convert following NFA into DFA δ a b q 0 q 0, q 1 q 1 q 1 q 2 q 2 *q 2

14. Design a Moore machine to determine residue mod 3 for each binary string treated as

binary integer.

15. Convert the following Mealy machine to Moore machine

Input a Input b

Present State Next State Output Next State Output

q1 q3 0 q2 0

q2 q1 1 q4 0

q3 q2 1 q1 1

q4 q4 1 q3 0

06

16. Design a Moore Machine for binary input Sequence ,if it ends in 101, output is „A‟, if

itends in‟110‟ output is ‟B‟ otherwise „C‟.

17. Construct NFA which accepts all prefix of string „aab‟.

07

18. Minimize the following DFA

δ 0 1

q0 q1 q5

q1 q6 q2

*q2 q6 q2

q3 q2 q6

*q4 q5 q7

q5 q2 q6

q6 q6 q4

q7 q6 q2

13

19. Construct the minimum state automation equivalent to following FA whose transition

table is

Q ∑

0 1

q0 q1 q2

q1 q4 q3

q2 q4 q3

(q3) q5 q6

(q4) q7 q6

q5 q3 q6

q6 q6 q6

q7 q4 q6

13

20. Convert following RE into FA : 10+(0+11)0*1 06

UNIT- II

1. Construct the regular expression corresponding to state diagram described by

05

Page 4: Question Bank Marks UNIT I - Siddhivinayak Technical …stc.org.in/image/banner/Theory of Computation.pdf4. Convert following NFA into DFA δ a b q 0 q 0, q 1 q 1 q 1 q 2 q 2 *q 2

2. Construct the regular expression for given transition diagram

05

3. Construct the regular expression for given transition diagram

05

4. Construct the regular expression for given transition diagram

07

5. Show that the following language are Regular or not:

i) L={ap/P is prime} ii) L={ ώώ / ώ is (a,b)* }

06

6. Design Finite Automata without transitions for the regular expression((a+b)*de)*

05

7. State and explain the pumping lemma with an example. What is its application?

06

8. Using pumping lemma show that the following language are not regular:

i) L={0i2/I is an integer i>=1}

ii) L={0i1i/i>=1}

08

9. Let G={ [A0, A1], [a, b], P, A0 } where P consist of

A0->aA1

A1->bA1

A1->a

A1->bA0

Construct Transition system M accepting L(G)

06

10. Find Right and Left Linear grammer for:

i) 0* (1(0+1))*

ii) (((01+10)* 11)*00 )*

08

11. Find Right and Left Linear grammer for:

08

Page 5: Question Bank Marks UNIT I - Siddhivinayak Technical …stc.org.in/image/banner/Theory of Computation.pdf4. Convert following NFA into DFA δ a b q 0 q 0, q 1 q 1 q 1 q 2 q 2 *q 2

L={anbm/n>=2,m>=3}

12. Write the regular expression for the language:

i) L={an bm/(n+m) is even}

ii) For the set of strings with even no of 0‟s followed by odd number of 1‟s for the language L={02n12m+1/n>=0,m>=0}

07

13. Explain in brief the closure properties of regular sets. 06

UNIT – III

1. Write a CFG to generate the language L= {0m1n 0m+n /m,n>=1},

07

2. Convert the following grammar into CNF:

S->abAB, A->bAB / Є, B->Baa/A/Є

07

3. Construct a PDA for the language.

(i) L= {wwR/ w is in (0+1)*}

(ii) L= {a2ncbn/ n>=1}

07

4. (b)Convert the following to GNF:[07] G= ({A1, A2, A3}, {a, b}, P, A1) where P consist of

A1->A2 A3, A2->A3A1/b, A3->A1A2/a

08

5. Construct Turing Machine that accepts the following Language on {a,b}

(i) L= {aba*b}.

(ii) L= {w: |w | is even}

06

6. Explain the properties of CFLs.

06

7. Eliminate null production, unit production, useless production, from the following

grammer

(i) S->aS/A/c A->a

B->aa

C->acb

(ii) S->a/aA/B/C

A->aB/ Є

B->Aa

C->aCD

D->ddd

07

8. Let G=<V,T,P,S> be a grammer whose productions are: S->aB/bA

A-> a/aS/bAA

B->b/bSaBB

For the string “aaabbabbba”,find

i) Left most derivation

ii) Right most derivation

iii) Parse tree for each derivation

06

Page 6: Question Bank Marks UNIT I - Siddhivinayak Technical …stc.org.in/image/banner/Theory of Computation.pdf4. Convert following NFA into DFA δ a b q 0 q 0, q 1 q 1 q 1 q 2 q 2 *q 2

UNIT – IV

1. Explain in brief different types of turning machine.

07

2. Explain in brief Multi dimentional turing machine 05

3. Explain in brief

i) Multitape turing machine

ii) Two way infinite tape turing machine

06

4. Design a Turning Machine to compute the multiplication of two numbers. 08

5. Construct Turing Machine that accepts the following Language on {a, b}

i) L= {aba*b}.

ii) L= {w: |w | is even}.

08

6. Explain in brief Church‟s Hypothesis. 07

7. Design a Turing Machine that computes

f(x,y)= x-y if x>=y = 0 if x<y

09

8. Construct a Turing Machine that recognize a language {an b

n c

n/n>=0} 07

9. Construct a Turing Machine that recognize a language {an bn cn/n>=1}

10. Construct a Turing Machine that recognize a language {0n 1n /n>=0}

11. Construct a Turing Machine that recognize a language {0n 1n /n>=1}

12. Design a Turing Machine that computes the function f(m,n)=m+n 06

13. Design a Turing Machine that computes the function f(m,n)=m*n

Or

Design a Turning Machine to compute the multiplication of two numbers.

06

UNIT – V

1. Define Linear bounded automation 03

2. Find Linear bounded automation that accepts the language L={an!/n>=0} 06

3. Find Linear bounded automation that accepts the language L={WW/W ɛ (a,b)*} 07

4. Give (LR/0) grammar for the following production

S‟->Sc

S->SA/A

A->aSb/ab

07

5. Find the grammer generating the set accepted by LBA whose transition table is as

follows:

08

6. Explain the closure property of DCFL‟s 06

7. Explain following grammer in detail :

i) Type 0

ii) Type 1

iii) Type 2

08

Page 7: Question Bank Marks UNIT I - Siddhivinayak Technical …stc.org.in/image/banner/Theory of Computation.pdf4. Convert following NFA into DFA δ a b q 0 q 0, q 1 q 1 q 1 q 2 q 2 *q 2

iv) Type 3

8. Explain the Chomsky Hierarchy ?Explain with example? 06

9. Show that L={Wɛ{a,b}*:na(W)≠nb(W)}is a deterministic context free 07

10. Show that the languages.

i) L1={0n 1m /n=m and n>=1}

ii) L2={0n 1m /n=2m and n>=1}

is a deterministic context free-language

10

11. Show that L={an bn / n>=1}U {a}is a deterministic. If yes construct DPDA for it 05

12. Show that there exists some LBA M, for every context sensitive language L not

including € Such that L=(L)

07

13. Give unrestricted context sensitive grammer for:

L={ai bi ci /i>=1}

07

14. Show that the family of context sensitive languages is closed under reversal 06

UNIT- VI

1. Prove the following

i) The complement of recursive language is recursive. ii) The Union of two recursive language is recursive.

07

2. Describe in brief what is halting problem 06

3. Prove that the Turing Machine M halts on input W is undecidable.

06

4. Explain the properties of recursive and recursively enumerable languages in detail 07

5. Explain Universal turing machine 06

6. Determine whether the following pairs (A, B) have a solution or not, if yes give

solution, if no why?

07

7. Determine whether the following pairs (A, B) have a solution or not, if yes give

solution, if no why?

i) A={1,10111,10} B={111,10,0}

ii) A={10,011,101} B={101,11,011}

07

8. Show that the following function are recursive:

i) n+m

ii) nm

06

9. Show that the addition and multiplication of two positive integers is total recursive

function.

07

10. Does the PCP with two lists x=(b,bab3,ba) y=(b,baa) have a solution? 07