0% found this document useful (0 votes)
5 views19 pages

Toc Pyq Apna Engineering Wallah

The document outlines the structure and content of mid-term and end-term examinations for a B.Tech program in Theory of Computation, including various questions related to automata, formal languages, and grammars. It specifies the marks distribution, compulsory questions, and topics such as regular expressions, context-free grammars, and Turing machines. Additionally, it includes instructions for students regarding enrollment numbers and exam formats.

Uploaded by

omjee9473
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)
5 views19 pages

Toc Pyq Apna Engineering Wallah

The document outlines the structure and content of mid-term and end-term examinations for a B.Tech program in Theory of Computation, including various questions related to automata, formal languages, and grammars. It specifies the marks distribution, compulsory questions, and topics such as regular expressions, context-free grammars, and Turing machines. Additionally, it includes instructions for students regarding enrollment numbers and exam formats.

Uploaded by

omjee9473
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/ 19

Apna

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)

MID TERM EXAM INATIO N


B.TECH PROGRAMMES (UNDER THE AEGIS OF USICT)
4th Semester, May, 2023

Subject: Theory of Computa tion


Paper Code: CIC-206
Max. Marks: 30
Time: 1½ Hrs.

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

' lassification or Lan >ua 1 cs with dirn.!,rntn.


-,
.) COl
-,
e L= { a11 b0 In >= () } is llOt Rc 0 ular. ) - COl
. sh Do wn Aut omata (l;M)-i<->r__.t._,_ s ~-
hl;'_.\.:_:1;_n_g _u,-1s-'C-+-----= CO2
n >= I i _
~,.a..;.;~_: _L:.__ __ _ __ _ _ _ _ _ -·---

fo1lowing: CO2
Tree 2.5
2.5
(Please w rit e yo11r E11 rol111c11t No. i111111 cd ia1c ly) Enro lm e nt No. _ _ __

•· SUPPLEM ENTARY MID TERM EXAMINA TION


- ~

-,
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

~ TinH': 1Vi Jin,. Max. Marks: 30

~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

different closure propt: rti es or Rcg 11Lir La ngu:1gcs·.~ s


Jes.
ua L=- a 11 b11 C 11 11 >:..... () \ is Ill) ! (. ' 011 l c .\. t - Fr1..' t' .
1 1! 0 5
uage L= { w I w cont ains equal nu m hL'r L)f a ' s 5
(P-le_as
- -- , ·-:-- avu. r ;a:,,,ca:m .«ou J'io;J
_ ____

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

Sub ject : The ory of Com put atio n


Pap er Cod e: CIC -20 6
Max imu m Mar ks: 75
Time: 3 Hours
from
Note: Atte mpt any Jfre ques tion s inclmli11!(
Q. Nfl. J w/,ic/, i.f Cflmpul.w,ry. S elect one ques tion
encl, u11it.

[6x 2.5 =15 ]


QI Att emp t any SIX .
e.
a) Dif fere ntia te DFA and NFA with exa mpl
s of CFG ? Wri te the ir pro duc tion form at .
b) Wh at arc the two nor mal form
gua gc con tain ing eve n num ber of
c) Des ign a reg ular exp ress ion for the Jan
O's foll owe d by odd num ber of l's .
d) Def ine recu rsiv e enu mer able lang uag es.
e) Def ine Sav itch theo rem .
uag e .
f) Sta te the pum pin g leem a for reg ular lang
Com plet e Pro blem .
g) Dis ting uish betw een NP- Har d and NP-
and FOL LOW for the belo w
h) Des ign LL( l) par sing tabl e usin g FIR ST
gra mm ar
S-+aAcd/BcAc
A-+ b!E
B-+Cf/d
C-+ fc
Aut oma ta.
i) Des crib e form al defi niti on of Pus hdo wn

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

r the alp hab et I: = {a, b}: [7. 5]


b) Let 's con side r two reg ular lang uag es ove
ing stri ngs with one or mor e 'a 's)
LI = {a, aa, aaa , ... } (the lang uag e con tain
tain ing stri ngs with one or mor e
L2 = {b, bb, bbb , ... } (the lang uag e con
'b's)
ed und er (i ) Uni on (ii) Inte rsec tion
Sho w tha t the regu lar lang uag e are clos
(iii) Com plem ent (iv) Diff eren ce.
to the reg ular exp ress ion
nstr uct a min imi zed DFA equ iva lent
*10+1 *0) (01)*. [7.5]
NFA ther e exis ts an equ ival ent
ve tha t for eve ry L reco gnized by an '
. (7.5]
acc epti ng the sam e la n gua ge L.
P.T .O.
[-2-)

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.

Q3 a) Prove that the following grammar is ambiguous (5)

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)

·:·: t~ ~~~i~~~ -~y:~~l·s.~;~]·pr~t!l;~-tirn1s fro1~·G·= (N,1~Y .~) . when: N = {N,A,U,C} and


,,b} and p ={ s ➔ aS/A/C, A ➔ a, B ➔ aa,C ➔ aC b } (S)
(Pleas• writ. gour ~am Roll No.} Exam Roll N o• .. ........ . ...........

END TERM EXAMINATION


FOURTH SEMESTER .TECH APRIL - MAY 2019
Pape.r Code: ETCS-206 Subject: Theory of Computation
Time: 3 Hours Maximum Marks: 75
I Note: Attempt all questions a.s directed. Internal choke is indicat ed.

Ql (a) Construct a Mealy machine equivalent to the Moore machine given in


table. (5)

Present Next State Output


State b-: : 1
q2 0
2 1
0
3 1

(b) Describe the Chomsky classification of language wit...½ example. {S)


(c) Draw the DFA equivalent to the CFG with productions
P = ~ ➔ osjtA, A ➔ IA/OB, B ➔ IBI/\. Here /\ is used for null. (5)
(d) Prove that every language accepted by a multiple-tape TM is
acceptable by some single-tape TM. (5 )
(e) Prove that if there is a polynomial time redu ction from P 1 to P2 a..11.d if
P2 is in P then P1 will be in P. (5)

Q2 (a) Minimize the following DFA (6.25)


Q1I o 1
➔ qo q1 qo
qi qo q2
q2 q3 qi
q3 q3 qo
q4 qJ qs
q5 q6 q4
q6 q5 q6
q7 q6 q3
(b) Prove that for any input string x and y, o(q, xy) =b'(o(q, x} Where o is y;
the t ransition function of a DFA. (6.~5)
OR
Q3 (a) Draw the DFA for regular expression 00*11(11)*00* and find the
complem ent and reverse of the DFA. · (6.25)
(b) Draw the DFA for L={a bm jn,m;;?:l} and if Lis not regular language
0

then prove it using pumping lemma. (6.25)

(a) Simplify the CFG G = ({s, A, B, C, D, E }_{t1, h, c}, P, S) where


P = {s- ➔ ABC,aB, A ➔ aA/a,B -► b/CjD, D ➔ a/b, E -► c:/1\} and convert the
• plified CFG into CNF. Here A is used for null. (6.25)
P.T.O.
drom e over {u,b}. (6. S)
(b) Con stru ct the PDA for odd leng th palin 2
OR
QS {a) Des ign a PDA for U1e L = b"c"jn ~ 1}and if it is not c FL then prove
{a"
(6.2 5)
it usin g pum ping lem ma. store then we
uage L by emp ty
(b) Prov e that if A is a PDA acce ptin g lang e L by final
sam e languav,
can desi gn a PDA B whic h can acce pt the (6.2 5)
stat e.
two strin g of {O, 1} sepa rate d
Q6 (a) Des ign a Turi ng mac hine to conc aten ate (6.2 5)
by a blac k tape sym bol. .
(6.2 5)
{b) Stat e and prov e Turi ng Chu rch' s Thes is.
OR
mandn,m,k;?:1 } (6.2 5)
Q7 (a}°Design Turi ng mac hine for L=~~bmck/k =n+
{b) Wha t do you mea n by recu rsive
and recu rsive ly enum erab le
(6.2 S)
lang uage s? Exp lain with exam ple.
(6.2 5x2= 12.5 )
Atte mpt any two: -
for the Turi ng mac hine M
(a} Con stru ct the time com plex ity T(n)
acce ptin g strin g of type 0° 1n where ~ 1. _ .
clas ses. .
(b) Explain diffe rent time base d com plex ity
ther e 1s a poly nonn al time
(c) Prove that if P1 is N P-comp~ete and
N P-co mple te.
reduction from P1 to P2, then P2 1s also

***********

€ \ 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 .................. ... ~

Urnnch: CSE · l;'f{'S 2()(, Sl·mcskr:4111 s I·


• II IJl'cl : l'I 1cory of Computation
·
Subject CmIc: ', -• -· , I M11xim11m
• Marks: JO 1" .
1mc. . I 30 II rs.
Not,•: 011e.~tI,m 110. I '·'' <'Olll/',11 .,·01·,,, from rc,·
' t o/'the qu,•,·tiom
- ' ,t,
· ""''"'{ IIIV I WO {fll{'.\ '1/0/IS.
·

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

Q3 (a ) Minimize the following FDA: (6.25)

a a

(b) Construct a DFA equivalent to the NFA M whose transition table is


given in Table 2. (6.25)
Table 2: Transition table of NFA M

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 DFA equiv alent to the gramm ar


QS
S ➔ aS/bs)aA, A ➔ bB, B ➔ aC, C ➔ A. (6.25)

(b) Reduce the gramm ar S ➔ AB, A ➔ a, B ➔ cjb, C ➔ D, D ➔ E, E ➔ a


to
Chom sky Norma l Form. (6.25)

(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 ' ' ·:··•· •• ,

... • ·. ,' • • .•·.· •,,.; .,' . • . ,-.. ·,·· i:•i·•.· , , ti,' • • ..


, :_:·:. : ·'••·.. : \: ·:.·· ,:·: ........_:-·:~ .:·•:,'." ' .' ' '· : ••, ',, :-:--,: ,.., ·. , !, ' ..,.,:'\

,. ,. , ,,. • '"F" .., T ... "E' . . ..... -: :·


Roll No . ,., . , .
··· · .·.:. ·~'.·.:~·'.:··•.. ·.:~-.. ~ .... ·. •··! · ' ·· · ·
· ·.· · ·. ·: . . .. .<:. i'. .:· r ··: ◄ 1r,s,.: . ~~.m.::. ◄ - x.a11 tio11
. . , .. .. , ·. . .
. . .• 1iria

1-i
~ · ·..· ·· ·.- · :·:· _:. :.:· . ,..: • , ·, I ·;

·'. . -:. · . .-·: ·:·.·:s.·.;b',:.:· .·...· ·. · ",,• •·:·..... . :··...··.:··· ··· ·. . .


: ' • •', • t ,, ,• • • • , ,I 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. .... · ··..
~\ :.'. ,:" ..:·,.··:. >.· ·:'.::,·,• . . , .. ,.· . ·.. . ·~· .,:·.· . .

.·., :r-.. ·.(1+1) -... ;::."· .


~5/ ':'.'t'. .:,:. :· Qt ~):.Dcfin~ atll~nl'at_a ·:1r1d diffore11li~t~;~~~wce11 DFA _n~d ~~\ ~.:·:,;_: ·.·,:... . . .:·:- .'." ·,
t50i ', ' .: ., ' I,) bi ffcre,itiate Mclay arid Mqore f ~c~ i:~~: l)csi~n. a m~aiY miithin6 fo find ps complement of
.. ; , ,. .· . . . .. · . (l+ l)
•.

.. · given bir1~1:y mimbcr/ ·;\ • ·· ;> '.. . -· ·.. . .,

~ ,·:. · :. •: __- ·,: . 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, ,: ,; .· ., ,_ .... ~ .

-~§JoP~,wi!1ii .t~g_t~la_(e~pr~_~iion,q(ci f .b)" b.


. •"-.~':°'• •' .. • \.\'.;... ._
·· .·~ •
, :._. {1+ 1)
l;\-:-' .,: . ':i.~. : ·_:.. :Xa~guag~, .ti1e:;·~~··: i~p:t~St~te~

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)

Q2 b) Design a DF A for the following regular expression P


expres sion _(P') (ii) It would accept
DFA in a way (i) It ~ould ~ccept complement of given regular
(2+1 ~'z +l ½) ·
reverse of given regular expression (PR).
Q3 a) Find the regular expression corresponding to Figure l.
- iI . o -· O

(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)

J Q4 (a) Convert the following grammar G to Chomsky Normal Form:- (6)


S➔ABCa,A➔ aAbb, A➔e,B➔ bB,B➔ b,B➔AC,C➔ aCa,C➔e
~ (b) Prove that intersection of a CFL L with a regular language Mis a CFL. (6.5)
OR
QS (a) Prove that class of deterministic context free languages is closed under
complement. (6.5)
(b) Check whether the following grammar is ambiguous. If it is ambiguous
remove the ambiguity and write an equivalent unambiguous grammar. S➔I
C t S I iC t S e Sla,C➔ b. (6)
Q6 (a) Construct a turning Machine for checking if a set of parenthesis is well-
formed. (6)
(b) Define Turning Machine. Give a block diagram with specified functions of
each part of it. What is the difference between a Turning Machine and Two
way finite Automata? (6.5)
P.T.O.
(-2-]

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.

You might also like