Toc Pyq Apna Engineering Wallah
Toc Pyq Apna Engineering Wallah
Engineering
Wallah (IPU)
Notes
PYQ’s
Practical Files
App Download Link
CLICK HERE
(To Access For All Subjects
Enrolment No. - - --
(Please write your Enrolment No. immediately)
Note: Attempt Q. No. J which is compulso ry and any two more questions from remaining .
Max. C O(s)
Q. Question
Marklil
No.
Which of the following two regular expressions are equivalent? 3 COl
I (a)
Explain.
I. (00)* (E + 0)
11. (00)*
m. 0*
iv. 0 00 *
(b) Write a regular expression for the language accepting all strings 2 COl
that start with a and end with b over al habet I= a,b .
(c) Explain four-tuple definition of Context Free Grammar with the 3 CO2
hel of an exam le.
Convert the Context Free Language L= { a b I n >=0 } to its
0 0 2 CO2
e uivalent Context Free Grammar.
Differentiate between DF A and NF A. Ex lain with exam le. 5 COl
Draw a DFA over I= {0, 1} that accepts all binary strings divisible 5 COI
b f:ive.
Convert the given NF A to DF A. 4 COl
a
q2D a, b
fo1lowing: CO2
Tree 2.5
2.5
(Please w rit e yo11r E11 rol111c11t No. i111111 cd ia1c ly) Enro lm e nt No. _ _ __
-,
L'
B.TFCII Pnoc;1ul\1M fi:S (lJ~ _l)f,:n
•
nm AEGIS OF USJCT)
41h ," H'lll('Sftt·, .J1111c, 2023
~
~ Paper Code : CI C-20<1 S uh_jcct: Theory of Computation
~ot c: .\ tr cmp f Q. No. 1 whid1 is l'0111p 11lsory and nny fwo more questions from remainin g.
-) -. - ~ - - - - - - - - - - - - - - - - - - - - - - --
f-'7 , -A - - , - - - ,
----,-
" ,.-,a x. ,
Qnc . . rion CO(s)
No. Marks
1 (a ) Defi ne the follo\\·ing terms with examp les : 5 CO I
1. Symbol
11. Al phabet
111. String
I\'. L~mguage
( b) Choose the correct option and explain yo ur answer. 2 / CO2
CFG is not cl osed under - - --
1.
11.
Union
Complementa tion
I
i
111. Kleen Closure
i,·. Co ncatenation
(c) Dra ,,· a parse tree to derive the string "a baabb" for the given CFG : co~
S --+ SS I aSb I £
2 a) I Defin e NFA. State the advantaaes and disadvantaaes of NF A. 3 C01
(b) Consi der a language L that accepts all the strings having three
consecutive a ' s over L= {a,b}. COl
1. \\Trite a Regular Expression for L. 2
11. Draw a DFA for L. 5
3 (a) Minimize the given DFA. 5 ' COI
a
E N D T E R M EX A M IN A TI O N
202 3
FOU RTH SEM STE R [B.T ECH ] JUL
Y
UNI T-I
ent DFA [7.5]
a) Con ver t the foll owi ng NDFA to an equ ival
ii 1 6
----1
1,0
----0------- 0
UNIT-II J~
Q4 a)
0
the language L={O• 1J Qk I j >i+ k}
Generate CFG f \alcncc of PDA and CFG. Construct a Po [
f:f•;
b) Describe the cqu1 /\ equiva1 '7.s] •
the grammar: S -+ aAA, A-> aS/b/S/a e[;t to J
-SJ
PDA for the language a nbman+m
. ..yl
QS a)
Construct 'nistic and nondeterministic PDA are not . ['7 sl
b) Prove that determ1 equivalent. . •
[7.S]
UNIT-III .,
Q6 a) Construct a Turing machine that accepts t~e language of Palindro "
b ' Al specify the moves to trace the stnng abaa, abbba a b Ille over
{a , . so
b) S;ate halting problem. Prove that t h e h a 1ting
. ' a aa [7 S
problem is undecidabi ·)
"
e.
A
[7.S]
Q7 a) What is Turing Machine? Explain its advantage and different Variants. ,.
b) Design a Turing machine to accept the language L={an bn, n>l}. [7.S]
[?.SJ
-
~
t;
UNIT-IV
State and prove Cook's Theoram. ...
State and Prove Interactive Proof systems. [7.SJ
[7.5]
..
.,
Show that the directed Hamiltonian circuit problem is NP-Complete. [7.5)
Explain and prove post correspondence problem taking a suitable
-
example. [7.5]
"
~
~
*********** -
- }
-
" !,
...•
•
....
•
....
•
~
•
~
.;
~
~
~
~
~ :
~'_!.
· QI An.swcr the following questions (2X5 =10)
a) D ti . ·
c me NFA with the help of an example .
.-· b) Constru~t a DFA to accept nil strings over {0, l} wi1i ch contains three consecutive zeros.
c) What is ambiguity in grammar'? How is· it removed? · ·.
. d) State three closure properties of Context Free Languagcs(CFL) .
e) Differentiate between deterministic PDA and non-deterministi c PDA.
Q2 a) Minimize the following DFA (5)
b) i) Find a regular expression for the set {an bm: (n + m) is odd}. (2.5X2=5)
ii) Find a regular expression over {O, l} for the all strings not ending in l 0.
S ➔ a jaAb I abSb, ·
S ➔ aAAb I bS
b) Construct the regular expression for the DFA shown below: (5)
cl
~
• I •) '
G~---b---~
\ '
a.b
nstruct a PDA (Pushdown Automaton) to accept the language L = { a11 b'\ ;11 \1 '11 1 m, 11 ....,= I }
empty stack and by final state . _ _ . (5)
***********
€ \ c..S- )J:)Co
Apna
Engineering
Wallah (IPU)
Notes
PYQ’s
Practical Files
App Download Link
CLICK HERE
(To Access For All Subjects
Mid 'fcr111 Exantination-2018 Roll No .................. ... ~
QI n) Write down the regular l'X wcssion for the ll>ll nw ing di agrnm .
/0st- 0 0 ~J, I
Figure 1.1 (2)
b) Design a mealy machine to lind 2 's co mpk111c11l of given binary number which is processed from
right to lcH instead of tell to ri ght. (2)
c) Design a DFA accepting the binary equival ent of lhc elements oflhc set (2nln > O} and describe,
in English language, the following regular ex pression (a)' b(a)' b(a)' b(a )'. ( 1+I)
d) Find all strings of length 4 or less in the regular set represented by the following regular expressioll.
(b a•+ a b•t and Design a DFA for lhe regular expression (00)'(1 1)' . (l+I)
c) Define regular grammar for the following DFA.
~
Q2 a) Minimize the following DF A M
0? Figure 1.2
= (( q0 , q1, qz, q3, q4, qs}, ( a, b}, 8, qo, {qz, q5}) where
(2)
o is given as: 6(q 0 , a) = q0 , 8(q 0 , b) = q3, 8(q1, a) = qz, o(qi, b) = qs, 8(q z, a) = q3,
o(q 2 , b) = q4 , o(q 3 , a) = q0 , 8(q3, b) = qs, 8(q1, a) = qo, 8(q4, b) = q5 ,
(5)
Ql b) Find the regular expression corresponding for the Figure 1. 1 using Arden 's Theorem. (5)
Q3 a) Design a DFA for the following regul ar expression P = (1 + 01)' . Afterwards, convert that OF.-\
in a way (i) It would accept complement of given regular expression (P') (ii) It would accept re\erse of
given regular expression (PR). (2+ I !/2 + I ~~)
{Onl"ln ~ O} is not regular.
Q3 b) Prove that L = (5)
Q4 a) Reduce the following grammar G into Chom sky Normal Form (CNF)- {S-+ aAD, A -+
aBlbAB, ➔ b, D ➔ a} Hert, S, ~,' B & Dare the variables; Sis the start variabk; and a anJ bare the
8
terminals. (5)
the given gram111ar-{S-+ uSjA£1, A-+ Jjc, B --i. b}. I kre, S, A
Q4 b) Remove the NuH
Joe; a, band c arc th e lc nuinal s and '1. is the Null symbol.
(5)
.t;ND ·1·ERM ..tiXAMINATION
FOURTH SEMESTER rB.TECH] MAY-JUNE 2018
Paper Code: ETCS-206 Subject: Theory of Computation
(Batch 2013 Onwards}
Time: 3 Hours Maximum Marks: 75
Note: Attempt any five questions including Q no. 1 which is compulsory.
Assume missing data if any.
. Ql (a) What is Finite Automation? Differentiate between DFA and NFA? (5)
~ (b) Construct a DFA over the a lphabet {O, 3}, such that number of O's
in the string is always even. (5)
~ (c) Construct a PDA accepting the set of all even-length palindromes over
~ a, b by empty store. (5)
(d) State Church's Hypoth esis a bout computability of a machine . (5)
~ (e) Prove that graph coloring problem is NP-complete. (5)
~
Q2 (a) State and prove Kleen's Theorem. (6.25)
~ (b) Construct a Mealy machine which is equivalent to the More machine
given in Table 1: (6.25 )
~ Table 1: Transition table for Mealy machine
~ ·
Next-State
~ Present State a=0 a=l Output
➔ Qo q1 q2 1
~ q1 q3 Q2 0
Q2 Q2 Ql 1
~ Q3 1
Qo Q3
a a
Present State 0 1
P.T.O.
-
[-2-)
(6.25)
(a) State and Pump ing Lemm a for Conte xt Free lan~a ges.
Q4 er. (6.25)
(b) Const ruct a PDA to find the 2's- comp lemen t of binary numb
(a) Const ruct a Turin g machi ne that enum erates {onl n Jn ~ 1}.
(6.25 )
Q6
(b) Const ruct a Turin g machi ne for the langu age {anbncn /n ~ 1}.
(6.25 )
(6.25 )
Q7 (a) Expl~ n Univer~al Turin g Mach ine with the help of an exam ple.
ages and the
(b) Expla in recurs ive and recurs ively enum erable langu
relatio nship betwe en them. (6.25 )
***********
' \' \ ' ' '
1\ 7•~ , .•·, \1.'1,, , \,,.., ,,•· ' ' • . ,. '" ·" ',....... ~~,·
.':'. ·:·. ..~.:."•• • \,. · , 'i·
't ' ' ·:··•· •• ,
_·· :·','"· ., ·:.·.·· :.· . ·.· ;_';. :· .'. ::- :<:.. :..
~. :.:..·.:, .. ...... _>:>. . . ·.· :·:.· ··.•.>-' ...'.;,,~: ...-· ····. ,. .. .,•· -Scmcstcr-4 ·• :·
,._\· ~;/ ;>:: -.'. ·..'···
•.•. ·,,...... Branch·CSE ···
~:•,.>: :<·:•~: .·. :;:/:,§A~J~~'(.~~.<!.c=·, ~i'sf ·~,n~.~.~:~~·;-.\~·.;:~~ /··./ i:: ·-iin.1:t!:3~\;~~ -.~:rc?'t~fatio~·_....
2·9.·~: ,: : ~:- :-.;: ;:· :· .:i}t1.~ ,t rm two · •· · < .• · •.. ·.
J ,s ·comp,tl.mrl', from res/ oftl,e· 11eslto11s attem · .,. .. ·· · ,·. :
-~ ... .::-:Note: 011estrn11 110. 11
:: ·. .:. ..':','. :.:.·•.'· '. ·:.·:. :·.· .. '•i•: .;.'.: .. .·: ..' . •.· .
1
es1011s. .... · ··..
~\ :.'. ,:" ..:·,.··:. >.· ·:'.::,·,• . . , .. ,.· . ·.. . ·~· .,:·.· . .
~ ,·:. · :. •: __- ·,: . c) ·. Repres~nt -, t!~·e f oll.~ ~.ing s~!:,.~Y :Jf~~~ l~_r.. e~_p~~is i~~:··
' , • :
{l 2 In •.~
.i••.,. , :_,:•,•;;' ' . , .~
· .. :· . ." •' ·· ,:
..
: O}_.and -~escribe, in Engti~h
,::.',.'\•. :·.,..•··- • .11 .. ~-:·_• 1,>fl · ,' 1, ,' ;, ,•,_•,_..t; ,:.-1 ·1 .·,-.•
~f-~ _,.r, ,: ,; .· ., ,_ .... ~ .
9 ~ :: ~ ·.• -~- -; :·:~ ~::·:;;·'. ~)-~\t .nt . .~11 s~~i:?.~ \{~L _ i·~~~~t;_ ,::i ;t e~\'.~~~~t,'.:!;n\!:th{ i:}~,¥.:~'~~:::~d ;·foprfs.er1 _~e~..::_by _th·e· f~llo:- ing ..regular_
i'o~ (10 + 01)*0 (_0 01 +
~ \. • •• : .:'_ ._ :., • • •
1 • expression ;_, (<(~·: ~.,- ~~~-);,ailci.: J?e.s.ig~\ ii.;::J?:F:f\i. :fo~,:.91tt r~g_u_{ a(_,e x~ress
~ - _ · · ,_-•_·_ . . ·~11r '.: _~- ·- ·/_.:/·:_/;.: : ,i,._:.:i<:.)\:/\::L.'·;···<.'·: ..:"/··:.,i •. .:)i\:>. _ ·: ·:·. .: . <1~1) ...
ctions are s ➔ 0 B 11 A, A ➔
·..e) .J?efirie ~onte.:x,t: fre~ .gr.anrn1ar·(CfQ)i·rq_h:si der. aCFO·Ci: wh6se -produ
C 0I0Sl1 AA,B ➔ lllSIO BB, find° the . right . mo.st: d~rivation for the string 00 110101 in this
·• :- . ·'.·\ o (l+l)
gramm ar. .
Q~ a) Min imize the f6116wing DFA:r /;t dC/o; Cli,:ck:q~;:q~i~;>iz~J;:'{ci->h},··.o, C/o, {q6}) where
8 is given as: 8(qo, a) ~ qo,- o(qo, b) = q3, 8(qi, a) --~ qz, . 8(qL b) -~ Qs, o(q2, a) = q3 ,
= qp, . . 8(q 3, b) ;; qs, 8(q 4 , a) = q0 , o(q 4 , b) = q 6,
o(q2, b) = q4, 8(q3, a)
- _. · -=- -
8 (q s,-- a) q1, o(qs, b) = q4,
(00)* (11) •. Afterwards, convert that
o(q6, a)= qi, 8(q6, b) = q3.
=
(5)
(5)
(5)
Q3 b) Prove that L = {aPlp is prime number} is not reg ular.
Form (CNf)- {S ➔ OAD , A -.
a) Reduce the following grammar G · into Chomsky Normal
variable and O, J, 2 are the
AB, B -+ 1, D -+ 2} Herc, S, A, fl & D are th e variables, S is the start
(5)
A, fJ-+ A. D -+ b }. Herc,
ovc the Null produ cti on from the given grn mmar-{S - aSIAl l, /\ -+
the Null symbol.
D urc the variables.S is the start variables, u and /, are the terminals and 11 is
(Please write your Exam Roll No.) · EXAMINATION
END TERM B TECH] MAY· JUNE 2017
FOURTH SEMESTER • Subject: Theory of Computation I
Paper Code: ETCS-206 Maximum Marks: 75
Time: 3 Hours -- d i ~ Internal choice is indicated. I
I Note: Atte__mpt all question as ~e___:... . -----·
·m1·n1·stic automata with example .(Sx5=25)
· · t' an d non detel '
Ql (a) Expl ain dctcnrnrns ,c . for regu lar languages.
(b) StRtc and prove Pumping Lemma orrnal Form and Greibach Nor:°1a1 Form.
(c) Differentiate bct,~een Cho':'sk~ to accept the set L of all stnng over {O, 1}
(d) Constn..ict a Tunng Machme
ending with O 10. . , .
(e) State and prove Savitch 1 heo1em .
(6.5)
. . . m state automation for the following DFA.
Q2 (a) Design a mm1mu
Cl ab
b
(b) Prove that i. a*(ab)*(a*(ab)*(a*(ab)*)*=(a+ab)* * *
ii. (1 +00*1)+(1 +00*1) (0+ 10*1)*(0+ 10)*1)=(0+ 10 1) (6)
OR
(a) Convert the following Moore Machine to its equivalent Mealy Machine. (6.5)
Q3
I 0
£.Q
°G O / I
t
•
l
(b) Prove that if L1 & L:i are context free languages, then L=L1uL:2 is also context
free. • (6)
Q7 (a) S ta te an d pr OR
ov e H al ti ng P ro bl
(b) D es ig n a T ur em for T u rn in g
ni ng M ac hi ne to m ac h in e.
for th e su in g 'a aa ac ce pt th e la n g (6 .5 )
b b b ' w it h ta pe sy u ag e L={a0 bn,n
m bo ls . > 1} . S h o w an ID
Q8 Write sh o rt no te
s o n a n y two:- (6)
(a) Prove th at a
fu nc ti on f:~* ➔ ~* (6 .2 5 x 2 = 1 2 .5 )
is a polynomiall is ca ll ed po ly no
y bo un de d T ur ni ng M ac hi ne m ia l- ti m e co m p u ta b le if th er e
(b) E xp la in cl as si co m
fi
(c) S ta te & prov ca ti on of pr ob le m s w it h ex am pl p u ti n g it.
e C oo k' s T he or em e.