0 ratings0% found this document useful (0 votes) 103 views5 pagesTheory of Computation
Theory of computer science
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
R20 eo Li
CMR TECHNICAL CAMPUS
UGC AUTONOMOUS
B.Tech - III Semester, Regular End Examinations, Feb-2022
Theory of Computation{20CS304PC]
(Common to CSE,CSM,CSD & IT)
Time: 3 Hours Max. Marks: 70
Answer Any Five Questions
All Questions Carry Equal Marks
5X 14=70 Marks
1. a Convert the given NFA into DFA and check the string acceptance for the input
sequence”000111010” by resultant DFA [7M]
sree EE CE CEES
b. Find Deterministic Finite Automata for the following languages on E=(a,b} .L ={w
na(w) mod 520} and show that string “aaa” is accepted by the resultant automata, [7M]
2. a Define Non-deterministic finite automata? Design NFA to accept the set of strings
contains “010” as substring over the alphabet {0,1}. Construct transition table and show that
the string “001011” is accepted by resultant NFA. (™]
b. Convert the given ¢- NFA to DFA and check for the string acceptance by resultant DFA
for the string:”aabba” (7™]
3. Minimize the given finite automata 4m]
cama fOul ea!
Sale le
Bialicdlir
=c [D/H
Do [elu
— (Fit
~F [els
e [His
a [tte
Sramraiiea]
4, a. Construct Finite Automata for the given Regular Expression (a+b)*aa(b+a)* [7M]R20 set) CT T7iR
». State pumping lemma? Prove the given language L= {a*ba"ba"™ | n,m>=1} is non-regular
language? (7™]
5. a Construct PDA for the language L={WW®| WE(0+1)*).Check whether it is
deterministic or not. (™]
». Show that the following grammar is ambiguous with respect to the string aaabbabbba.
S> aB | ba
AD aS| bAA| a
B> bS | aBB | b [7m]
6. a. Write the procedure to convert CFG to PDA and also convert the following CFG to
PDA. I™
5 aABB | aaa
A> 288 | a
BO baB | A
ca
. Consider the following grammar (™)
EDEHT|T
TOTELE
FE) Jalble
and consider the following string (a+bc*a) and constuct
i, Left most derivation
Right Most Derivation
7. a. Design a Turing Machine to accept the following language L= { 0°1*| n>=1} [7M]
b. List and explain Decision properties of Context free languages. ™
8. State whether the following instances of PCP has a solution. It is presented as two lists A.
and B, and the ith strings on the two lists correspond for each I= 1, 2,..... A= (001, 01,
110); B=(110, 010, 00). UM}
». Explain briefly about P,NP.NP-Hard and NP-Complete problems with examples. [7M]Subject Code: 20C$304PC
CMR TECHNICAL CAMPUS
UGC AUTONOMOUS
B, Tech. III Semester Regular/Supply End Examinations, Feb-2023
Theory of Computation
Common to CSE, IT, CSM, CSD, CSG, AIML
Time: 3 Hours
Note
‘This Question paper contains Part- A and Part- B.
All the Questions in Part A are to be answered compulsorily.
wees
PART-A
1. a Draw the transition diagram for the DFA accepting all strings
with a substring 01.
7S bb Formally define NFA.
¢ Write a regular expression for even number of a’s and even
number of b's of a string w = {a, b}*.
4 State pumping lemma for regular languages.
— Convert the following CFG to push down automaton:
S$ — aS |bS lal b
f — Give the formal definition of PDA.
g Whatare the required fields of an instantaneous description of
a Turing machine?
h Differentiate multihead and multitape Turing machine
i When is a language L. recursively enumerable?
7X i__ Define NP hard and NP completeness problem.
PART-B
2 Prove that, if L is accepted by an NFA with: e-transitions,
then L is accepted by an NFA without etransitions.
OR
3 Consider the following £-NFA
a) Compute the e-closure of each state
b) Convert the automaton to DFA.
Max. Marks: 70
All Questions from Part B are to be answered with internal choice among them,
10X 02 = 20 Marks
Marks
5X 10=50 Marks
Marks
10
10
co
col
col
coz
co2.
O03
co3
co4
co4
cos
cos
co
col
col
ser TNO: | | at
BL
L3
LI
L3
Li
L3
Li
L2
L2
L2
Ll
BL
L2
L310
U
Discuss the basic approach to convert from NFA to regular
expression. Illustrate with an example.
Show whether the following language is regular or not.
L= {a b"a"|n>0}
OR
Minimize the following automaton:
S>AIB
A> 0Ale
B= 0B] IBje
a) Show that the grammar is unambiguous
b) Find a grammar for the same language that is ambiguous,
and demonstrate its ambiguity.
OR
Design a PDA to accept the set of all strings of 0°s and 1’s
with an equal number of 0’s and 1°s,
Consider the following CFG where $ is the start variable:
S—aAa|bBb/e
A>Cia
BoC\|b
C+ CDE!e
DA|B| ab
a) Eliminate e productions
b) Eliminate any unit productions in the resulting grammar.
©) Eliminate any useless symbols in the resulting grammar.
4) Put the resulting grammar into Chomsky normal form.
OR
Design a Turing machine to compute addition of two positive
integers.
Prove that Universal language is recursively enumerable but
not recursive
OR
Define PCP and prove that Post's Correspondence Problem is
undecidable with one example.
10
co2
co2
coz
co3
co3
co4
co4
cos
cos
L2
L3
L3
L3
L3
L3
L3
L2
L2call sett) 7IR] T
CMR TECHNICAL CAMPUS
UGC AUTONOMOUS
B.Tech - III Semester, Supply Examinations, July-2022
Theory of Computation (20CS304PC)
(Common to CSE, CSD, CSM & IT)
Hours Max. Marks: 70
Answer Any Five Questions
All Questions Carry Equal Marks
5X 14=70 Marks
|. a Consider the following Transition system and test the acceptance of strings given below
i, 110001 (™)
horo1
@ | w
epee
e e | *
Tepe Te
i a)
b. Construct a DFA equivalent to M= ({qo.qh. 42. 43,44}, (0, 1, 2}, 8 go, {ga}), where 6 is given in the
following Transition table. I™]
>
igieea
tat [ a [tear
*
Te oF
@ - {s] -
2. Convert the following NFA with €-moves into an equivalent DPA. amy
3. a. State and prove Arden’s theorem. t™
b. Construct a Finite Automata for the Regular Expression given below
(0+1)*(00+1 1YO#1)* mq