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

Mock 10 – Mixed Practice

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

All 10 topic-wise mocks in this unit
0 / 29 answered 00:00
Q1. Given the functions:
Predecessor function: Pred(x) = x − 1
and T(x, y+1) = Pred(T(x, y)), T(x, 0) = x.
Which of the following operations is a candidate for T?

Directions (Q91–95): Consider the following Three Address Code sample for solving the questions:

100: t1 = y + 2
101: initial = x / t1
102: limit = 10
103: if i > j goto 105
104: goto 111
105: if num > b goto 107
106: goto 111
107: num = limit - 1
108: b = y + 2
109: i = i - num
110: goto 103
111: j = i - num
112: k = j + b
Q2. What are the various LEADERS (leading statements) for the TAC given in the passage?
Q3. Let L = {ab, aa, baa}. Which of the following strings is NOT in L*?
Q4. Which of the following symbol-table implementations is best suited if access time is to be minimum?
Q5. The precedence of regular-expression operators from lowest to highest is:

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)
Q6. What is the move in the cell numbered M1 of the table?

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)
Q7. What is the move in the cell numbered M3 of the table?

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)
Q8. What is the move in the cell numbered M5 of the table?
Q9. Consider L = {ab, aa, baa}. Which of the following strings is NOT in L*?
Q10. Match List – I with List – II.
List – I (Propositions)
(A) P ∧ (P → Q)
(B) ¬(P ∨ Q) → (P ∧ Q)
(C) P → Q
(D) P ∨ (Q ∧ R)
List – II (Disjunctive Normal Form)
(I) P ∨ Q
(II) (P ∧ ¬P) ∨ (P ∧ Q)
(III) (¬P) ∨ Q
(IV) (P ∧ P) ∨ (P ∧ Q) ∨ (P ∧ R) ∨ (Q ∧ R)
Q11. Overfitting is expected when we observe that?
Q12. Match List (I) with List (II):
List I
A. Product Complexity
B. Structured System Analysis
C. Coupling & cohesion
D. Symbolic Execution
List II
I. System Requirements Design
II. Software design
III. Validation techniques
IV. Software cost estimation
Choose the correct answer from the options given below:
Q13. Which one of the following is not typically provided by Source Code Management Software?
Q14. Which of the following super computers is the fastest?
Q15. Which of the following statements about ERP system is true?
Q16. Which of the following is not a Clustering method?
Q17. Which of the given wireless technologies used in IoT, consumes the least amount of power?
Q18. The distributed system is a collection of (P) and communication is achieved in a distributed system by (Q), where (P) and (Q) are:

Directions (Q91–95): Consider the following three-address code.
100: t1 = y + 2
101: initial = x / t1
102: limit = 10
103: if i > j goto 105
104: goto 111
105: if num > b goto 107
106: goto 111
107: num = limit − 1
108: b = y + 2
109: i = i − num
110: goto 103
111: j = i − num
112: k = j + b

Q19.

What all blocks does Block 3 and Block 5 dominate in the Flow graph for the TAC given in the passage?

Directions (Q91–95): Consider the following three-address code.
100: t1 = y + 2
101: initial = x / t1
102: limit = 10
103: if i > j goto 105
104: goto 111
105: if num > b goto 107
106: goto 111
107: num = limit − 1
108: b = y + 2
109: i = i − num
110: goto 103
111: j = i − num
112: k = j + b

Q20.

Which of the followings is the correct Flow graph for the TAC given in the passage?

Q21.

Let L= {ab, aa, baa}. Which of the following strings are not in L*?

Directions (Q96–100): A Turing machine for L = {aⁿbᵐcⁿdᵐ | n ≥ 1, m ≥ 1} is designed as M = ({q0, …, q7, qf}, {a, b, c, d}, {a, b, c, d, X1, X2, Y1, Y2, B}, δ, q0, B, {qf}). X1 and X2 mark matched a's and c's; Y1 and Y2 mark matched b's and d's. Part of δ is given in the transition table (shown with each question); cells M1–M5 are to be filled.

Q22.

What is the Move in the cell with number 'M1' of the resultant Table?

Figure

Directions (Q96–100): A Turing machine for L = {aⁿbᵐcⁿdᵐ | n ≥ 1, m ≥ 1} is designed as M = ({q0, …, q7, qf}, {a, b, c, d}, {a, b, c, d, X1, X2, Y1, Y2, B}, δ, q0, B, {qf}). X1 and X2 mark matched a's and c's; Y1 and Y2 mark matched b's and d's. Part of δ is given in the transition table (shown with each question); cells M1–M5 are to be filled.

Q23.

What is the Move in the cell with the number 'M2' of the resultant Table?

Figure

Directions (Q96–100): A Turing machine for L = {aⁿbᵐcⁿdᵐ | n ≥ 1, m ≥ 1} is designed as M = ({q0, …, q7, qf}, {a, b, c, d}, {a, b, c, d, X1, X2, Y1, Y2, B}, δ, q0, B, {qf}). X1 and X2 mark matched a's and c's; Y1 and Y2 mark matched b's and d's. Part of δ is given in the transition table (shown with each question); cells M1–M5 are to be filled.

Q24.

What is the Move in the cell with number 'M3' of the resultant Table?

Figure

Directions (Q96–100): A Turing machine for L = {aⁿbᵐcⁿdᵐ | n ≥ 1, m ≥ 1} is designed as M = ({q0, …, q7, qf}, {a, b, c, d}, {a, b, c, d, X1, X2, Y1, Y2, B}, δ, q0, B, {qf}). X1 and X2 mark matched a's and c's; Y1 and Y2 mark matched b's and d's. Part of δ is given in the transition table (shown with each question); cells M1–M5 are to be filled.

Q25.

What is the Move in the cell with number 'M5' of the resultant Table?

Figure
Q26.

Consider L = {ab, aa, baa}. Which string is NOT in L*?

Q27.

Assertion (A): A load-and-go assembler avoids the overhead of writing the object program out and reading it back in. Reason (R): This can be done with either a one-pass or a two-pass assembler.

Q28.

Let Σ = {w, x} and T = {x, y, z}, with homomorphism h(x) = xzy and h(w) = zxyy. If L is denoted by r = (w + x*)(ww)*, then h(L) is denoted by

Q29.

The number of substrings that can be formed from a string given by a d e f b g h n m p is