0% found this document useful (1 vote)
236 views17 pages

Department of Computer Application It and Science Question Bank Mca Iv Semester Theory of Computation Unit-I I. Objective Type

This document contains a question bank for the Theory of Computation course for the 4th semester of an MCA program. It includes objective type questions, short answer questions, and long answer questions related to topics like Chomsky hierarchy, formal languages, grammars, finite state automata, regular expressions, and mathematical induction. The questions range from basic multiple choice and fill-in-the-blank questions to proofs involving mathematical induction. The document serves as a study guide for students to review and practice different concepts from the Theory of Computation course.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
236 views17 pages

Department of Computer Application It and Science Question Bank Mca Iv Semester Theory of Computation Unit-I I. Objective Type

This document contains a question bank for the Theory of Computation course for the 4th semester of an MCA program. It includes objective type questions, short answer questions, and long answer questions related to topics like Chomsky hierarchy, formal languages, grammars, finite state automata, regular expressions, and mathematical induction. The questions range from basic multiple choice and fill-in-the-blank questions to proofs involving mathematical induction. The document serves as a study guide for students to review and practice different concepts from the Theory of Computation course.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 17

DEPARTMENT OF COMPUTER APPLICATION IT AND SCIENCE

QUESTION BANK
MCA IV SEMESTER
THEORY OF COMPUTATION
UNIT-I
I. OBJECTIVE TYPE:
1. Which of the following statements are correct?
a) An alphabet is a finite sequence of distinct symbols. b) A word is a finite sequence of symbols over a
given alphabet.
c) A regular language is always infinite. d) None of the above
2. Match the column
i. Regular grammar a. Type 1
ii. Recursive grammar b. type 0
iii. Context sensitive grammar c. type 2
iv. Context free grammar d. type 3
v. Turing machine e. recursive language
3. The following grammar
G = (N, T, P, S)
N = {S, A, B}
T = {a, b, c}
P : S aSa
S aAa
A bB
B bB
B c is
a. is type 3
b. is type 2 but not type 3
c. is type 1 but not type 2
d. is type 0 but not type 1
4. The following grammar
G = (N, T, P, S)
N = {S, A, B, C}
T = {a, b, c}
P : S aS
A bB
B cC
C a is
a. is type 3
b. is type 2 but not type 3
c. is type 1 but not type 2
d. is type 0 but not type 1

5. The following grammar


G = (N, T, P, S)
N = {S, A, B, C, D, E}
T = (a, b, c}
P : S ABCD
BCD->DE
D->aD
D->a
E->bE
E->c
a. is type 3
b. is type 2 but not type 3
c. is type 1 but not type 2
d. is type 0 but not type 1
6. The following grammar
G = (N, T, P, S)
N = {S, A, B, C, D, E}
T = (a, b, c}
P : S aAB
AB->CD
CD->CE
C->aC
C->b
bE->bc
a. is type 3
b. is type 2 but not type 3
c. is type 1 but not type 2
d. is type 0 but not type 1
7. The word automata means
a. self acting b. self processing c. self ish d. none
8. The word formal language means
a. the symbol used have well-defined meaning b. they are unnecessary, in reality
c. only the form of the string of symbols is significant d. none
9 In the series 2,6,18,54---------what will be the 8 th term?
(a) 4370 (b) 4374 (c) 7473 (d) 7434
Ans:-4374

10 Which terms of the series 5,10,20,40-------is 1280?


(a) 10th (b) 9th (c) 8th (d) none of these
Ans :-9th
11 Which of the following will not be a number of the series 1,8,27,64,125-----------?
(a) 256 (b) 512 (c) 729 (d) 1000
Ans :-256
12 In the series 10,17,24,31,38--------which of the following will not be a number of the series?
(a) 48 (b) 346 (c) 574 (d) 1003
Ans :-346
13 Look at this series 2,1,(1/8),(1/4)------what number should come next?
(a) 1/3 (b) 1/8 (c) 2/8 (d) 1/16
Ans :- 1/8
14 How many terms are there in the G.p. 3,6,12,24----384?
(a) 8 (b) 9 (c) 10 (d) 11 (e) 7
Ans :- 8
15 2+22+23+-------29 =?
(a) 2044 (b) 1022 (c) 1056 (d) none of these
Ans:-1022
16 120,99,80,63,48 what is the correct number?
(a) 35 (b)38 (c)39 (d) 40
Ans :-35
II. SHORT ANSWER TYPE:
1. Draw Chomsky Hierarchy with grammar, language and automata used.
2. Give description of automata theory.
3. Explain pigeon hole principle.
4. What is the principle of mathematical induction?
5. Define alphabet, string, language, grammar.
6. Give definition for regular grammar with example.
7. Define context sensitive grammar with example.
8. Write the definition of context sensitive grammar with example.
9. Define recursive enumerable grammar with example.

(10) 1+2+3+-------n=

(11) 12+22+32+--------n2=
(12) 13+23+33+------n3=n2(n+1)2/4
(13) 2+4+6+------2n=n(n+1)
(14) 1+3+5+7+---------(2n-1)=n2
(15) 1+2+4+8+16+-------=2n-1

(16) 3+9+27+81+243+729--------= (3n-1)

(17) 1+4+7+-----(3n-2)=
(18) How many terms of A.p. -10,-7,-4,-1-------must be added to get the sum -104?
(19) Find the sum of the series 51+50+49+-----21?
(20) Write down the 8th terms in the G.p.1,3,9------?
(21) Find the sum of the following A.P.1,3,5,7-------199?
(22) Find the A.P. whose 10th terms is 5 and 18th terms is 77?
(23) An A.P. consists of 60 terms if the first and last terms be 7 and 125 respecitively find 32 nd
terms?

III. LONG ANSWER TYPE:


1. Prove by Mathematical induction 1 + 3 + 5 + 7 + ... + 2n-1 = n2
2. Prove by Mathematical induction 12 + 22 + 32 + ... + n2 = (n(n+1)(2n+1))/6
3. Prove by Mathematical induction 1+2+3+4+5+...+ n = (1+n)n/2
4. Prove by Mathematical induction 12 + 23 + 34 + ... + (n)(n+1) = (n)(n+1)(n+2)/3
5. Prove by Mathematical induction 13 + 23 + 33 + . . . + n3 = (n2(n + 1)2)/4
6. Write the definition/statement for all the languages defined under Chomsky hierarchy.
7. What is the pigeons hole principle?

8. Prove that the sum of the first n natural num. is given by this formula 1+2+3+------n=

.
9. If n N

10. 12-22+32-42+-------n2= n(n+1).


11. relate arithmetic means of A.P. harmonic means of H.P. and geometric means of G.p.

12. = .
UNIT-II
I. OBJECTIVE TYPE:
1. How many tuples are there in FSA?
a) 4 b) 5 c) 3 d) 6
2. Look at the following non-deterministic finite-state automaton (NFA), with A as the start state, and D as
the only accepting state.

Which deterministic finite-state automaton (DFA) with as its state transition function accepts the same
language?
a) Start state A , accepting states C and D. (A,b)=B (B,a)=C (C,a)=D
b) Start state A , accepting state C. (A,b)=B (B,a)=C (C,a)=C
c) Start state A , accepting state D. (A,b)=B (B,a)=D (B,b)=C (C,a)=D
d) All the answers above are correct
3. How many parameters are there in transition function for FSA?
a. 1 b. 2 c. 3 d. 4
4. A language L is accepted by a FSA iff it is
a. CFL b. CSL c. regular d. recursive
4. In a finite state machine, m = (Q, , d, q0 , F) transition function d is a function which maps
A) Q ->xQ B) Qx->Q C) Q->F D) Qxq0 ->
5. The regular sets are closed under
a) Union b) Kleene Closure c) concatenation d) all of the above
6. Which of the following statements is the most correct answer?
a) Every finite language is regular.
b) For some regular grammar G, it holds that L(G) = L(G)*.
c) Syntactically different regular expressions can describe the same language.
d) All statements above are valid.
7. What kind of strings is rejected by the following automaton?

A) All strings with two consecutive zeros B) All strings with two consecutive ones
C) All strings with alternate 1 and 0 D) None of these
8. Which string is not accepted by the following FSA?
a. 00110 b. 01010 c. 11010 d. 00111
9. Consider the following NFSA

The automaton accepts


a. all words of the form {(ab)na|n 1} b. all words that end with a and
c. all words that end with a and not d. all words containing substring ba
10. Type-0 grammar is known as
a. Regular grammar b. context free grammar
c. context sensitive grammar d. recursive enumerable grammar
11. If NDFA contains Q number of states, then DFA contains
a. less than equal to 2^Q b. greater than equal to 2^Q
c. equal to 2^Q d. All of the these
12. Regular language can be recognized by
a. turing machine b. pushdown automata
c. finite state machine d. linear bounded automata
13. If language L = {a, aa, aaa, aaaa, aaaaa, ..}, then the regular expression will be
a) aa* b) a* c) a+ d) both a and c
14. Take a look at the following regular grammar (with S as the start symbol), the regular expression, and
the given nondeterministic finite-state automaton (where S is the only start state, and also the only
accepting state):

Which statement holds?


a) The NFA and the grammar describe the same language (but not the regular expression)
b) The NFA and the regular expression describe the same language (but not the grammar)
c) The regular expression and the grammar describe the same language (but not the NFA)
d) All three describe the same language
15. Consider the following regular expression: R=a(ab)(abc)
Which of the following regular expressions denote the same language as the above regular expression?
a) (a + ab + abc) b) a(a + b)(a + b + c) c) a( + ab)( + abc) d) a+
(ab)+ (abc)
16. Which of the following regular expression over {0,1} denotes the set of all strings not containing 100
as substring
A) 0 * (1* 0)* B) 0 *1010 * C) 0 *1* 01* D) 0 * (10 +1)*
17. Which of the following regular expressions describes a language that includes the stringsa, aba,
ababa?
a) a*b* b) (ab)* c) (a/b)* d)
a/aba/ababa(ba)*
18. Which of the following strings is not included in the language described by the regular expression
x(yz/zy)*z?
a) xz b) xyz c) xyzzyz d) xzyyzz
19. If R=Q+RP, where P and Q are regular expressions, then
a) R=QP* b) R=PQ* c) R=P+Q* d) R=Q/P*
20. For which of the following application, regular expressions cannot be used?
a) Designing Computers b) Designing Compilers c) Both a & b d) Developing
computer
21. Regular expression a / b denotes the set
a) {a} b) {a,b} c) {^, a,b} d) {b}

II. Short answers type:


1. Define Regular expression. Give an example.
2. What are the operators of RE.
3. Write short notes on precedence of RE operators.
4. Write Regular Expression for the language that have the set of strings over {a,b,c} containing at least
one a and at least one b.
th
5. Write Regular Expression for the language that have the set of all strings of 0s and 1s whose 10
symbol from the right end is 1.
6. Write Regular Expression for the language that has the set of all strings of 0s and 1s with at most one
pair of consecutive 1s.
7. Write Regular Expression for the language that have the set of all strings of 0s and 1s such that every
pair of adjacent 0s appears before any pair of adjacent 1s.
8. Write Regular Expression for the language that have the set of all strings of 0s and 1s whose no of 0s
is divisible by 5.
9. Write Regular Expression for the language that has the set of all strings of 0s and 1s not containing
101 as a substring.
10. Write Regular Expression for the language that have theset of all strings of 0s and 1s such that no
prefix has two more 0s than 1s, not two more 1s than 0s.
11. Write Regular Expression for the language that have the set of all strings of 0s and 1s whose no of 0s
is divisible by 5 and no of 1s is even.
12. Give NFA of the languages of the regular expression (1+ )(00*1)*0*.
13. Give NFA of the languages of the regular expression (0*1*)*000(0+1)*.
14. Give NFA of the languages of the regular expression (0+10)*1*.
15. Convert the following RE to NFA. 01*.
16. State the pumping lemma for Regular languages.
17. State the closure properties of Regular language.
18. Draw finite automata for regular expression a|b.
19. 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}
n n
20. Show that the set L={a b |n>=1} is not a regular.
21. Construct a DFA equivalent to the NFA given below:
0 1
p {p,q} p
q r r
r s -
s s s
n n
22. Check whether the language L=(0 1 /n>=1) is regular or not? Justify your answer.
+
23. Construct a NDFA accepting all string in {a,b} with either two consecutive as or two consecutive bs.
24. Give the DFA accepting the following language: set of all strings beginning with a 1 that when
interpreted as a binary integer is a multiple of 5.
25. Draw the NFA to accept the following languages.
(i) Set of Strings over alphabet {0,1,.9} such that the final digit has appeared before.
(ii)Set of strings of 0s and 1s such that there are two 0s separated by a number of positions that is a
multiple of 4.
26. Construct DFA equivalent to the NFA given below:

27. Consider the following NFA. Compute the closure of each state and find its equivalent DFA.
A b C
p {p}
q {q}
* {r}
r
28. Convert the following NFA to its equivalent DFA
0 1
p {p,q} {p}
q {r} {r}
r {s}
* {s} {s}
s
29. For pumping lemma for regular language, what is w, x, y, z and write lemma.

III. LONG ANSWER TYPE:


1. Construct an NFA equivalent to (0+1)*(00+11)
2. a) Construct an NFA equivalent to the regular expression (0+1)*(00+11)(0+1)*.
b) Obtain the regular expression that denotes the language accepted by the following DFA.

3. a) Construct an NFA equivalent to the regular expression ((0+1)(0+1)(0+1))*


b) Construct an NFA equivalent to 10+(0+11)0*1
4. a) Obtain the regular expression denoting the language accepted by the following DFA
b) Obtain the regular expression denoting the language accepted by the following DFA by using the
k
formula Rij

5. a) Show that every set accepted by a DFA is denoted by a regular Expression


b) Construct an NFA equivalent to the following regular expression01*+1.
2
6. a) Define a Regular set using pumping lemma Show that the language L={0i / i is an integer,i>=1} is
not regular
b)Construct an NFA equivalent to the regular expression 10+(0+11)0*1
n2/n
7. a) Show that the set L={O is an integer,n>=1} is not regular.
*
b) Construct an NFA equivalent to the following regular expression ((10)+(0+1) 01.
8. a) Prove that if L=L(A) for some DFA A,then there is a regular expression R such that L=L(R).
p
b) Show that the language {0 ,p is prime} is not regular.
9. Find the regular expression for the set of all strings from the deterministic finite automata given below:

10. Construct transition diagram of a finite automaton corresponding to the regular expression (ab+c
**
) b.
11. Find the regular expression corresponding to the finite automaton given below.

12. Find the regular expression for the set of all strings from the deterministic finite automata given
below.

13. Find regular expression of the below automata

14. Write about Mealy machine and Moore machine with example.
15. Transform given NFA to DFA.
16. Determine string acceptability of 01100 using transition function for below automata. Draw
Transition table.

17. Write definition of FSA with explanation of transition function .


18. Show that language L={anbm|m,n>=1} is regular language using pumping lemma.
19. The language {anbcn|n>=1} is regular or not using pumping lemma.
20. Conversion of NFA to DFA :-

a a b b 33 a,b
2 b 4
11
21. Conversion of NFA to DFA :-

a a b
1 2
a b b

3
22. Conversion of NFA to DFA :-

b
A B
b a a

C D
23. Conversion of NFA to DFA :-

0,1 0 0
0,1 0 Y
S R
0,1 0
1
X 0

24. Conversion of NFA to DFA :-

A 1
0 1B 1 C
0
1
1 0
0

E D

UNIT-III

I. OBJECTIVE TYPE
1. A grammar has the following productions: S->aSSb | a | bSa
Which of the following sentences are in the language that is generated by this grammar?
a) aaaaabb b) aabbaabb c) bbbaabbaa d) All of the above
2. Let G1 and G2 be context-free grammars. Which of the following is the most precise statement that
holds?
a) L(G1) U L(G2) is always context-free b) Sometimes, G1 U G2 is context-free
c) L(G1) L(G2) is never context-free d) All statements above are valid
3. Which of the following statements is the most correct answer?
a) A language is ambiguous if every sentence has two or more parse trees
b) A language is unambiguous if every sentence has a unique left-most derivation
c) A context-free grammar is ambiguous if the right-hand side of one of its production rules starts with
the non-terminal that appears on the left-hand side.
d) All three statements above are valid.
4. Push down machine represents which grammar:
A) Type 0 B) Type 1 C) Type-2 D) Type-3
5. L = {a | p is prime}
P

a) regular b) not regular c) accepted by FSA d) accepted by PDA


6. Which of the following strings is not generated by the following grammar? S SaSbS |
a. aabb b. abab c. aababb d. aaabb
7. Consider the following language L = {anbn|n 1} then L is
a. regular b. CSL but not CFL
c. CFL but not regular d. type 0 language but not type 1
8. Context free grammar is?
a) A compiler
b) A language expression
c) A regular expression
d) None of these
9. Which of the following does not belong to the context free grammar?
a) Terminal Symbol
b) Non -terminal symbol
c) Start symbol
d) End symbol
10. A Context free grammar is a?
a) Type 1
b) Type 2
c) Type 3
d) None of the above
11) Context free languages are not closed under ________.
a) Union
b) Concatenation
c) Closure
d) Iteration
12) Context free language can be recognized by_______.
a) Finite State Automaton
b) Linear bounded automaton
c) Pushdown automaton
d) Both a and b

13. Grammar that produce more than one Parse tree for same sentence is_______.
a) Ambiguous
b) Unambiguous
c) Complementation
d) Concatenation Intersection
14) The logic of pumping lemma is a good example of _________.
a) The pigeon hole principle
b) Divide and conquer method
c) Iteration
d) Recursion
15) Pumping lemma is generally used for proving that _________.
a) Given grammar is regular
b) Given grammar is not regular
c) Whether two given regular expression are equivalent or not
d) None of these
16 CNF is stands for__________.
a) Context normal form
b) Complete normal form
c) Chomsky normal form
d) Compared normal form
17 Type three grammar is________.
a) Context sensitive grammar
b) Context free grammar
c) Regular grammar
d) None of these
18 Normal form is__________.
a) One
b) Two
c) Three
d) Four
19 Production S AB|^, Aa, Bb is _________.
a) CYK Form
b) CNF Form
c) GNF Form
d) None of these
20. For one or more than one derivation tree the string is called_________.
a) Ambiguity
b) Derivation tree
c) Parse tree
d) Left most tree
21 A CFG SaB/bA
Ab/aS/bAA
Bb/bs/aBB
Generates string of terminates that have
a) Equal no. of as and bs
b) Odd no. of as and odd no. of bs
c) Even no. of as and even no. of bs
d) Odd no of as and even no. of as

22 Union property of CFL is_______.


a) L (G) =L1 U L2
b) L (G) =L1.L2
c) L (G) =L*
d) All of the above

II. SHORT ANSWER TYPE


1. Define CFG .Find L(G)where G=({S},{0,1},{S->0S1,S->},S).
2. Define derivation tree for a CFG (or) Define parse tree.
n n
3. Construct the CFG for generating the language L={a b /n>=1}.
4. Let G be the grammar S->aB/bA,A->a/aS/bAA,B->b/bS/aBB.for the string aaabbabbba find the left
most derivation.
5. Let G be the grammar S->aB/bA,A->a/aS/bAA,B->b/bS/aBB. obtain parse tree for the string
aaabbabbba.
6. For the grammar S->aCa,C->aCa/b.Find L(G).
7. Show that id+id*id can be generated by two distinct leftmost derivation in the grammar E->E+E | E*E |
(E) | id .
8. For the grammar S->A1B,A->0A | , B-> 0B | 1B| ,give leftmost and rightmost derivations for the
string 00101.
9. Find the language generated by the CFG G=({S},{0,1},{S->0/1/ , S->0S0/1S1},S).
10. Obtain derivation tree for grammar G=({S,A},{a,b},P,S) where P consist of S->aAS / a, A->SbA / SS / ba.
m n p
11. Write the CFG to generate the set {a b c | m + n=p and p>=1}.
12. Construct a derivation tree for the string 0011000 using the grammar S->A0S |0 | SS , A-> S1A | 10.
13. 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.
14. Define the acceptance of a PDA by empty stack. Is it true that the language accepted by a PDA by
empty stack or by that of final state are different languages.
15. Give the formal definition of a PDA.
16. Draw Parse tree for given string abaa if grammar G is: S->aAS|a|SS, A->SbA|ba
17. Define PDA with its machine.
18. Why we use stack for PDA in recognizing CFL?
19. What is a grammar and types of grammar?
20. Explain context Free Grammar with example.
21. Explain parse tree with example.
22. Explain Yield and Sub-tree in the relation of parse tree
23. Write closure properties of context free grammar?
24. Explain pumping lemma for CFL?
25. Explain Application of pumping lemma.
26. Explain Left most derivation and Right most derivation.
27. Construct a context-free grammar G generating all integers (with sign).
28. If G is the grammar SSbS|a ,show that G is ambiguous.
29. Explain about Chomsky Normal Form.
30. Explain about in GREIBACH Normal form.
31. Show that a CFG G with productions SSS |(s) | ^ is ambiguous.
32. Check the grammar ambiguous or not
SiCtS
SiCtSeS
Sa
Sb
33. Construct parse tree and derivation tree of string bbabbbbab if production SSAS|b, Aba.
III. LONG ANSWER TYPE:
1. Let G be a grammar s->OB/1A, A->O/OS/1AA, B->1/1S/OBB. For the string 00110101 find its
leftmost derivation and derivation tree.
2. a) If G is the grammar S->Sbs/a, Show that G is ambiguous.
b) Give a detailed description of ambiguity in Context free grammar
3. a) Show that E->E+E/E*E/(E)/id is ambiguous. (6) b)Construct a Context free grammar G which
accepts N(M), where M=({q0, q1},{a,b},{z0,z},,q0,z0,) and where is given by
(q0,b,z0)={(q0,zz0)}
(q0, ,z0)={(q0, )}
(q0,b,z)={(q0,zz)}
(q0,a,z)={(q1,z)}
(q1,b,z)={(q1, )}
(q1,a,z0)={(q0,z0)}
n m n
4. Construct a PDA accepting {a b a /m,n>=1} by empty stack. Also construct the corresponding
context-free grammar accepting the same set.
5. a) Construct a equivalent grammar G in CNF for the grammar G1 where G1 =({S,A,B},{a,b},{S->bA/aB,A-
>bAA/aS/a, B->aBB/bS/b},S)
b)Find the left most and right most derivation corresponding to the tree.

6. Find the language generated by a grammar G=({S},{a,b},{S->aSb, S->ab},S)


7. Given G=({S,A},{a,b},P,S) where P={S->AaS|S|SS,A->SbA|ba} S-Start symbol. Find the left most and right
most derivation of the string w=aabbaaa. Also construct the derivation tree for the string w.
8. Define a PDA. Give an Example for a language accepted by PDA by empty stack.
9. G denotes the context-free grammar defined by the following rules. ` S->ASB/ab/SS A->aA/A ,B->bB/A
(i)Give a left most derivation of aaabb in G. Draw the associated parse tree.
(ii)Give a right most derivation of aaabb in G. Draw the associated parse tree.
(iii) Show that G is ambiguous. Explain with steps.
(iv) Construct an unambiguous grammar equivalent to G. Explain.
10. Construct the grammar for the following PDA. M=({q0, q1},{0,1},{X,z0},,q0,Z0,) and where is
given by
(q0,0,z0)={(q0,XZ0)}, (q0,0,X)={(q0,XX)},(q0,1,X)={(q1, )}, (q1,1,X)={(q1, )},(q1, ,X)={(q1, )},
(q1, , Z0)={(q1, )}.
11. Show that language L={anbncn|n>=1} is not context free language using pumping lemma.
12. Convert into Chomsky Normal Form
S->ASB|AB|b
A->BC|a
A->a
B->bb
13. Explain ambiguity in context-free grammar.
14. What are Normal forms for context- free grammar in details?
15. Reduce the following grammar G to CNF.G is SaAD, AaB|bAB, Bb, Dd.
16. Find the grammar in Chomsky normal form equivalent to SaAbB. AaA|a ,
BbB|b.
17. Construct a grammar in Greibach normal form equivalent to the grammar
SAA|a, ASS|b.
18. Convert the grammar SAB, ABS|b, BSA|a into GNF.
19. Reduce the following CFG to GNF :
SABb|a, AaaA, Bbab
20. Write and proved the pumping lemma in of the CFL.
21. Contruct left most derivation and parse tree If Production in grammar G are SaA|bB,Aa|bA|aA,Ba|bS
and string of aaabba.
22. Show that L={ap |p ia a prime }is not a context free language.
UNIT-IV
I. OBJECTIVE TYPE
1. Which is not the correct statement(s) ?
(i) Every context sensitive language is recursive.
(ii) There is a recursive language that is not context sensitive.
A. is true, (ii) is false.
B. is true and (ii) is true.
C. is false, (ii) is false.
D. is false and (ii) is true.

2. Correct hierarchical relationship among context- free, right-linear, and context-sensitive language is
A. context-free right-linear context-sensitive
B. context-free context-sensitive right-linear
C. context-sensitive right-inear context-free
D. right-linear context-free context-sensitive
3. In a context-sensitive grammar, number of grammar symbols on the left hand side of a production can't
be greater than the number of
A. grammar symbols on the right hand side
B. terminals on the right hand side
C. non-terminals on the right hand side
D. all of these

4. How many tuples are there in LBA?


a) 9 b) 6 c) 7 d) 8

5. How many parameters are there in transition function of LBA?


a. 2 b. 3 c. 5 d. 1

SHORT ANSWER TYPE:


1. Write definition of Linear Bounded Automata with proper diagram of LBA machine.
2. Write definition of Context sensitive language and grammar with an example. Write any 4 closure
properties of CSG.

III. LONG ANSWER TYPE:


1.

UNIT-V
I. OBJECTIVE TYPE
1. How many tuples are there in TM?
a) 5 b) 6 c) 7 d) 8
2. Which of the following statements is/are FALSE?
a. For every non-deterministic Turing machine, there exists an equivalent deterministic Turing machine.
b. Turing recognizable languages are closed under union and complementation.
c. Turing decidable languages are closed under intersection and complementation
d. Turing recognizable languages are closed under union and intersection.
3. Recursively enumerable languages are not closed under
a. union b. homomorphism c. complementation d. concatenation
4. TM is more powerful the FSM because
a. the tape movement is confined to one direction b. it has no finite state control
c. it has the capability to remember arbitrary long sequences of input symbols d. none
5. PDA behaves like a TM when the number of auxiliary memory it has is
a. 0 b. 1 or more c. 2 or more d. none
6. UTM influenced the concept of
a. stored-program computers b. implementation of programming languages
c. computability d. all of these
7. The number of internal states of a UTM should be at least
a. 1 b. 2 c. 3 d. 4
8. Any TM with m symbols and n states can be simulated by another TM with just 2 symbols and less than
a. 8mn b. 8mn+4m c. 8mn+4states d. mn states
9. A TM cant solve halting problem
a. true b. false c. still a question d. none
10. If there exists a TM which when applied to any problem in the class, terminates if thhe correct answer
is yes, and , may or may not terminate otherwise is said to be
a. stable b. unsolvable c. partially solvable d. unstable

II. SHORT ANSWER TYPE:


1. Define multitape Turing Machine.
2. Explain the Basic Turing Machine model and explain in one move. What are the actions take place in
TM?
3. Explain how a Turing Machine can be regarded as a computing device to compute integer functions.
4. Explain the multi tape Turing Machine mode. Is it more power than the basic Turing machine? Justify
your answer.
5. What is meant by a Turing Machine with two way infinite tape.
6. Define instantaneous description of a Turing Machine.
7. Design/representation of Turing Machine for the given transition function TM={Q, , , , q0, #, qf}
where
Q={q0, q1, q2, qf}, ={a,b}, ={a,b,x,y,#}, q0= q0, # = #, h= qf and the transition function is defined below
a. (S,a)=(A,b,R) b. (S,x)=(A,y,L) c. (A,x)=(B,y,R) d. (B,y)=(C,#,R) e. (C,x)=(S,y,L)
8. What do you mean by universal Turing Machine?
9. Define recursively enumerable language.
10. Give an example for an undecidable problem.
III. LONG ANSWER TYPE:
1. Design the Universal Turing Machine for the given transition function
a. (S,a)=(A,b,R) b. (S,x)=(A,y,L) c. (A,x)=(B,y,R) d. (B,y)=(C,#,R) e. (C,x)=(S,y,L)
2. Describe all the types of Turing Machine.
3. Obtain the code for the TM M=({q1,q2,q3},{0,1},{0,1,B}, ,q1,B,{q2}) With the moves (q1,1)=(q3,0,R);
(q3,0)=(q1,1,R); (q3,1)=(q2,0,R); (q3,B)=(q3,1,L); (q3,B)=(q3,1,L)

You might also like