TOC 2076 - Ankit Pangeni

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

CSC 257-2076

Tribhuvan University
Institute of Science and Technology
2076

Bachelor Level/Second Year/ Forth Semester/Science Full Marks: 60


Computer Science and Information Technology (Csc 257) Pass Marks: 24
(Theory of Computation) Time: 3 hours.
New Course

Candidates are required to give their answers in their own words as for as practicable.
All figures in the margin indicate full marks.

Attempt all the questions.


Section A
Long Answer Questions
Attempt any Two questions (2x 10-20)
1. Define the NFA with e-transitions and e-closure of a state. Show that for every regular expression r,
representating a language L, there is e-NFA accepting the same language. Also convert regular
expression (a+b)*ab* into equivalent Finite Automata. (2+6+2)
2. How can you define the language acceted by a PDA? Explain how a PDA accepting language by
empty stack is converted into an equivalent PDA accepting by final state and vice-versa.
(2+4+4)

3. Define a Turing machine. Construct a TM that accept L = { wcw" | we {0,1} and cis E or O or 1.
Show that string 0110 is accepted by this TM with sequence of Instantaneous Description (1D).
(2+6+2)
Section B
Short Answer Questions
Attempt any Eight questions. (8x5-40)
4. Give the formal definition of DFA. Construct a DFA accepting all strings of (0,1) with even number
of Os and even number of 1s. (2+3)

5. Define Chomsky Normal Form and Greibach Normal Form in reference to CFG. Give a suitable
example of each. (2.5+2.5)

6. Give the regular expressions for following language over alphabet f0,1) (2.5+2.5)
a. Set of all strings with 2rd symbol from right is 1.
b. Set of all strings starting with 00 or 11 and ending with 10 or 01.

7. Show that language L={0"1" | m>=1} is


notaregular language. 5)

8. Describe the Turing machines with mutiple tape, multiple track and storage in state. (5)

IOST,TU 1
CSC 257-2076

9. Construct NFA
a
accepting language of {0,1} with each string ending with 01 and convert it into
equivalent DFA.
(2+3)
10.Construct a PDA
accepting language over {0,1} representing strings with equal
Show by sequence of IDs that 0101 is accepted by this PDA.
no
of Os and 1s.
(3+2)
11. Define complexity of a Turing machine. Explain about big Oh, big Omega and big Theta notation
used for complexity measurement.
(1+4)
12. What do you mean by tractable and intractable problems? Explain with reference to TM. (5)

IOST,TU
2
heoyompbahn -oa
-Ankt PargeiIOID
Sechion A

NFA cWh_--ganefton and e-Uosuve


tine The
a &lale Bho
l o sdate That or eveyegul _enpreseo
here3_-NEA
epresenbng aanguae
lanauage HGO ConveN 2guar
atephinp ho Same (a+b aku hh egoiatent Finde Aukmaz
erPre3sjn

h mnshon Caued an psllon


he NEA mathemakat madel
NEA Whfch fs define as a
Tha CoDs?gds o 5 p e
E: QSGo, F)_whes.
Q: zatte sel ol slaBa
FFnike auphabet
g0E
lo: Tka dale
Thikal date
Sg SvsE1
P: Sct ofdina shalea F
mpg ition unCep_dekred a

hCae DLpson MedCocore_ mSBade R


laarhable a Hate 2
debined a du the éps Pion Clasu e
On eadin Cpaitn[e) ony P Cates

e: lors taxa an Bnampe C¬-NFa

e-UoseC2o: 4o,2, 923


E-Clase (4)=\, ?2_
E-Clse (22) =h 22, 91}
Euoe (21): 23
elasSMAte PAGE
DATEUUUT

ien gulah épreaslon


(3+6) ab*

Ke's Convent Pt to AFA

WhIth_ Poa finde_Qutmata EH

o poe, eNey egu tar 6rpresBion


Yepreichtin a_ánquaeL thare EUPA
achepingha Ramo languaje
0'S aISUne L:20k)tor a requ to epe A
2. we_pnve that L:2()_for Soma -NB
|Mwih
Saaly av a taptng 8eue
No_hComing edge at the hiha fla
No ougoin edge at the accephng d
lep-)Czreake a larhn_gdake Say , an ana
Hate Sa 92 fabe tha nans?hen 2,h 2
O ho ven gular enpreion, P, i n
But R s (8)"_ghen (meale_a bngo
niha &iale, whch_wn alo be theinal ddas

elassmate PAGE
DATE O I I N
#
op-2:Kopeak Xhe sououn u by Cona rdeminy tho
WO0spg
pgecadenty equlas pnekh0n Operadov JA
Oparatp s1e he enpreh»
ProLcodene eopenatos h Togulan
a_eNpera depnad
Ontn 2 Coakenatn&klun "loru

ofon oPenrato 2) an be elPmtnade by Potodong


Daralusd og betuen krg two 6iae ag otoe
423

ho_Concat enabe_perasr ( o no operatn ata


8tat e
Can be elemtnate by fnindoch a n
behvean the Rada fauou

klone's CLosoR/¥) Can be eiminated by nmdooy 3et-u


JT homeS Ony one OOgoingeop. at lett mo Has
p-*

oe
2 TE Thres Only one tntominy edje a

3) 6Lse fomdu0_a now Male between twe HakK


having Suf-Ap 0 0S0O-

2E la4b)_(aab)otb)
aib
elassmod Coeip onding EwFAIs PAGE
DATE
.9.Mow Can_you dekne heanguae aapal
by_PDA Eplan vhow a_PDA_aiuephng
anguageby empty &Aaek_s_Lonverlal inh
an4uvaLont PDA aluphry by_finas tabe _
Vic0-Ve0.
oh dawn automada
hat aoopBs utha ConletPs_a_?nite_ausomah4
PDACan aceup! fhe_hringt reanguaje
languag by
HcaupBance by fna Aa
ven a PDAP Uhe languase
tna ae 21 fswl (9 20) aF* ccpte by
Lwhene PEP a Yer (P t,Y)}

Hcupianto bs émphy tatk


on a
PDA_P_hean2ua4e
emph &aes 4(P) Psw/2w,aLptes by
horePEQ 20)L* (PievE)}

onvonston PDA aceopkn


empi auk h_ language by
PDA'a0Lphngby frallu
us CoDsPden the
anquage_ PDA PN thab acep)s
by emph, Ktau a
and
egvatoptPA that acop l PE B
I

by_kna
lasSMate
PAGE T
DATE IIN

haContwdin f r Jom y Ps dlane as on

Ddxe,aNouSymba XoXo ) y plaa Po


niw ddant Blake,Po to posh Zo1tio
2)nwodta a g ender Khate 2.
ad Fymbsi oA P_7D fhe top 01 diau
ofhenFdes ansinor unh Pu in fP
Copyihe
re the
L rnu4_add ano7hon_new Male Pr,wbch
accuphng_Aadeof_PE

hue, fha nouw CoAruted le has fhe_Comporen


Pu: go Po,Pi, z folxo] ,&E,Po,Xo,AP
Whene dp R deknod by
SEPo,E1Xo): (90, Xoo)
a:6, Aak
2 plala 460, Pnpus a fp ov the POs
hynbteYt 9 7 YauCMaie_au
the fang'hon
opy
onthone of P
kunCten_fel46X%)
Add ansthr trans?ron
Pite Pn

eXolE
P
XelE

Slake to 0cph
nv.eosion a_PDA aepfiry by hoal
Py emphy_Hatk
e dene ag oloue
he Conghnchn ef Pw m
elassMate PAGE
DATE UON

opdoct a nQu dmbot o (No GT an


J the atx
platgP h the bothmBhant 8tae Po to pogh Zo
2.Theoduco a new
amhs q_ PE)_h te top qd the Haa
LHand
epen lale o ard hale_ot Pe)
or eagh_al00ptng khade o P add a
domnsfa On e f a new tate
P

hx fhe no CoNdnucdes Pu hay mpnen


Pu:/Bo,Po, P, 2, Tu{XoswPo,Xa]

(ubene dN Ps doknedk
1. lPo,6 Xo)_( 90, 20 Xo)
2. ale qES Pnpuk o &2_0T 0:6, and diax
hymbauYer Sw 9,4 Y) Contatn au the

doans Phon_ nChong e Pa


9 al0ophng iata 26f_ dae Brnbr
Yerbr xo S2061Y) =(PE).
4 &hak kymbou Yer or y-X, n /9,tY)PEN
C,asyt

(P
( ans
ATE UIOID
Narh
3.oe
a ugin
Con&roc!a TH That a@ap
o jOLJo
0 Ps acooptea by This TH w'th
n a n t a r v e u
Descaipha (D) Segvone a

no matbine 19 am wbmahn uh
h ATey
0aacoA ob an n{nite_1ape omau,
f depned bu Sexen tupla M:{0 2J. Jo»P, ,aT
B
ni ke &ek,f Siakes
: Fnike sek of npok 3umboe
o:_inak_dhale 966@
P Set o Enai_lade FS
Tape Sqmbois 2 g uays 8ubse of
B: Blank mb B6r but BE
Tan s?han nchon desned by
Lwhov, R,2,s Ähe movenart head
je. RRghe 1lep or labonar
4venangva_ l:Wc E /0u aw c foroo

o's daxe an eramPe SHring OLo0oJo whore e B


B_RRADBn CPs'o

0l0)R
B/B2
O/BR B/B2 olB nol0
20
BIBK

alasSMAte olo PAGE


DATE T

As Chau he acghana of &tnng


DUO wh Segvence q Tndandeneou
dogorf piony

o 0WoE B Jo
B 2,10

BI BD

BD124 RD

B43RRI
B 1o R

HalE_aAd aupt
Hones 0o acopB es by the
en oring mal hine.
DATE ON
Sechon B
the_ kormal_dhtinihon D
ve
onkinud a_DeA_acuphny_au 84rings
Wh_even_nómber f_0S andevg
O
DUmber o J

artbt
A DEA Ra kentte _awbomala (Ohou e
e tuplog_&1,20,P)
ive
: enile se! o stde(alphabel)
2 Sek of Ipu symbou
ansPhan o h n d : YS>8
2hihat &ae
ESet al Finat kdate Peg9
iven:0J
he DFAtn_acaepha au &rings wPh
ven num ber of'oG and even nomber efis
, 001JJ 00JJ OJ0/, 0Jj0, -~~

hoe, :402 92,41

P:2o
sdebnad as d0,0) 2,
S90): 22 2,o)>21
elassmte
&(, 123 I23,0) 4PAGE
DATE OIII

cebne_ Chomsk Nos mal om and oebach


Monalfom_ in MJnenn t CF2GUve a
entampl each Suilabo

lnmalJom [CNE PF aL_ pmdocha V Saksh


Ono 41no_fpluowg NUOR
A
Aa Whoo, 4, B,C Oe lam-teamire
A-BC Symbr and a P a
termina dymba._
Thos, gramman fo CNE_Ps ana cShch Khootdot
havo_e-pDdochon un?t_pdothan 2 VselLes_ Aumbr
Eampu SAB
C9hne, 3,A D e nm-daminM
4ib ane ternira Symbay

A CoDted ra laamma 67ebach


Nonmatfom_awF) au Pls pmdckm ng ae
ntha u Aav* Whoe,A an-dermrw
A a f ero ra1 and
V a Set eNm ermias

9hoe, b s a emnae
X
XAB (DE ae Nn-farnina

PAGE
elassmate
DATE UN

.6.Grue he hagulan eypressiong


uow angvage Over aiphabe ou?
a Setok au rngs ih 2u Sqmbo ~m vis
b 8et o_au &tring Sfanta. with 00or
dnd endin _cwith_Jo or 0

aivenT:0y
hoho Tegulan epesbun a the sed o)L
ib d Symbo Hang
m riht 1s R

lELoJJ, 0011 10J10 u,0oDo o, -

- /he vlogplan 6ipromen_o the Sel cd


taingg aningwih 00 Or J an
ending uth_ o or o
0o Jo , 000J , Jl0 J
o OD Olo, Jjuou
00411) (0+1)* (Jo 4o1) --3

classMate
DATEDOIND
.2 o1naE Languayo 1 doMJm
egulaslanguahe

L'spMve Vbn9 pumpinqkemm


uppose Is a gula Language
Dumpinq ngth=P_nits ch That anu
| 10's dfvde 3 nb Xyz_
L DAS_Supp0se P-3
hon S-'0°1':000JJJ
Wocw. 4S See a l poSsible Caseein whith we Can
dyiole &mb tneé park yz
Case Y rs in 'o'pant.
O 00J/

2 Aol I1}
aye 2Y pan
000 JJ X ooo

ae 3 Y Ps in (o' as tveL a9 ( ' pas

D 00JJ 0o?

Nou, un_&how hau y'z A fo7 9e

PAGE
clasSMAte
DATE LN
Cae:
000 011
Sna, no-o os 7 n0-0 's Jo, y2zd
Cago 2
y 2 : 00oL1JL
hn n0o os #no of J's So.92 EL
Cago 3

Honco.7t doesn't gaksy an


Cantrad!chon, P hot a
So by
Caue. So,by
requ la Languax

ecofbe Tho
|tape, mvkple Turg malhing wh
toa and mulkpu
&torage fn Hate
Ung Machine wh
muHpte tape
Aturng
Ono tape malhiae Can have more
ddirq
poumen o The an endaa entra tape more than
than
tape addg no
adds no
tho abi.lih p CoMpUdabonal modo,
acoap buE onu
ncrease.sed.A MUl8pe LhaJanguape
Ofne tape TH ConssP&
7H
fapes e0th Contml andfn1be Cons
ealh CoLL Can tape fe dtvfded_ nuMbor
iolo POto_ceu ad
ape uphabeds:
ude blank the o_cape
Jhe anyJymban
ymba okok_ kintte
kinlte
opot ymbrymbais
npot symb
PAGE
DATE UIUII
finie Co

ape -

uni Maohine uh Notipe daat


he dape tuminq malhine Can be cons de1e
ahaufnd mulbplo alu tach tak_Can_bad
Lono &ydba, and Uho tape_aLphabet the TN
ConsPts of tup Cwith_ONd Campanent or ead
ratk oUrwing_ure fhotrate the TH wh
muple daatw_
Lhnide Conhan
he Tape aphakes
rau X
Iraex2 Y toplo UkR_ - -
Tral he tage_head moR up 2do
Slan Din Sumbon in tape at oe poa-

ing Ma Chine_with_iora9e in dialee

mallhine,_a lake Can be lie to e


tng
la intte amont_e dala. The hste_cenda
odlhingLoDhds p Kdate katkebaval
1aktkkai
atype
T ak8m b d e r o d a
hi_Ca9 a
a

Ente Contr
PAGE
elassMate
DATE U

Ps desnod
C A byx ) JyA ma
A The ymb o
ate ard_data Porhon o
Rcanneg_m_Lha, dape fs onsrdened to be pie
Capiey
Pab ha_Seiad Canmporont Aale 2 Mava
The &late a
he Semh
Uigh enkering_&ale 1 8 Yeplaung bn by

9(pn&trucka_NEA_acepkhng_lanauage lo,1
lwMh _each_tring erdingwn oand mued
mue
t egutvatet DPA
nPven 520
Lots Convend the NFA tD DFA
NEH &trings_endino wfth oJ i

nshon tablo

No.l9 maue4mn?hm abl


egufvatnle DE£ /

alasSMAte
02
0

dra &ale cligaaam DA


A

PAGE
DATE JL

Q .o nruc a_PDA _acuuphng langua9e ov Tlo


eprosonding &trtnos uh_emal o o

and J'S how by Seg venC eZ TDs tha


D10J Ps_atosples by This PDA
Given, 1:4011)
PDA awepAng_ngg wth epal ne.oa
6 , 001 OJo, JJo0, l0 J1 ool o,

AUs tako otrn 00J)


O4/E 2
90/00
D,20/020
20 20>

s Chokho acozplano e OJol


g0, 010J, Zo)_E(l0,104, 0Zo
20 01, Zo)
t 0 1 , 020
Flgo E,2o
2,20)
h'nu. 1 fs ain ak
alassmate PAGE
DATE ITD

ekae Complai aToTing Machine. explan


aboukbfg Oh, b Omaga and be Thetaa nctah
Wed p lomplexih measorement
Tyafna_malhne, Lhe timeComplezi elens
tha measdhe Cha_ouD ber e Himes the
The tape
tape
Moe whn_the_malhine s nihauized_her Sorme
Input Stnbod the spa.co_lompeiy Pe 7he numbe
Op CeL the tape witle
Thl0nlogn) 3(0)o(n)
1You Can_Wte pam htornat)

. h a t do yoo man by dractabo Mtractaba_prbon?


E plan wh elenend TM
ho_piblams Thal Can be s0ved withineaserah
time and 9pace_lonkaaFDAs_ane Catk altabe
LDooblem
he_Problems that Cane be soLued Pn paynmalae
NmO_but laufras_enpann hal me algonYthn
CaLLod e1ra dable oT hendpwblomp

KCsakehe CUsgPand CLa N Bpobame


and
Dvablo Pn pounomjal_pimeby dekrmi ntthc
on-oledenminihcAaPrg maChine hen Spaa
the S p a e
lmplemenno he Hepr e
me kimere4u'red
Say
cwe Can Pmrdcasle
Phwan_ayorfthm are easonable
are
ha_prblem Psgratake The prblens
PAGE U
lasSMate
DATE LON

The tme egurador an ajorlhmiprban


lonrt en, Whore_r an er ponenhalUnben g
je. they Con
e hy co
ho class efdoacdabe_poabamg
P-bme TY fhe Comp Mang\
be Pmp ansonlea_bya
Gpoblomp : nmaiable.

Cmplomo
tTattasD LIntraetate)

#nsther &namp Ctas probon Can be Porvel


in_peuynoma_ma So 4raltabe bot
ND-lns Capke hwe Pn_polnomiat he bot
Can be 1/ehhed n_pouynnial_o &: Sudeku

NP

racake
Paublam Nontroabla
Prtbgpa

elasSMAte

You might also like