0% found this document useful (0 votes)
255 views56 pages

Ace - Toc PDF

Uploaded by

Ram Gorya
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
0% found this document useful (0 votes)
255 views56 pages

Ace - Toc PDF

Uploaded by

Ram Gorya
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
You are on page 1/ 56
OUR GATE 2011 TOPPERS (BELOW 10) ELECTRONICS & COMMUNICATION ENGINEERING SINO | STUDENT NAME ~_[_GATEHTNO | RANK ] (a SE ouas———| eer aS MANIKANTA ec sa07 ELECTRICAL & ELECTRONICS ENGINEERING [SNO [STUDENT NAME [GATERETNO— [RANK [1 TSADHU PAVAN KUMAR, EE 6052318, 2_| SRUTHIAJAY FE 7198146 4 COMPUTER SCIENCE ENGINEERING ‘SNO [STUDENT NAME GATEHTNO [RANK |__| SALKE SURENDRA SUBHASH | C3 2053505 = CIVIL ENGINEERING 'SNO_] STUDENT NAME [1 [YERRAMSHETTY SRINIVAS “AAKASHB. ‘GOOTEN CHINNA MUKUNDK | CF 1201298 ‘MECHANICAL ENGINEERING SNO | STUDENT NAME GATEHTNO | RANK [KAMAL KANT CHANDRAKAR’| ME 6107542 § INSTRUMENTATION ENGINEERING 'SNO [STUDENT NAME GATERTNO [RANK 1_[LEO MATHEW IN 7136208 5 2__[RAKESH CHANDRAMR | IN7074828[ 10, PRODUCTION ENGINEERING {SNO [STUDENT NAME GATEWINO_] RANK (a Tiay KUMAR PLIOAIS64 5 CONTENTS [| rope FINITE AUTOMATA | REGULAR EXPRESSIONS FA WITH OUTPUT REGULAR GRAMMARS ~| PROPOSITIONS OF REGULAR SETS | PUMPING LEMMA FOR REGULAR SET 7 [MINIIIZATION OF FA [8 [OBJECTIVE TYPE QUESTIONS [9] CONTEXT-FREE GRAMMAR - 40 | NORMAL FORMS ~ 11 | PUSHDOWN AUTOMATA ~ 72 [PDA ~ ~ 13 | NON CFLS : 14 | OBJECTIVE TYPE QUESTIONS [45 [TURING MACHINES: - _] 16 _| MODIFICATIONS OF TMS 47 | CONTEXT SENSITIVE LANGUAGES 18_[ LINEAR BOUNDED AUTOMATA 19 | UNDECIDABILITY __ 20__| CLOSURE PROPERTIES OF FORHAL LANGUAGES 21 | CLASSES P & NP 22__| SOME OF NP HAND PROBLEMS 23 | OBJECTIVE TYPE QUESTIONS ON CSL, TM, L__[upecipasiury ~ GATE - SYLLABUS ‘THEORY OF COMPUTATION —~—~S~S~CS& Formal Languages and Automata Theory: Regular languages and finite automata, Context free languages and Push-down automata, Recursively enumerable sets and Turing machines, Un-decicabilty, Analysis of Algorithms and Computational Complexity: ‘Asymptotic analysis (best, worst, average case) of time and space, Upper and ower bounds on the complexity of specific problems, NP:completeness. ACE ENGINEERING ACADEMY COMPUTER ENGG THEORY OF COMPUTATION TOPIC: "PRELIMINARIES" Approximate weightage of ach Reference Book: Formal bngsages wd automata tea by Pashdown ato, 1096 Chapers 4 Sand (Con 3) PACED PACED IC: “PRELIMINARIES” (OBJECTIVES) plone indrome (3a where i palindrome which ofthe folowing i coat 2nd Sarthe on {hei pide bat 2. Real te flowing [Teh ong dey iad a 2 Theat Ren eed) pe ano ‘hour of the same day of so ae 2, Thevltn yon pole sy fae rq were bom atthe ame only i pandq wee bom these hourof he elon 8)? 3 a he ely. lence relation but not 2 Al equi 6 Read the flowing the sate ) Any so se foun The sto te seis tert or oumsbly inf. ise ine, it coleton of combine sts coun allecton of ouatblyifte se hs gen ation oe mac c fgren an 2.2.0, 23,820.94 diammmticcena tte cn (omy w 9 aces 3,4 sass ansymmerie ein ent Le 2d 3d 4b Se 6d Take Oe Ine SUCCESS AND STRUGGLE HAVE LINEAR RELATION LACE Engineering Academy, 204, Rahman Plaza, Opp: Methdit School, Near Tf Mahal Hote, Fernandez Hospital Lane, Abi, Hyderabad} Phones : 040~ 24752469, 24750437 ‘Website : www.aceenggacademy.com mail: [email protected] ACE ENGINEERING ACADEMY COMPUTER ENGG THEORY OF COMPUTATION TOPIC: “FINITE AUTOMATA, REGULAR EXPRESSIONS & PROPERTIES 'F REGULAR SETS" (Syvopsi Li, Deterministic Finite Auomate: & Derive fste automaton is cereseted by a fc fo X00) ne ofthe states in Q 2 se hh Fe. 1.2, Extending transition funtion, ena er For Finite automata “ Asting "is suid to be accepted bya finite stomaton = ( fo some p in F. The language accepted by M, designated L in) 14 Examples: | Give DEA for aceptng the set of al strings contain = substing (Contd.21 Facer 2: Fiacert 2-Gine DEA lst being iho" when inept singe 8 mee stn dara ennai igri ke by Sand then reverse he direction ofeach arc keeping th 20, Non-Deterministic Finite Automat bolo string: rapping QX 2° to 2 and electing 2 Suppose symbol of wand xis theres of w. Also suppose that a, )= ( Then Sa, w) Bq.) and by then 12.2, Acceptance by NFA: An NFA a hes netstat, wl tn te chal (Cond..3) Cacert 3 ( Fface rt {face tt #: Facet Exampts: 4, sample: ne ttc an NEA rhe tf al Sting ove the alphabet {0.1} contining 111 as subing. Transition aagram: ert Qu 1 1 1 S66 where 4 symbol 3. Const NFA osu stings ove, 1} sch st same wo 0s eset by oflengh 4,120, Transtion Diagram: be described by some DEA, NPA, al ngs where theo yo rom ight ‘30. Construction of DEA from NEA (Sub Se LAN = (Qu2.dugaFid bea NEA, We hi Up)=UN)- rm start sate we can throw away these ase tats which are reachable fom staring tate states then Qo will ave ate be Of ses oF D may be Fi# 2. Thats, Fo is al sets of Ns states xp. a) 5 N gosto (Contd.3) Contd.) Facer t 5 Face rt Ee. “> Wemay repesentan e-NFA exaly as we do an NFA with ane exception B:QXZU(e }92" set ofall vertices psuch hat thee path from gto p 8 low only is ofthe fom xa, whee as thes symbol ofw. Note as @ member of Dl ‘cannot be e,hichigpat in. We emp 5,9) follows a) Let {p.p2_pu)be Bg, x). That, the p's are all ard only the states that we can each end with one or more transitions from q along ptt labeled followed by c-labeled ass in 1.Rgy €) = e-closure (gy = (44 Paco) second eh (u/8n mF 40). T Se ls on pg (Contd, 97° fface ft lent DPAD=(Qo, 5, dv Foi those set of states that contain alas one ace SISis in Qoand SF #4) in and sets Sin Qoby 1b) Compute U8 pya) s Letts set be 1.1 a) } Then 8(8,8) =U -closuret ist 44. Example: Consider the following. -NFA which accepts sings n which some v0 0's are separated bya sting of lng 21> 0 and eons DFA? (9 and D respectively. As D only sate of DFA. Facer Te Fface rt aston eo DFA 52, Preelne Of guar Exreion Operas 1. "Closures higher precedence than concatenation, 2. Concstnaion hs higher precedence than nin, the alphabet (0,1) with nope (Cond..8) Facere for union: fe Ta for union sty that we may take the union of two languages in ether “LAdemprent Law For Union: ake the union of two dental expressions, we can replace them by 6 =e ++ (Unary postfix operator? means 20 or one instance) 5S, Converting Regular Expression To Automata( e-NFA): respectively (Contd. Facet Letts ist. 44. Sate diagram for rye for) is fface rt Fface rh ab 124456 the symbols which ap Fllowpos(6)” 6 _srep $: Construct Dstates, the sof ites of DFA and Dian the ti the procedure given below, The states in Dttes reaulr expression the accepting sites areal hose gon A. only 2s associated with, so ay boen sen, we do bu we athe transition Dian, i. ‘ 19, Positions Vand 3 ae for =a n{B] = fllowpos(t) Cont.) fface rt 12: fface tt symbol IF e ake positional number fom we may conse so orene 3. Stat state = 4 Followpos()= ( Fellowpos§) 46 Followpos()= (6) > (1# > is aed om this word) 56 Fellowpas(6)= 2 5. Lethe start state (3,5) be A which comespond o end makers only in states Band C.So these ae final a vale c 2B slo oo. (Con13) Facer 3 Facet Transition Diagram: Introduce a ejection state "R” and make ll uns ie ‘Rand make all unspecified tansiions otha sate, The resulting ‘$8. Construction of regular expression fom ft automat: “Arden's theorem Le a Mad or tn regression of Pate atm estonia ‘representation using Arden’s theorem: “nr edges fom vty pression presentation an get the flowing set of 3) 4 Conseqae Qn te Qe and Arden’ theorem we can express interns of ns recognized by the automat, We have 10 tke Union of al eM face tt ftace tt 1 to reduce numberof unknowns by repeated subsitton. By subsitung sin ‘vege 6.0. Two way finite automata : {automat 2DFA) quintuple M=(Q, 5, a1F) Jeftone square. 1 (ga) = (i) the 2DFA ‘Astin is said to be accepted by a2DFA Same tie entering on accepting ie. (Contd. 13) Facet 15: Facer 18 finest of ouput alphabee 5:QxE > Figs Moor machine cl 72. Melay Machine: ‘AMelay machine Q of of input lphbet 2: fie set of ut 5:0xI9Q 1 OX 9 8 (9) gest oapu sil wi the ston fm ste gon input 4p: staring site InMelay machine op fon Example: M= (4 PoP. (Com..16) Facer 16 th ct an equivalent an Mela machine forthe following Moore machine Construction of Moore soot LaM= (0,24, 8,2.) beth given Mey machine and M! =(Q!,5, 8! Where ¢ fond 17 Face rt fface tt Face tt (Contd. (tacer 2 (ace 84, Consrucion of NFA froma lefelincar grammar Lef-inar grammar we will reves ll he right hand sis of th protons then we ea grammar fom which we will const €-NEA, To get e-NFA of given le chang intl, al sates and reverse the direction ofl the ees e-NFA forthe following i oO Facer 20: Facert 5, Construction of righ-lincar and et-lnear grammars from a gen Finite Automata ph linear grammar: "0" fom A 10 B add the led it add the nO" om B 1 C. Soa the production B-9OC As "is ina tate ion BO. mC 10C, Soa the produstions C-90C IC. As ‘C ina gra Le near grammar contain the po A> BOIAWAL,B> C00, C-> Co} Example? Fine right-tinear and lef-linar grammars forthe flloing finite Autom, t Aight near Grammar ‘A> OB/IDIOED C3 Bo,puro0. D> DoDI x and cightlnear grammars fr the following automata 04 BoA alco ee eomtd. 201 Sfacert ef linear grammer 49 BOIA solution: The gven regular ex Let 10=a.11= b. Now theregu [NEA for this regula expression 0 start f Right linear grammar AD ONEB,B> aBibBian AD eB an be writen as A 8 (sine €B=B) the resuking grammar i B28 / bab esto linear grammar: This an be obtain grammar: ‘Ths cn b ane by reversing all thre hand sides of the prod onset contains the follwing peuction. (inthis diagram A—> B Means, B canbe obsined fom A) ontd.22) facet 2 (racer 1.0, PROPERTIES OF REGULAR STES Closure Properties Of Regular Sets: 1. Regula sts re closed under uron,coestention and Klene closure 53 Regula sets are closed under intersection, That, also regular set. “ Proof 110112 ELI, As regular sts are closed under union and complementation Li, 2, TIO L2 and L1 © L2 are aio regular set, +4. Regular sets ae closed unde df L=M. Observe shut L-M=LM and 12 are regular sets then LI 02s Land Mae regular languages, then sos Fig (L—Mjor(Lo% — As regu ses are closed unde inrsection a complementation LM is also regular. Le L~Misalsoreguar 5. Regula sets are closed under string reves Theres only A scoops Ww 6 Regular Ses in ety 8° bea regular set dened by a) = Re Re Select regular expressions denoting Replace each occurence ofthe sybe regular expression for Ry, the language of al stings of hen Lis 7 Regular sls are closed under homomorphism and inverse homomorphism iain sing for each (con..23) rience of engi ess th vetengh where n <2 Tite auematon acceps sore eens m facet : i ‘thms For Regular Se ay eonuta ih nt rv = {abc} and de ca. Then mono mhaning the ngage ase tia ste” The DEA a= fon digg as 2636 ia) = tee Mb) = bs caocdcs denotes the regular language ML gute of Regia st Fas gos 0dr sv ite automata are uae -E trey accept same agua) = and La respectively (oT AE is aoept by by) = anand 1)= ab i Stet Mi and Ma be FA accent 2ne teeta Mo 8 eat Mace a word ian rfid wheter Lar Li Hence igh invriant elation reggie xyes id tobe EH respect ent ae eave “rep y sme aie aman, sere ofthe squalene Ho ivan equals on of 3 fan only i fora 202% an ea uber sot a Sno pe © ss cannot eac any Bia sate ks. ceca tore ye Tp DA NT se ses cin st ep setsare sed under lets. iF La sero L108 rea the diagram 28 HON below. seo regulars (eonid..29) Facet 2s mot eich a finals nothing canbe deleted fom icky Roto al shat a ot echo sting ste inecr ane st ofl ad fom tg Sg, reach final sedate ech fom star sale we ean emo der ‘esting DFA canbe redrawn, ‘thre Sal suet all te Ben DEA accept empty anguage Fiscon Hole Principle: eve put objects in have more than on em Pumping Lemma For Regular Sets , ete Lemme wes igen hole pincpe to show thi ceain Ianguages ae not regula. There sae thee foms of Punping Lemma, 4 Standard Form Of Pumping Lemma: Let'L' bean innit et rede MERE ess sme postive meget sch ht any 6 withle| 2mean be decomposed as with ei and 1 To paraphrase this, every ly long sting L canbe be at arbiacy number of rections a the mip iid sing is “pune, bence the tem pumping ae Hotes (igeon holes), and ifn my the ess one box must 2 = wy also Pain such way thestringin L. We ay chat (contd,.26) Flacerr Flacert 2. Weak Form Of Pumping Lemma: Suppose el} 68 ping (where n>, an lene) Rogar Language Yes 0 Sates Weak form yes | ae sy oF may not bea elt Duta language whi f I oof Pumping Lemma, 5. ieontsinsna's and ffacef a: fface tt 4 Prove or rove the egulrity ofthe language (www € *) ‘Sins vie ven lng esr, ois mt sy Sadar frm of Papi Lena eierc exists a DEA with states, Choose 2 shown below or cr att Len, Tanguase fe decompose the above string a 3y pamping Lemma uv c L> Ife pump ing the conditions ofthe (contd.28) re ETE rove or disprove the regularity ofthe language L= (2 Facet 8 Facet regular. SoT isreular and /n 20), which we already of pumping lemma, Hence “L? “Seltion; Suppose" regu, So tus sais we Progesion sors of subset of sings whose lent ae in Ai a Garay Sard 20r38 ‘Sotaion: Suppose te given language rau emma, Hence infinite subset of powers of deo =a21 astenghofvie tence the given languages ot el ‘Wegota contradict 4 rove o disprove ther “Soon: Lethe given language segue, Sot must seis Sater exists DFA with sts. thoose z=L as shown below maz) x form of Pumping Lena, 0. 900. 10090000, 9000 Wa 1s. Choose = 0. less than. As ings with oa ruber of ofthe language which coi As ela sets are closed under intersection, as ojn=tand= inthe rele. oot. 29) Pacer 29: 12 Proveor disprove the reulity ofthe anguge1.~ exw in Solution: Suppose! fface tt "1m 1) ise regular Define Hoon hi(a)=01, by (b)= 10 inverse homomorphinm. a6 n> Tshould Hence the ven languages nos regulr ot eg Solution: Let the given language is ‘emma for regularets Thee exis such that p> n Choose 2= Letiy=a: should satsly Strong form of Punping states accep ti language. Let phe a prime 22s shown below: ‘0000000000000000, a state pis distinguishable rm tae qi there exist a sting x such that ipa) isin F and 84.0 isn or vie versa. Otherwise thy are sid abe egivelonr 10d. Method: Sotuton: Constr table as shoe below an place an“ Safes that ean be equal we discover apie of| ‘an x" is paced in each | Facer 30 Facer ' toede te Naw ech pirofststes and ht trot aly known to edt ne coi epaisofstes =, ands 8) reach gt mb Isaen cans velo Sonn tbedinsistsity sig hn penta dstgushe ty era ait so aed ath ent (9) eens, he example, we pia inthe ety sinc teeny (6 faleady has ans (a entry receives an since he = (be) hasan x abedeT @ = (1, on input” bah ae going o same state So no string stating thlcan cry (bg) Asa) assoated with hg) place On each input symbol tats are St 1) = (and 0, 0-8 dese tate. Hence they at ot Js ‘Now the tbl is Ace rT 4,04,%6,0)- (6) 44,01,84,00= (60 (6d de, )= (62 place an >a), tb 0))= (glace an > GLO, Ae, > tC 0), 8 fom the above abi, the eile ‘The minimum tat fie (hI) (6 poe lace in and (3, ine 9. Facer hence d far not distinguishable oon fon (comid.32) | Face a0: 9.2, Method: Agri Inpute-\ OFAM. sansa Sand Oupat:-\ DFA imiving the umber of sate of DFA. i symbol state, An tasitons 1° fom by applying step 2) follows faOmb BaN=L HE.)-E A. Nee aO=— ad ae a ae ah Dee Fracerr 8a.0)b, 8a = Be=h He. oF BeO=2 de l=— Gy and gis ing into; So ican be doops into tw0 se, By applying step? onthe set Ge, 0n fb. 8 8.1) dee ® ging tog", tthe group Gyan on “1° the group Gence Gy canbe decomposed as on-1" tte group (0 they canoe be (contd..34) 3 Fincert THEORY OF COMPUTATION ‘OBJECTIVE TYPE vESTIONS FINITE AUTOMATA, REGULAR EXPRESSIONS & PROPERTIES OF REGULARSETS 1. The word forma” informal languages means 2) The symbols used have welldfined meaning re unecessary, in ali ©) Onl the form ofthe sing of symbols None of the above 2.LetR be a nonempty relation on collection of sets defined by AR B(A Relates to 8) and only ifA.- B =© then pick he tre statement z eniticam, (GATE ~1998) gas (Gare -2003) bn 20} U ae 3 as a9 12, Whatarethe mnjgum numberof sates inte NFA aeceptng the language (aby abe}*? as an a2 loom. Facer 13 Conside tbe NFA M shown below tN sates, the maximum number of states in an equivalent 38 Face tt (care -2003) . (GATE ~2001) on aw (GATE 1998) ons ae equivalent which of wo 2 (eis the emply (GATE 1996) GATE ~ 1998) fface lt 36: (facet 24, Let's! and “Tbe languages over = a) represented by the regular expression a+ b*)* and(a+byt (GATE -2000) a)ScT bres QS=T asnT =e (GATE -2003) 28. The regular expression * (@none ofthe above language described bythe regular on on pesgny +r (2a)%(e #a)=ata, 4) Lat Sand Tbe thre languages and assume Sit+ T wecancorlode that R= S*T and from the premise R= S*T w RoSR+T 32, Choos he nconet statement, 8) Moor and Melay machines ae FSM 's with ouput api. 1) Any given Moore machine hasan equivalent Mela machine. ©) Any given Melay machine has an equivalent Moore mains. 4) Moore machine is nea FSM. ood Hh Facer a: Face rt 58. The majo difrene between a Moore and Mel 8) The ouput ofthe former depends onthe pest sate an reson inp, ©) The ouput ofthe rormer depends ony onthe presents pends only on he eset int, ‘4. An FSM wit ouput capability can be sed toa ew give sieges in binary representation. This i May be true None ofthe above, te state machine with te flowing state le has single input x and single cup 2 38 (Gare 199 36 The nie stat machine dese bythe Following stat digra with Assan ate here an ar label is and x stands for I-bt int andy stands for 2b oupus (care-20m 4) outputs the sum of the resort previous its fie np )outpas OF whenever input sequence contas «) opts 0 whenever input sequence conti 10 none ofthe above 57. Let(Me}'mean Which ofthe above machines have idenity property 2) ) only sabAS abbas > asthas (Cont..13) fface ff. 45, fface tt ‘SIMPLIFICATION OF CONTEXT-FREE GRAMMARS ut reducing the be generated by @ fe and Each eminal of G appears inthe derivation of sme word in L 2. There are no productions ofthe form A> B where A and Bare vate, Further notin L, we can equi where A,B, and C ate could make every prodeet (possibly empty), Elininaion of useless symbols LetG=(V.1.PS) bea grammar. A symbol Xis useful ifthe i derivations $5 axpt ise X is useless. There ar two specs cane dvd (AS Beans B can be derived fom A afer zero or more numberof intermedi can fev nd an equiva CFG oceach Ain V' thee s some w in T for which A&> VTP.) sich venat ‘Given CEO @=(v,1, su ha for each Xin V! ) we can effectively find an equivalent CFG G!" ther exits and in (V"! ‘Procedure for eliminating useless symbols Let G~ (VT, P, be given CEG then by Applying Lem oLpy:=2% NEWV:= (4/49 w forsome win); while OLDV # NEW do begin OLby:=Newy; NEWV:=OLDVU (AJA > a forsome.in (TU OLDV)* hen ad al vibes of oT! ‘Note: EVERY NONEMPTY CFL IS GENERATED BY 4 CRG wart No UseLEss sy¥DOL (Contd. 46) (aceft 46 facet ‘Examples: [Consider be following grammar and eliminate wees ymbos $3 ABICA Ads BS BC/AB C3 aB/b. Solution: Finding V',P* LDV :=4, NEW:={A.C) OLDV +NEWY, OLDV:= (A.C) NEWV:={A,C} U{S}_(°Therighthand side ofS > CAis in TUOLDYy) tion whos ight han side isin (T UOLDY)*) 2 Consider the fllowing CFG and eliinat sles symbols SP ABAD AB IKBIGEDS ing Vand Pin owy:=0 NEWV:=(4,8,6) “The ight bad sie ofS AB sin (TU OLDV}*). NEWV =(A, BS, E}L © ("no proton islet whose righthand side is TUOLDV), ‘Now P! consists of ely productions whose symbols rin VI UT. y contain only starsat ie, S and 2 wi a0 AB). AS APBD badda bw eso strings can be added. vlgamawst the set of productions of P containing only symbols of VOT" Ge symbol Abad) ies SOAB AD BSD. (Com..47) (facet aM ftacet izting productions: Productions of te jormA ear called production Sure if sin LG), we cant nina alle prods fom bt fis mt LC), tas ot that we cu The method determine for exch varie 4 beter A fsa, we cll A lle, We may replace each production B 23) Xy wy Bal productions fred sriing ot some subse of thse X's tat ar null, ba we dn’ nce B > een fall Nisare mila UG fora CPG G with 99 Algortim for fading nalale symbol of CFG: AD esa produc WGisa: ae ‘can find an equivalent CFG G! without nullable productions except $ > € ho eisin UG: 8-9 ets te ractn seth es ae geo any other production, “ 7 Ein Of tt Proactions: Polite ote fm A Bar cl nt poo. procs Who ip hn sb cons fag le CFO with no « productions has unit prodcton AB o ifthe prodoctons leading rom A 108, suchas ASX 2% >. 9B, Xs re some non-terminals, we then nde new productions ac rule the nn-anit product Baw B> a/as/a;, sme forall such puts of A's an B's simultancously. We ean i ile Every CFL witout cis defn bya grammar with no weles symbols, - productions ot prodotons es: irate €- productions fom the following CRG SOX XO aK OX Te XD aKybxJa/b 2 Bliminatec-prductons rom the fallow pote the following CRG X32 ySow 2348 woz AD aA bare B> Ba/ Bb ie Contd. 48) of production is ‘Now the S3XY XP Zb/b yo bw/b ZPABIAIB woz AD adla/bA > Ba/a/Bb/b 5. Eliminate unit productions fom the following CFG. S3 Arb» ADBIb BOS/a proton and seen of uit pct ae Son S438 Aas A3aos 83s B3s4 Nov S9A__ ges $96 S338 the 53s 3a As AB bos gre Adbb a38 a5th B>S9A the 9b Tener CF fr iene $3 a/b IRA 21D a/b/bb rons fect fi he ong CF The list of unit reductions and sequence of uit produtions ae BSc B>C2D B3CSD3E ches BOs cop CSD9E — givsC 38 BiesD >a Facet ” Hacer NogMAaL. FORMS ‘Cuonsky Nowa FoRM ‘Any CFL without is generated bya grammar in which al product ate ofthe form A> BC productions SOBA dfn an equivalent ranma in CNP. Solutions: ‘The only productions already in prope form are A-3 aad B > 8 ‘There are no unit productions, s0 we may begin by replacing terminals on he ight by except in the ease of productions A aand B-> 8 by 8 > CyA.and C, 9 b. laced by AD CSand > ‘A DAAIs replaced by AD GAA $9 isreplaed by $3 8 BBS isreplsced by B> GS, B> aBB isrepacedby B> CBB, Inthe next stage ‘A GAA is eplaced by A> CD and D> AA B> C,BBis replaced by B C,Dz and D; > BB. production tobe a production with var CFG. Let A> a Bay Beproductions. Let G 1B, be thee formed by ang the variable B10 V and placing DASH BG A> pp Sisiss BI aps sist Then L(G) = Li ‘By applying Lemmal and Lemma; we can consret GNF ane fee CFL. facet 50: Fiacert jegranmar$-> AB, AS RS/b B->SA/a into ONF. Aas [Now the gramaris Ay AAs Aa Ardy /b As? ArAal Replace all he productions whose righthand side are numbered with lower num than the Ie Inthe above productions Ay > A.A isthe oly such production, ten be replaced with As athe [Nov thi canbe rplaced with As 9 AGALAsAs/ bAsAS ‘Now grammar Ay Aahidshs! bake! Byapohving lemmas BO AVAL BO AAD "Now B productions canbe replced with A productions as shown below Bo AsAaAsA /ArksAs |As~ productions ean be replaced as show 7 DAAIBAY 2B BD BAABA,ASAsAD/ DAs of production are Rename the variables 2 Replave the produetions whose ight hand sie starts with ower nirbere varie than the eft hand side ‘ambiguous CEL. L=(ahbtetat/n 21,21) Ue ted /nz mz 1) (Cond...5) ffacert SL ffacett “Pam operator grammar ia CEG with o- productions suck that no consecatesybls nits ofetctns reverie > Brery CEL witout € hasan operator grammar fall productions ofa CEG are ofthe frm wor Aw, then L(G) is areulr set ‘Where aterm sing PUSHDOWN AUTOMATA “ToacceptL, we shall make we place blu, green nd ed pl Net set an be chy pty kb some PDA ican be rp by ata ‘some other PDA and vice versa . ira (Com... 52) fface tt 252: Fface tt Definition of PDA: Mis asgstem (0,5 I, 8 gn 29 F, where input alphabet, stack alphabet, = ‘ rapping from Qx (EU {e}) xT to finite subsets of Q x1" eninstant we define an instantaneous ere gis ss, wasting of ipat ) fe wpa) Tats ores ae Janda. Kinny [5K We K if IDL can become K after exactly iw IM iM moves Th vert oped fom | ol wher Uuersood. MIM IM can define L(t language accepted bya PDA M=(Q, ZI, 6 4 z» F) final ste, to be, fo (qn ts) ( €Y for some pin F and 7 Mefine NM), he language accepedb) empty stack (or nll tack 10 Bef Jn), When aceptance is by eps tach, he set of final st tre nual let the set of fnal states be the emp) St ‘Dereguavisric PDA's Weusel + fopthe reflexive and tra IM DAMis + (pe e)forsomep relevant, and ntl case, detente 2) nonempty, then (2s emp forall 8 ink; . 2-forno qin Q,ZinF and ain BU {6} does (Not: For frte automat, the deterministic and non-dtemi respect tothe languages ecceied. The same fs ot re for PDAs, DPDAS ace contin more than oe element.” nodels were equivalent with iy subset of languages accepted NPDASs. Tht NPDA is more powerful than DEDA, PUY is a CFL, then thre exists a PDA, M hat accepts Le Examples. 1. Givea PDA forthe language L= (wen! /w «(a+0)'} Contd. $3) Facer ffacert yo snd sab ontop of stack so then rein in sae ga (B—blank space) at sill we hae o reach the middle of the ting that Weare reading the fst symbol ofthe second al ofthe input = (9,29), 840 3)=(45 ©), Fface ff Ss fface rt 4. Give PDA forthe st ofall strings with an equal number fs and Solon: ‘This PDF works s fll: Instat qy on input ‘a when top stack is no push x. On input b when top of stack is 2 0r9 shy. On input a when op of stuck is pop . On input b when ap of stacks x pop x fon input when op of stack i 2 go final ste by removing 2. 5. Give PDA for fae! i# jor) solution: Stat in qn and Sas the bottom of sack when you see on np ‘top of stack i S push SBor Bont stck.on inp” when top of stk is B pop . (Contd.59) oe facet indraes over (9,5) toon" /w «(a+0)4} Ufabw*/w 6(a +8). Sasa, . Solution The gamma satis S355 This grammars le recursive because ofthe production S > SS, So we fist eliminate left linia mediate let recursion Wthere are productions of the form A Ady /Ads ou. A@ty/ Bs! Ba)! Bo Where ‘Aisa variable, f= (V UT)* and no fi begns with an A. Then, we replace the productions by introducing AD BAT BA Je! BoA! A Da Al aA / ig lef cision te above grammar we will ge the following productions 29 8zle te flloming produtions VIZ, 29 (S221 (22 (Cont. 56) Facet “The modified grammars aAIB 2 (6 O) that Solution: The grammar for the given set ‘The language L=f www: The CEG fork is ‘AD aAa/aAb/bAa/ bAb, Ada ftace lt 9 (tacet et ftace( eae ton oF CFG FROME FDA wit sHFY SIAC ae -with empty stack then there exist a AUTOMATA, PDA with empty eat . APDA PX(Q,5, [,8,qa.2o, F) to be deterministic, if and only if the following conditions, are met: Veo of (249192548 8 4 Saar 1. gaan) has el most one member for ny qin ain S, or a= and xin. ; o{qa.x) is nonemp tom ak! $2 fayzaa) orewnas@ 2. 18teax) " Fule2: Exh move sing pushdown symbol gery Example: fnew" in prodivionta, Aa akon acersinga pas dom yb Important Points ize L is accepted by some DPDA with empty stack if and only if L has the prefix propery if there ae no two diferent stings x and yin L ‘accepted by some DPDA by fn state ropulr lagu The languages accepted by DPDA': All the epular language are accepted (by final stat) by DPDA’s Tanguaes accepted by DPDAS. The DPDA langunges are context fe fac are languages tat have unambiguous CFO's, The DPDA languages ete the regular languages and the cone '5, Deteministie CFLs are closed under complement, inverse homom inersection with regular sts and regular diference (CFL ~ regula). “6Detemnnistie CFLs ae closed under union oncatenaton, Kleene closer, homomorphism and intersocion rovers oF Cowrext Free LaNousces Closure properties of conte fre languages. 1. Contex fee languages are closed under anion nln of two CFL's is ain a CFL. {Let Lb palindrome. CG for cam be writen as $9 a8a/BS/a/b/ © Let Labo (dB CFG fr Lycon be ‘Then CRG for Ly Ua canbe writen as 53. Si) PaSia/BSb/a/b/€ $9 a80/BSb/a/b/ € Let Lybe (0 Bf and CFG; be SPaSh/e ‘Then CFC for LL con be writen as SPSS: S, PaSia/BSb/a/b/€ Dash wont. 58) (Contd. $9) Cacery 3 Face ft 5: Cnr guages re cosed der Kien ase ef Liba CPL he Disco CFL Ex. ‘21 be the palindrome and CPG be Si 2 aS0/b5b/a/b/ © Then one posible CFG for paldrome* i S358/6 $1 PaSa/bS0/0/6/ € + Comes opus are lsd ane substi. SCHL afr thobeo CF lr Lb tor ech Ly be LiG), ie that he variables of G and the G's ae doin. Construct a grammar Gas 5 praductons of eG, forme ings poco d 9 af Can bs ‘ach insane ofa in appearing in Besa eth self ors ian equal mun fs and Ly = (0/21 ob For Gwe may chose §> S06 /b808/ For GtaheS, 308,101, substitution fa) = Ly amd (8) = Ls Then ft) is generated by the grammar SSS / S88 / € as S3ic/atare 5: CFL ae ed one honomrphin 4 ‘the hotmomarphism. A omc i oa > The PDA 0 accept te imersehomomorphion of wha a given PDA aces nputa z Accept / Reject re he yea in his gra ish after input is read, Ma) sambols of (a) are used ane ata time and edo the PDA Bei the constrcted PDA read anther ofits input (Cotd.€0) Cface ff 60 I face ff 1 sa CRLan Ror lig ten ECP, Foor alsa Psa sow Bb i oa se Re Wi tack 8 lisa CFL's and Riso regular language ten 1L- Risa contd fe language > L-R=LOR Ris regula ‘Then L- Ris aCFL. “Lea cPLten LE Reversal of) sa CF, aeaeofeach pradetion in P.That 8, fA 9 aia praditin of ten 43 Biba peton of an easy dation on the eg of erst in Gand Go Ssow that 1G = LP Bently al de semen forms of Gare reverse of sented forms of Gand vice ves. 10, CFL's are closed under INIT op > INIP (L) = for some Ly’ and Ly are 60 CFLS then sed der ersetion. May CFG ilar anguges re contest The intersection of 0 regal anaes i regular therefore 7 and Lar repur and coment fe, then Ly bai both regula comext free ‘May not CPG. Lely B22 Fwhere mm 12.3 23 a mayor may wot CEL That is C's ave not (Cond. 61) Facet 613 Faces ‘Be: Consider the following grammar nd find whether they generate empty itor BO BC/AB Ada CO aBsb (On ciminaing useless symbols we gt fllowing productions S>cA Ads cob Aster re no = productions ono unit produto AS grammar doesn't vanish the given grammar dest generate empty langage. 21 Now draw the graph as shown blow Asthis graph doesnot contain cyl th given ganar generates finite langue. 2 s3aB AD BCI BS Corb cos “The reduced gram for this pammaris SAB ADBC/a shown below shownbow As his graph contain eyles the given grammar eres infin language (Coud..02) | fface ft 6s flacert ‘Now-Covrexr-Feee Luvovaces “Gin CNP. Let eal te prodeton ofthe form jn ofa word ina given CFG, enontrminal said tobe ur a8 ree desenden ofl. Example for points: ‘Consider the grammar S.AZZ> BBB ZAA>aB>b awe produced with the derivation of abba, we find SoAZ s. » Inthis igure “2 is selembeded 4. Conse the CFG for NON NULL PALINDROME in CNF: SAX, S36, -XPSA SPAR S3BY, S388, YSsp Ads Intis igure (acer 6 (acer epee he same sequen of padutions X. The seco can enue teh exactly athe ind X, we cou proceed oa fal CFL. Then there y wat in Land wemark ay nor more postions ez io Zurn) sch hat Laviexyl = ul ila hea we phen anh progreson (Comt.69 ffacet 64 Fface tt ere context so it mus sty standard form of puning emma. of pumping ena, then uy (the string uv’ with {= 0 as ‘Thus uwy is not ofthe form be! But by 2. Show tat he language L= fw € fa, Solution: Lette given language is comet: fy standard form of pumping lenin ge flows Le 5 1 Sorte given languages not conten fe, 3-Check whether the language (31 Jj~i?)is ontetfiee orn? Solution: Define homomorphism hon the given language 2 follows aye ust satsy weak frm of pumping ings hse ents are in arithmetic progression. i, contacto, Hence from weak form of pumping lemma we can tage h(L) isnot eae fc, 2 are closed under homomorphism we can sey language also not context fee (Conid..65) fface lt Facert 6s ul, Sot mst satisfy weak form of purping ema ine primes are kl then itbecomes tQd=+ (hich snot prime) “asthe series conttning nn prime nue we ean sty that the given language at ‘one fee, Mewmensuie Aucorrtist FOR CONTEXT FREE GRAMMARS. at we havea grammar G =(V.T, §, Pin ehomsky normal frm snd 1s y= aj an subsets of V Wi Vie “an be ompated for all 1 bibs BB, that have odd number ofa's aod numberof b's fface ff be proves. 29.Theset (2B n= 1,23, eam be generated bythe CFG )8 9 ab/a8b 1) 89 aasbb 8 ab/a8b/e 4) 2286 ab /sabb 30, Choose the corret statements 31. Which of he following CFG's can’t be simulted by an FSM? Sia )vnion lent cJeamplementaion product. 33. The set A= (a 9) regular 2,3, 00) fSanexample ofa grammar thats ec) not context fre «None of the ove next flee but whose complement is nt CF 36. The intersection ofa CFI. and eg ot be regular not be context ee separ always CFL ary memory thas 2 ) None ofthe above 38. Choose the coreet statements 4) The power of DFSM and NDFSM are same ') The power of DFSM and NDPSM ae diferent ©) The power of DPDM and NDPDM are different {1 The mer af DPM and RENAL Wont 708 fface tt €) Stings ending wih aparicular alphabet 4) None of te akove 42. Consider the fellowing,CFG:G define by prodetons 5 3 aSbs /bsaS fe Ciacert drei 8) alte abve ae cnet seme ditfernee(DCFL Regular) ‘context foe | = (2b, e}iscontent free Facer ma, complement, inverse homomorphis, concatenation, Kleene closure, homomorphism ot en 1} are not CFL's but Li and Ly are CFL's (Cont...72) Pacer n: Cracert 58, Choose the incoret statement )LetG =(V,T,§,P) bea content te grammar such that every oe ofits productions sof ‘the form A> V, with b= k> LT derivation ee fr any w © L(G) asa high such under ifeence bt eased under regular diferent regular then L ~ Lis context fre he lngugge generated by some content fee lng ess than some gven number n. be regula. Then there exist an algort o common element. ine whether or TURING MACHINES ‘ead that can trael right or left onthe ape a tha can read and wrt a single symbol om each A diagram giving an inttive visualization ofa Turing Machine a fa [| a [fafa | Fine cao (Cont..23) (facet a ftacert Definition: inal states, ‘We denote instananeousdesrption state of M, oid ih side of (2 is longer than the sro the ist by one move. IF font some abe of the following examples = Lor), (a BIQB,S) S means stay ther insta ‘of moving lf or ie) omt...76) Facer gh mos UE however when setching Hlerchagings toa, M 2. Mulitape—TM: IF language Lis ace Machine ied by Sig Two way infiate T.9 scoped by ingl- tape uring mach Finite contol TT TTTTTT Facer 1 Face rt ing machine My then Lis accepted by some a ional TM the pe consists of K~ dimensional turing machine M, then tracks ‘An of-fne TM sa multtape TM whose input tape i read-only. Usually we sucound the ‘nd markers, x the lft a $ onthe right T betwoon © a ‘TM M by using one i copy its own input om the extatpe. and rdd any language accepting power and all ‘these are equivalent tothe Basie model. POST MACHINE: ‘A post machine, denoted PM, ion of ive things: storage location (apace where ting of symbol which nally comtains te inputstring. We allow for aractes not in canbe used inthe STORE, characters from an apa called the tore alphabet fface rt 6 3. Read sates, for example which remow ‘haracer rom the STORE and rae 4. ADD sates 4 ffacett ‘ADD t Which coneateaate characte ont From PDA pushes states. No branching cn tke ps {MADD state forever eter in Band 5. A start tte (anenterable) and some ha We could also define a Nondeermiitc post machin, N ‘han on edge wih the same abe! to come from a READ PM, Examples 1. Design a post machine forthe language 3°" 20} ight end ofthe sting in the STORE, This isnt is would allow for more woos) {aw We have no drawn the edges tht ead p RENECT states, bt instead weallow the patho «rash in the READ state i there smo ph TnREADy, we check tothe we foritto go accepted. Ith tring: READis thats the ip from READ; to READ, loop at READ: pus the rest of th a's rom th front v sed inthe wip fom READ; 1 of the front and appended on rip back from REAI ‘must hae ben orginally of the orn READ}, terest ofthe ist ec w ADD: Facet 7 Facet 2, Design a post machine or accepting the language (0b) “Any language that cn be accepted by a PM can be accepted by some TM. “Any language that cn be accepted bya TM ean be acepted by some PM. ke a PDA except that it has to push down to push a characte x into a sack, We have to PUSH, x or PUSH x. When we POP a STACK forthe purpose of ‘STACK, citer POP; ot POPs (Read characte frm read-only Accept and Reject are same asin he PostMachine. Wom facet 8: Facet “b’ into STACKa, When we are done, we check to ‘whole inal input sting was ofthe form ae" Any language accepted by @ 2PDA can be accepted by some TM and any language ‘acepted by a TM can be a accepted by some 2PDA, Any language accepted by a PDA with n stacks (where nis 2 oF more) called an ‘PDA, ean also be accepted by some TM. In power we have nPDA = recursively enumerable language is aceped by athe counter machine (we can imulte wo tacks by 3-counters only. 2.Every reeusveyenumerable language i seeped by atwo-counter machine (ve an simulate the counters with two courte only) 2 very recursively enumerble language is accepted bya 3~ pebble machine. (3 ~ pebble are suet o silat two counter). AH LEUELL SPeooues (Conid..79) Facer 2 Facet Sronace name State: We can use the 6 machine, representa postion inthe “program” ofthe tring ‘The etniquerequizes no extension tothe TM mode asa tpl, hand hoping to 5) A dat portion, which remembers the ist shnbol sen, which must be Oo The symbol B inthe component means that no symbol hasbeen read Example The transition function Bf above TM as follows 1 a Portion ofthe state eB. The symbol scene state, and M moves righ, entering contol state ally, qs the contol stat, andthe dat into the seeond component ofthe 2 ) where isthe “complement” of, that is, Of tan Vita = erent rom the ne ith stored init 'M reaches he fist bank, it eters the fe Second occurrence ofthe symbol sored entered the accepting iat. for a= 0 ora 1. Thus ifM encounters a without having to think of the tape of turing machine as composed of se Each track can hold one symbol, and tape alphabet of the TM consis of component foreach “rack”. Like the technique of storage inthe finite eon, tracks doesnot extend what the TM can do, (iace tr 0 ‘Acommon use of multiple tks is tet one tack h holging a Flacert the data and a second tacks eptnack of small number of (Cond.:31) fface ff {facet Bye] 8) sfale tf of cl{rfofe ar | sate B_| store “Afr frst move eB] Bea] e t]o] cfrfofe a 1_| store Affe second move By) By eye] if ol clifo]s B] ayayeye rfof cfr fof | sue (Conid...82) facet Aner fourth move: WY sate B_| store Afr fit mare i} ef clilo © | sate B | store Afr sith move [Te] sy |e frfo] elifo | state B_| store Afr seventh move Pye] eye tfol clrfo a B CTacet Womd. 8 Facer New f E Cl fface tt t Ef : . “T+ - FB I Hl I ; ; rary “TB ft i : (Cont...89) Facert oo Facer The fea move i Pls ‘As TM entered {qu B] which sina state hats en, where w € (0+ 1) ven ipa s inthe form 3. Design a Turing Machine M which do prope subtraction. Proper subtraction s defied ote smn form 20, and zero for m B, 2B aa laa, \Weean see how his works by looking ata 52 athe aac abbee 2 sBbbec PaaAbbee aabAboe 3 sbbAce > aabbBbece P abbdece > aabbbcce 3 snbbboee he sltion f efor te A and Bs meses An scree o hee lero sige Hite enter band Iden sens he nena iri eat the oregon the process ey sn wr Se ‘ight regram ataring machin wasp the ongenge ” “ Some amples of ontet-castive languages angus ae closed under ie Following o Lion Smsteton Panes ‘clits homamarptism 5. Inverse homomoephi = 9. Reversl ‘oe CSs ae close nde compensation tian op question, (Cont...88) Facer 88 Facer language and w is string we can find whether W e Lot not bership algorithm for context sense languages, id to bein hurods formal form if each of its prions forms A > s, AB, A> BC, AB CD. Where ‘We varibls. Every CSL. can be generate by « gram bounded automat (LBA) is a non deterministic turing machine sti alphabet includes two special syn respectively 2. The LBA hs no moves let rm. or ight fom 8, nor bounded automaton 4 turing machine which, iead of having po on which ‘ested 1 the portion ofthe tae con the 040 tape gua eu Restting the wing ou length ofthe inp wou the tring machine tothe potion ofthe ape aumatn” F), where (Q, 3,8, ac, $B, where ‘TM; and Sére symbols in 3 the let ane ight tn 5 seq in} ii 1 Yh eect then bac ome LBA 3. IEL~ (0 for LBA M~ (0, 3 1,8 qo 8, F then Lesa SL. 3. Bvery CSL is reeursve but converse not rue > Astin is accepted LBA if thee is aps ce oF moves, aetsHeaqas for some gr Fy ay as € T°. The language accepted by the LBA isthe’ sich accepted Hierarchy of formal languages (Chomsky Hierarchy) 4. Unrestricted grammars (or Typed of gamma) ‘AganmarG= Prodoctons are of the form I doesnot appear on the ight hand sie of any grammars (Type? gran A grummar G= (V.T.PS) is ait be ont >a Where A.© Vand a.¢ (VUTY. ~ fie ill production in Pte form (Contd.89) Ffacert » Facet cammars (ot Typed grammar) Reig ca rammar consists of prucios ofthe fom A> xB, A > x where ABeV and cA et near grammar consists of productions ofthe form A> Bx, A > x where ABeVandx eT* “TYPES OR Regular grammar estes amma TYPE 3cTYPEDCTYPEI c TYPEO Undesidaity Recursive Languace ‘Mianguage Lover alpbe Ziscalledecrsiv if theresa TMT tat cepts every worn and jets every word in sively enumerable there ig 2TM T that aceps Tr ever woe in the language Lhe complement of (Comd...90) Fface tt 0: Fface tf ‘We construct language Ly by using the diagonal ens of the able to dteminemembessip in “is ecrivelyenumerable but no recursive Relationship between recursive, recursively enumerable and non rou Totrecavely numero Facet Tye is recursively enumerabe Wersve only to ibita TM that scp oe essed fface rt Com. 925 fface lt 292 fface ft ow saps spi Ang Ls. Th we est an tn for Lys show (mw), Mt I B A >< Fig: Algorithm constrted for Ly assuming that lgrit A fr Lexis As ais RE dosn't have algorithm. Thu Lis not recursive I Le were ecursiv,L,would also. ‘Ts Leite but not recursive FL wee ce. then Land Loe would be recursive. They Leis aot (MD) isnot recursive} recursively enumerable, _ Proof! Suppoas Le were re then we could construct a TM TFL which we know doesnt exist be aM accepting We may construct an algorithm A tat takes a input and produces &s »m™ MM! hich B must proce is shown in fig (end TM 0 accept and Mai shown in Fig ‘The TM of Fig () acopts iff Li “TM accep iff Mv the assumption that My exis recursively enumersbe Rice theorem for recursive index sets: pet aceptd by a Turing machine serpy, ecu, ‘an even number of sings, of sises many or predicates, Does a TM M's seorem : Any nontivil propery & ofthe re languages is undecidabe able index sets: ore complicated sal show that Lisi nl ising. hen there i nite subset 176 does not have the containment propery then Ls not san infinite language L sch that 9 finite subset of Lis inten nat re hen the ist of binacycodes forthe iit ets in (Contd.94) Facer one itt Gand LL! forsome re, L! then LI in. test in, then thee is some nie subset of that isin -MPCP canbe red no PCP. Both PCP, MPCP are undeidabe over the input alphabe fface tt nang more than one element (Cond..98) Facer 95. Facert Inthe following able D means decidable U means undecidable,T means Tivially decidable and? ‘meats open question( answer i ot known). in Reply CFL's CFL's CSL Reone ce — a Ltevint? (matentio JD DD le) > o> vouou > vou oy > ou vou ou vou vou ou vou vou ou stk, wees [Dg vou ou rere Cs a vou og ‘tse eon tomes} UU impasse tae pe tse rou > Fou Cn a u Contd... 96) Facer 90 Facer (Closure properties of formal langues by some deterministic Turing ction of input length NPs f languages o° prob ‘8 polynomial bound on he * TheP=NP question oflanguage her of not Pand NP are really the same clases thee ae lang 28 of ne problem in has the same answer the second, P-Complete ch language in N known NP-complete Po then Ps is NP {some NP-complete problem isin Pen P= NP (face lt ou Fface lt ‘NP-Hard problem: thes language. suc hat vey angus L! 7 ly reducble Land we cao prov tht 8 NP then ‘NP-hard problem. ‘ve can prove tht L i in NP and every NP problem ean be poy wom sai tobe NP-complete protien) fhe NP — Complete problems > ean stall problem simply SAT is NP-complete, are NP-Complet. anatocncat an decd Hanatan circt 0 Vertex cover problem: which asks s 0 find edge: inthe one that at lest one eng of eer Independent et problem Compete sm problem :iven raps Gi and G> the nodes of hoose the cotespondnce Between 11 The subgraph asa subgaph 7 odes of Gy and nodes ofthe sb “The subaraph ~isomerphism problem is 12. The edge cove problem = Given ot edges, that i, ase of keds soc ‘and an does G have an “edge cove” ok isan end of a Teast one ge ithe ede blr is NP-complete “Tea insur ntger programming problem is NP-complete The dominating st problem : Given gras Ga Toler of seh hat cach noe is eter in or aac ~ complete. “The unitexceutont ct SiS, [act caver problem: Given & ‘such ‘ofS is there a set of pe does bave vt nein the spanning Wee “ble is NP-Complete abet recognize ders facet os (ince 4G; gener diferent languages is NP-Complet. 2. ns xis NP-complete. ‘Do evo guar gamma ceguivalent if and only HfL mization problem may be ‘wit possible toe NP-complete wheres dessin problems can, Thee re ot NP-complete 1g adequate to show Loa Lay whee Li 006 Iniractable Problems pane poblems solvable in pl 1 the poles which require more than snetble TM are intractable cM ementation bu is ist known wheter NP ' cen Co-NP an thor classes of langues showin Slow [NP-Complete Problems Complements of ‘NP-Complete Problems 1+ is peNP hen NP and Co-NP ll ae se «+ np-co-N@ i ee some NP-Comle pl whos omens" NP. (Cond. 99) ffacect 0: Facet OBJECTIVES ON CONTEXT:-SENSITIVE LANGUAGES,TURING MACHINES UNDECIDABILITY AND COMPUTATIONAL COMPLEXITY choose the oe 2) AisrecusiveiTboth and its com nent ) The resets are closed under complemer statements (GATE 1987) accepted by TMs ye number} (GATE 1955) acs, Dacesst guage L= s)aregularset ion (GATE:~ 1989) languages d)none ofthe above 3. The following languages are closed under in s}reeursive sexs Byresese) 44 Recursive languages are (GATE 1990) byalnays recognizable ‘recognizable by Turing machines lowing statement te ? uringmachned)For no machine M; the above statements true 6. Which fe following statements re ru ? (GATE —1992) 7. Choose the incoreet stateren's Every subset ofa countable set is countable b) The lass of TMs i countable clas of LBA ig countable 6) The clas oF DPDA isnot coumable itmicaly) (GATE 1994) (GATE ~1995) tae bab /b ‘The above grammar is context ree bk SJomiet sensitive g) LR (KY 10, Which or the following statements fase (GATE 1996) The hang problem of TMs susie wether a CFG sambiguose ie undecidable ©) Given two arbitary CFGS G, snd Gis undeidable whether «Given two regular grammars Gand Gy itis undecidable whet (Contd..100) Facert Facer 11. The advantage of chained hash ale external hashing) ovr the open aaressing scheme is (GATE~ 1996) 8) worst case complexity of seach operation sess ) space used is ess A) none of the above ing is not decidable (GarE-1997) lege, Maceptss with ink tes, ) Equivalence of two given TMs ©) Language acepted by a given FSM is non empty. Language generated by a CFG isnon empty 13. Regarding the power of ecognition of languages, which of the fllowing tternents fase? (GATE~ 1998) 4) The NDFA ate equivalent to DFA. b) NPDA are squvalen to DPDA ©) NDIM are equivalent to DTMs. d) Multtape TMs are equivalent single-tape TMs (GATE. 2000) oe (Pare decidable is decidable of M onw visit the stateg? ig statements about X is coret (GATE 2000) ')X is undecidabe bux partially decidable ©) Xi uneciable and not even paalydeicable 4X is no adecision problem statements (GATE- 198) 35 (0 wheter 2 TM M accepts w is undcidable, ‘0M M stared on blak op wil ever halt is decidable ia TM ever pins a symbol is Uecidable if TM ever 16, Choose the. 2) The prob (GATE- 1990) oma is unde dah £4) The membership problem for type fnguages is decidable |8.Which of the followings the strongest cont statement about ite language ove some (GATE-1991) isacsL 1 his TM cognizable 9 ws given below (GATE ~1995) For every, teri exaely one ting of length that belongs tL be the component of Lin a)LeisasoinNP Byles decidable) cis notin NP 4) None ofthe above (Cont.101) Facet Facer’ 20. Ram and sya have ben ak show tha enn problem i NP-complete Ran ali retucsin frm the }-SAT problem to, and shyam shows ‘Which ofthe fllowing ean be infeed from (GATE~2003) by Mis NP bu not NP-com her NP-had ort NP afier we ind ost i7P= NP. wo languages Ls and Ls ach iE fiE' DE" bea da (8) if Rx) ¢ Ua. Further let 1a Vic of th fallowing CANNOT be ru ? (GATE 2008) ine stating state. The tape rmbol Bis the lank symbol slphabet of M indicate end ofan inp: ing table oth and re recursive 25. AnFSM can be considered tobe TM. tape lena ending capa ape length, wit ional tape movement. tna ape movement Ffacert iw Facer 26. Mis more powerful than FA because 8 None 27. A PDM behaves like an FA when he number of aur memory a0 br ee 28. PDM behaves like a TM when the number a0 ‘yor more sn FSM with 2 tac pow fh sack is more powerful an an FSM with 2 stacks 30, Bounded mi ve recursive but computable? ©) Bounded fanetion d) Ackermann funtion ot ive ut pray ecursive? ') Riemann function) Bounded function.) Ackermann faeton 438, Choose the cotet statements Ato prt recursive funtion paral recursive fet recursive Futon Koa partial ecursive frction Lyisssidt be rable) NP-HARD 6) None af the above lose under union he language must be recursive ming anges (Cont.108) fface rt 103 fface tt eal sates ofa UTM shoul be. 2 o: 59, Any TM with m symbols and n states canbe by another T ©) Bm sates * ALL THE BEST * ACE, 204, Rahman Plaza, Opp: Methodist School, YWCA Lane, Hyderabad — Phones : 04024752469, 4750437 mal: ace gategu ‘Website: www accengeacademy.com | *ALL INDIA 1“ RANK 20 TIMES IN GATE* *ALL INDIA 2™ RANK 10 TIMES IN GATE* Offers excellent coaching for GATE, IES, JTO, APGENCO, APTRANSCO, APPSC, CPWD etc. For further details contact: ACE ENGINEERING ACADEMY Head Office: 204, 2" Floor, Rahman Plaza, Near Taj Mahal Opp. Methodist Sch Fernandez Hospital lane, ABIDS, HYDERBAD ~ 500 001, Ph : 040 - 24752469, 24750837 worw.aceenggacademy.com emal: [email protected]

You might also like