TCS QB
TCS QB
Module 1,2and 3
Less number of states are required. More number of states are required.
There is more hardware requirement There is less hardware requirement
for circuit implementation. for circuit implementation.
They react faster to inputs. They react slower to inputs(One
clock cycle later).
Asynchronous output generation. Synchronous output and state
generation.
In DFA, just a single state transition may be The user does not require to provide any
achieved for each symbolic representation information about how various symbols
of the alphabet. influence the NFA.
In DFA, the next potential state is explicitly Every pair of input symbols and states in NFA
defined. might contain many possible states.
NFAs are the source of allI DFAs. All NFAs are not DFAs.
There is a need for more space allocation There is less need for space requirement.
In DFA, the total time it takes to run any In comparison to DFA, the total time required
input string is less than it is in NFA. to run any input string in NFA is longer.
It doesnt know how to handle an empty It is capable of handling empty string
string transition. transitions.
Dead state may be required. Dead state is not required.
Regular
Type - 3 Grammar
Type- 2 Grammar
Type-2 grammars generate context-free languages.
The productions must be in the form A’y
where AEN (Non terminal)
and y e(TUN)* (String of terminals and non-terminals).
These languages generated by these grammars are be recognized by a
non-deterministic pushdown automaton.
Example
S’Xa
X’a
X’ aX
X’ abc
X’[
Explore our latest online courses and learn new skills at your own pace. Enroll
and become a certified expert to boost your career.
Type - 1 Grammar
Type-1 grammars generate context-sensitive languages. The productions must be
in the form
a Aß’ ayß
where A eEN (Non-terminal)
and a, B, y ¬ (T U N)* (Strings of terminals and non-terminals)
Example
AB ’ AbBc
A’ bcA
B’b
Type -0 Grammar
Type-0 grammars generate recursively enumerable languages. The productions
have no restrictions. They are any phase structure grammar including all formal
grammars.
Example
S’ ACaB
Bc ’ acB
CB’ DB
aD--Db
ZaDaous a DEA foz the falousing
lanquage auezlb.
1) All strings oP_lengthat mostTve
2)A) Stxings oith eactlly tOD 1s.
iDhese ae he valhd stxingsi
Stzing
sting'a
af length 0- accept thcouh
length aoept thaaugh
2a.
0,)
tahle
Cb)state tsansitian
GHhauct a failueState
"A 2)
diagaaaL
Second
te40 State
ia)
Pirsttronsitian
Ce)Gtate A
1in Opp.
C
Gajanan
1take Stxinqswith BHARAT
Approved by
Maharaj
1 INNOVATIVE
takes Tempal,
the s AlCTE,
the COLLEGE Kanhor,
ENGINEERS'
DTE,Govt.of
Badlapur
the
machine DTE
Maharashtra
Institute (W) AND
a
is
c
b Hau to Conet an ezaraple
*Example
AA to DÊA
Caovezt the given dA
state
H1 o
46(9o], ) =Ao
25(C90]. )=21
The ötransitian tax Stote q1isobtained al:
15Cl,o) =L,2Cneu Staie qeneaate
2.5'(2), )=L1.
he 5'tansitiao fox state q2 is obtined si
TEACHARS'EDUCATION SOCIETY'S
INNOVATIVE ENGINEERS' AND
ENGINEERING
OF Ambarnath,
6E OF E
BHARAT COLLEGE
Badlapur (W) 421504, Tal.
Dist. Thane. Ph.: 7666615915
Kanhor, and Aflited to University of Mumbai
Opp. Gajanan Maharaj Tempal,
AlCTE, DTE,Gov.of Maharashtra
Approved by DTE Institute Code:3351
State
’ 0 0
ThetanSitian diagnm
4Recuraive
Recognini2able
enumerable
by 1aing
languagesType
moe bines
o)i
Peample - The languaye oP all sting
that aTe a Valid Canmpu tatiaA
histaag O a Tuxing machine
BADLAPUR I
"TÊ bp
eotethe and
wiL A11 Opp.
NEA TE DesignaNAtor
n-detemini Gajanan
entexthe the fhe State lost BHARAT
ApprovedMaharaj
fll INNOVATIVE
Gtarting by
Tempal,
end Startn4 digits AlCTE,
finalendtn, Kanhor,
ENGINEERS'
to COLLEGE
tantiHoo DTE,Govt.of
stically in Badlapur
Code:3351
Institute
DTE
fina
thetafte+ state are Maharashtra (W) AND
ands 421
hy
ond TEACHARS'
in by Som bina 504, OF
and Tal.
State ending
makinq u making
ending dio Ambarnath,
AffilitedEDUCATION
ENGINEERING
a grom
and numbez UniversitytoDist.
Thane.SOCIETY'S
ds diqits a of
an a
digits Mumbai Ph.:
mave 7666615915
last wilmave whexe
are Hoqzton axe
the
1waittoqa 0theo
it the fixs
of OandJ (s
lo
Senuence
oumber
even,add
odd
76F615915
ENGINEERING t be string
by be in
the
Ph..
SOCIETYS
Murnbai
of Seen 1sseenCald
seea'Could
Thane. qiven Eeen
ofUniversity
whichaccepts tack of
Dist.
EDUCATION aleady W
1s language statt,nothia
Arnbarnath,
to
Afilited diagram 16is
OF
TEACHARS Code:3351
Tal,and
Insttute
DTE Reep numberofs
D¾A Laith
COLLEGE
504,Maharashtra o2th
thotCading
AND
421
(W)
Stxing
oustStxing of
equised State
ansitian uence
Badiapur
ENGINEERSDTE,Govt.of c Ending1o.
with
a)ndiag
Kanhor, DAany number Fo Seq
BHARATAICTE,
INNOVATIVE
Ternpal, DEA oState
the DEA oislatin
by and b)
Approved
Maharaj o he b)Desigo Seen
Gajanan Destlgo
1% ne in tate
1'5The The
Opp.
Of
5a
ADLAPUR
"he
QEndingottostarting
h 1.223
symbalis
Pxecedin 1 22inal Opp.
Gajanan
ransitianciagzm
DEA State final State BHARAT
Approved
Maharaj
INNOVATIVE
twil) by
Tempal,
AICTE,
stete txansitisn State COLLEGE Kanhor,
ENGINEERS
3fate, DTE,Govt.of
be Badilapur
Seauence Code:3351
InstituteDTE
in of Maharashtra (W) AND
tox 421
TEACHARS'
state nathing dag 504,
5tings OF
St and Tal.
Ambarnath,
AffilitedEDUCATION
ao ENGINEERING
xingsen
Q at to
Uiversity Dist.
ending SOCIETYS
Sequence Thane.
oheneve of
Mumbai Ph.:
ding 7666615915
wth
Lwtth
the uith
sseen
lo
3.6.4 Application of Pumping Lemma
Pumping lemma should be used to prove that given set is not regular.
Pumping lemma should be applied to a problem in steps as given below.
.
Step 1: To prove that L is not regular, we proceed with assumption that L is regular and it is
accepted by a FA with n states.
Step 2 : Now, we choose a string 0¬ L such that I o l>n.
which o to select is very important and it is the key to solution using
pumping lemma.
Step 3 : o is written as xyz,
With Ixyl s n
and lyl > 0
Now we must find an i such that xy'z e L. This will contradict the assumption that L
is regular and hence we can conclude that L is not regular.
-whichitoselect such that xy'z g L is very important.
Example 3.6.1: Show that the languar