You are on page 1of 35
Med 1 a © List ond explain the clarification) of. Finite fuctomata - Discuy the application of Ft: Sele Finicte: Avdomeda : — Used 4o recognize pattern — Tt take, String of synbel as idput and Chong is state accerdingly: lather derived symbol is found they Hyanition oc Cui: Pile! pructomata, nee x Jee with | oe outpak | Pen witted” | ‘ |. ode Sees (Moore \\ (Mealy >, | \ \ Mackne} Madde.) (DFA) n)(NEA) (Enrs) % Eitte Automata ig clamified terto too types {. DEA (DeterminisHe Finite Duchmeta) 9. NFA (Non-Detemtmiche Finite Actors) 1 .cIn DFA, machine qoet to one State only $ / 3 Y ‘a powticulas input clkanacke?« 9, DEA gloetdt accept null move. 3. Every DFA is defired og S hight N= 5 vas {, 2, iF) ee ee where y @ rfinite Set of crater T i finite set oF input symbols 2, 1 Initial state Ei Final state § : Hramitien Functor: $ 9% 2g NEAS Q. THN, madaine can transmit “0¥ number of slate fer 2 particalar inpet- Q. Te can accept ru move’ 3, As soma OFA, NEA fs ole defined by s tuple -buk with Ai-treverk —tromticHoo -funch’on + Me QT, 8 2eiF} where, Q*S¢t of Staty +s Setot inputs stromition incon Jo vinital Stoke F: Pral stole egies useful in Aegigning lemdeok Gcannes Cosatyris) daigning Spell aheckew . taed in NUP C Natural Language Pocemig’) 3 \ Q 3B: Fa can model the Lehavior of aigital Overs q S. used in netwak protocol analysis. 1(B] raw a pea Uetuch accept strings encling usith ushone tie Mput 6 ford. Sel the requived ofA is Ms $@,2,5,%0 FS £8 fre M1 2h Oa 2 ZAfon3 sg. eg Ot ety 3 F> int Lome fuot.tots.F 6 8 Input o1o11 LD @D+AD*® 2. String Is Accepted 1 (C) Const wuct DFA equivalent to the given NF A To ’ oO ! A|(A.B)| A Ble [lc] ~ e[D @lo |o AD [ABD ABCD | ABCD] ACO 2 [Al sol. Ust te elemenis ond cempouimts of DEA ond NEA. DPA- It sefess to Detesumivustic Finite Automata. tt is Satcl to be detesuministic If edsuipencling team input Symbol How & a singe SMmultant state. |.e.., Hee & only one tramition, tt nas 5 tuples and repaasemted A- M2 {Q,2,5,%,FF @> Set of aul Stciter Yo > Initial stecte. => Set of Input symbols F 4 Final Stete. 89 Tromitien Functen “DFA cammot We Empty string TRoawiton PFA con be undesuteod as one machine ? DFA suquise mise space 7 S1@x33@ fem next perwibta state belengs to Q NFA - It 5104053 to Men- Delesuministc Anite Autemato: tt 4 Salcl to be nen-deterumintstic IF Hasta ie Mee tham enue Powibte homMyton fem ene state on Hie sama Mput symbet It rea alo have a set O45 tuples ound is same cs DFA NFA Com Use Empty Shing Trowuition NPA Coun be Unclasutood as mnuttiple ute machivas cemputing at tha save tme 3 NPA saquisies ler space thom pFA 7 S$: Qx(ZVUE) 9 2% -e-, pont permible state Lelengs to pouses Set of @ 2 Blcowshuct the mode machine to clotexmine tericlue med 3 Sv We vaod to censhuct Mecte Machine tat cetesumivies wiod s fo each sting Chinasyy Integen) Reridue moda (Uke %): remainclor ushom dividing by 3 A Binosy Sting treated ar binasyy Integer —9> c00-40%3 50 So, the wequired moore machina is SCOlV~I%371 oP 0109 24332 OK 1 G ada OU 3-330 PEER CD) 1009 u-p3—4 z 1015573 32 fice Boew 1 109 &Y%390 B18 DOL Wi ares oe tf 2 @ 9% 6%3>2. Henee proved the Following two FSM's are 2 [CE] checix whether equivalent o* MOE — Fina Stare) crate. g — Tntesme diate . 2 AS B iS Fs and ¢ P is Zs, both ie Is machines ave not equat D> vo a Poy " PtH “ RO He, 2 Ben FOV eg [A] sh and expaln the Close THOREMTES OF Rega qHammax: Clomne_Wopentes Of Regular yarn 1 Gd and Gr ave Yequan quammars, then the Mion OF QL OMA AA Ceended a8 EUUED) 1S AIST A TecpLleN Quosrencet - | Sowis tmeans Wek TF Gt generates temmage Ht and Go generates | yorquage 1) ten the Qrammax —reguisleg Free he GNKON & | | Ga and Ga Generates the lanquage UL | peimed oS Qua = Fafticed oF aeqay | | | WH closuye Under UNIONS | | [a Claste_eander_coMCATOATON | WSL and GI GE TEYAIGK Qrarrwrnts, apen *He. CONCAIENOON | F Gt and Oa (demniad Os G1.Ga} % GO A eEqUIAN QeaCRNOS- | ye ea Qenemates lenqpinge Lt god Ar qeneraies language Ly | then the qrarennat Newing From the Conecttenotion oF | BA Ste Oe generorss HE Langues ELE pefited Of GLGn= Sal west ond Heel @ qagixe UNder_Meene thor + | eGo eCHIAN Grammer, “hen we tleene {Ot | (denoed og Qk) % ONO A regular ayosenar- > G Jenerotes tarrunge b> gen he Aono TEsKTN) Tom the eleene Chore OReraNfon generates the ToemAgE gosetble ConeatenantONS of cI OF 2, whicn Tnaudes ON rove SHaTqS Hom & pefined os oh = AED --+\ 3 [8] Demonstrate the Pumping lemma for regular sets. Fiumping Canawa le ta 4 “ is Wied +5 Prove tok a language ts et Vequlon - Tt can! : ant be uied Lo. prove. -that language is Vequten, Detinetion (fA As mack tage Te Omg an Bhat pang len “g ‘Y String S where |<} SP may be betpiled Saye Such trot MU be rye, ve of into 2 pany, . aoe Codon, yD wy is { = 9 tyl so a txy)

0} is not ceqatar language, Awume tet A is reqator hergaogtand ciume prnping {eng th e-T oe of b= ate! C= aagrasa bblsbbbh x Y x Qoue | it Sex rhe Seanaaaabbbbedh ea YD lwlso 3) bxy/=lxp Sane 1) aes S= xy F Aaa maaan anna bbb Lbhbly Ma [ ‘ ~ ab ¢€A ht ae 3) Ixy] - 2

Cat qo > UWezatqya By using the Ardens theorern, We act Sub €q,0, @ eq @, We 9% I= cbs b+ gat > 4, b+okb'+ Glard) Bq using ‘the. Arden's thee» qa = broth (ath) an , yeSSiON » ™ ee a arbre “a by (att) , APA] consinuce tet and PINE Linea qrammar fer tre afen NA. ° | a4 Ores on rere Miner Qrarnmay Gx) Left ~ Hea Reqular Grasemnas : A qammary Q= (TSP) S Said 40 be keke —Kenent “AR cy productions axe OF the HUN % ae, 4>* | where MBE and xeTt Leet -VineaX rarnenert ap 44-0 aa 900 ao at on 9 98% i at > 9:0 a3 > aoe | aa > wort a3 7 0 Rignk —Wineas QromMey Coy) Pgh Viner Requlay Grammar + A gxamnmnat Qe (TSP) BW Sold 49 be Fann - Means FE an productions are OF he FO FAKE, AH uinete MBEN and xe. BRAK —Wneak Qhasrimax + ay Ov > 0-40 ao Be aa 8 aa O48 as 0:98 ar > 4.00 ya > 4% 4{B] Apply pumping lemma for language L={an /n is prime} and prove that it is not regular Atiume Lis regular language » pUmipicg bengly pac al ey ae ae past S =rayle = aaaaa .a> Eby 2) ty] >a S= xyes 4 = BaaaaaA TO eh, 2) ty) So 3) [xy] 2X

Gver lonquage is het Vequtons 5( A)Explain step by step method to prove certain languages were not regular. ‘The Pumping Lemma is used for proving that a language is not regular. Here is the Pumping Lemma. ID is a regular language, then there is aus integer n> 0 with Uhe property nat: (*) for any string x € L where |x| > n, there are strings u,v, w such that (i) 2=wu, v#e i) |uv| 0 that satisfies the property (*). 3. Give a particular string 2 such that (a) re, (b) Ia] 20. This the trickiest part. A wrong choice here will make step 4 impossible. 4, By Pumping Lemma, there are strings u, v,w such that (i)-(iv) hold. Pick a particular number k € N and argue that uv*w ¢ L, thus yielding our desired contradiction. ‘5(B) Sirnplify the forloutlag _Qrammor ? Ss ABAIBIC Camats (er) Cie —alghodek| terminal) Bs Atbor As albcles- Step-d: Grammar has ho unit producttens useless Sumbdis - aaa step: . Check for UN Productions. ete SB BoA Oxe -vNIe Productions: Step-3: RUMINOE {58 by Yeplacing Bo AIDA- when, g—5 NBalAlbeATRIC = —t ow EIN! “s—A' ONTE Production ey Neplacing 4-9 albclBs- amen g— fBa alee tes [¢ —— Sep; ‘Ehminate BOA bY replacing A alecles They) B» albcles[ bbA —S) Hep Wence tne — Stenglied gqxammon {s Sy ABala teclestc Bs albc ips |bbA Aa abClBS Wwytrake ammbiquous —Qramman and chece the grammar fs omblquous oy Nok - Gas GAEL ERE TENG Ae. UW consider we idyiartd & > BAG > SATE te GS ee) a IA ZEKE igo td) > lds XE -y fda taxi and Ba BE C GORE) a GREY 4 BAGKE a Wt BFE tay txt Cc & ia) sapere ore | WD FIQHE motk derivations Possible - wence grammar 1S *omnibiquous: 6(A) convert grammar into GNF. S> AP A> Bs Aaa - No pr Au Koh rit productions Megas Check Pretectiog Ie ONE af neh, NS a-> BSB (per cluction Ue A> BX - SB a frrociuctions \ ve age chang yw ge Ae A> Bx x > 8B names Kew PRC CHions Oni 0) > ADAZ A, AB AY ay 31 3 A> 325 WF procluction) production ) maior Pepe ' ayo AIMS + gylon me C : pu > ®AZAZ oy below production 14 Step $+ Check lw vA > ak hor AyD ADAS rie Ay any dp > ae AY bny au > ana ns ona Ma Ape = Ao Aye ~ a 6(B) What is pumping lemma? Explain its closure properties? [June/July — 2022, Set-3] [Remembering ] Pumping Lemma If Lis a context-free language, there is a pumping length p such that any string w € L of length > can be written as w= uvxyz, where vy # 6, |vxy| 0, uvixyiz € L. S08 Applications of Pumping Lemma Pumping lenmua is used to check whether a granmuma is conteat fiee ur nut, Let up take an example and show how it is checked. Problem Find out whether the language L = {xnynzn | n> 1} is context free or not. Solution Let Lis context free. Then, L must satisfy pumping lemma. At first, choose a number n of the pumping lemma. Then, take z as On1n2n. Break z into uvwxy, where lvwx| ne §(2, ,0,%) = (9,,0%) £(4,,€,0%)- [ 2,,8) $C, 1/02.) = (2, ,0) § (23/€,002,) = ao. SCG 2 0026) = (44/08) § Cae) 2 eeb aoe): S23 e 7(B) Demonstrate conversion of PDA to grammar. Algorithm to find CFG corresponding toa given PDA Input - A CFG, G = (V, T, PS) Output - Equivalent PDA, P = (Q, 5, S, 5, qo, |, F) such that the non- terminals of the grammar G will be {Xwx | wx € Q} and the start state will be Ago F. Step 1 - For every w, x, y,z€Q,m€Sanda,beE>d, if 5 (w, a, €) contains (y, m) and (z, b, m) contains (x, €), add the production rule Xyx — a Xyzb in grammar G. Step 2 - For every w, x, y, Z € Q, add the production rule Xwx + XywyXyx in grammar G. Step 3 - For w € Q, add the production rule Xww — € in grammar G. 8(B) Compare DPDA with NPDA using a suitable example. Deterministic Pushdown Automata (DPDA) and Nondeterministic Pushdown Automata (NPDA) are both computational models used to recognize languages generated by context-free grammars. However, they differ in terms of their capabilities and operational mechanisms. Let's compare DPDA with NPDA using an example of language recognition: recognizing strings of the form {a*n b’n|n 2 0}, where each ‘a’ is followed by the same number of ‘b's. DPDA Example: Consider a DPDA that recognizes the language {a*n bn | n 2 0}. The DPDA works as follows: It has a single stack. When it reads an ‘a' from the input, it pushes a symbol onto the stack. When it reads a 'b! from the input, it pops the symbol from the stack. The DPDA accepts if it reaches the end of the input with an empty stack. Example: Let's consider the input string "aabbb". Start in the initial state with an empty stack. Read ‘a’, push a symbol onto the stack. Read ‘a’, push another symbol onto the stack. Read ‘b’, pop a symbol from the stack. Read 'b’, pop another symbol from the stack. Read 'b', pop the last symbol from the stack. Reach the end of the input with an empty stack, so accept. NPDA Example: Now, let's consider an NPDA that recognizes the same language {an bn |n > 0}. The NPDA works as follows: It has multiple stacks (in this case, let's assume two stacks). At each step, it can nondeterministically decide which stack(s) to push or pop from. It accepts If there exists a valld computation path that leads to the acceptance state(s). Example: Using the same input string “aabbb": Start in the initial state with empty stack(s). Nondeterministically decide to push ‘a’ onto the first stack. Nondeterministically decide to push ‘a’ onto the second stack. Nondeterministically decide to pop from both stacks. Nondeterministically decide to pop from both stacks again. Nondeterministically decide to pop from both stacks again. Reach the end of the input with empty stack(s), so accept. Comparison: Determinism: DPDA is deterministic, meaning that for each state and input symbol, there is at most one transition. NPDA, on the other hand, can have multiple possible transitions for each state and input symbol. Expressiveness: NPDA is more expressive than DPDA because of its nondeterministic nature. NPDA can recognize languages that cannot be recognized by DPDA. Complexity: NPDA tends to be more complex both in terms of design and analysis compared to DPDA due to its nondeterministic behavior. 9(Aydefine the TM with Formal notations. “Explain universal turing machine. KM 1s expressed as a ‘7-uple (@, 1, B, 7 % 40, F) where: * Qisarfinite set of states «Tis the tape alphabet (symbols which can be written on Tape) * Bis blank symbol (every cell is filled with B except inout alphabet initially) + 71s the input alphabet (symbols which are part ot input alphabet) «2s a transition function which maps Q x T ? Q x T x {L,R}. Depending on its present state and present tape alphabet (pointed by head pointer), it will move to new state, change the tape symbol (may or may not) and move head pointer to either left or right. + qQis the initial state «Fis the set of final states. If any state of F is reached, input string is accepted. Turing Machines input tape finite control Ge e New capabilities: - infinite tape — can read OR write to tape - read/write head can move left and right read/write head Turing machines are an important tool for studying the limits of computation and for understanding the foundations of computer science. They provide a simple yet powerful model of computation that has been widely used in research and has had a profound impact on our understanding of algorithms and computation. A turing machine consists of a tape of infinite length on which read and writes operation can be performed. The tape consists of infinite cells on which each cell either contains input symbol or a special symbol called blank. It also consists of a head pointer which points to cell currently being read and it can move in both directions. Universal Turing Machine A Universal Tung Machine is a Turing Machine which when supplied with an appropriate description of a Turing Machine M and an input string w, can simulate the computation of w. M,W Turing Machine > » Response as M response with W U™ Universal Turing Machine Construction of UTM Without lose of generality, we assume the following for M: * Q= (ql, q2, ....qn} where ql=initial state and q2=Final State * t= fol, 02,,...0n} where o represent blanks * Select an encoding on which q1 is representable by 1, q2 by 11, and so on + Similarly, ol is encoded as 1, 62 as 11, ete. + Finally, let us represent R/W head directions by 1 for L (Left) and 11 for R(Right) + The symbol 0 will be used as a separator between Is. With this scheme. any transition of M can be given as : 5 (q3,01)=(q4,03,L) | wit appear as 011101011110111010 9 yperelop a ‘ludng Machine to accept We language 060" eshere @D ote belones to Cori) it fork far ® 9 SL ~ alti a) pee ey: blot alone g kt B “ @ bhit. @ @s let © aay fark xhar Xft blow blok vir Yk Stn = BababCababs =) OXYXYC KYXYB § (2/0) = C2178) Se) = Garcee) FGre8) = Gsy8) 6Gu9 5 Giraik) SG itt) = Grr beR) FG + Gres) S(qard = Gre) SHH = & HO bem = rw 6@3,*) : (@aekid) o&® ry) > @ mt) o@,¢) = (qu rect) 6 49) Guar SF Gyre) > Cqueb) +++ And $0 on. 10(A) (OR) ®. List and explain the types of Turing machines. [July 2023, Set-1] (Remembering ] 1, Standard Turing Machine: The standard Turing machine consists of a tape divided into cells, a read/write head, and a finite control unit with a set of states. It can move left or right along the tape, read symbols from the tape, write symbols to the tape, and change its state according to a transition function. Diogram: Turing Machines input tape finite control read/write head qe « New capabilities: - infinite tape - can read OR write to tape - read/write head can move left and right 2. Multi-Tape Turing Machine: ‘A multi-tape Turing machine is similar to the standard Turing machine but with multiple tapes instead of one. Each tape has its own read/write head and can move independently. The transition function may involve simultaneous operations on multiple tapes. Diagram: state register 3. Non-deterministic Turing Machine (NTM): A non-deterministic Turing machine can transition to multiple states from a given configuration. Jt explores all possible paths simultaneously during computation. If at least one path leads to acceptance, the NTM accepts the input. 4, Mult-Head Turing M ‘A multi-head Turing machine has multiple read/write heads that can move independently on the tape. Each head has its own state and transition function, allowing for parallel computations on the same tape. Diagram: 5. Oracle Turing Machine: ‘An oracle Turing machine is an abstract machine that can query an oracle for answers to certain, ‘computational problems. It can perform a limited number of oracle queries during its ‘computation, Diagram: (No specific diagram as it’s a theoretical concept) 6. Probabilistic Turing Machi A probabilistic Turing machine incorporates randomness into its computation. It can make probabilistic choices at each step, leading to different possible outcomes with associated probabilities. Diagram: (No specific diagram as it’s a theoretical concept) 7. Universa Mat ‘A universal Turing machine is a theoretical model capable of simulating any other Turing machine. It takes as input the description of another Turing machine and its input and simulates the computation of the given machine. Universal State Turi ‘Transition | (st) Machine ‘These are some of the variations of Turing mac science. Each type serves different purposes and helps in understanding the capabilities and limitations of computation, es commonly studied in theoretical computer O(B)Write a short note on NP hard and NP complete problem NP-Hard Problem If problem Y is NP-Complete and convertible to X in polynomial time, then issue X is NP-Hard. The difficulty of NP-Hard and NP-Complete tasks is equal. NP class is not required for NP-Hard Problems. If every NP problem can be solved ina polynomial amount of time, it is called NP-Hard. Examples The following problems are NP-Hard: 1. The circuit-satisfiability problem 2. Set Cover 3. Vertex Cover 4. Travelling Salesman Problem NP Complete Problem If a problem Y exists and is reducible to X in polynomial time, then the problem X is NP- Complete. Both NP and NP-Complete problems are challenging. If a problem is a NP and NP-Hard Problems component, it is NP-Complete. In polynomial time, a non-deterministic Turing machine can solve an NP-Complete problem. When an issue is np-complete, it is np and np hard together. np complete issues can, therefore, be verified in polynomial time, according to this. Examples Following are some NP-Complete problems, for which no polynomial time algorithm is known. 1. Determining whether a graph has a Hamiltonian cycle 2. Determining whether a Boolean formula satisfiable, etc

You might also like