THEORY OF COMPUTATION
Module 01
[nbodudion do Finite Pedomeda
|shuctuvad Repawrentations
futomata & Complexity.
aha Coral Concepts of Rutomedta theory.
pdowin'shic Finite Automata
Nondulaministe Finite’ Automata
[Pn Application : Tead Search s Finite Peckormecta
| with Epsilon- Transitions.
[Module 02
Exprowions
Frnie Automata and Expaortors
Proving er not do be Renuloa ;
| osu Pavope ties of Regelar Lamee one, Eguie
equivalence and Minimizodion of Ratomata
Pppliratton of Regeloa expaousiona.
Module 03
Cordext — Free Gammon
Poowe Tyees by ound
PBrabiuity in Grammars
rebel tn Grammars cond Lames
Definition of the Pusholown PAuctomaton
The lo of a PDA
Equivalence of Pon's and CFG'S, Deloministe
Purhdlovon Automedta.| Moclute O4
Forms Conlexd - Free Grrcvrenrans
| age eh for Cordlouk - foue lange,
| choses Proflertis of Contod -Free Language,
| Moclute 0S
| Tabeduetion bo ig Machines :
| Problem thed Compubtxs Cannot salve
The Turi Machine
0: com Techni 4 Turi Ma chins
extentions to" thu Basic Turing Machine
Adler Undect cla bility :
| A Language Thed © 3s Not Pecurni vely Enzi= Finite Auctomecta: self cboiven computing device
S To dustge A compiler we we FA.
Compila converts HLL 5
wy wits Re machine Lowel language
1. Lexical is
= Breakdovon Ahesoune code to meaningfudl
voods. 1. tokens
2- Sgn tex
3+ Semanhe
4+ Trier mrecliakt cocle generation
Ss. Code qurnadion
6- Cods operation.
| Fenite Automate (FA) consisting of 2 Mmadin parla
a Oijjered Stafsa ------ ®
2) Thaniitrory among tho Stabe ----— coerced
jp ee
Inieed Stato Stoke
Push
2) Transition 85 &
| Pash
FA
pds |e bap eee
NFA
| ora] pFsm Qlondebaministe FA)
| coetuminishe FA)
IC perumninnstc Fonte
Siak rmachint)
i .@4 ®gure ctrl sapresents feral stab
tnittalonod mask|1. Alphabd. G)
|= faite set of syrnbel?
| ert S-da bed
2. Shi :
| = Fieule sequence f sepmbals over
ex. shing -de abs, abe ob, aay
ddey not avalid Sring 2° not ine
LY empty sing whch & donotid by &
Differert functions shir
[+ length of shing chmod log! |
labal=%
} letlog = a
161 =0
ie
—3 Oo more Occurence.
ste
5 1 @ more Meemences.
2. Comatmatton of oO shieg
J wx y2---> auprerenls abi ngs
abe b---3 Symbals.
t= coll
Y= ee
After concatin ation of x and yg Shing i
NE re
Icy) = 1d+ly) f|3. Pouurx of cm alphabe
k
| 2 ‘ k= lama of Hu shieg
|| eg Fz doy
zi etey
Z'=LO1 Y
st +200, 01,10, ny
T3-L001, O00,0, O10, 101, 100,11, Hy
“danguage a)
= finite Jinfinite sek Of Shings
[L- 24 = ie. empty Ler
Problems :
1 Waite a Longuoge of all fhe Ahing? af 08 & 14
Fuwith equal no-of each. “t
| e-2ory
| Lh =20), 10, NO, OO, O101, 1010, ----Y
| Gine seb Shins consisting of n O- jolla. by
n 13 for some n30
Ps doth
L2 4 €, 01, O01, 001; ooo, ----Y i
3) Wola set of binary number uphacs value o perme
S- = 10,14
sy dito, 5101, Ms lou, ~~.anak valid Shing for Of 17 uch what (0% Taf
af cis o then 1)
| =z - Lo,
| L = LE, OF, OM, DOI, OOMIs ~ y
S| To volunbyy Faryad “then
|
Oo OG O--®
end state,
State
i the
JDFA/ DFsm
1 nm consisting of 5 tuple elorionld
lve CO, 5,4, GF)
jet Set af States
ja: Alphabet cet”
s Transition fundion
|g, + Inital state
|e + Final Stat ov + Peering State
Csypnteoe rs ~premnsition Syumeben)
Problems
. Design DFA that accepts all Anviag® of 0% and 13
has a ae os in du hing.
Data =v -to.th
L- Ol, 001, 101, NOOl, -- -
Ge a yO.
ue ” dnansitvenJo4a.-4.-4. 4
|9- oda
4944
tankition gundion Transit table
LGV
f(g.
Jlq, 0D,
MG 10 °Vs
|dC4,,0)°9,
d9s19° Ve
4 ae a DFA dy cuccepd Att of all ahmgs ending with 00
ey
| 22200, io, 1000, -- +4
| A,
| EE (4) OWE b ansition ctapran
|
B «NG 4.0954
|.- Ve
r-Q,
transition Spenetian, bons dalle
| f (4,04 Je ay
| d(4. 20074, 3% \ale
| of (4,04, a (41 =
FCG) x 4, lala!
| f(4,+0)°%
fl 4.974= -dod
1. - 4000, 1000, 006! 001000, ~~~
| chamition qunction
1 PC4..)- A SCA) Ve
| SCA..04, SAA
SUN AA 1745
(4.0) 74,
£(4,,1) 4
o(,.0)- 4,
rarsition dable
+
x4 \%| 4s
pcan ene G ae
[Bair aprh dhaF accep 3 umseertive O-
\o
Yo|%
Ga,
41%,
Ge
4] Design a DFA that cuceph a 011 Os subshing.
3 s-dony
4 doll, OO, '001, Oo!DON, - -
“6-96
8 Ate eet at
d 4..)- a” chomitin table
| PC %.-0)7 4%, Ole
| f(4..0)° 9 3% \u le
| 6(4..1)>q, % lula,
ica aie 4, [4.Ja,
CU Q
09,0) 4: * 45 [9] 4
C4. 1) > ae5 design o DFA that has no a a Audion
= dOny 7
A+ 210; OON10, O10, 5
hannton agram
62-02. Q”
ha nsitvan funchm Aronsition dahle
d(4., 0)= g, 3
\
WY. 19-4, alata
M44, 4, |4.[4,]
SCM,» 07-9, alata]
d(4,, 0)°4, « 4,la[4,.
d(4,,1)-4, ‘ele.
d(4,,0)249; B-19.,4.94,.%4
H4,-1)=4, 4.444
eadayt
& woul dre have begins with O10
5 don} b
d= LOlO,1 000, DID09, O10 I = = =
romiition danromr y on
herarhan spundion 4
(4 50)- Gr SQ
Grae asd C4 Wed
£09,194, fl 9,0) 4s
(4,02 A dC%,1)°9“"ylDaige 0 OFF hak ends eawsith O1?
Sis -.doly ,
Le LO1010, O10
franiibon diagram
| Bmw
|
| dw edon' > :
#| Ouige a DFA for Heer ve eae cofaio 0 08
is Flow} dubshing t
h-l€, 0,1, 00,11, 110, NO, --- y
b-b-d8
4. Daigo ora for a Le d
Loe ola, by* 210! B ewny
|S s-do.b}
1 ed Ga, ob, ba, aabb, e-_.. §
an
HLO10, -— ~~ } )9 Daige OFA fy 0 danqumge 1 -deoetos byw “rol
ssc. Lasby
2 =da,b» a0b, boo. aba... 4
| Lanxibion Ai cera
| —
1 Design CO OFA fox Jongunge Lalu L014 %2 us har
| odd parity &
| UT Nok? odd porrity = No-of 1’ Ahad be odd
Cpanity v.17 ta.)
Ea
zr -dory
he d}.n,100, O10, 001,- ---4
| even poouity "0 eed co ute
=
Lorn do | ae elo, bf
‘baigo a ofA do accep) @ language pedua EXO
eveu, with bY
~ Aavb 4 y
i Tb, ob, cab, abab»-- 5
Qo fybeqn 2 wn Gal colons bony et
sw condor no mov than by
|= 5 don by
B
|e Lug ex arb4™ *
| peed ¢,0 0b» a3
| besition cua?
a”
| 2B
ri Daign ora 4on 0 danquane nen on 8004 i
| Leduge Lote 4 we coniaans A
| abso urls, extuncad bansition jundion ap Shp 120
ch)
i> sedond
Led E, OOM, ovo, © oa
0211, =
Ess
Qe.
| oxtinsed transiben cpncbon for shes lolo
| £4. £)" Ve
| écq..u- dc£C4,-6,1) - ALC
CLG + 9,.1) 4)
| (4,10) $4'Q., 19,0) * 164,,0)+ @
&(9,, 101° L(deq, 19,1) ~ £41 3
a (4., 1010) (dq, 101},0)- ig, )=% .
ene as ay tinal stake
[ee 00) ----» juss de check
| 44,0"
| A£q0)2 ded
meat (4.»€),0) =
| gitar tiga. £(q.,0)>4,
ia Ll oe) No dta. 4
we) 227 nob fi
j
;
]RT njoul a DAP do accept odd no- of Og “oven fangQeng
p. odd no-af 0'8 & odd novof 1%
3. even no af O' & odd Mo of 1.
4. odd no. of O's & even no-of 12
odd no.of 04 @ odd noof A 2 P24
Esk
2.
oOo
ED, 0,0.
even no-of OF & odd no.of "4 2 F2Q,16 Desyn DFA dx a Jonquage
yee dant wriain evon O4 &
2) odd 0% and even 14 |
3) odd o's & odd 14
4) em o% & Odd 14
1. clon conican EE, ,F* 201% %34
Ger ex) ‘
3. clasn’t
| EO ° ‘0,
U-dun't EO, F-d 4,9,,4,}
GE,
OY BOE,
fot
: ’
Va
©
0, ° 6,0.‘Dao a DFA im r
a ke duve des bys
no tue Contecube oradas smart i
> s-doabs
Led ¢,a,5, 05, ba, aba, .-_-. }
Dergr 2 vr A for Language Le dw eda by**
uo has netthon alo na bb as subshing
=
sedasby
ret GoNFA] NFSMC Non -clibominsshe finite automate) ‘.
it alto consishng 5 elements \ |
(Bez. A,a.,F) \
( athow A. bansition pundion
| Qbout A
| 4- @ -tonniten
| re @ € @
2+ On comumy smal Vp slap Mow mor Many
!
1) Daign a NFA doy Le d We dasby* + w onda tn
lab m bat
| > s- Lo,b}
L= Lab ba, aah, bba, -----§
Srany) bon Ar cuppa
| Asake
|
oS @D
Problems
j7 onra for cubab
3 PQDT
ie Sete
NFA —> CQ, 2, A34..F
Daye cece otk
9,2 4.5
Fo “9, a.4
| ansihion bable
| oO |b
fre 342. 421}
x4i[d/¢
|
| areas
| *4y ? ole
Eocdinded “Branston fy
(4..€) = Le
[een a)= f(9,,0)-¢t ay
| eq ab) = da, b0d4.5) = <4atso%s
| f04..0ba) = dl4,,0)V6Q,,0U M4, 24)
22 40.4 duh |
feq., abab) » (4,20 4b) UIC4.,b)
| Lobes Veh ce Stn tom Be is
| the 3 4
Lo wae
a3 this vo The dina Serbs
gen Shing th in Cecep tek Stoke .
function Aor abab
fn
.bbaba
txlinded franstron fundion
$09.05 Ue
&(q,.6) Staeb) - CYor%e4 :
£04q,-bb)- £0 44,6) VFCA,b) \
= SEG 89
£64.09 ICG)
29 Gi Ved
| F6G.,bbab) = F(A, ,b) 004.»
=f Ger 4a M4
t¢ bb , 4
o(4,, aba) fl4.,0) 04(4, UIS4, 4)
= dQ... 4d!
Ly accept stats,
$04, 6b4) -
jv 44,6) p
|
2| worte nen do accept the ha
Led weda.byx | 34 Shonatle + ve ought & al
se
ZT -Aas by
1 =4aaa, bababb,-----$
transibun oagram
-B2-O578
cs ab 534)
bamsition table.|
+ rect
oe NEA do ciceep » Onguage,
j Org
[ Pe wEXa by] every w ends w in by
Ls
rs sab)
} 1 «tb, ob, bb, bab, )
i
| ranibon diagram
a)
4 Wouleenra do nacognire che Nernquage
Ledwevaby™ | & made ef am aphenad a,
b's }.
followed by ao Ey 2010 Gy more
Sy aby
1 ~ Laa,aaa, aabbb, aaab,. - 229:
| bansibin dracyam.
|
oa GO @ a &
| Design NFA ace o Jo
4 Jo aaccepl OOOH nnglgeh
Ped wedaey® jw - aha am jl do even Y
Ce haw to write €- NFA)
SE-Laby
L = déaba , ob 5
POLO HO
SD—- a.
6 Design & NFA fon a Jonpucwge \
ha wwe da,b.cy™ By Lae eYo- “|
> sedard
es ots betab , abcobb - —
x
pattie
bb ¢
Bo eet oe
a | beg a NFA for eset
hi dwXo, by”: bdonby*
f eo? Tabbaay an 27d bay Y
}
| SS -do.by \
| Led ehaghbach» abbbaboa,-- - -:
To convert NFA to pen
© Cleminate € hanson [rewnd) clea nen
to remow © tombe we how ‘b
clits mine © - clanure. || a Coblmine the @- Chose).
2p3C4n) =X Jos Ho Co bt
| epscad = Yas by
LbY
epsC b) =
| epscc) = cy by
| ;
al Find the & Clarence for the blow NFO
A é Qp a RX
| skp!
I espe) =L bb % O-% 3.44
| eppera = ts 35
les pC 3) = 2434
3 |Convert the NFA do conesprndirg FA
b
gto 26)
a
j espe) adi,2y
[ 2sP(2) = ALY
| espCs? = Lay
esp (ay = Ley
| stars state of NFR Us 1
veo apperlaeti.2 ia, tae gow Sioa, See
Active sate 1.24
Cat, 24,0) = leper) VEPSER) = 9234
UNI2 Yb) =AHYUR GLO
| At thin poird of Gebre Time
achive state 124 542,34, Loy| ~~,
ee - “B
s EC 2,3¥,0) epscs) Vepse 4) ~ day ‘ie
4
dl tas34s 5) agyudey2At
Active statu + do.ay aang ti VAP
MA344,.0) . esplayor ty ° duy
Cl eauyb) © Peps = se
2124.d0} 42534 3 Hy AY
Active stalis -
faay,a) . 464
| f(Xuub) - eps(a)~ AUy
|
'
SCA GY,0) . Aes
f(2ay,b) - ¢
.
— a o > f
p22 & b
ae ° *
CNote:.frnat Sas = Nea final shale evhich o
present in ora)Storing Stare of
ant stot 5 oe
| epscp)= p39 «
epsta) TEPF PF
opsca)e da gph 204d
Acbye Steele
4Py
Sx Pya) = cpscpre ~
epstay ~ 2P4%
SCIPYC) = epslry =a pany
| Ackve statis
(Ph dP. gy od Pe
ebay 0) = epsrBdU epsCaD =ePH LOL API
EC. 0.4 3,2 = CPAQIL EASED Lg ye parerP
ECAP ALC) = CPHDU eRALOY = Lp TY
Ackye _stalss
py, Lah.de- a7
FCG, 14,4) = epslayV eps CQ) Veps(r)
= dp 2p.gy U- 4.43 apa
;
¥
_aPicapany BV SG.
F eae y we, Ce
CPE ste assed
d= erst
- Pay OAdgy 7Mo ~02
Reclion exprsons r
ledges aecgie
expursion
Requtan capussion hove 3 _opaio
- Union operons
= Union of 2 language Lem aenced by
Lum we the set of ings sthak ane ett in
or tian M aria both.
example; YE b= 400% ™ nog
M:-tE; ook
thn LUM =4 00!, St, €> Woy
P- Concokenation operctos
3 Concasenotion of 2 lanqro9e L&M anole
tm bp the set of shi qpimed by aces Tok
and wrtenating fe with stings fa M
example : 14 L- door, , 104
M- dE, 0014
then LM =a
=X 00151
21 1O, OOr@or, 1/001, 11000!
5. Kleene’s Clasum opercctons
3 Kleone’s clasunre of do. L 6 by
L* b the det of shi ngs jormed by
tok
nuumber of shings fom L Cupith 4 at
and concatinating atl of them )example Y Le YD. t ==
thon LY =O. 4 OM, tro, OOM, HOME +
Preenclence of operes2*
jy. Kleene’s clerue CStan operator)
ig. Comedenabion C clot operator)
2. Onion operate C A v operator)
Problems [nate : reqpstan expTenian . patter’
Give pagan expaenien. bo Jonguoge
L=d we Larby* Iw! is evern$,
(a eetoby
L = €, ah. 0 bb, dobas 2-2: ¥
eee ((O-U6) wg, PX Oc mex OM
(Ove (vb)) oe
taper enges | (GAO
Give suqulon expr jor the langue
Pe repre donb * Ne! is Ady 7
> we-do- bh
L- dab, abe pease
odd:
Baad
fav) Cov Heaows”™
; or \
Cavey cavey” (a0 ;
3| Wark
> Eedasby Ledoby
an exprenim to cccert ablan pene “gor |
1-Lwera, by® le atosds a Obby
> seLaby
t- dabb, abba, cublob,
abbab, ahbbo
S| Wok maquina 3p Jeu
Le Lye do by® | vends, or Abe}
= s-doby
L= Laabh, babb, abb--- 4
|Guwy" abe;
C6} Wlonke Tougqelan © oocprension po A
L- A werko. bb” iS has aubshiing obby
> sha, by
L = dL abb, aabb, paboa,2--- y
“(ue ™ exbb (aul wm
coyprenten fav Longurcge
Wouter
Ledwedo,¥* 1h
srzedoly
L-J 00!, Coe}, 10010, Oo L.y
har aubbshing oo'4
jour’ oo! coun,
3/ Le Bo EL ONY 1 cloesnot owe Aubstring 094
= ae |
20) 15 0% 1, OF , 111, Ooo, Diy
fav om oO)q@ L =X Ca, b}™ | w contains edd ino. of ay
iB redoby
da, 6%, ob, baaah, Sabaa y
a) cav™ab")* abe!
2 Lee wm eLonbY" | pecesymed 5 = =o}.
it be
pe
AO
jaco/eaa |
e [Ce lEen ,
i)
voR AON
| oa io eyecay
secutive Zevon}
BD) Lege etoiyt]w en
= ztoty
Led 0,15 01 01014 1018. 10,
©) Ciui0)*
feu l sp
WB) Led wed ly lw eoueins prea erica}
Seto
L+00,1
oro, 11000, coryarb” /ny>4, mesd
La, by
L=2acaaa , aaaab, coaaaabb, AAcaby
Canarb, aed.
fed aaa): a (ov 00% you bv Gh
1 a fora ‘f
| aaa a (ev Spoppveeh))
1S Le Lare™ | pug m+23
| > Ledo.by
Led bb, Qaaabbh, aaabbb»----4
| \ fe va Vaavaaavaaca) bb pe
1 L=Le?™/ nr, msoy
= F-da, by
L=2€, bb. acoaabblob, _ - $ Freven ao.o,
Os gb)
{ Gor cbb* * |
IF. OF b™ [aman is even 4. 5.) Ol ee0 =e
52 La. by oes eal + even!
ed arb, aaagblbbb ,aabbbb » «bbb,
aaah, AQa,b bbbb, ay
‘(Qa i no” bookie
iC i aco” VU ~Ala.03" bebo) \
both oe even beth orn oddl ’
Seven
= evenZonverbon prom
||
GHeps =
4. Remove unreachable stots Coued slate pro’
Curto mecta) ™
att fo cutomela these is ciccepting Stobe
eaprevion & b Pong °
z-4f sieating volt of Curbomato. has ony Facomin,
gansition mn create MLD stanting st
E bansition ing Stace
&- Creat new accepting Stode wthen
D more thom one cxcce pting Sots 8 prone g
ee transition bo ft
ii) thee YW © of tamiten Por accep Ring
State os Noe € amnsition
FD AP certtommacto has 2 stede Such thot
€ wz accepted Me Ley hem eoibtern & Ww
OIC
m=
anal ery’
“4 Stant & the
iyunsit an utornata, has only the S
excepting _ select domme state ¢ from §&
nomove ¥ it OY making Auiteble mo i
tn ite pronsition8 om {inal
regulon eaprenion
30-20
woritten the| iti) 0 =a
MQ stertes
3@ 20-4.@ £6
me movt state 3
bo )
somone
ee
yemmovingy 4
Oe 6
Demovng p
> @ Leetew56)
Fina) sequton eapwsion bese (iouey)*
w
bamiten
|
aoe
>& € OLA G) Geo Storstng
WN Jo
Ch
| c a
Os
|? @“gamnen ©
ste)
2
Dyna
Do
Dumove 3
abuaaetb
Que
*Que
Gy Cabra “Q0 +)
{
FRE = (QbUaqorb}F(Aave)Oy =®
i ™ b 7
De a
Bocq reads new storing Stal
ee
bac
> Oto?
abUaactb
-@+gzR aa ©
bUdac*y
Gp —_Cbunaates"lave +@
Ere = (abUaaarh)*(q ve)