Roll No. …………………..
BCA–C402
Bachelor of Computer Applications
(Fourth Semester)
EXAMINATION, 2022-23
THEORY OF COMPUTATION
1
Time : 22 Hours
Maximum Marks : 60
Note : All questions have to be attempted.
Section—A
1. Multiple choice questions : 1 each
(a) The set of all strings over the alphabet S = a, b
is denoted by : (CO1, BL-1)
(i) ( a + b )*
(ii) ( a + b )+
(iii) ( a + b )−
(iv) a*b*
P. T. O.
[2] BCA–C402
(b) Which of the following regular expression
identity is true ? (CO2, BL-2)
(i) r ( *) = r *
(ii) ( r * s *) = ( r + s )*
(iii) ( r + s )* = r* + s*
(iv) r *s* = r * + s*
(c) The logic of pumping lemma is a good example
of : (CO4, BL-3)
(i) Pigeon-hole principle
(ii) Recursion
(iii) Iteration
(iv) Divide and Conquer technique
(d) Context free grammar is recognized by ?
(CO4, BL-2)
(i) FA
(ii) PDA
(iii) TM
(iv) Both (i) and (ii)
(e) Context free language is closed under ?
(CO3, BL-3)
(i) Union
(ii) Complement
(iii) Intersection
(iv) None of the above
[3] BCA–C402
(f) The intersection of CFL and RL : (CO3, BL-4)
(i) is always regular
(ii) is always context free
(iii) Both (i) and (ii)
(iv) Need not be regular
(g) The language L= 0n1n 2n where n 0 is a :
(CO4, BL-4)
(i) Context free language
(ii) Context Sensitive language
(iii) Regular language
(iv) Recursive language
(h) Minimum number of stack is required for
implementing finite state machine : (CO5, BL-2)
(i) 0
(ii) 1
(iii) 2
(iv) 3
(i) The minimum number of states required to
recognize an empty string over alphabet
= a, b ? (CO2, BL-1)
(i) 0
(ii) 1
(iii) 2
(iv) 3
P. T. O.
[4] BCA–C402
(j) Number of minimum states require to accept
string ends with 001 over = 0,1 in DFA ?
(CO3, BL-4)
(i) 3
(ii) 2
(iii) 1
(iv) 4
(k) Which of the function can a turing machine not
perform ? (CO5, BL-3)
(i) Copying a string
(ii) Deleting a symbol
(iii) Accepting a palindrome
(iv) Inserting a symbol
(l) The language accepted by Push Down
Automata ? (CO5, BL-2)
(i) Context free language
(ii) Regular language
(iii) Both (i) and (ii)
(iv) Recursive language
Section—B
2. Attempt any four of the following : 3 each
(a) Write the difference between DFA and NFA.
(CO2, BL-3)
[5] BCA–C402
(b) Construct a DFA that accepts a language L which
has the number of zero’s is of multiple of 3 over
an alphabet = 0,1 . (CO2, BL-3)
(c) Construct a minimal DFA to accept a string over
alphabet = a, b . Which ends with “aba”.
Also create transition table and validate the
machine with sample inputs. (CO3, BL-2)
(d) State and prove the pumping lemma for regular
language. (CO2, BL-3)
(e) Define ambiguous grammar. Show that the
following grammar is ambiguous : (CO3, BL-5)
S → aSbS/bSaS/ ( epsilon )
3. Attempt any two questions : 6 each
(a) Obtain the left and right derivation for a string
w = 001122 for the production rules :
(CO3, BL-5)
S → AB, A → O1/OA/, B → 2B/ (epsilon)
(b) Prove that regular language is closed under
intersection and union. (CO4, BL-4)
(c) Explain the block diagram of PPA with its
components specification. (CO4, BL-3)
P. T. O.
[6] BCA–C402
4. Attempt any two questions : 6 each
(a) Convert the following NFA into DFA :
(CO2, BL-3)
(b) The state diagram for Moore Machine is given as
follow : (CO4, BL-6)
(i) Draw the transition table for Moore
machine.
(ii) Find the output for the input string
011011010
(c) Discuss the Chomsky hierarchy of grammar with
suitable examples. (CO3, BL-6)
[7] BCA–C402
5. Attempt any two questions. 6 each
(a) Obtain regular expression from the given finite
automata : (CO4, BL-3)
(b) Convert the following grammar to CNF form :
(CO5, BL-5)
S → A/ABO/AIA, A → AO/C
B → BI/BC, C → CB/CA/IB
(c) Define PCP and prove that PCP is undecidable.
(CO4, BL-6)
BCA–C402
P. T. O.