Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
45 views
14 pages
CS 2010 (Afl) - CS - End - May - 2023
Uploaded by
223UTKARSH TRIVEDI
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save CS 2010(AFL)-CS_END_MAY_2023 For Later
Download
Save
Save CS 2010(AFL)-CS_END_MAY_2023 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
45 views
14 pages
CS 2010 (Afl) - CS - End - May - 2023
Uploaded by
223UTKARSH TRIVEDI
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save CS 2010(AFL)-CS_END_MAY_2023 For Later
Carousel Previous
Carousel Next
Download
Save
Save CS 2010(AFL)-CS_END_MAY_2023 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 14
Search
Fullscreen
(a) Design a Context Free Grammar for the language L={a"b" : n> 1} Sa aSbb | alob (b) Check whether the following grammar is ambiguous or not: S — alabSblaAb A— bSjaAAb Bo bA Yo, the Gren gramman is ambia nous Booz, Sos the on ‘adoads pee Can goers mnere than donivation tus. Dareivebion trea -t Denivotiontree - 2 (c) Design a Context Free Grammar for the following language: L={w: w e{0, 1}* and w isa palindrome string} So rlo[s| oso tsi (d) Distiriguiah between CNF and GNF. CNe | Gne > A OFG is incNe tt W paddy [o A ce is in Gate Th ol ant of Yo Sonn, produhons one oh te tenn, ees Ax>art ~ a wher A,B,C EV and abet aeT and LEV ae TyCNF G@nF > The oo. & shops vequured 4 > The roa sles required +o derive a shiny of leno °° derive a sting af ange n ‘6 (an-\). es (Cn). (e) All linear grammars are not regular grammar but all regular grammars are linear. True or False, Justify. (ARvE) = B teaudan greens te ote, right \rrens o« \aPL Linea Ves almost one vanes at peans one RUS a produto, cod, resbackon on pasikion of He variable. > A Vinton Gromman if Oo ramon in hide amas one vad: abpeans on Ae RS & produdtios cto teshackon on positon of Hu variable. = Cran: a eee A 5 aBla (BAL yeoman: (f) State the Pumping Lemma for Regular Languages > Ws greener, ig & neon, Groeman. touk nok sequlay Lik \ be an valine cegder Lagange Ahan thane ews gone que integer gush eat ong stings OL with can be decomposed 247 w= aye wth \ry\ e & ond \y\ >t such thak [wis aye CL Soe old tz OnN2--(g) Design a finite automata for the following language: L = {w: w e{a, b}* and length of w is a multiple of four} aro L = {a°b4: p +q is even} (h) Find a regular expression for the following language: Cans (oye + alaay, webby (i) Star closure of every regular language is infinite. State True or False with justification. (FALSE) We Kaw, 4 w a sequler | . (j) What is Chomsky’s Language Hierarchy? =) ghan- closure Rg ig X which io Hod. 2. (a) Design a NFA for the following language and also find a regular expression for the same language: L = {w: w e{a, b}* and either w starts with “ab” or ends with “ab”} (4) O—© a Ding othy pekbe NEA Can be ateebled-RE ab(arky + (as¥y ob (b) Design Context Free Grammars for the following [2+2] languages: i) L={0P192": where p, q, r>=0 and q = p +r} ii) L= {0'Pi<=j +4} 2 S > AB A> oat\ > B+ 162\> “ Ss A\elosi & > dol 00 \o00| cov B> \\1¢6 3. (a) Design a DFA or NFA for the following languages: [4] i) L=L ((aatbb+ab+ba)'bb’aa‘(bb+aa)’) ii) L=L(ab‘a‘atba’b’b) U L((a+b) baba)(b) Convert the following grammar into Greibach Normal [4] Form: S— ABjaB A — aabli B= bbAla Eliminade -Predackon: Nutloble varieble = 7 Al | Ss rel elacla i G5 AGl ebalal aera’ RO oob Bo bbAl ali, Gne > aabt| beaab lal bblabbala A> ab B, bbalal be ay So aViVa Bl bal bu TAMMATS AD avy, Bo bv, Alal ov, Waa Vib4 @ Considering the set of strings on symbol {a, b}, construct a DFA for all string containing “aa” but not “aaa”. Then find out its corresponding regular expression. [2+2]OF fo © Rammove ay ——— tab Li . » fe a a (bl btab)aa) (n+ b( haha) ‘OsX% > 7) Racnove Ga* (b+ assy a a(vl bratfen) Ont b( ntah3a) ~~ © Ana tthe Ree can be pes - (b) Design an NFA which will accept all string generated [4] by the symbols present in your roll number. Convert the NEFA into its corresponding DFA. Fro ae$ Rah. SALosooil Sf 0)1;2,54 Nei DEA — —@) 01,26 @) 5) > —@ yee 7 CD 01, 1S OMUS OD ONUs5. (a) Consider a language, L= {ww : we {a, b}*}. Show that [4] L is not a Context Free Language, using Pumping Lemma. Soludion’. Consider the language L= (ww iw € {a, by’), Although this language appears to be very similar to the context-free language of Example 5.1, it is not context free. Take the string anya”. ‘There are many ways in which the adversary can now pick exy, but for all of them we have a winning countermove. For example, for the choice in Figure 8.2, we can use i = 0 to get a string of the form tba", k
=2 and q >=3}. €p ’ ~ a b b Ors Ssoror8 QL Ss aa — A> ab Bo aB\bC ~ An Robb —_ Dove E_> »\bec> Bb Bo=Balfhea A>Sa Sa 6. (a) Convert the following Context Free Grammar to Chomsky Normal Form. S— AABC A— aAbli B-aBla C= aBalbCh] A 65] Remove >— produdiony Nulbabe varide~ Larch S>nneclaec\ Anal e A> Nb \ale Bsar\e Cabal bcb\vb Romeve Urrk ~produudirnarr A> OAb \ale Bsop\a C>akal bcb\vb S>areclascl Are laslaCue. | S> Vivo \ Ave vie | ve8| A> VaAVul 2% 8 V38\ a C+ V26Va\ Wut Yu\ Vay, Wa AR Vi7 Be N3Z98& Vuse VU S> YW \ Aral WB | vB a As Yevu\o% 8 V3e\a C5 VeVay | Vavu\Vavy Wo AR V20 BO V3Z90& Vuoe Ve -> v3 Pr Vo Va vz Vad (b) Prove that Context Free Languages are closed under B) Concatenation operation. Let us assume two CFLs L, and L, with their corresponding grammars G, = (Vy, T,, Py, Sand G, = (V2, To, P2, S.) respectively such that V, NV. = Let L be the new language generated by concatenation of L, and L, with its. corresponding grammar G = {V, T, P, S). Thus L generates the L,L; language as S — 8,S, ("" Concatenation) Grammar for the L can be derived from L, and L2 as follows:: G= (Vy UV2U{S}, Ts U Ta, PiU Pa {S — S; S2}, S}. Lis a CFL as the new production S —- S, S, does not violate the rule of being context free.________________ Waa 7. (a) Construct a PDA or NPDA for the following language: [4] L={alblc’: where i=jori= k} a, e|Az (b) Construct a NPDA for the given CFG, G = ({S, M, N}, [4] {0,1}, S, P) where the production rules P are given below: S— MN10 M— 00MIN N-IM1 Remve Vat prodabivas® S2muilo M~> OvmM| iM N-> amb Gar. ~ SS 0M Yo S5 OV{MNV [6 M> Oom\im1 [7] Ms OME My ND IMI No IM, M20 N271p nye? 3) 22 Gi) Mo] ©) 8. rms, 0,S[> OM] WM VM] V2 AN) Ay oi] > M1> ‘a) Design a Turing machine for the following language: (5) ie ie L={c™"a"b": n,m >1}(b) Write the Instantaneous Descriptions (IDs) for the input By) string “cccaab” to the above designed TM. eeeeK Ay cccoa b- Kaye col, x Cacaak |- * Cc 4 Aah y x04, CY ab x Cc Kal [- Ka, ceN ab Se &xCC yab XK @ycc Yob F x xa,C Yak L xX ce Yolo \- xx CY a ob \— X¥¥ OMY XX 4% Ye bE Xa2%¥ CYYD bk ¥X4CYVS I X¥ X WY \e ¥¥ KP US K ¥KY FA Lxx%tYay2Ex ¥¥ a, YY We X¥¥UKYYZ LX GIS Lv XK Yat JE KX KY Ae LE XXX YYZ 428 Lb ¥RX* YY Z B48
You might also like
HW3 Solutions 2017 Spring
PDF
100% (1)
HW3 Solutions 2017 Spring
4 pages
HW4 Solutions 2016 Spring
PDF
No ratings yet
HW4 Solutions 2016 Spring
11 pages
(123doc) - Bai-Tap-Ngon-Ngu-Hinh-Thuc
PDF
No ratings yet
(123doc) - Bai-Tap-Ngon-Ngu-Hinh-Thuc
23 pages
ToC -Sheet 5-
PDF
No ratings yet
ToC -Sheet 5-
5 pages
Unit III Regular Grammar
PDF
No ratings yet
Unit III Regular Grammar
54 pages
REGULAR GRAMMARS
PDF
No ratings yet
REGULAR GRAMMARS
51 pages
Unit Iv Flat LM Cse
PDF
No ratings yet
Unit Iv Flat LM Cse
16 pages
Grammar
PDF
No ratings yet
Grammar
131 pages
FLAT-PC(CS-IT)407-2023-24
PDF
No ratings yet
FLAT-PC(CS-IT)407-2023-24
3 pages
FLAT Lords Paper
PDF
No ratings yet
FLAT Lords Paper
60 pages
TOC Question Bank - Unit - 1 - 2 - 3 - 4 - 2022
PDF
No ratings yet
TOC Question Bank - Unit - 1 - 2 - 3 - 4 - 2022
7 pages
Toc Class Test
PDF
No ratings yet
Toc Class Test
23 pages
Automata Theory QBank
PDF
No ratings yet
Automata Theory QBank
7 pages
ATC - Mod2 - RegularLanguageProperties (Autosaved)
PDF
No ratings yet
ATC - Mod2 - RegularLanguageProperties (Autosaved)
53 pages
Automata
PDF
No ratings yet
Automata
168 pages
11-18_TOC
PDF
No ratings yet
11-18_TOC
3 pages
Comments and Hints For 2009 Example Exams: Harald Hammarstr Om May 26, 2009
PDF
No ratings yet
Comments and Hints For 2009 Example Exams: Harald Hammarstr Om May 26, 2009
6 pages
2.LM
PDF
No ratings yet
2.LM
57 pages
Grammar
PDF
No ratings yet
Grammar
8 pages
Unit 3
PDF
No ratings yet
Unit 3
98 pages
Auto Chapter2 -1 (1)
PDF
No ratings yet
Auto Chapter2 -1 (1)
21 pages
18 Context-free Grammars
PDF
No ratings yet
18 Context-free Grammars
13 pages
tafal unit-2,3,4 theory important questions
PDF
No ratings yet
tafal unit-2,3,4 theory important questions
19 pages
Comp CFL 10
PDF
No ratings yet
Comp CFL 10
38 pages
Chomsky Hierarchy1 1
PDF
No ratings yet
Chomsky Hierarchy1 1
21 pages
9-Regular Grammar
PDF
No ratings yet
9-Regular Grammar
26 pages
TOC QBank
PDF
No ratings yet
TOC QBank
7 pages
TOC UNIT 3 Dbatu Book
PDF
No ratings yet
TOC UNIT 3 Dbatu Book
22 pages
Bca (CS-73)
PDF
No ratings yet
Bca (CS-73)
5 pages
TCS UT 1 QB
PDF
No ratings yet
TCS UT 1 QB
8 pages
Tutorial 4
PDF
No ratings yet
Tutorial 4
3 pages
Context - Free - Language
PDF
No ratings yet
Context - Free - Language
17 pages
CS 311 Final Notes
PDF
No ratings yet
CS 311 Final Notes
3 pages
BCS503 Model Question Paper 1
PDF
No ratings yet
BCS503 Model Question Paper 1
16 pages
Unit 3-FLAT
PDF
No ratings yet
Unit 3-FLAT
80 pages
2022 Afl End Regular Question
PDF
No ratings yet
2022 Afl End Regular Question
10 pages
CFG MCQ
PDF
100% (1)
CFG MCQ
7 pages
Flat Jul 2016
PDF
No ratings yet
Flat Jul 2016
2 pages
Lecture 7 - Context Free Grammars
PDF
No ratings yet
Lecture 7 - Context Free Grammars
59 pages
MITWPU - Unit 3-Theory of Computation
PDF
No ratings yet
MITWPU - Unit 3-Theory of Computation
72 pages
WINSEM2022-23_BCSE304L_TH_VL2022230502937_Reference_Material_II_12-01-2023_KEYS_for_TASKS
PDF
No ratings yet
WINSEM2022-23_BCSE304L_TH_VL2022230502937_Reference_Material_II_12-01-2023_KEYS_for_TASKS
4 pages
CST301-2021
PDF
No ratings yet
CST301-2021
3 pages
Assgn3 2011
PDF
No ratings yet
Assgn3 2011
2 pages
hw1
PDF
No ratings yet
hw1
3 pages
Solutions To Assignment 4: October 25, 2000
PDF
No ratings yet
Solutions To Assignment 4: October 25, 2000
4 pages
Normal Forms For Context Free Grammars
PDF
No ratings yet
Normal Forms For Context Free Grammars
43 pages
Lecture 2 - Chapter 1 (1.2)
PDF
No ratings yet
Lecture 2 - Chapter 1 (1.2)
32 pages
ATC Module 3
PDF
No ratings yet
ATC Module 3
38 pages
ATC Module 3
PDF
No ratings yet
ATC Module 3
40 pages
Question Bank
PDF
No ratings yet
Question Bank
10 pages
Dmbs U1
PDF
No ratings yet
Dmbs U1
12 pages
Normal Forms For Context Free Grammars
PDF
No ratings yet
Normal Forms For Context Free Grammars
43 pages
question
PDF
No ratings yet
question
13 pages
CS6503-THEORY OF COMPUTATION-1977516805-updated TOC
PDF
No ratings yet
CS6503-THEORY OF COMPUTATION-1977516805-updated TOC
10 pages
Unit 2 TOC ODL
PDF
No ratings yet
Unit 2 TOC ODL
42 pages
Assignment 4
PDF
No ratings yet
Assignment 4
6 pages