Automata Theory Quesons and Answers – Finite Automata This set of Automata Theory Mulple Choice Quesons & Answers (MCQs) focuses on “e!ular "an!ua!e & #$pression% ' There are tuples in nite state machine a) * +) , c) d) unlimited .iew Answer Answer/+ #$planaon/ states0input states0input sym+ols0inial state0accepn! state and transion funcon 1 Transion funcon maps a) 2 3 Q 45 2 +) Q 3 Q 45 2 c) 2 3 2 45 Q d) Q 3 2 45 Q .iew Answer Answer/d #$planaon/ 6nputs are state and input strin! output is states 7 8um+er of states re9uire to accept strin! ends with ': a) 7 +) 1 c) ' d) can;t +e represented .iew Answer Answer/a #$planaon/ This is minimal nite automata * #$tended transion funcon is a) Q 3 23 45 Q +) Q 3 2 45 Q c) Q3 3 23 45 2 d) Q 3 2 45 2 .iew Answer Answer/a #$planaon/ This ta
, =3(90ya) is e9ui>alent to a) =((90y)0a) +) =(=3(90y)0a) c) =(90ya) d) independent from = notaon .iew Answer Answer/+ #$planaon/ First it parse y strin! a?er that it parse a - @trin! is accepted +y nite automata if a) =3(90$) # A +) =(90$) # A c) =3(Q:0$) # A d) =(Q:0$) # A .iew Answer Answer/c #$planaon/ 6f automata starts with starn! state state and a?er nite mo>es if reaches to nal step then it called accepted B "an!ua!es of a automata is a) 6f it is accepted +y automata +) 6f it halts c) 6f automata touch nal state in its life me d) All lan!ua!e are lan!ua!e of automata .iew Answer Answer/a #$planaon/ 6f a strin! accepted +y automata it is called lan!ua!e of automata "an!ua!e of nite automata is a) Type : +) Type ' c) Type 1 d) Type 7 .iew Answer Answer/d #$planaon/ Accordin! to Choms
, =3(90ya) is e9ui>alent to a) =((90y)0a) +) =(=3(90y)0a) c) =(90ya) d) independent from = notaon .iew Answer Answer/+ #$planaon/ First it parse y strin! a?er that it parse a - @trin! is accepted +y nite automata if a) =3(90$) # A +) =(90$) # A c) =3(Q:0$) # A d) =(Q:0$) # A .iew Answer Answer/c #$planaon/ 6f automata starts with starn! state state and a?er nite mo>es if reaches to nal step then it called accepted B "an!ua!es of a automata is a) 6f it is accepted +y automata +) 6f it halts c) 6f automata touch nal state in its life me d) All lan!ua!e are lan!ua!e of automata .iew Answer Answer/a #$planaon/ 6f a strin! accepted +y automata it is called lan!ua!e of automata "an!ua!e of nite automata is a) Type : +) Type ' c) Type 1 d) Type 7 .iew Answer Answer/d #$planaon/ Accordin! to Choms
c) 1 d) 8one of the menoned .iew Answer Answer/+ #$planaon/ Finite automata doesn;t re9uire any stac< operaon ': 8um+er of nal state re9uire to accept E in minimal nite automata a) ' +) 1 c) 7 d) 8one of the menoned .iew Answer Answer/d #$planaon/ 8o nal state re9uires '' e!ular e$pression for all strin!s starts with a+ and e nds with ++a is a) a+a3+3++a +) a+(a+)3++a c) a+(a+)3++a d) All of the menoned .iew Answer Answer/c #$planaon/ @tarts with a+ then any num+er of a or + and ends with ++a '1 Gow many HFA;s e$its with two states o>er input alpha+et I:0'J K a) '+) 1c) 71 d) -* .iew Answer Answer/d #$planaon/ 8um+er of HFA;s L 1n 3 n(13n) '7 The +asic limitaon of nite automata is that a) 6t can;t remem+er ar+itrary lar!e amount of informaon +) 6t somemes reco!niNe !rammar that are not re!ular c) 6t somemes fails to reco!niNe re!ular !rammar !rammar d) All of the menoned .iew Answer
Answer/a #$planaon/Oecause there is no memory associated with automata '* 8um+er of states re9uire to simulate a computer with memory capa+le of storin! P7; words each of len!th P; a) 7 3 1 +) 1(73) c) 1(7) d) 8one of the menoned .iew Answer Answer/+ #$planaon/ 1(m3n) states re9uires ', F@M with output capa+ility can +e used to add two !i>en inte!er in +inary representaon This is a) True +) False c) May +e true d) 8one of the menoned .iew Answer Answer/a #$planaon/ se them as a Rip Rop output
Automata Theory Questions and Answers Answers – The Language of DFA DFA This set of Automata Theory Multiple Choice Questions & Answers (MCQs focuses on !The Language of DF DFA" A" #$ %ow many languages are oer the alpha'et ) a counta'ly infinite ' counta'ly finite c uncounta'le finite d uncounta'le infinite *iew Answer Answer+ d ,-planation+ A language oer an alpha'et alpha' et is a set of strings oer A which is uncounta'le and infinite$ .$ According to the /0tuple representation i$e$ FA1 2Q3 43 53 63 F7 8tatement #+ 6 9 Q:; 8tatement .+ F9Q a 8tatement # is true3 8tatement . is false ' 8tatement # is false3 8tatement . is true
c 8tatement # is false3 8tatement . may 'e true d 8tatement # may 'e true3 8tatement . is false *iew Answer Answer+ ' ,-planation+ Q is the Finite set of states3 whose elements i$e$ the states constitute the finite automata$ <$ 5= tells us the 'est+ a how the DFA 8 'ehaes on a word u ' the state is the dumping state c the final state has 'een reached d >leene operation is performed on the set *iew Answer Answer+ a ,-planation+ 5 or the Transition function descri'es the 'est3 how a DFA 'ehaes on a string where to transit ne-t3 which direction to ta?e$ @$ hich of the following option is correct) A1 22a'c3 aa'a7$ 2B3 a3 ''77 a a'c'' A ' BA c B may not 'elong to A d a'ca A *iew Answer Answer+ ' ,-planation+ As the 6uestion has dot operation3 B will not 'e a part of the concatenated set$ %ad it 'een a union operation3 B would 'e a part of the operated set$ /$ For a DFA accepting accepting 'inary num'ers whose decimal e6uialent is diisi'le 'y @3 what are all the possi'le remainders) a ' 3. c 3.3@ d 3#3.3< *iew Answer Answer+ d ,-planation+ All the decimal num'ers on diision would lead to only @ remainders i$e$ 3#3.3< (Eroperty of Decimal diision$
$ hich of the following - is accepted 'y the gien DFA (- is a 'inary string 41 23#7)
a diisi'le 'y < ' diisi'le 'y . c diisi'le 'y . and < d diisi'le 'y < and . *iew Answer Answer+ d ,-planation+ The gien DFA accepts all the 'inary strings such that they are diisi'le 'y < and .$Thus3 it can 'e said that it also accepts all the strings which is diisi'le 'y $ G$ Hien+ L#1 2-9 4IJ- contains een no:s of :s7 L.1 2-9 4IJ- contains odd no:s of #:s7 Ko of final states in Language L# L.) a # ' . c < d @ *iew Answer
Answer+ c ,-planation+
$ The ma-imum num'er of transition which can 'e performed oer a state in a DFA) 41 2a3 '3 c7 a # ' . c < d @ *iew Answer Answer+ c ,-planation+ The ma-imum num'er of transitions which a DFA allows for a language is the num'er of elements the transitions constitute$ N$ The ma-imum sum of in degree and out degree oer a state in a DFA can 'e determined as+ 41 2a3 '3 c3 d7 a @O@ ' @O# c @O d depends on the Language *iew Answer Answer+ d ,-planation+ The out degree for a DFA P fi-ed while the in degree depends on the num'er of states in the DFA and that cannot 'e determined without the dependence oer the Language$ #$ The sum of minimum and ma-imum num'er of final states for a DFA n states is e6ual to+ a nO# ' n
c n0# d nO. *iew Answer Answer+ a ,-planation+ The ma-imum num'er of final states for a DFA can 'e total num'er of states itself and minimum would always 'e #3 as no DFA e-its without a final state$ Therefore3 the solution is nO#
Automata Theory Questions and Answers – Kon Deterministic Finite Automata0Pntroduction This set of Automata Theory Multiple Choice Questions & Answers (MCQs focuses on !Kon Deterministic Finite Automata0Pntroduction" #$ hich of the following options is correct) 8tatement #+ Pnitial 8tate of KFA is Pnitial 8tate of DFA$ 8tatement .+ The final state of DFA will 'e eery com'ination of final state of KFA$ a 8tatement # is true and 8tatement . is true ' 8tatement # is true and 8tatement . is false c 8tatement # can 'e true and 8tatement . is true d 8tatement # is false and 8tatement . is also false *iew Answer Answer+ a ,-planation+ 8tatement # and . always true for a gien Language$ .$ Hien Language+ L1 2a' a'a7I Pf is the minimum num'er of states for a DFA and R is the num'er of states to construct the KFA3 J0RJ1) a . ' < c @ d # *iew Answer Answer+ a ,-planation+ Construct the DFA and KFA indiidually3 and the attain the difference of states$ <$ An automaton that presents output 'ased on preious state or current input+ a Acceptor ' Classifier c Transducer d Kone of the mentioned$ *iew Answer
Answer+ c ,-planation+ A transducer is an automaton that produces an output on the 'asis of what input has 'een gien currently or preious state$ @$ Pf KFA of states e-cluding the initial state is conerted into DFA3 ma-imum possi'le num'er of states for the DFA is ) a @ ' <. c #. d #.G *iew Answer Answer+ c ,-planation+ The ma-imum num'er of sets for DFA conerted from KFA would 'e not greater than .n$ /$ KFA3 in its name has :non0deterministic: 'ecause of + a The result is undetermined ' The choice of path is non0deterministic c The state to 'e transited ne-t is non0deterministic d All of the mentioned *iew Answer Answer+ ' ,-planation+ Kon deterministic or deterministic depends upon the definite path defined for the transition from one state to another or undefined(multiple paths$ $ hich of the following is correct proposition) 8tatement #+ Kon determinism is a generaliSation of Determinism$ 8tatement .+ ,ery DFA is automatically an KFA a 8tatement # is correct 'ecause 8tatement . is correct ' 8tatement . is correct 'ecause 8tatement . is correct c 8tatement . is false and 8tatement # is false d 8tatement # is false 'ecause 8tatement . is false *iew Answer Answer+ ' ,-planation+ DFA is a specific case of KFA$ G$ Hien Language L1 2-9 2a3 '7IJ- contains a'a as its su'string7 Find the difference of transitions made in constructing a DFA and an e6uialent KFA) a . ' < c @ d Cannot 'e determined$ *iew Answer
Answer+ a ,-planation+ The indiidual Transition graphs can 'e made and the difference of transitions can 'e determined$ $ The construction time for DFA from an e6uialent KFA (m num'er of nodeis+ a (m. ' (.m c (m d (log m *iew Answer Answer+ ' ,-planation+ From the coded KFA0DFA conersion$ N$ Pf n is the length of Pnput string and m is the num'er of nodes3 the running time of DFA is that of KFA$Find -) a #Um. ' .m c #Um d log m *iew Answer Answer+ a ,-planation+ unning time of DFA+ (n and unning time of KFA 1(m.n$ #$ hich of the following option is correct) a KFA is slower to process and its representation uses more memory than DFA ' DFA is faster to process and its representation uses less memory than KFA c KFA is slower to process and its representation uses less memory than DFA d DFA is slower to process and its representation uses less memory than KFA *iew Answer Answer+ c ,-planation+ KFA3 while computing strings3 ta?e parallel paths3 ma?e different copies of input and goes along different paths in order to search for the result$ This creates the difference in processing speed of DFA and KFA
Automata Theory Questions and Answers – 8impler Kotations This set of Automata Theory Multiple Choice Questions & Answers (MCQs focuses on !8impler Kotations"$ #$Hien Language+ L1 2-941 2a3 '7 J- has a su'string Vaa: in the production7$ hich of the corresponding representation notate the same)
a
'
c
d
*iew Answer Answer+ a ,-planation+ The states transited has 'een written corresponding to the transitions as per the row and column$ The row represents the transitions made and the ultimate$
.$Let u1:###:3 1:#:3 then u1#### and u1 ####$sing the gien information what is the identity element for the string) a u0# ' 0# c u0#0# d B *iew Answer Answer+ d ,-planation+ Pdentity relation+ Bw 1 wB 1 w3 thus the one satisfying the gien relation will 'e the identity element$
<$hich of the following su'string will the following notation result)
a #### ' ### c ## d ## *iew Answer Answer+ c ,-planation+ The gien DFA notation accepts the string of een length and prefi- V#:$
@$Eredict the following step in the gien 'unch of steps which accepts a strings which is of een length and has a prefi-1:#: 5 (63 B 16 W 5(63 15 (5 (63 B3 15(63 16# W XXXXXXXXXXXXXXX a 5 (63 ## 15 (5 (63#3 # 15 (6.3 # 16< ' 5 (63 # 15 (5 (63 3 # 1 5 (6#3 # 16. c 5 (63 ## 15 (5 (6#3 #3 # 15 (6.3 16< d 5 (63 ### 15 (5 (63 ##3 1 5 (6<3 # 16. *iew Answer Answer+ ' ,-planation+ %ere3 5 refers to transition function and results into new state or function when an transition is performed oer its state$
/$ Fill the missing 'lan? in the gien Transition Ta'le+ Language L1 2-941 23#7 J- accepts all the 'inary strings not diisi'le 'y <7
a Q ' Q# c Q. d Ko Transition *iew Answer
Answer+ Q# ,-planation+ The ta'ular representation of DFA is 6uite reada'le and can 'e used to some ore comple- pro'lems$ %ere3 we need to form the transition graph and fill up the gien 'lan?$
$hich among the following is the missing transition in the gien DFA) L1 2-941 2a3 '7 J - starts with a and ends with '7
a 5 (63 a 16 ' 5 (F3 a 16# c 5 (F3 a 1D d 5 (6#3 a 1D *iew Answer Answer+ ' ,-planation+ For the gien Language3 the transition missing is 5 (F3 a 16#$
G$The complement of a language will only 'e defined when and only when the XXXXXXXXXX oer the language is defined$ a 8tring ' ord c Alpha'et d Hrammar *iew Answer Answer+ c ,-planation+ Pt is not possi'le to define the complement of a language without defining the input
alpha'ets$ ,-ample+ A language which does not consist of su'string Va': while the complement would 'e the language which does contain a su'string Va':$
$hich among the following is not notated as infinite language) a Ealindrome ' eerse c Factorial d L12a'7I *iew Answer Answer+ Factorial ,-planation+ Factorial3 here is the most appropriate non0infinite domain$ therwise3 palindrome and reerse hae infinite domains$
N$hich among the following states would 'e notated as the final stateUacceptance state) L1 2-941 2a3 '7 J length of - is .7
a 6# ' 6. c 6#3 6. d 6< *iew Answer Answer+ ' ,-planation+ According to the gien language3 6. Ps to 'ecome the finalUacceptance state in order to satisfy$
#$hich of the following are the final states in the gien DFA according to the Language gien$) L1 2-941 2a3 '7 Jlength of - is at most .7
a 63 6# ' 63 6. c 6#3 6. d 63 6#3 6. *iew Answer Answer+ d ,-planation+ According to the gien language3 the length is at most .3 thus the answer is found accordingly$
Automata Theory Questions and Answers – ,-tended Transition Function This set of Automata Theory Multiple Choice Questions & Answers (MCQs focuses on !,-tended Transition Function"$ #$ The num'er of tuples in an e-tended Kon Deterministic Finite Automaton+ a / ' c G
d @ *iew Answer Answer+ a ,-planation+ For KFA or e-tended transition function on KFA3 the tuple elements remains same i$e$ /$
.$ Choose the correct option for the gien statement+ 8tatement+ The DFA shown represents all strings which has # at second last position$
a Correct ' Pncorrect3 Pncomplete DFA c rong proposition d May 'e correct *iew Answer Answer+ c ,-planation+ The gien figure is an KFA$ The statement contradicts itself$
<$ hat is wrong in the gien definition) Def+ (263 6#3 6.73 23#73 53 6<3 26<7 a The definition does not satisfy / Tuple definition of KFA$ ' There are no transition definition$ c Pnitial and Final states do not 'elong to the Hraph$ d Pnitial and final states can:t 'e same$ *iew Answer Answer+ c ,-planation+ 6< does not 'elong to Q where Q1 set of finite states$
@$ Pf 5 is the transition function for a gien KFA3 then we define the 5: for the D FA accepting the same language would 'e+ Kote+ 8 is a su'set of Q and a is a sym'ol$ a 5: (83 a 1 p9s 5 (p3 a ' 5: (83 a 1 pYs 5 (p3 a c 5: (83 a 1 p9s 5(p d 5: (8 1pYs 5(p *iew Answer Answer+ a ,-planation+ According to su'set construction3 e6uation # h olds true$
/$ hat is the relation 'etween DFA and KFA on the 'asis of computational power) a DFA Z KFA ' KFA Z DFA c ,6ual d Can:t 'e said *iew Answer Answer+ c ,-planation+ DFA is said to 'e a specific case of KFA and for eery KFA that e-ists for a gien language3 an e6uialent DFA also e-ists$
$ Pf a string 8 is accepted 'y a finite state automaton3 81s #s.s<[[sn where si94 and there e-ists a se6uence of states r3 r#3 r.[[ rn such that 5(r(i3 s iO# 1r iO# for each 3 #3 [n0#3 then r(n is+ a initial state ' transition sym'ol c accepting state d intermediate state *iew Answer Answer+ c ,-planation+ r(n is the final state and accepts the string 8 after the string 'eing traersed through r(i other states where P 9 #3.[(n0.$
G$ According to the gien ta'le3 compute the num'er of transitions with # as its sym'ol 'ut not +
a @ ' < c . d # *iew Answer Answer+ d ,-planation+ The transition graph is made and thus the answer can 'e found$
$ From the gien ta'le3 5I(63 ## 1)
a 267 ' 26#7 263 6#3 6.7 c 26.3 6#7 d 26<3 6#3 6.3 67 *iew Answer Answer+ ' ,-planation+ 5I(63## 1 r95I(63# 5 (r3 # 1 263 6#3 6.7$
N$ Kum'er of times the state 6< or 6. is 'eing a part of e-tended transition state is
a ' / c @
d G *iew Answer Answer+ a ,-planation+ According to the 6uestion3 presence of 6. or 6# would count so it does and the answer according to the diagram is $
#$ Eredict the missing procedure+
#$\(Q3 B 12Q73 .$\(Q3 # 1 2Q3 Q#7 <$5(Q3 # 1) a 2Q3 Q#3 Q.7 ' 2Q3 Q#7 c 2Q3 Q.7 d 2Q#3 Q.7 *iew Answer Answer+ c ,-planation+ According to gien ta'le and e-tended transition state implementation3 we can find the state at which it rests
Automata Short Question & Answers QNo1.What is the diference between the st rings and the words o a l anguage? Answer:A string is any combination of the letters of an alphabet where as the words of a
language are the strings that are always made according to certain rules used to dene that language.For example if we take Alphabet Σ = { a , b !ere a , b are the letters of this alphabet. As you can see we can make a lot of strings from these letters a and b. For example a,b,aa,ab,ba,bb,aaa,aab,aba,baa,"""""""""""""""""""" and so on. #ut when we dene a language o$er this alphabet ha$ing no a’s and only odd number of b’s. %hen the words of this language would ha$e only those strings that ha$e only odd number of b’s and no a’s.some example words of our dened language are
b , bbb , bbbbb , bbbbbbb ,"""""""""""..and so on. &o we can say that all the words are strings but all the strings may not be the words of a language.!ence strings are any combination of letters of an alphabet and the words of a language are strings made according to some rule. QNo.2 What is the diference between an Alphabet and an element o a set. Whether Alphabet is an element o a set or it is a set itsel? Answer:An Alphabet is a set in itself. %he elements of an Alphabet are called letters .
For example #inary Alphabet Σ = {',( !ere ',( are the letters of binary alphabet. #inary Alphabet is $ery important because it the Alphabet used by the computer. &et of )atural )umbers )={(,*,+,,-,""""""""""""".. !ere (,*,+"""""""""""""". are the elements of set of )atural )umbers. QNo. What is Null !tring "#$ ? Answer: %he string with ero occurrences of symbols /letters0 from 1.
2t is denoted by /&mall 3reek letter 4ambda0 5 or /6apital 3reek letter 4ambda0 7, is called an empty string or null string. %he capital lambda will mostly be used to denote the empty strin g, in further discussion. QNo.% What is &A'(N)*+,- ? Answer: %he language consisting of 7 /)ull &tring0 and the strings s dened o$er an
Alphabet Σ such that 8e$/s0=s. &ome example words of this language are aa As 8e$/aa0 = aa aba As 8e$/aba0 = aba bbb
As 8e$/bbb0 = bbb aabaa As 8e$/aabaa0 = aabaa bbbaaabbb As 8e$/ bbbaaabbb 0 = bbbaaabbb 2t is to be noted that the words of 9A42):8;< are called palindromes. QNo.What is the concept o /alid and in/alid alphabets ? Answer:>hile dening an alphabet of letters consisting of more than one symbols, no letter
should be started with any other the letter of the same alphabet i.e. one letter should not be the prex of another. !owe$er, a letter may be ended in the letter of same alphabet i.e. one letter may be the su?x of another. Σ= { a , b / @alid Alphabet0 Σ= { a , b , cd / @alid Alphabet0 Σ= { a , b , ac / 2n$alid Alphabet0 QNo 0. What is A'+' ? Answer:A43;4 /A43;rithmic 4anguage0 is one of se$eral high le$el languages designed
specically for programming scientic computations. 2t started out in the late (-'Bs, rst formalied in a report titled A43;4 -C, and then progressed through reports A43;4 D', and A43;4 DC. 2t was designed by an international committee to be a uni$ersal language. %heir original conference, which took place in Eurich, was one of the rst formal attempts to address the issue of software portability. A43;4Bs machine independence permitted the designers to be more creati$e, but it made implementation much more di?cult. Although A43;4 ne$er reached the le$el of commercial popularity of F;8%8A) and 6;#;4, it is considered the most important language of its era in terms of its inuence on later language de$elopment. A43;4Bs lexical and syntactic structures became so popular that $irtually all languages designed since ha$e been referred to as GA43;4 H likeIJ that is they ha$e been hierarchical in structure with nesting of both en$ironments and control structures. QNo. What are the !e3uential +perators? Answer:!e3uencing +perators:
&eKuencing operators a LL b
&eKuence
a MM b
&eKuentialNand
&eKuentialNand. &ame as abo$e, match a and b in seKuence
a OO b
&eKuentialNor
%he seKuencing operator LL can alternati$ely be thought of as the seKuentialNand operator. %he expression a MM b reads as match a and b in seKuence. 6ontinuing this logic, we can also ha$e a seKuentialNor operator where the expression a OO b reads as match a or b and in seKuence. %hat is, if both a and b match, it must be in seKuenceJ this is eKui$alent to a LL P b O b. QNo 4.What is Non5)eterminism and )eterminism and what is the diference between them ? Answer::eterminism means that our computational model /machine0 knows what to do for
e$ery possible inputs. )on determinism our machine may or may not know what it has to do on all possible inputs. As you can conclude from abo$e denition that ) onN:eterministic machine can not be implemented / used 0 on computer unless it is con$erted in :eterministic machine. QNo 6. What is meant b7 e3ui/alent 8A’s ? Answer:FABs that accept the same set of languages are called Kui$alent FABs. QNo 19. What is the diference between &alindrome and *e/erse unction? Answer:2t is to be denoted that the words of 9A42):8;< are called palindromes.
8e$erse
=w
xampleQ Σ={a,b, 9A42):8;<={7 , a, b, aa, bb, aaa, aba, bab, bbb, " 2f a is a word in some language 4, then re$erse /a0 is the same string of letters spelled backwards, called the re$erse of a. e.g re$erse /xxx0 = xxx re$erse /D*+0 = +*D re$erse /('0 = '( QNo11.)ene ;leene !tar? Answer:3i$en Σ, then the Rleene &tar 6losure of the alphabet Σ, denoted by ΣS, is the
collection of all strings dened o$er Σ, including 7 2t is to be noted that Rleene &tar 6losure can be dened o$er any set of strings. xamples 2f Σ = {x
%hen ΣS = {7, x, xx, xxx, xxxx, ". 2f Σ = {',( %hen ΣS = {7, ', (, '', '(, (', ((, ". 2f Σ = {aa#, c %hen ΣS = {7, aa#, c, aa#aa#, aa#c, caa#, cc, ". )oteQ 4anguages generated by Rleene &tar 6losure of set of strings, are innite languages. /#y innite language, it is supposed that the language contains innite many words, each of nite length0 QNo12.
letter otherwise it is in$alid. QNo1.What is *e/erse o a string? Answer:Alphabet pro$ides only a set of symbols. A string is a concatenation of these
symbols. 8e$erse of the string means to write the string in re$erse order. 2t has no eTect on alphabet. Alphabet will remain same. QNo1%.)iferentiate ;leene !tar >losure and &'!? Answer:3i$en Σ, then the Rleene &tar 6losure of the alphabet Σ, denoted by ΣS, is the
collection of all strings dened o$er Σ, including 7. 9lus ;peration is same as Rleene &tar 6losure except that it does not generate 7 /null string0, automatically. Uou can use other symbol for alphabet but we are mostly use sigma symbol. QNo1.)ene *egular -@pression? Answer:8egular xpression is the generalied form of any regular language through which
you can construct any string related to that language. %ake an example from your handouts 4 = {7, a, aa, aaa, " and 4 = {a, aa, aaa, aaaa, " can simply be expressed by a and a , respecti$ely. 1
2
so a and a are the generalied form of 4anguages 4 , 4
B
1
2.
And a and a are called the regular expressions /80 for 4 and 4 respecti$ely.
B
FAVBs about 4ectures D to ('
1
2
B
Automata %heory FAVBs about 4ectures D to ('Q No.1 What is the concept o 8A also Cnown as 8!, " 8inite !tate ,achine$ ?
FA /Finite Automaton0 is a nite state machine that recognies a regular language. 2n computer science, a niteNstate machine /F&<0 or niteNstate automaton /F&A0 is an abstract machine that has only a nite, constant amount of memory. %he internal states of the machine carry no further structure. %his kind of model is $ery widely used in the study of computation and languages. Q No.2 What is the diference between 8A D E D E. ?
2n e$ery FA, we mark transitions with single letter of the gi$en alphabet but in %3 transitions can be marked with letters or strings /combination of letters0. 2n e$ery FA, e$ery state shows transition for all letters of gi$en alphabet but in any %3 it is not necessary to show all transition for all letters of gi$en alphabet. 2n %3, we may or may not show all letter transitions according to reKuirement. >e can also show transitions on reading any strings in %3s but it is not possible in FABs. 2n 3%3 :irected edges connecting some pair of states are labeled with regular expressions . 2t may be noted that in 3%3, the labels of transition edges are corresponding regular expressions. 2n %3 we write strings and in 3%3 we are bound to write 8. $ery FA is also a %3 but not e$ery %3 is FA. Q No. What is the diference between 8A’s and E’s .Wh7 we need E’s when we ha/e 8A’s?
%he %ransition 3raphs /%30 diTer from FA in the following areas %3Bs are generaliations of FABs. %3Bs can change state without an input / )ull transition0. 6an read more than one letter /words of the language they are accepting0 along the transition edges at a time. 6an ha$e a regular expression as a edge label. 6an ha$e more then one start state. >e ha$e been gi$en more freedom in %3Bs. #ut this freedom is on the cost of more memory and processing power it means that if we implement %3Bs on computer using some programming language it will need more memory and processing power of computer than used in the implementation of FABs. Q No.% What is the concept o the nion o 8A’s ?
>hen we take Wnion of two FABs it means that resultant FABs should accept all the words that were accepted by the two FABs indi$idually. 2t is like taking union of two sets, the resultant set contain members of both sets.
For example 4et A ={(,+,-,X, and # = {',*,,D,C,(' then, A W # = { ',(,*,+,,-,D,X,C,,(' you can see that A W # contain elements of both sets similar is the case with 8A’s . Q No. What is the diference between is E and E ?
2n %3, there are letter transitions for the strings. >hile in 3%3, one can write whole 8 as a transition from one state to another one. Q No.0 Fow one can create *- o a particular language?
First thing about 8 and FA is that there is no hard and fast formula or method to generate these. ;ne can generate them by its mental approach. And this mental approach can be acKuired through only 98A6%26. !ere are some useful tips to write 8Bs, Y 4et our language consist of the words of length three exactly o$er alphabet Σ= {a,b then it consists of the words 4 = {aaa, aab, aba,abb,baa,bab,bba,bbb. 2ts 8 can be simply written as 8 = aaa Z aab Z aba Z abb Z baa Z bab Z bba Z bbb which simply means that our language consists of onl7 these words. &o we can make 8 for a nite language by writing its all words with Z operator between them. Y >e should also keep the null string in our mind. 2f our language generates null string than our 8 should also generate it0 For example language ha$ing all the words of e$en length has null string in it as well so we can write its 8 as follows 8 = //aZb0/aZb00S %his 8 also generates null string.
2f a language generates all strings starting with a. then strings will be of type a , aa, ab, aab, aaa, aba, abb,". !ere 8 should start with [aB and then all strings including null. &o this will be /a Z b0S and complete 8 is a /aZ b0S. &imilarly languages of strings ending in b will ha$e 8 /a Z b0Sb. Q No. What is the diagrammaticall7 diference between 8A’s and E’s?
%he main diTerences between FABs and %3Bs are as follows Y Y Y Q No.4 What is the corresponding 8A or *- Gaa""aBb$"aBb$$
8 is aa//a Z b0/a Z b00S. 2ts corresponding FA is as follows. Q No.6 What is diference between 8A’s and N8A’s. Are the7 opposite to each other ?
FA stands for nite automata while )FA stands for nonNdeterministic nite automata 2n FA there must be a transition for each letter of the alphabet from each state. &o in FA number of transitions must be eKual to /number of states S number of letter in alphabet0. >hile in )FA there may be more than one transition for a letter from a state. And nally e$ery FA is an )FA while e$ery )FA may be an FA or not. Q No.19 )iferentiate between "aDb$ and "aBb$?
/a, b0 = 8epresents a and b. /a Z b0 = 8epresents either a or b. FAVBs about 4ectures (( to (Q No.1 What is the diference between how’s 8A and E .Wh7 we need E’s when we ha/e 8A’s? %he %ransition 3raphs /%30 diTer from FA in the following areas
Y %3Bs can change state without an input / )ull transition0.
>e ha$e been gi$en more freedom in %3Bs. #ut this freedom is on the cost of more memory and processing power it means that if we implement %3Bs on computer using some programming language it will need more memory and processing power of computer than used in the implementation of FABs. Q No.2 What is the concept o the nion o 8A’s ?
>hen we take Wnion of two FABs it means that resultant FABs should accept all the words that were accepted by the two FABs indi$idually. 2t is like taking union of two sets the resultant set contain members of both sets. For example 4et A ={(,+,-,X, and # = {',*,,D,C,(' then, A W # = { ',(,*,+,,-,D,X,C,,(' you can see that A W # contain elements of both sets similar is the case with FABs. Q No. What is the diference between E and E ?
2n %3, there are transitions for the strings. >hile in 3%3, one can write whole 8 as a transition from one state to another one. Q No.% Fow to create a *- o a particular 'anguage?
8egular expression is used to express the innite or nite language, these 8 are made in such a way that these can generate the strings of that uniKue language also for the cross check that the dened 8 is of a specied language that 8 should accept all the string of that language and all language strings should be accepted by that 8. Q No. Fow diagrams o 8A’s are created ?
2t depends upon the Kuestion how many states in$ol$e in a FA. %here is not any formal procedure to design FA for a language. %his ability \ust impro$es with time and practice. $ery FA is also a %3 but not e$ery %3 is FA. 2n e$ery FA, e$ery state shows transition of all letters of gi$en alphabet but in any %3 it is not must. 2n %3, we may or may not show all letters transition according to reKuirement. >e can also show transitions on reading any strings in %3s but it is not possible in FAs. Q No.0 Fow one can create *- o a particular language?
First thing about 8 and FA is that there is no hard and fast formula or method to generate these. ;ne can generate them by their mental approach. And this mental approach can be acKuired through only 98A6%26.
2 am gi$ing you few tips. 2 hope those will help you. 2f we ha$e a nite language then it will always be regular and will not ha$e S in 8. e.g. 4={aaa, aba, bb. 4 language generates gi$en three strings then its 8 will be /aaa Z aba Z bb. &o in nite language Z of all strings can be itBs 8. 2f we ha$e an innite language, then there will be S in itBs 8. >e should also keep the null string in our mind. For practice \ust try to create 8 of simple languages. :onBt try to confuse yourself with complex languages. For example if a language generates all strings starting with a. then strings will be of type a , aa, ab, aab, aaa, aba, abb,". !ere 8 should start with [aB and then all strings including null. &o this will be /a Z b0S and complete 8 is a /aZ b0S. &imilarly languages of strings ending in b will ha$e 8 /a Z b0Sb. 2 hope now you will be able to generate the 8 of simpler languages. 3radually, increase the complexity of languages to become a perfect in 8Bs. )ow as similar to 8, FA of nite language will not ha$e any loop in it. 2f language is innite then there will always be at least one loop in its FA. From 8, if you want to generate its FA, then rst get the smallest strings and generate their FA and then gradually get the strings of bigger length and keep amending the created FA. After some practice, you will be able to generate the FABs. And the last thing nobody can do the new task accurately for the rst time. 9ractice is the key to success. 2n the start you will ha$e lot of mistakes but after practice you will be able to clear all of them. Q No. What is the diference between 8A’s Dand E’s ?
%here are two or three big diTerences between FABs and %3Bs. 2n FA there can be maximum one initial or starting state while in %3 there may be more than one initial state. 2n FA there can be transition for letters only while in %3 transitions from a state to another one can be for strings. 2n FA there must be transition from each state for each letter /deterministic0 while in %3 there may be no transition for specic letter from a state and there may be more than
one path for a string or letter from a state. Q No.4 What is the e@act denition o 8A ?
:enitionQ A Finite automaton /FA0, is a collection of the followings Finite number of states, ha$ing one initial and some /maybe none0 nal states. Finite set of input letters /]0 from which input strings are formed. Finite set of transitions i.e. for each state and for each input letter there is a transition showing how to mo$e from one state to another. Q No.6 What is the diference between E and E ?
2n %3, there are transitions for the strings. >hile in 3%3, one can write whole 8 as a transition from one state to another one. For 8 =aa//aZb0/aZb00S what will be its corresponding FA ^ 8 is aa//a Z b0/a Z b00S. 2ts corresponding FA is as follows. Q No.19 What is the diference between 8A and N8A ?
FA stands for nite automata while )FA stands for nonNdeterministic nite automata 2n FA there must be a transition for each letter of the alphabet from each state. &o in FA number of transitions must be eKual to /number of states S number of letter in alphabet0. >hile in )FA there may be a transition for a letter from a state. 2n )FA there may be more than one transition for a letter from a state. And nally e$ery FA is an )FA while e$ery )FA may be an FA. FAQ )FAQ Q No.11 What is the method to understanding 8A’s and N8A’s
Firstly we know that an FA is used to describe a language. ) ow a language consists of strings. FA will describe the specic language only if it accepts all the strings of that particular language and all the strings generated by the FA are in the language. &o conrmation is of two ways. )ow, how to tra$erse the FA. 2t is $ery easy. $ery FA has one initial state /state with Nsign0. From e$ery state of FA there is one transition for e$ery letter of the alphabet. 8ead the string letter by letter and mo$e according to transitions from state to state. 2f the string ends in the nal state /state with a Z sign0, that particular string will be accepted otherwise re\ected. &o, e$ery string ending in nal state will be accepted by FA and will be a word of the
language. For )FA, there may be no path or more than one path for a letter from a specic state. As similar to FA \ust start tra$ersing from the initial state and if the string ends in the nal state, it will be accepted. 8emember, as there may be more than one path for a letter from a state. &o any path can be used. 3oal is to reach the nal state. 8emaining theory is same to the FA. 9ractice is the key to success. _ust try simple FABs and )FABs in the start.
FAVBs about 4ectures (D to *' Q No 1.What is the concept o Nondeterministic 8inite Automaton "N8A$ ?
)ondeterminism plays a key role in the theory of computing. A nondeterministic nite state automaton is one in which the current state of the machine and the current input do not uniKuely determine the next state. %his \ust means that a number of subseKuent states /ero or more0 are possible next states of the automaton at e$ery step of a computation.;f course, nondeterminism is not realistic, because in real life, computers must be deterministic. &till, we can simulate nondeterminism with deterministic programs. Furthermore, as a mathematical tool for understanding computability, nondeterminism i s in$aluable. As with deterministic nite state automata, a nondeterministic nite state automaton has $e components. Y a set of states Y a nite input alphabet from which input strings can be constructed Y a transition function that describes how the automaton changes states as it processes an input string Y a single designated starting state Y a set of accepting states %he only diTerence lies in the transition function, which can now target subsets of the states of the automaton rather than a single next state for each state, input pair. Q No 2. ( a language can be e@pressed in the orm o 8A than wh7 it is needed to use N8A ?
)FA stands for nonNdeterministic FA and this sort of structure has relaxation compared with FA. &o it is rather more easy to represent a language using )FA. >e ha$e methods to con$ert )FA into FABs so sometimes it is easier to build )FA of a gi$en language and than con$ert its )FA into FA using these methods rather than directly building an FA for a language which may be $ery di?cult.
Q No .Fow to made N8A corresponding to the closure o an 8A ?
>hile generating )FA corresponding to closure of an FA one should take care of the null string. &imple way to accept null string is declare initial state, nal as well. #ut in this way a lot of other strings will also be accepted. %herefore, accurate way is draw another state. :eclare the new state initial as well as nal. 6onnect the new state with the states originally connected with the old start state with the same transitions as the old start state. )ewly drawn diagram will be an )FA representing the language closure of the gi$en FA Q No %.What is the diference between nion o two 8A’s D >oncatenation o two 8A’s and closure o two 8A’s ?
6onsider two FABs gi$en below a a b b a b a b U*Z U(N `*Z `(N FA( FA* !ere FA( accepts all strings ending in a and FA* accepts all strings ending b. An FA corresponding to FA(WFA* will accept all the strings ending in a or ending in b. for example, aba,bbaaab,bbb An FA corresponding to FA(FA* will accept all the strings whose rst substring belongs to FA( and second substring belongs to FA*. for example, ababab, bbabbb. An FA corresponding to FA(S will accepts all the strings of FA( including null string. if FA( represents 8 r( then FA(S will correspond to 8 r(S.
FAVBs about 4ectures *( to *Automata %heory FAVBs about 4ectures *( to *- Q No 1.Fow ,oore and ,eal7 machine worCs in >omputer ,emor7 what is their importance in >omputing ?
&eKuential 6ircuitQ A seKuential circuit contains a memory component. %he memory component pro$ides a state input. A ipNop is often used as a memory component. %he state $ariable indicates the states of the seKuential machine, i.e. the status or stage or progress of the whole e$ent. %he state of a seKuential circuit is indicated by the output of a ipNop. A single ipNop can be used to indicate two states /K=' and K=(0. >hen there are more than two states, additional ipNops are used. 3i$en n ipNops, a total of * states can be represented. n
2n other words, a seKuential machine can be put into a number of diTerent states depending on the particular inputs gi$en. %he output is a function of both the 9resent 2nputs and the 9resent &tates. 2n addition to the outputs, the circuit must also generate an update to the memory components so that the state of the machine can also be changed with respect to the new inputs. %he update is called the )ext &tate Function and is also a function of the 9resent 2nputs and the 9resent &tates. #oth the output functions and the )ext &tate Functions are combinational circuits. E=f/`,& 0 &=g/`,& 0 t
t
%he superscript t indicates the present time period while the superscri pt /tZ(0 indicates the next time period. %he characteristic of a seKuential circuit is completely dened by a state transition diagram that enumerates all possible transitions for e$ery possible input combination. Q No 1.What is the concept o &umping 'emma ( and (( and what is the diference between pumping 'emma 1 and pumping 'emma 2 ? 2n fact 942 M 9422
are same /A way to recognie )on 8egular language0. %he only diTerence is that the conditions in pumping lemma 22 are more stricter than 9umping 4emma 2 some language that are di?cult to proof )on 8egular by 9umping 4emma 2 are pro$ed )on 8egular by pumping 4emma 22 easily.
Further mare in pumping lemma 2 we ha$e to generate all words to of a language but in 9umping 4emma 22 we ha$e to generate a single word to pro$e a language non regular. xplanationQ &ome languages like 9A42):8;< that are pro$ed to be regular by rst $ersion due to some of their symmetrical words when we pump these words they remain to be the parts of the language like bbabb #y pumping lemma ( 4et y = a )ow repeating y three times results in bbaaabb %hat is also a $alid word of 9A42):8;< so by pumping lemma 2 9A42):8;< can not be pro$ed non regular, so there was the need of pumping lemma $ersion $ersion *. )ow consider for the word bbabb if we take )=* %hen by pumping y /let we take it b 0 two times results in bbbbabb %hat word is not in 9A42):8;<. #ut if we take )=+ and y = a %hen by pumping y two times results in bbaaabb %hat word is in 9A42):8;<. &o be careful in taking total no of states of the FA and also the repeating factor /y0 to pro$e an innite language non regular you need to pro$e only one word that is not part of the language. Q No 2. What is the signicance o &umping 'emma (( ?
%he signicance of *nd $ersion of [pumping lemmaB is that there are some innite non regular languages like 9A42):8;< we can built FA that can accept there certain words but if we increase the length of their words that FA donBt accept these words so by pumping lemma $ersion 2 it is $ery di?cult to pro$e them non regular but with the
second $ersion we can pro$e that a language is )on regular e$en itBs some words may be accepted by some FABs. &ee page (- of the book for further example. Q No .,oore and ,eal7 machine?
(. 2n order to run a string on a
FAVBs about 4ectures +( to +Q No 1.What is the diference between semiword and word please also gi/e an e@ample regarding this? Word:
A word is complete combinations of terminals only e.g. abba or ab or a or null string. !emiword:
A semiword is a string of terminals /may be none0 concatenated with exactly one nonterminal on the right i.e. a semi word, in general, is of the following form /terminal0/terminal0 N /terminal0/nonterminal0 For example aaaaaa# , aabbaaaA , A. >hat is the diTerence between deri$ation tree and total tree ^ A :eri$ation tree is the one that shows how to deri$e any specic word of the language described by 6F3 but %otal 4anguage %ree shows all words of the 4anguage described by 6F3 on it Q No 2.What does mean the 'ANA- (! >'+!-)?
>hen we say that a 4anguage is closed it is always with respect to certain operation. A simple example may be that the set of integers is closed under addition. 2t means when we take two numbers from set of integers say +, X the result of
their addition would also be in the set of integers. &imilarly if the result of an operation on the words of a language results in the word of the same language we say that the language is closed under that operation. Q No .What are the &roductions?
9roductions are the grammatical rules and regulations. %hese rules express the beha$ior of 6F3. Wsing production in 6F3 terminals are con$erted into nonNterminals and when all the terminals are con$erted using productions, a word is acKuired. Q No %.What is the diference between concatenation and intersection o two 8A’s also what is the diference among nion o two 8A’s and addition o them?
2n intersection of two FABs only those strings are accepted which are independently accepted by both FABs, while in concatenation of two FABs only those strings will be accepted in which rst part of string is accepted by rst FA and remaining part of string is accepted by the second FA. >hile taking union of two FABs one can represent it using Z sign. &o /FA( W FA*0 and /FA Z FA*0 both are same. %here is no diTerence between them.
FAVBs about 4ectures +D to ' Automata %heoryFAVBs about 4ectures +D to ' Q No 1.What is the )iference between Nullable and Null production? Fow to maCe eliminate Nullable and or Null &roductions rom the >8 ?
%he production of the form nonterminal 4 is said to be null production. -@ampleQ
6onsider the following 6F3 & aAOb#O4, A aaO4, # a& !ere & 4 and A 4 are null productions. A production is called nullable production there is a deri$ation that starts at )on %erminal and leads to 4 i.e.
S ———–> aA | bB | aa A————-> C | bb C————–> 4
!ere A nullable )on %erminal due to )ullable production AL 6 as 6 leads to null. -@ample:
6onsider the following 6F3 & `U, ` Eb, U b> E A#, > E, A aAObAO4 # #aO#bO4. !ere A 4 and # 4 are null productions, while E A#, > E are nullable productions. ,ethodQ
:elete all the )ull productions and add new productions e.g. 6onsider the following productions of a certain 6F3 ` a)b)a, ) 4, delete the production ) 4 and using the production ` a)b)a, add the following new productions ` a)ba, ` ab)a and ` aba %hus the new 6F3 will contain the following productions ` )baOab)aOabaO a)b)a NoteQ 2t is to be noted that ` a)b)a will still be included in the new 6F3. ,ethodQ
6onsider the following 6F3 & `U, ` Eb, U b> E A#, > E, A aAObAO4 # #aO#bO4. !ere A 4 and # 4 are null productions, while E A#, > E are nullable productions. %he new 6F3 after, applying the method, will be & `U
` EbOb U b>Ob E A#OAO# >E A aAOaObAOb # #aOaO#bOb Note: >hile adding new productions all )ullable productions should be
handled with care. All )ullable productions will be used to add new productions, but only the )ull production will be deleted Q No 2. (s it possible to maCe >8 or in@ and post@ e@pression’s using deri/ation tree ?
:eri$ation tree is only used to deri$e words of language that is described by a 6F3. Ues, we can create 6F3 for languages inx expressions, postx expressions. Q No what is the uses o push down automata in computing ?
9:A is \ust an enhancement in FAs. i.e ; and &!F )+WN !E+*- ?
)o diTerence at all. #oth terms are used to describe memory structure attached with FAs to store some characters in it. Q No Fow we can distinguish between H>8I and H>N8I in the 3uestions ?
6homsky )ormal Form /6)F0 2f a 6F3 has only productions of the form nonterminal string of two nonterminals or )onterminal H one terminal %hen the 6F3 is said to be in 6homsky )ormal Form /6)F0. %hus if the gi$en 6F3 is in the form specied abo$e it will be calle d in 6)F. Q No 0.What is meant b7 the terms stacC consistence and input tape
consistence ?
%erm !tacC consistent means we can pop any character from the top of the stack only. 9:A should not be able to pop any character other than that is present on the top of the stack. %erm Eape consistent means we can read only the rst letter on the tape not any other letter of the tape after the rst one. Q No What is the concept o unit production ?
%he productions of the form one )onterminal H one )onterminal Are called unit productions. For example & H A /Wnit 9roduciton0 AH a O b !ere there is no need of Wnit 9roduction & A. we can directly write & N a O b Q No 4 Wh7 >onte@t 8ree rammars are called H>onte@t 8ree?
6ontext Free 3rammars are called context free because the words of the languages of 6ontext Free 3rammars ha$e words like GaaabbbI/9A42):8;<0. 2n these words the $alue of letters /a , b0 is the same on whate$er position they appear. ;n the other hand in context sensiti$e grammars their $alue depend on the position they appear in the word a simple example may be as follows &uppose we ha$e a decimal number 1%1 in our language . >hen compiler reads it, it would be in the form of string. %he compiler would calculate its decimal eKui$alent so that we can perform mathematical functions on it. 2n calculating its decimal $alue , weight of rst H1I is diTerent than the second G(I it means it is conte@t sensiti/e /depends on in which position the G(I has appeared0. i.e. (S('2 Z S('1 Z (S ('9 = ( /$alue of one is (''0 /$alue of one is \ust one0 %hat is not the case with the words of 6ontext Free 4anguages. /%he $alue of GaI is always same in whate$er position HaI appears0.
Q No 6. What is nit &roduction?
%he production in which one nonNterminal leads to only one nonNterminal. Q No 19.What is 'et most )eri/ation in >8?
2t is a method of generation of strings from a 6F3 starting from left most letter of the string.
FAVBs about 4ectures ( to Q No 1.i/e a e@ample o con/erting a >8 to >N8? 6onsider the 6F3
gi$en below & A#6 A aa O b # c 6d 2ts 6)F will be & :6 : A# A O b a #c 6d Q No 2.(n the lecture %1 Js e@ampleD we ha/e con/erted &)A to con/ersion orm and a word Jaaaabb’ is deri/ed rom this con/ersion orm &)A. What are the deri/ation steps.
%he 9:A con$erted to con$ersion form has some specic features that are important to understand rst. %hese features are %he states named &%A8%, 8A:, !8 and A669% are called \oints of the machine. >ith the help of the con$ersion form we ha$e been able to achie$e that 9;9 state has only one path out of it and the path taking /multiple paths0 decisions take place only on the 8A: state. %he word [aaaabbB is generated as follows from the 9:A &%A8%N9;9N9W&! %his step pops and then pushes it to ensure that stack contains at the beginning. 8A:(N9;9DN9W&! N9W&! a As rst time after reading GaI there is at the top of stack so we will follow
path segment 8A:(N9;9DN9W&! N9W&! a 8A:(N9;9-N9W&! aN9W&! a )ow a is on the top of the stack so we will follow 8A:(N9;9-N9W&! aN9W&! a 8A:(N9;9-N9W&! aN9W&! a Again following same segment for a 8A:(N9;9-N9W&! aN9W&! a Again following same segment for a 8A:(N9;9(N !8N9;9* As we read b on input tape. 8A:*N9;9(N!8N9;9* As we read b on input tape. 8A:*N9;9+NA669%. As we read from the input tape Q No .Fow to diferentiate between HwantedI and Hunwanted branchI ?
>hen we deri$e a word in %op down parsing beginning with the starting )on %erminal the branches of the tree that do not lead to our reKuired word are left aside these branches are called unwanted branches. For example for 6F3 &HLAA AHLa O b 2f we want to generate the word GaaI we will lea$e the branch generated by the production ALb. Q No %.What is the diference between intersection and union o a language?
2ntersection of two languages will consist of all those words which are in both languages while union of two languages will consist of all those words which are present in at least one language. &ymbol for intersection is and for union is W. Q No .What is the diference between >onte@t ree languages and regular languages?
8egular languages can be represented by FABs because we do not need any memory to recognie /accept or re\ect them on FA0 them but there is another class of languages that can not be represented by FABs because these languages reKuire that we ha$e some memory /with the help of memory we can store letters of the string we are checking so that we can compare them with next coming letters in the string0. For example language anbn reKuires that we must store aBs and then compare their count with next coming bBs so that we can check whether aBs are eKual to bBs or not. :ue to this reason we use 6ontext Free 3rammars to represent them because we can-t write 8Bs for them. &o 6ontext Free 4anguages represent a broader category this category also include regular languages as subcategory. 2t means that context free languages include regular languages as well as some other languages. Q No 0.What is the diference between ,oore and ,eale7 machines?
2n
i. &%A6R 6onsistent ii. UNable 9aths iii. >orking string i$. &emi >ord means !tacC consistence means that in the 9:A con$erted in the con$ersion form, when we follow a path segment /which is formed by combining startD read or here state with ne@t readD here or accept state on the path$ along the
9:A its pop state should ha$e the path for the same letter that is present on the top of the stack at that stage. 2f this doesnBt happen our 9:A will crash because in con$ersion form of the 9:A the pop state has only one letter path, so if we could not be able to nd that letter on the top of the stack our 9:A will crash /if will not nd path where to go from that state0 WorCing string means the string present on the input tape. K5able &aths means that when we follow a certain seKuence of rows from the
row table to generate a path for a word form start state to accept state. %he path /seKuence of rows0 should be stack as well as \oint consistent it means that rows should end at the same read or here state /\oin consistency 0 and the
rows should be able to pop the letter from the top that is indicated in the pop state of the row. !emi word is the string of terminals it may be null string ending with a )on
terminals on the right. For example some semi words are aa& aabbA #
(s Automata Eheor7 is a &rogramming !ubLect or theoretical?
Automata theory is the study of abstract computing de$ices, or GmachinesI. %his topic goes back to the days before digital computers and describes what is possible to compute using an abstract machine .%hese ideas directly apply to creating compilers, programming languages, and designing applications. %hey also pro$ide a formal framework to analye new types of computing de$ices, e.g. biocomputers or Kuantum computers >hat are practical xamples of the implications of Automata %heory and the formal 4anguages^ 3rammars and languages are closely related to automata theory and are the basis of many important software components likeQ Y 6ompilers and interpreters Y %ext editors and processors Y %ext searching Y &ystem $erication
What are the E7pes o Automata?
Y %he %ypes of Automata %heory are Y Finite Automata Y 8egular 4anguages Y 4inearNbounded Automata Y 6ontext &ensiti$e 4anguages
Y 9ushN:own Automata Y 6ontext Free 4anguages Y %uring
Y 8andom Access
Question:
Fow t7pes o Automata )ifer?
%hey diTer in the following areas6omplexity /or &implicity0 9ower 2n the function that can be computed. AnswerQ
2n the languages that can be accepted.
VuestionQ
What is the diference between the alphabet and an element o a set?
AnswerQ
Alphabets is a set of letters nothing else but a set of strings /elements0 can ha$e more than one letters in one string.
VuestionQ
)iference between &alindrome and *e/erse unction?
AnswerQ
%he language consisting of 7 and the strings s dened o$er Σ such that 8e$/s0=s.2t is to be denoted that the words of 9A42):8;< are called palindromes. 8e$erse
=w
xampleQ Σ={a,b, 9A42):8;<={7 , a, b, aa, bb, aaa, aba, bab, bbb, " 2f a is a word in some language 4, then re$erse /a0 is the same string of letters spelled backwards, called the re$erse of a. e.g
re$erse /xxx0 = xxx re$erse /D*+0
= +*D
re$erse /('0
= '(
VuestionQ )ene !trings? 6oncatenation of nite letters from the alphabet is called a string. e.g 2f Σ= {a,b then a language 4 can be dened as4 = {a, abab, aaabb, ababababababababab,""""" AnswerQ
itBs mean all words with aBs more or eKual to bBs
VuestionQ
)ene empt7 or null strings?
AnswerQ
6oncatenation of nite letters from the alphabet is called a string.&ometimes a string with no symbol at all is used, denoted by /&mall 3reek letter 4ambda0 5 or /6apital 3reek letter 4ambda0 7, is called an empty string or null string.
VuestionQ
)iference between string and word?
AnswerQ
Any combination of letters of alphabet that follows rules of language is called a word. A string is a nite seKuence of symbols from an alphabet.
VuestionQ
Ehere are as man7 palindromes o length 2n as there are o length 2n5 1D please e@plain?
2f we try to create palindromes then middle elements /* in e$en palindromes M ( in odd palindrome0 does not cause any change in no. of palindromes:ening the language 9A42):8;<, of length *n and *nN( dened o$er & = {a,b e.g if we take n= * for *n 4ength /*n0 = and string can be written as {aaaa, abba, baab, bbbb And if we take n = * for *nN( 4ength /*nN(0 = + and string can be written as AnswerQ
{aaa, aba, bab, bbb
Automata Theory Questions and Answers – egular Language & ,-pression – # This set of Automata Theory Multiple Choice Questions & Answers (MCQs focuses on !egular Language & ,-pression"$ #$ A regular language oer an alpha'et a is one that can 'e o'tained from a union ' concatenation c ?leene d All of a'oe *iew Answer Answer + d ,-planation + Kone$
.$ egular e-pression 23#7 is e6uialent to a # ' U # c O # d All of a'oe *iew Answer Answer + d ,-planation + All are e6uialent to union operation$
<$ Erecedence of regular e-pression in decreasing order is a I 3 $ 3 O ' $ 3 I 3 O c $ 3 O 3 I d O 3 a 3 I *iew Answer Answer + a ,-planation + Kone$
@$ egular e-pression ]I is e6uialent to a 9 ' ] c d # *iew Answer Answer + a ,-planation + Kone$
/$ a) is e6uialent to a a ' aO] c aO9 d wrong e-pression *iew Answer Answer + c ,-planation + ^ero or one time repetition of preious character $
$ 9L is e6uialent to a 9 ' ] c L d L9 *iew Answer Answer + c3d ,-planation + Kone$
G$ (aO'I is e6uialent to a 'IaI ' (aI'II c aI'I d none of a'oe *iew Answer Answer + ' ,-planation + Kone$
$ ]L is e6uialent to a L] ' ] c L d 9 *iew Answer Answer + a3' ,-planation + Kone$
N$ hich of the following pair of regular e-pression are not e6uialent) a #(#I and (#I# ' -(--I and (--Ic (a'I and aI'I d -O and -I-O *iew Answer
Answer + c ,-planation + (a'I1(aI'II$
#$ Consider following regular e-pression i (aU'I ii (aIU'II iii ((9Ua'II hich of the following statements is correct a i3ii are e6ual and ii3iii are not ' i3ii are e6ual and i3iii are not c ii3iii are e6ual and i3ii are not d all are e6ual *iew Answer Answer + d ,-planation + All are e6uialent to (aO'I
Automata Theory Questions and Answers – egular Language & ,-pression – . This set of Automata Theory Multiple Choice Questions & Answers (MCQs focuses on !egular Language & ,-pression"$ #$ %ow many strings of length less than @ contains the language descri'ed 'y the regular e-pression (-OyIy(aOa'I) a G ' # c #. d ## *iew Answer Answer + d ,-planation + string of length 1 # string of length # 1 @ string of length . 1 < string of length < 1 <
.$ hich of the following is true) a (#I 1 (#I ' (O#I(O#I#(O# 1 (O#I#(O#I c (O#I#(O#IO#II 1 (O#I d All of the mentioned *iew Answer Answer + d ,-plaination + Kone$
<$ A language is regular if and only if a accepted 'y DFA ' accepted 'y EDA c accepted 'y L_A d accepted 'y Turing machine *iew Answer Answer + a ,-planation + All of a'oe machine can accept regular language 'ut all string accepted 'y machine is regular only for DFA$
@$ egular grammar is a conte-t free grammar ' non conte-t free grammar c english grammar d none of the mentioned *iew Answer Answer + a ,-planation + egular grammar is su'set of conte-t free grammar$
/$ Let the class of language accepted 'y finite state machine 'e L# and the class of languages represented 'y regular e-pressions 'e L. then a L#1L. c L# L. 1 $I d L#1L. *iew Answer Answer + d ,-planation + Finite state machine and regul ar e-pression hae same power to e-press a language$
$ hich of the following is not a regular e-pression) a `(aO'I0(aaO''I ' `(O#0('Oa#I(aO'I c (#O##O#I d (#O.OI(#O.I *iew Answer Answer + ' ,-planation + ,-cept ' all are regular e-pressionI$
G$ egular e-pression are a Type language ' Type # language c Type . language
d Type < language *iew Answer Answer + a ,-planation + According to Choms?y hierarchy $
$ hich of the following is true) a ,ery su'set of a regular set is regular ' ,ery finite su'set of non0regular set is regular c The union of two non regular set is not regular d Pnfinite union of finite set is regular *iew Answer Answer + ' ,-planation + Kone$
N$ L and bL are recursie enumera'le then L is a egular ' Conte-t free c Conte-t sensitie d ecursie *iew Answer Answer + d ,-planation +Pf L is recursie enumera'le and its complement too if and only if L is recursie$
#$ egular e-pressions are closed under a nion ' Pntersection c >leen star d All of the mentioned *iew Answer Answer + d ,-planation + According to definition of regular e-pression
Automata Theory Questions and Answers – egular ,-pression0Pntroduction This set of Automata Theory Multiple Choice Questions & Answers (MCQs focuses on !egular ,-pression0Pntroduction"$ #$ L is a regular Language if and only Pf the set of XXXXXXXXXX classes of PL is finite$ a ,6uialence ' efle-ie
c Myhill d Kerode *iew Answer Answer+ a ,-planation+ According to Myhill Kerode theorem3 the corollary proes the gien statement correct for e6uialence classes$
.$ A language can 'e generated from simple primitie language in a simple way if and only if a Pt is recogniSed 'y a deice of infinite states ' Pt ta?es no au-iliary memory c _oth are correct d _oth are wrong *iew Answer Answer+ ' ,-planation+ A language is regular if and only if it can 'e accepted 'y a finite automaton$ 8econdly3 Pt supports no concept of au-iliary memory as it loses the data as soon as the deice is shut down$
<$ hich of the following does not represents the gien language) Language+ 23#7 a O# ' 27 2#7 c 27 272#7 d 27 2#7 *iew Answer Answer+ d ,-planation+ The gien option represents 23 #7 in different forms using set operations and egular ,-pressions$ The operator li?e 3 3 etc$ are logical operation and they form inalid regular e-pressions when used$
@$ According to the gien language3 which among the following e-pressions does it corresponds to) Language L12-923#7J- is of length @ or less7 a (O#OO#OO#OO# @ ' (O#@ c (#@ d (O#OB@ *iew Answer Answer+ d ,-planation+ The e-tended notation would 'e (O# @ 'ut howeer3 we may allow some or all the factors to 'e B$ Thus B needs to 'e included in the gien regular e-pression$
/$ hich among the following loo?s similar to the gien e-pression) ((O#$ (O# I a 2-9 23#7 IJ- is all 'inary num'er with een length7 ' 2-9 23#7 J- is all 'inary num'er with een length7 c 2-9 23#7 IJ- is all 'inary num'er with odd length7 d 2-9 23#7 J- is all 'inary num'er with odd length7 *iew Answer Answer+ a ,-planation+ The gien regular e-pression corresponds to a language of 'inary strings which is of een length including a length of $
$ Pf represents a regular language3 which of the following represents the *enn0diagram most correctly)
a An Prregular 8et ' I c complement d reerse *iew Answer Answer+ ' ,-planation+ The gien diagram represents the >leene operation oer the egular Language in which the final states 'ecome the initial and the initial state 'ecomes final$
G$ The gien KFA corresponds to which of the following egular e-pressions)
a (O# I(O## (O# I ' (O# I(O## I(O# I c (O# I(O## (O# d (O# (O## (O# I *iew Answer Answer+ a ,-planation+ The transition states shown are the result of 'rea?ing down the gien regular e-pression in fragments$ For dot operation3 we change a state3 for union (plus operation3 we dierge into two transitions and for >leene peration3 we apply a loop$
$ Concatenation peration refers to which of the following set operations+ a nion ' Dot c >leene d Two of the options are correct *iew Answer Answer+ ' ,-planation+ Two operands are said to 'e performing Concatenation operation A_ 1 A_ 1 2-y+ & y ∈ _7$
N$ Concatenation of with outputs+ a ' c $ d Kone of the mentioned *iew Answer
∈
A
Answer+ ' ,-planation+ _y distri'utie property (egular e-pression identities3 we can proe the gien identity to 'e $
#$ I can 'e e-pressed in which of the forms+ a O ' 0 c O 0 d *iew Answer Answer+ a ,-planation+ I1O as O means the occurrence to 'e at least once$
Automata Theory Questions and Answers – DFA to egular ,-pressions This set of Automata Theory Multiple Choice Questions & Answers (MCQs focuses on !DFA to egular ,-pressions"$ #$ hich of the following is same as the gien DFA)
a (O#I#(O#I ' #I#(O#I c (#I(OO#(#I d Kone of these *iew Answer Answer+ a ,-planation+ There needs to 'e # together in the string as an essential su'string$ Thus3 the other components can 'e anything3 or # or e$
.$ hich of the following statements is not true) a ,ery language defined 'y any of the automata is also defined 'y a regular e-pression ' ,ery language defined 'y a regular e-pression can 'e represented using a DFA c ,ery language defined 'y a regular e-pression can 'e represented using KFA with e
moes d egular e-pression is ust another representation for any automata definition *iew Answer Answer+ ' ,-planation+ sing KFA with e moes3 we can represent all the regular e-pressions as an automata$ As regular e-pressions include e3 we need to use e moes$
<$ The total num'er of states re6uired to automate the gien regular e-pression (I(##I a < ' @ c / d *iew Answer Answer+ c ,-planation+
@$ hich of the gien regular e-pressions correspond to the automata shown)
a (##O#I ' (##O##I# c (##O##I d (#O##I# *iew Answer Answer+ c ,-planation+ There is no state change for union operation3 'ut has two different paths while for concatenation or dot operation3 we hae a state change for eery element of the string$
/$ Henerate a regular e-pression for the following pro'lem statement+ Eassword *alidation+ 8tring should 'e 0#/ characters long$ 8tring must contain a num'er3 an ppercase letter and a Lower case letter$ a ()1$I`a0S()1$I`A0^()1$Id$23#/7 ' ()1$I`a0S()1$I`A0^()1$Id$2N3#7 c ()1$`a0S()1$`A0^()1$d$23#/7 d Kone of the mentioned *iew Answer Answer+ a ,-planation+ Easswords li?e a'c#.<3 #.<R^3 should not 'e accepted $ Pf one also wants to include special characters as one of the constraint3 one can use the following regular e-pression+ ()1$I`a0S()1$I`A0^()1$Id()1$I`da0Sa0^$23#/7
$ Henerate a regular e-pression for the following pro'lem statement+ E(-+ 8tring of length or less for 123#7I a (#OOe ' (# c (#O(#O(#O(#O(#O(#O
d More than one of the mentioned is correct *iew Answer Answer+ a ,-planation+ As the input aria'les are under >leene peration3 we need to include e3thus option c is not correct3there'y option (a is the right answer$
G$ The minimum num'er of states re6uired in a DFA (along with a dumping state to chec? whether the
$ hich of the regular e-pressions corresponds to the gien pro'lem statement+ E(-+ ,-press the identifiers in C Erogramming language l1letters d1digits a (lOX(dOXI ' (lOdOXI c (lOX(lOdOXI d (XOd(lOdOXI *iew Answer Answer+ c ,-planation+ Pdentifiers in C Erogramming Language follows the following identifiers rule+ a The name of the identifier should not 'egin with a digit$
' Pt can only 'egin with a letter or a underscore$ c Pt can 'e of length # or more$
N$ Henerate a regular e-pression for the gien language+l L(-+ 2-j23#7IJ - ends with # nd does not contain a su'string #7 a (O#I ' (O#I# c (O#I(#O# d All of the mentioned *iew Answer Answer+ c ,-planation+ (a and (' are the general cases where we restrict the acceptance of a string witrh su'string 'ut we ignore the case where the string needs to end with # which ther'y3 does not allows the acceptance of e$
#$ The minimum num'er of transitions to pass to reach the final state as per the following regular e-pression is+ 2a3'7I2'aaa7 a @ ' / c d < *iew Answer Answer+ a ,-planation+