CS8501 2marks
CS8501 2marks
net
Year & Semester : III Year, V Semester Degree & Branch : B.E – C.S.E.
PART-A
6. Give the DFA accepting the language over the alphabet 0, 1 that has the set of all strings beginning
with 101.
7. Give the DFA accepting the language over the alphabet 0,1 that have the set of all strings that either
8. Define NFA.
13. Is it true that the language accepted by any NFA is different from the regular language? Justify
your Answer.
www.AUNewsBlog.net
www.AUNewsBlog.net
PART-B
1. a) If L is accepted by an NFA with ε-transition then show that L is accepted by an NFA without ε-
transition.
b) Construct a DFA equivalent to the NFA. M= ({p,q,r},{0,1}, δ, p,{q,s}) Where δ is defined in the
following table. 0 1
p {q,s} {q}
q {r} {q,r}
r {s} {p}
s - {p}
0 1
p {p,q} P
q r R
r S -
s s S
3. a) Check whether the language L=( 0n 1n/ n>=1) is regular or not? Justify your answer.
b) Let L be a set accepted by a NFA then show that there exists a DFA that accepts L.
5. a) Construct a NDFA accepting all string in {a, b} with either two consecutive a’s or two
Consecutive b’s.
www.AUNewsBlog.net
www.AUNewsBlog.net
Set of all strings beginning with a 1 that when interpreted as a binary integer is a Multiple of 5.
(i) Set of Strings over alphabet {0, 1,….9} such that the final digit has appeared before.(8)
(ii)Set of strings of 0‟s and 1‟s such that there are two 0‟s separated by a number of positions that is
a multiple of 4.
7. a) Let L be a set accepted by an NFA. Then prove that there exists a deterministic finite automaton
that accepts L.Is the converse true? Justify your answer. (10)
8. a) Prove that a language L is accepted by some ε–NFA if and only if L is accepted by some DFA.(8)
b) Consider the following ε–NFA. Compute the ε–closure of each state and find it’s equivalent
DFA. (8) ε A b C
p {q} {p} Ф Ф
q {r} Ф {q} Ф
r Ф Ф Ф {r}
0 1
p {p,q} {p}
q {r} {r}
r {s} ф
*s {s} {s}
10. a) Explain the construction of NFA with ε-transition from any given regular expression.
b) Let A=(Q,∑, δ, q0 ,{qf ) be a DFA and suppose that for all a in ∑we have δ(q0, a)= δ(qf ,a). Show
that if x is a non empty string in L(A),then for all k>0,xk is also in L(A).
states ε a b C
p Ф {p} {q} {r}
q {p} {q} {r} Ф
*r {q} {r} ф {p}
www.AUNewsBlog.net
www.AUNewsBlog.net
UNIT II GRAMMARS
PART-A
1. Define CFG.
5. What is ambiguity?
8. What is a derivation?
14. Construct a CFG for the language of palindrome string over {a, b}.Write the CFG for the
15. Construct a derivation tree for the string 0011000 using the grammar
16. Show that id+id*id can be generated by two distinct leftmost derivation in the grammar
17. Let G be the grammar S->aB/bA,A->a/aS/bAA,B->b/bS/aBB. Obtain parse tree for the string
aaabbabbba.
19. construct a context free Grammar for the given expression (a+b) (a+b+0+1)*
www.AUNewsBlog.net
www.AUNewsBlog.net
20. Let the production of the grammar be S-> 0B | 1A, A-> 0 | 0S | 1AA, B-> 1|1S | 0BB.for the string
0110 find the right most derivation
PART-B
1. a. What are the closure properties of CFL? State the proof for any two properties.
b. Let G= (V,T, P,S) be a CFG. If the recursive inference procedure tells that terminal string w is in
the language of variable A, then there is a parse tree with root A and yield w.
3. Discuss in detail about ambiguous grammar and removing ambiguity from grammar.
6. What is a unit production and how will you eliminate it. Give example.
7. Prove that if G is a CFG whose language contains at least one string other than €,
then there is a grammar G1 in Chomsky Normal Form such that L)G1) = L(G) –{€}.
I -> a+b
S->aAa | bBb | BB
A->C
B->S | A
C ->S | €
S-> AA | a
A->SS | b
www.AUNewsBlog.net
www.AUNewsBlog.net
PART-A
2. Define the acceptance of a PDA by empty stack. Is it true that the language accepted
3. What is additional feature PDA has when compared with NFA? Is PDA superior over NFA in the
sense of language acceptance? Justify your answer.
4. Explain what actions take place in the PDA by the transitions (moves)
b. What are the different ways in which a PDA accepts the language? Define them. Is a true
that non deterministic PDA is more powerful than that of deterministic?
6. Is it true that deterministic push down automata and non deterministic push
a. Down automata are equivalent in the sense of language of acceptances? Justify your answer.
9. Define the languages generated by a PDA using final state of the PDA and empty stack of that PDA.
10. Define the language generated by a PDA using the two methods of accepting a language.
11. Define the language recognized by the PDA using empty stack.
S → A/ B
A → 0A/ ε
B → 0B/ 1B/ ε Find the parse tree for the yields (i) 1001 (ii) 00101
E → E+E
www.AUNewsBlog.net
www.AUNewsBlog.net
E→ id Check whether the yield id + id + id is having the parse tree with root E or not.
18. List out the applications of the pumping lemma for CFG.
20. Use the CFL pumping lemma to show each of these languages not to be context-free
{ ai bi ck | i<j<k}
PART-B
1. a) If L is Context free language then prove that there exists PDA M such that
L=N(M).
b) Explain different types of acceptance of a PDA. Are they equivalent in sense of language
2. Construct a PDA accepting {an bm an / m, n>=1} by empty stack. Also construct the
3. a) Prove that L is L(M2 ) for some PDA M2 if and only if L is N(M1) for some PDA M.
b) Define Deterministic Push Down Automata DPDA. Is it true that DPDA and
PDA are equivalent in the sense of language acceptance is concern? Justify Your answer.
c) Define a PDA. Give an Example for a language accepted byPDA by empty stack.
4. a) If L is Context free language then prove that there exists PDA M such that L=N(M).
b) Prove that if L is N(M1) for some PDA M1 then L is L(M2 ) for some PDA M2.
6. a) Construct a PDA that recognizes the language {ai b j ck | i,j,k>0 and i=j or i=k}.
δ(q0,b,z0)={(q0,zz0)}
δ(q0,b,z)={(q0,zz)}
δ(q0,a,z)={(q1,z)}
δ(q1,b,z)={(q1, ε)
δ(q1,a,z0)={(q0,z0)}
PART-A
3. Explain the Basic Turing Machine model and explain in one move. What are the actions take place
in TM?
4. Explain how a Turing Machine can be regarded as a computing device to compute integer functions.
5. Describe the non deterministic Turing Machine model. Is it true the non deterministic
6. Turing Machine models are more powerful than the basic Turing Machines? (In the sense of
language Acceptance).
www.AUNewsBlog.net
www.AUNewsBlog.net
7. Explain the multi tape Turing Machine mode. Is it more power than the basic turning machine?
Justify your answer.
8. Using Pumping lemma Show that the language L={ anbncn | n>=1} is not a CFL.
11. What is the class of language for which the TM has both accepting and rejecting configuration?
12. The binary equivalent of a positive integer is stored in a tape. Write the necessary transition to
multiply that integer by 2.
14. Mention any two problems which can only be solved by TM.
16. Difference between multi head and multi tape Turing machine.
20. 21. Draw a transition diagram for a Turing machine accepting of the following languages. D
PART-B
3. Design a Turing Machine M to implement the function “multiplication” using the subroutine ‘copy’.
4. Explain how a Turing Machine with the multiple tracks of the tape can be used to determine the
given number is prime or not.
5. Design a Turing Machine to compute f(m+n)=m+n, V m,n>=0 and simulate their action on the input
0100.
www.AUNewsBlog.net
www.AUNewsBlog.net
7. Explain how the multiple tracks in a Turing Machine can be used for testing given positive integer
is a prime or not.
11. Construct a Turing Machine that recognizes the language {wcw / w € {a, b} + }
12. Design a TM with no more than three states that accepts the language. a(a+b) *.Assume €={a,b}
14.Design a TM to accept the set of all strings {0,1} with 010 as substring.
PART-A
2. Is it true that the language accepted by a non deterministic Turing Machine is different from
7. When a language is said to be recursive? Is it true that every regular set is not recursive?
11. Show that the union of two recursively enumerable languages is recursively enumerable.
www.AUNewsBlog.net
www.AUNewsBlog.net
13. Show that the following problem is undecidable.“Given two CFG‟s G1 and G2, is (G1)∩L(G2)=Φ?”.
17. Mention any two undecidability properties for recursively enumerable language.
PART-B
www.AUNewsBlog.net