Sunteți pe pagina 1din 2

2011 COMPUTER APPLICATION BCA 304 (Theory of Computation) Time 4 hours Full Marks 80 The figures in the margin

gin indicate full marks. Candidates are required to give their answer in their own words as far as practicable. Answer Q.No. 1 and any four from the rest. 1. Answer any eight questions: 2 * 8 = 16 (a) Distinguish between DFA AND NFA. (b) Find the regular expression of the language L(r) = {w * : w has no pair of consecutive zeros}. (c) Find a DFA that accept all the strings on {0,1}, except those containing the substring 001. (d) State Pumping Lemmas for regular sets. (e) Find the strings of length two or less from the language L((a+b)* ab*). (f) Show that the language L = {anb2n| n >= 0} (g) Find the language from by the productions: S a S a, S b S b, S . (i) In a grammar, what is useless production? Explain. (j) Find a regular grammar for the language L = {an bm : n + m is even}. (k) Which of the following is a context-free language? Explain: (i) L = {anbn cn ;n > 0, = (a,b,c)} (ii) L = {anbn ck dk ; n , k > 0, = (a,b,c,d)} (l) Is there any membership algorithm for checking whether a regular language is infinite or not? Explain. (m) Give an example of a language which is both regular and context-free. 2. (a) Draw the Finite Automata of the following language: L(ba* + aba* b*) (b) Find a regular expression for the language L = {w {a,b}* : n a (w) is even and n b (w) is odd}. (c) Give the DFA of the following language over = {a,b}. L = {w : n a (w) mod 3 > n b (w) mod 3}. 5+6 3. (a) Convert the following NFA into its equivalent DFA. 1 0 1 0 Start q1 0 1 0 (b) Prove that if L1 and L2 are regular languages then so also L1 L2.

5+

(c) Prove that L = {a i : i N} over = {a} is not regular. 5+5 4. (a) Find the CFG of the following: (i) L = {x (0 + 1)* : n0 (x) = n1(x) } (ii) L = {0n 1m : m,n >= 0 and n = m + 1} (b) Show that the language L = {a m b n c p d q : m +n = p + q} Over = {a,b,c,d} is context free. 5+6

6+

5+

5. (a) Define inherently ambiguous context-free language and hence show that the language L= {a n b n c m } U {a n b m c m } where m,n >= 0, is inherently ambiguous context-free language. (b) Define production and unit-production of a grammar. (c) Find the context-free grammar with -production equivalent to the following grammar: S ABaC A BC B b / C D / D d (d) Define CNF of a grammar. Convert the following into CNF: S ASB / A aAS / a B SbS / A / bb. 4 + 4+ 3 + (1 + 4) 6. (a) Define NPDA. Define the language accepted by an NPDA. (b) Construct npdas that accept the following language on = {a,b,c}. L = {wcwR : w {a,b}*}. (c) Prove that the intersection of a Context-free language and a Regular language is Context-free. (3 + 2) + 5 +6 7. (a) Define a TM that accepts the language L = {a n b n c n : n >= 1}. (b) Design a TM that computes the addition of x and y where x and y are two integers presented in unary form. (c) What do you mean by Turing acceptable and Turing recognizable languages ? 6+5+5

S-ar putea să vă placă și