0% found this document useful (0 votes)
28 views6 pages

Toc MQP

This document is a model question paper for the Theory of Computation course at R.V. College of Engineering, covering various topics such as automata, grammars, and Turing machines. It includes two parts: Part-A consists of short answer questions, while Part-B contains longer questions requiring detailed explanations and proofs. The paper is designed for B.E. students in their fifth semester and has a total duration of three hours with a maximum score of 100 marks.

Uploaded by

anumanenivb.cd22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views6 pages

Toc MQP

This document is a model question paper for the Theory of Computation course at R.V. College of Engineering, covering various topics such as automata, grammars, and Turing machines. It includes two parts: Part-A consists of short answer questions, while Part-B contains longer questions requiring detailed explanations and proofs. The paper is designed for B.E. students in their fifth semester and has a total duration of three hours with a maximum score of 100 marks.

Uploaded by

anumanenivb.cd22
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Course Code: CS354TA

USN

R.V.COLLEGE OF ENGINEERING
(Autonomous Institution Affiliated to VTU)
V Semester B.E
Model Question paper
THEORY OF COMPUTATION
Time: 03 Hours Maximum Marks: 100
Instructions to Candidate:
1. Answer all questions from PART-A. PART-A questions to be answered in first
three pages of the answer book.
2. Answer question 2 and any one question from 3 and 4, any one question from 5
and 6, any one question from 7 and 8 AND any one question from 9 and 10
PART-B.

PART-A

1.1 Consider the following automata. What is the set of reachable states for the 1
input string 0011?

1.2 The minimum state automaton equivalent to the below FA has how many number 1
of states

1.3 Find R212=? 1

1.4 Define ε –closure (q), where q ε Q of an automata. 1

1.5 In each case, find a string of minimum length in ∑= {0, 1} not in the language 1
corresponding to the given regular expression.
i. (0*+1*)(0*+1*)(0*+1*)
ii.
0*(100*)*1*
1.6 Describe the decision algorithm to answer the following question. 1
Given two DFA’s M1 and M2, are there any strings that are accepted by neither?
1.7 Give CFG for the language “The set of odd length strings in {a, b}* with the middle 1
symbol a”.

1.8 Show that the grammar with indicated productions is ambiguous. 1


SaSb | aaSb | є
1.9 Define Left Most Derivation (LMD). 1
Give LMD for abaaba in the grammar with productions
SaSaSbS | aSbSaS |bSaSaS | є
1.10 Identify the nullable variables in the grammar given below. 1
S→AB|ABC, A→BA|BC|a| є, B→AC|CB|b|є, C→AB|BC|c
1.11 If G is a context free grammar in CNF and x ϵ L(G) with |x|=n. How many steps 1
are there in the derivation of x in G?
1.12 Let G be the CFG with productions S→S+S|S-S|S*S|S/S|(S)|a 1
How many derivation strings are there for the string a+(a*a)/a-a?
1.13 DFA whose transition table is as below, here state A is the start state and states 1
B, C are final states.
δ a b
A B B
B C C
C D D
D A B
What is the equivalent left linear grammar for the above DFA.
1.14 Consider the right linear grammar with the productions 1
A→aB | bD, B→aB | bC | €, C→aB | bC | €, D→aD | bD
Find the left linear grammar which is equivalent to the above right linear
grammar.
1.15 Define Deterministic Push Down Automata. 1
1.16 What is the language generated by the Context Sensitive Grammar with the 1
productions S→ABCS | ABC, AB→BA, AC→CA, BC→CB, BA→AB,
CA→AC, CB→BC, A→a, B→b, C→c.
1.17 Obtain Turing Machine to accepts the language 1
L={w| w є {a, b}* and w ends with abb}.
1.18 What is the language generated by the right linear grammar with productions 1
S→aA | bC | b, B→aC | bA | a, A→aS | bB, C→aB | bS.
1.19 If L1 and L2 are recursively enumerable languages, then L1⋂ L2 is recursively 1
enumerable language. Is this statement is TRUE or FALE.
1.20 What is the solution to the instance of PCP given below. 1
List A List B
Xi Yi
1 1 010
2 0 10
3 10 101
4 01 100
PART-B
2a Find the regular expressions corresponding to each of the following subsets of 4
{0,1}*.
a) The language of all strings containing exactly two 0's.
b) The language of all strings that do not end with 01.

b For the DFA below describe, either in words or by writing regular expressions, the 4
strings that cause the DFA to be in each state.

c Explain the algorithm to find an equivalent NFA from the given NFA- ϵ. Use this 4
algorithm to draw an NFA for the NFA- ϵ given below.

For the DFA shown below, use the minimization algorithm to find a minimum state
d DFA recognizing the same language. 4

3a State and prove pumping lemma for regular languages. Use pumping lemma to show 6
that the following languages are not regular.
a) L={ww | w ϵ{0,1}*}.
b) L={xy | x,y ϵ{0,1}* and y is either x or xr}.
b Describe decision algorithm to answer the following questions. 4
a) Given two DFA's M1 and M2, are there any strings that are accepted by
neither.
b) Given a regular expression r and an DFA M, are the corresponding languages
are same?
c Let M1, M2 and M3 are the DFA's pictured below recognizing languages L1, L2 and 6
L3 respectively.

Draw DFA's recognizing the following languages.


a) L1 U L2
b) L1⋂ L2
c) L1-L2

OR
4 a Define CFG, Language generated by CFG, Left most derivation and Right most 4
derivation. Consider the grammar below SS+S | S-S | S*S | S/S | (S) | a.
i. Give two left most derivations for the string a+(a*a)/a-a.
ii. Give the derivation tree corresponds to each of the derivations in (i).
iii. How many distinct left most derivations of this string are there?
iv. How many derivation trees are there for the string a+a+a+a+a?
b In each case, given the context free grammar G, find an equivalent CFG with no 4
useless variables.
i. SABC | BaB, AaA | BaC | aaa, BbBb | a, CCA | AC
ii. SAB | AC, AaAb | bAa | a | є, BbbA | aaB | AB, CabCa |
aDb | є, DbD | aC
c Define GNF grammar. Given below a CFG G, find a CFG G1 in GNF generating 4
L(G) – { є }. ABC, BCA | b, CAB | a
d Draw the NFA accepting the language generated by the grammar with productions 4
S→abA|bB|aba, A→b|aB|bA, B→aB|aA
5 a Define PDA. Construct PDA for L={wwR | w є {a,b}*}. Show by IDs the string 6
abaaba is accepted.

b Let L be L(M1) for some PDA with empty stack M1=(Q,∑,Γ,δ,q0,Z0,ϕ), prove that
there exists an final state PDA M2 such that L=L(M2). Construct empty stack PDA 4
to accept L={w | w є {a,b}* and w is palindrome}. Convert it into equivalent final
state PDA.
c What are steps to be followed while finding an equivalent PDA by empty stack for 6
the given CFG. Find the equivalent PDA to the CFG with productions
S→aSb | bSa | abS | baS | Sab | Sba | є. Show that the string abaabb is generated by
the given CFG and it is accepted by its equivalent PDA.
OR
6a State and prove pumping lemma for context free languages. 6
Show that L={ww | w ∈{a,b}*} is not context free.
b Let L1={aibjck | i< j } and L2={ aibjck | i< k }. Show that L1 and L2 are context free 6
but L3=L1∩ L2 is not context free.
c Decide whether the following languages are CFL or not. 4
i. L={anbmambn| m,n≥0}.
ii. L={xayb| x,yϵ{a,b}* and |x|=|y|}.
7a Design Turing Machine to accept the language L={ w | ε {a, b}* and 6
Na(w)=Nb(w)}. Trace the machine for the string baabab.

b Let x and y are two positive integers represented using unary notation. Design 6
a Turing Machine that computes the function f(x,y), where x,y ϵ 1 +
f(x, y) = x - y if x > y
f(x, y) = y - x if y>x
f (x, y)=0 if x = y
c If L1 and L2 are recursively enumerable languages over ∑, then show that 4
L1 U L2 is also recursively enumerable languages.
OR
8a Design Turing Machine to perform the string reverse operation over ∑={a, 8
b, c}. Use Instantaneous Descriptions to show operation on w=abac.
b Write a note on 6
i. Multi tape Turing Machine
ii. Non deterministic Turing Machine
c Prove that every regular language is also a recursively enumerable language. 2
9a Construct the Linear Bounded Automata for the language 8
L={ wwR | w ε {a, b}*}. Trace the machine for the string aabbaa.
b Define Context Sensitive Grammar. 4
Give Context Sensitive Grammar to generate the language
L={ anbncndn | n ≥1}. Show that the string aabbccdd is generated by the grammar.
c Write a note on Chomsky hierarchy. 4
OR
10 a Define Unrestricted Grammar. Give Unrestricted Grammar to generate the 8
language L={ w | ε {a, b, c}* and Na(w)=Nb(w)=Nc(W)}.Show that the string
acabcb is generated by the grammar.
b Write a note on undecidability. 4
c If the given language L is Context Sensitive Language, then L is recursively 4
enumerable language. Prove this statement.
Q.P.Code
Course code: 21CS54 Course Title: Theory of Computation

PART-A
Q.No 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10
BT 1 2 3 1 2 3 2 1 1 2
COs 1 1 2 1 2 2 2 1 2 1

Q.No 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 1.19 1.20
BT 3 4 4 4 1 3 3 2 1 4
COs 2 3 3 2 1 3 2 1 2 3

PART-B
Question No BT level COs Question No BT level COs
Addressed Addressed
a 2 1 a 3 2
2 b 3 2 3 b 2 2
c 4 3 c 4 3
d 4 3 d
a 3 3 a 3 3
4 b 4 3 5 b 2 2
c 4 4 c 2 3
d 3 4 d
a 2 2 a 4 4
6 b 3 3 7 b 4 4
c 3 4 c 3 2
d d
a 4 4 9 a 4 4
8 b 3 2 b 3 2
c 3 2 c 1 1
d 4 1 d
10 a 3 3 a
b 2 1 b
c 2 1 c
d d

Signature of Scrutinizer Signature of Chairman

Name: Name:

You might also like