0% found this document useful (0 votes)
29 views20 pages

TOC Notes 1

nmnmm

Uploaded by

sksingh77800
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)
29 views20 pages

TOC Notes 1

nmnmm

Uploaded by

sksingh77800
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/ 20

heou ot Computa tion CToc)

Unit 1

Symbl 14 is a chanae en
I+ is
Alphabet (E)- I4 is a finite, nen -empy set of symbal.
denoted z . Ex Z : 2o,b
Alphabe ts, 14 is hinite set sequence
Stning Collechon o a

ot symbols choosen taow s ome alphabets


with
Empty Stning The cmpty strin ishe stning
ccwTance CNo Sqmbols). I4 is densted b E,X
E
Length Staing 4 is the no.
of symboln he stning.
Cancatna fion o StTing Join tuw o on mone Stainq
of an Atphobet JF 2 is an alpha bet we can cpness
Powen
sct of all stzin gs of centain length Fnom that alpha bet
yusing the expo nenthal notation
1+ is denoted b i s he set o

sting
or
leng th k.

fo,l} A2' - 2)
is and k is l
Sc 2 no. of alphabe ts 2

k 2
oo, o,lo, 1
o 3 (23: 9) k 3
oooo
, o o , ool, olo, loo o , Tol, o1, u

KleanCloswe

Set of Stzung oven an alphabet Z is usual denoted by £".


Ex fo,
Efo,3, t oij, o, if.-- .

fo,i3
*=£'ug' ug ugs.....
Automatoa
Posikive ClosuneThe set o sting ove an alphabet
without 6 (Emp Set) is usually denoted by tallouss us Systemaically about whatmac hine do
to think
ext w hou 9oing into haidwone detailsIn e an odsey
anea a
machine mathemotico
fo, CS that deals with the sudy oabsBaaet
thotcon be Solved
well as computahano) problem
model) as

uSin Auto mata


#Considen tae langaage 5, whene S:{,b ho moy Thene ane di tfexent pe ot aut mata.
stzing does his languoq have engh 23,n
(L BA)
Automata cCA) 3. L i n e a Gound Autam ota
1. Finite
S ob 2. Push down Automata (PDA) 4 Twing Machine (TH)
Fon en th2 Lencenne
Consetened with mules and meaninq nathe
Fonma Language
S
= iaa, a,b, b.a, bb with ules /Syn tor
utin automa ta ít is onl con ceined
For length =3 and nat with h e meaning

faaa,a ab,abb, bbb, bba, bab, aba, baal


Simi l0ly leng tn = n
Gnommen

Lanquaqe Gnmamme is a stondosid wa o nepuesenting


a
l angu9e
I+ is deneted by G
1 is a
non-empy set of S
ings hene ane two tpes o G{v, T,P, s}
lonuagt v= Vai able Denoted wih capital Leter)
T Tenminal (Denoted with mean
1 ou want to tomi nate
1. inite 2. In inite the stnig we use terminal)

Ex Llengtno sting2i Er L,: f o, b} P Poduction Means the ules at which language is geneated)
aa,ab, ba, bb} If uoo useuJe S Stant Sumbol
use atleast one a

a, ab,abb, abab, abbba.


Peduch states
OCA Can
contoin muliple ina
Ex s a Sb /E S
t Sunbe oCA
vaaiable
Tonina!
Setof Anite sta
agb, aa g bb, aaa Sbbb Set oAphabet fa,b}
T7onsrtHon
ab, a b , o3, b S t a t Sate
ob, Set of t e ins stte

numbe o Possible
Z {a,b} Anite automation is call ed nite because
o letes in he alphabet ne both
stes and nun ben
S a Sb aubmaton becouse ot cha nge ot stote is totaly
frduckon inte an

kles Sin ee what


avcn by the input.1+ is deterministic
S o Sa
note l l ull,
state is next is automatic

Dedesministic Enie Au tomato (OFA) Q aesnnenpnliniteset


Ex 5 Ca) 1
OFA efers to ekoninistic hknik. Autamab. Deienminisit
relos b t e uniquenes o tre cmpuh ion Panocessing o stin by DE A
Tne n autmata is calle DFA i e machine s
ead an input strig one smbs at a ime Suppose a ,as, - -

-,a is a
sequence ot
sambo
qois the
92,. n is a state hene
In 0RA is on y one path n speesie nput fnon e iniHal sote .
wrent stat the nert shte DfA does no+ apee
accept he null mode hot is tre oFA can ngt change e
statt witmaut am input ch anoutah. S ) - q1

SCqnn) - n
To1onsifian Gana ph CTenealiz2ed Tonsikon Gno ph_(GT
A nonsi to ioph is Collection o 3
n a
things. A GTG is acollec hion 3 *irgs
. A Anite set o stotes, atfeost one uith is designotd . inite set states
at the s n t state. And some f uith desiana ted os 2 An alphabet siqma oinput letosdinected-ard tra
nal stote sae each lale I with
3 D e c fed age connecing some paisn o
TRis This is ho we denote rat Stn* C l a erp1ession.
Ainsl sto te

An
2. Afphabet of possible input let s
3. A inite seto tonsitian that knous hous to go fmom
some sta te to o
the, boses on 1e oding specikcd sub V
sinms ot inpE leten

64a) 5 (q,,b)
Ex TG - e, baa and abba

6 (4, 1) 9, s (9,b
e

abb

The angoge Cxepted bq the 1ansitian graph s all warr


ending h in b o v e alphabet Tansiti on Gmaph
Consiouet a s+ed ofA staning with a

a()

Trap Sta tk Dead shk Non-Deteminishc Finite Automenta (NOFA

MCQ, z , f , S) Refe o OfA

. Constawet DfA which erpt language of all


a
string
conaininA In NCA we have cho ose of
2(a,b) : a,ao, ab, oba, ba, bab 3
state f data tnansmithm
That is n t poss ible in OCA

(15
Doss ble skokes ane

# OCferunce blw ofA $ NFA.


Orsign a 0FA which except s e f sBing containirg exe4 OFA NCA
Vown ' ' in evemy sting fon alphobet g {o,1}.
. Oead con bgunahon not allowedL. Oead con hgurohon is allouwd.
2. Mulhple choose ane nof allowed | 2. Mulhple chooses ane allowd
Comepondirg * he Input.

3 Nult) move
is not ollowed e (nutl)move is llaved
4. Ocsigqr& Urdos tanding is 4 Oesign Undershnding is
G:ilt oS
Stak
Non- Oetemanistic meons a chooge ot mave oa on automotion
1athen than prisoibing o unique move in each situation

we allow a set ot_ poss,ble moves NEA


to|1.l,
Foanaly we acheve tais by deinig theta nsition unchuy
So
that its 7ange is a set of possibe 'states.
Constuct a NEA of all binau Sting in ushich 2d DfA
last bit is L.
)
O,1

(C.u

There Ane kuo s i n i e Automedan.


tes

171a ns fomation NEA t 0A 1. Linite Autama ta wittout Oulput


2 inik Automa ta with Ou put
Ex Mo07e Machine
( Mealy tothine

Siales
Tansihon Guraph of Moose Machine/Tonsikan Table
Ne,Stae
Mo021 Machine Cunent Shte Oulput
In Gnik autmato outpuB is 9sso cotd wtn each
Stote, In mooe ma chine evey stale ot his nik b
2
machine
Sia Capital Detfa
M (Q, z, 4 ,5, A, 9)
Q. I input strivgq is ootlo oulput stak -?
A non-cmpky Rni t Set of stale in Moone Machi
A
non-empty hinik setof input Symbs. Design a Mooie machine o t ansmiHan tabe
A noh-emp Anite setol Output
& I is tzransitin unchion which takes Next Stake
tw Apument as in Gnite outometa Cunnent State Output
one is iput stale d anothen input sqmbol.
I isa Output unchn. 3
1. Iniial Stat

Graph Mo0e Machine


Sh

(ola
(1./a 1

O
Mealy Hoa chine
"
i Gns the Output of a Stning lolloo by qiven msore saked
machineThe Gz1aph behaid. I4 is ini te autmeta in which output i asso

mathine evey aansiHan


with each tnansition I n mealy
S1 o a pahcnla input sqmbol has a
i xed adtput
aaabecC is te oulput siairy o the given
ph NeC E , 4. s, A,9.)
Hachine
Ganoph of nealy
Design a mooTe machine that produce l complement
afo
o
aw binay input stnim alt
nput
Smbo
Smba

inauA I's Complement


(v Input Stin abba

bo ol o o

T1ansikion Table o Mealy Machine

S
Present Next State
(1o/ State
nput:b
State Oulput stafe Oulpu

T+ is on the basis o oave iven tlaph ol


me aly machinhe
. sgr Hesly ockine br given ansitian t e Desian mealya moine that prdeee omécapeat (1)
biraynpt stig
Compkment
64te
St

d e upt of s t i ail.

b
oll

Diference blw Hoone And Healy Hachine


olo
Mealy a chine Moaze Rachine

Duput dyanis on pnesent L.Oiput amly depends or p s

sk
afc 2. 1 a m inp+stig n

/ len ouput si
A
uyut stming
3. A a

) Aimd he uput sin allath


*

by meal ochie.
acbcbb
Hou fo Convent mooTe machine to meay nochine Tonsiton Toble

Onou a moohe machine. Next S tate

Pne sent State


State | ofp Stak olP

Moone machuhe

Hous o convent mealyto nmoGie machine2


THonsihion Toble Make the obove machines"t>1onsihon
sto
Next Stake
Nert Stae
Cwwent s fak oulput
Cuven+
Stat
Stak P state op

Lto
Nou, dnou Gnph o mealy wih above moone able.
mm above
Now, doraw moone gaph nmealy table.
)ot
IL olo
a the 1monsitian
L table n hii mo ahe
machine.

l machine
Next State 3. o cach Sumbol a,a is a equlan oepnessiam denaottng
Cuent stte set a3.
Output

4 Unian o 1egulan exphcssim 1s dso equlan


R1 URL :
equlan
a Ub a,b
Onit 2
Regulan Expression
5. Coneat ion o tuo zeqsulan cepaess îans is olso negula
I4 is methad to
7epneS ent language It nepnesnts a 6. kleena clesune ot egutan expnessian is
alsoealan
a
eul longuoge, eulan eessin lauogc is lanaa
who wene
aepted by tmeAnik Au faaa Regulan Erpiession fo Anite Autownota

L ¬,0,aa,a aa ,aaa. No Sinig í } =) RE) =4

Let R b a a lon expnessin ovoalphabet z R s lergn L fa,b3 => Re)s atb


i (engt 2 q9,ab, ba, bb j = Caa+abt ba +bb)
is a 7ul erpession denotinq set t6}. a tatb+bfa+6)
a +b) a +b)
R: elcollechan vlength 3 i aaataabt aba t i 2 Ca+b) (atb)Catb)
ot
Nu strings)
v) Atmust L a ,b6 a,65 => te +ab)
CR) fe.
Q. wik a
equla erpessim numbe o b should be net
2 is 1egalan cx esi on denohy mo?e han ab's la .e.ab,ab ,bab, abb,bb, bbo3
a
the erph set {.
Convet Regulo Erpmession

E+a +b+ ab +bab+Qbh + bb+bba


Consleuclian dRequlan Expession Faiom DEA Sol A 6
Aa+ Ba+ Bb
I. Arnden's Theoum Let P and Q one tuo 1egulon
erpessians ave E and i P does nat can toin nul Ea Batb)
Sfnings E, then a t Ba+b)

R + RP Nous Compoinin if R + RP and P OP


fnom this a t f : (a tb)
has a Unique Solu ion QP a (a +b)" Aus

R O+ RP . Constuuet a
negutan Expnession Cove
sponding to sfak
R Qt(0+ RP) P
R Q+ QP+RP
R
R:
a P + (Q+ RP) P
oPt QP 23
( Dianm
tP)

R- p] ab
Find the 7egulon epe ssian on tnonsition
Groph diagyam. S R- + RY , R: QP

a
)
6 ab +ba)
. Constsuuet a Regaulantxpress ion courespnding
(ab+ba) Stat
Cab

E(ab t a)
(ab+ba) *

Q. Consteuet a Regulan Expression cariesponding to stak

Sal

Sol 3
A E +As+C
B A +60
BI+Co

+,o0
+ 9 , LC+°) oo
+ e
R P¥
+ t (Itod Koo
C 61 o
C t ( o + 1(t+ o1)fao)
A E +Ao+ C
+ AotLo"16|
A = G A(o +lo¥1o*1)
*
e (o+ to 1of 1)

A Co+ 1okro%()
h e (o
PupinLex fheoXum . Using umpinq Lemna pmwe that nguage
A a n b n o is not negulon.
Il L is an Inhnik language thn hene enst Some
pos1hve Supoose n: 7
A anb"
intaer 'n ' (pumping leng h ) s u c h hat any stnin
wEL has Sal

cngth 1eatc han equal to ie "lw)2 n


'n' than a can aa aaaa bbbbbbb
be divided into doree equa pants, wrnyz
2 aaqa aa b b b b b b
1. Fon each io u 6 L a

2. Ylo
a aaaaaabbbbbbb
3. W:|
3. y!sx
bbbbb
=) aaaaaaqbbagbb
Q. Usinq Pumpinq Lemma Teorum _pmare that the langstage a aaaa laa bb)bbbbb
¬ L
A-aban |no} is not Reguloh 7 C>o , y 2

AA a"b" S u po n-2 Clos wne Propenhes o Reguln Language


and a
languoge ' i s fommed
aabbbb 1Centoin language is nepulan
is olso iegulan
'

then 'n
then by cUitan opT0tians,

. The Union otuo ie gulan (anguage is nequlan.


uyz EL
a a(bb)bb e L 2. The o
Intasection megulan language is negulan.
two

aa bbbbbb L 3. The complemtnt d a


nequlan laquageè iS negulan
4. The difennce o tuux iegula la ngudge is megulon.
The eversal o o ncgula langua is nequl an
Thad means is Nat Requlan S.
The c losuwne ot a egul lanquage is nequlan,
6
The ConCatena tim a *qulan arnguage is equlan.
ot

Homommphism subsitution d sinigs Suwbo f r*ua a

ag s elan. 67
The se homo ma-phiam Substitui on o sinings Smbsls
oa 7egulm language is 1e gula
Convesim Keguln Expression thnite Autamota Onit-3

2
Contert free Gz1amme Longusge
3. but stt o ules to de He vodid
AgmmmU is nothig
4 a+b
Sentence in any lang uag
Thene ane 4 impontant Componnts m a
aammaticol disptian
a* of alanguoe
6 ab . mene is a inite set d Symbsls a t omm he stnings
fthe lanquage beinq dehned we call this alp habet tninal
theangua b
a b
a,b amb_epPe aen ted
Thee is a ini te set oaioble also colld Someimcs
Cab)* non - teminals cach vomoble iepdresen ts a language Aat is a

sct sting iepnesended b Yn.


atb 3. One heariable 7epmesents the language being deind,
b
il s called the stnt densked
smlgereraly
S.
by
4. Thee is o nite st oe
ules apdue hon that
Lo. a bt epne sents the necursive deinahan a
language Each
ot
poducim ConcepT
a A vaable hat is being dentd by the poduetion
The vaiable is
caled the head opduchm.
e pnsduc hom Smbo(G)
c) A stning of mone eanminals veniables
ze0

this staing called he body o t e groduchion nep 71esnt ,

onc wa to k m s t n i s i n he o the viable


languaae
the he.
A Context fnee Gimammev
Said to be Con ext Free".
g1amme G (Vn, Ve P.S) s

Whene,
A Anie set non-tomira Repesen ted by Capi
leHo.
A Ginite set ot omira epresen ted by smal lefo
S Stning Smbo
P Set neGu lan g pp oduchian.

thotgenootes equal nG. of a's b's in he


Langua9e
Longuoge
n
onmb anb Pis Pis SaAb
S A a Ab /E (G CV,7,P, S) )
Gnal State
i) excha nge the posi hon of Lrput Initial state and
and
re vese the irenskan ot oll Input

Deiva tiun a Deviahion (Panse) Tee


o
Qobtain
Deivahon is basically the sequonee of tsteps For us
genena e
an
etekonequialent left linca qnammen on he
Fnom
Fotlowing Riht linean Gtromen.

6 bA
AaA/b8/b
6 bA
i Onauw taonsi tion
diagn am
Left Mast Desivation D e i v e the Stnig "abb" Fsn left most derivatian anrd
In let
most deai va tim the input is scanned and ight as derivatian Using CF 6
aiven b
epla ced win te phoductim ule f an lest to ight,So
we have to 1ead input sfneam Hrom let to ight. S A6/ E
A aB
Ex Pn oduchan Rule

E = a lb
Sol CLet Most Denivaiam)
a 8B A a
Tnput sining a
(S6) 8 6 Sb)
a-b+a ab B
abB
E-E ab Sb E)

a-btE abb
a-b +a
Right Most Denivaion)
Right Most Oenivation A (Sb)
C6Sb)
Ab
In ight most denivation the input is sonned and
,

eploced ith the producfhn ule nom zight to left So we CAa 8)


have to veas t e input Steam ror 11ght to lekt
a CSb) b Sb)

Ex
labb 6-¬)

E 6+ a

L +a
Deive the sB>Ting "oolat fo LMO and RMD
CFG 4ven using the
Denive stmigs aabbabba
" "
fon LhD ard Rmo
Using CF G 9ven belous

5 A18
A oA1E S a B lbA
A al asl bA A
oB[ 1B/ B blbs| aBB
So S A 1B CLet Mo st Deivation) E Design DFA cwhich contoin exact [ NEA To DEA]
OAIB
o0A1B3
A oA)
CA E)
C3-0)
oolo B a,ab, bab, bbo
oolol8 6
oolol E
(
oolot
S A 18 Right Most Oeniva hon)
Alo8 a,b
AlO 16
( 163 Houw fo convt NEA ts DFA
Alol G
( E)
Ato
CAA)
aAlO (A0A)
oGAO
A6) Sol State
State

You might also like