All mock tests are FREE till 31 December — register to save your progress
Paper 2 CS · UNIT 08 · MOCK TEST

Mock 2 – Finite Automata & Regular Languages (Part 2)

Unit 8: Theory of Computation and Compilers · 25 questions · about 30 minutes. Press End Mock any time to see your score and the correct answers.

All 10 topic-wise mocks in this unit
0 / 25 answered 00:00
Q1. Which of the following is an ε-free grammar?
Q2. What are the minimum and maximum numbers of initial, dead, unreachable and final states in a valid n-state finite automaton whose accepted language is not φ?
Q3. Which of the following finite automata recognise the language L = {a, b}*?
A. M = ({q0}, {a, b}, δ, q0, {q0}) with δ(q0, a) = {q0}, δ(q0, b) = {q0}
B. M = ({q0, q1}, {a, b}, δ, q0, {q0, q1}) with δ(q0, a) = δ(q0, b) = {q0, q1}, δ(q1, a) = δ(q1, b) = {q1}
C. M = ({q0, q1}, {a, b}, δ, q0, {q0, q1}) with δ(q0, a) = {q0, q1}, δ(q0, b) = {q0}, δ(q1, a) = –, δ(q1, b) = {q1}
D. M = ({q0, q1, q2}, {a, b}, δ, q0, {q0}) with δ(q0, a) = δ(q0, b) = {q0}, δ(q1, a) = {q2}, δ(q1, b) = –, δ(q2, a) = {q0}, δ(q2, b) = {q2}
Q4. In the pumping lemma for regular languages, writing the string as xyz, what is the minimum length of y?
Q5. The item generated by the production A → ε is:
Q6. In the ε-NFA M = ({q0, q1, q2, q3}, {a}, δ, q0, {q3}), where δ is given in the transition table below, what is the minimum length of string to reach the final state?
Stateεa
q0{q1}{ }
q1{q2}{ }
q2{ }{q2, q3}
q3{ }{ }
Q7. Which of the following are correct for regular expressions?
a. φ + L = L + φ = L
b. εL = Lε = L
c. φL = Lφ = φ
d. φL = Lφ = L
Choose the correct answer from the options given below:
Q8. Match the following based on the lengths of strings in the language accepted (using the brute-force method of parsing).
Choose the correct answer from the options given below:
List IList II
a. S → aSa | aaI. ((2n × 3) − 4); n ≥ 1
b. S → aaSaa | aaII. 2n; n ≥ 1
c. S → aaaSaaa | aaIII. ((4 × 2n) − 6); n ≥ 1
d. S → aaaaSaaaa | aaIV. 2n − 2; n ≥ 2

Directions (Q96–100): A Turing machine for the language L = {anbmcndm | n ≥ 1, m ≥ 1} is designed. The model is M = ({q0, q1, q2, q3, q4, q5, q6, q7, qf}, {a, b, c, d}, {a, b, c, d, X1, X2, Y1, Y2, B}, δ, q0, B, {qf}), and part of δ is given in the transition table below. X1 and X2 are used to mark a's and c's, and Y1 and Y2 to mark b's and d's.

abcdX1X2Y1Y2B
q0(q1, X1, R)M2
q1(q1, a, R)(q1, b, R)M1(q1, X2, R)
q2(q2, a, L)(q2, b, L)(q2, X1, R)(q2, X2, L)
q3M3(q4, Y1, R)(q6, X2, R)
q4(q4, b, R)(q5, Y2, L)M5(q4, Y2, R)
q5(q5, b, L)(q5, X2, L)M4(q5, Y2, L)
q6(q6, X2, R)(q7, Y2, R)
q7(q7, Y2, R)(qf, B, R)
Q9. What is the move in the cell numbered M2 of the table?
Q10. Consider the language L = {anbm : n ≥ 4, m ≤ 3}. Which regular expression represents L?
Q11. Consider the NPDA M = ({q0, q1, qf}, {a, b}, {1, z}, δ, q0, z, {qf}) with
δ(q0, λ, z) = {(qf, z)}
δ(q0, a, z) = {(q1, 11z)}
δ(q1, a, 1) = {(q1, 111)}
δ(q1, b, 1) = {(q1, λ)}
δ(q1, λ, z) = {(qf, z)}
Which language L is accepted by the NPDA?
Q12. Mr X designed open source software which must comply with some criteria. Choose the false statement in respect of above.
(A) No restriction on redistribution of the software as part or whole
(B) The integrity of the author's source code must be maintained.
(C) The software can be sold after distribution.
Q13. Which of the following statements is incorrect for Parallel Virtual Machine (PVM)?
Q14.

Consider the following DFA

Figure

Which of the following NFA is valid for the given DFA ?

Q15.

Consider the following DFA that generates set of Σ = {a, b, c} strings over

Figure

Now identify that which of the followings is the best description of the language for the above DFA

Directions (Q91–95): A machine is represented by states Q, input alphabet Σ = {a, b}, a transition function δ, initial state q0 and final states F. It accepts all strings over Σ that contain abb as a substring, with any combination of a and b before and after it.

Q16.

For the above mentioned passage which of the following is correct?

Directions (Q91–95): A machine is represented by states Q, input alphabet Σ = {a, b}, a transition function δ, initial state q0 and final states F. It accepts all strings over Σ that contain abb as a substring, with any combination of a and b before and after it.

Q17.

Which of the following represented the minimum state DFA for the above specified passage?

Directions (Q91–95): A machine is represented by states Q, input alphabet Σ = {a, b}, a transition function δ, initial state q0 and final states F. It accepts all strings over Σ that contain abb as a substring, with any combination of a and b before and after it.

Q18.

For the above specified passage, which of the following is DFA for the language represented/accepeted by machine?

Directions (Q91–95): A machine is represented by states Q, input alphabet Σ = {a, b}, a transition function δ, initial state q0 and final states F. It accepts all strings over Σ that contain abb as a substring, with any combination of a and b before and after it.

Q19.

For the above specified passage, which of the following represents the regular expression?

Figure
Q20.

For the regular languages and context-free languages which is not correct?

A. both are closed under union operation

B. both are closed under concatenation operation

C. both are closed under intersection operation

D. both are closed under complementation operation

E. both are closed under kleen star operation

Choose the most appropriate answer from the options given below :

Q21.

For the given two machines which of the following is correct?

Figure
Q22.

Let A={a, b} and L=A*. Let X={anbn, n>0}. The languages L U X and X are respectively :

Q23.

The sum of minimum and maximum number of final states for a Deterministic Finite Automata (DFA) having ' P ' state is equal to :

Q24.

Which of the statement is/are CORRECT ?

(A) Moore and Mealy machines are finite state machines with output capabilities.

(B) Any given Moore machine has an equivalent Mealy machine.

(C) Any given Mealy machine has an equivalent Moore machine.

(D) Moore machine is not a finite state machine.

Q25.

Consider the following finite automata F1 that accepts a language L

Figure

Let F2 be a finite automata which is obtained by reversal of F1. Then which of the following is correct?