Viden Io Toc Akash B Tech Computer Science 4th Semester Ip University Toc 2018 PDF
Viden Io Toc Akash B Tech Computer Science 4th Semester Ip University Toc 2018 PDF
P ~ Now find a string‘S’ in A such that ISI >P — Divide Sintoxyz — Show that x yiz ¢ A for somei ~ Then consider all ways that S can be divided into x yz — Show that none of these can satisfy all the 3 Pumping conditions at the same time. ~ S cannot be pumped == Contradiction Assume that A is Regular Pumping length = P S=a’b” => S=aaaaaaabbbbbbb x Pe7, Casel: The y is in the ‘a’ part, xy'z = xyz42018 Fourth Semester, Theory of Computation ss aa gaa ebbbbbbs aa aanaaaaa a bbbb by, : +7 Case 2: The y is the ‘b’ part rytanya aanaaaa bb bbbh s aaaaaaa bb bbbb bbb} 5 ‘ T#ll Cage 3:'The y is in the ‘a’ and ‘b’ part xyz xy" eagag abl bbbbb aaaaa aabbaabb bbbbbh IXYI
AAD, A_> aBIbAB,B > b,D >a Here, §,A, Band Dare the yay Sis the start variable; and a and b are the terminals. ables, Ans. As there are no null productions or unit productions, we can proceed to gt. 6) Step1 Let G, = (W'y lab. d). P, 8). where P, and V'y are constructed as yj. (i) B+b,D dare included in P,. ome (ii) S + aAD gives rise to S > C,AD and C,>a. AaB gives rise to > C,B. A~ DAB gives rise to A >> CAB and C,> b. Vy=(S,A,B,D,C,,C,). Step 2 P, consists ofS > C, AD,A->C,BIC,AB,B > b,D 4, C, >a, 6, -54, A+C,B,B->b,D->d,C, >a, C, bare added to P, S + C,AD is replaced by S-> C,C, and C, + AD. ‘A-+ C,AB is replaced by A-> C,C, and C —> AB. Let G,=(1S,A, B, D, Cy, Cy, Cy, Cy), (2, b, dl, Py) where P, consists of S-> C,C,,A-> C,B 10,C,,C, > AD, C, ->AB, B->b, Dd, C, +a, C, >, G, isin CNF and equivalent to G. @.4.(b) Remove the Null production from the given grammar-(S— |aS\4p, ‘A->1 lc, > b}. Here, S, A and B are the variables; Sis the start variables;a,5 and are the terminals and } is the Null symbol, 4 ‘Ans. Step 1 Construction of the set W of all nullable variables: W, = (A, ¢ Vy! Al->Ais a production in G} (A, B) (A, B) u [S} as S > AB is a production with ¢ W*, = (8,A,B) W, = W,U6=W, Thus, W = W,=(S,A,B) Step 2 Construction of P': @ B -> bis included in P’. (i) S > AB give rise to S > B,S + AB (iii) A = cis included in P’. ’ Hence the required grammar without null productions is G'= ((S,4, Bl, bP: 9 where P’ consists of S > aS |ABIBA>cBob