CS701 – Theory of Computation: Midterm Important MCQs (50 Solved Questions)
Virtual University of Pakistan • Read every solved MCQ with its verified answer key directly on this page. Free, no login required.
All 664 Midterm Packs · CS701 Course Page · CS701 Subjective Pack (17 Q&As)
-
Which of the following is NOT part of the formal definition of a Turing machine?
Topic: Turing Machines and Their Variants
- A finite set of states Q
- A tape alphabet Γ
- A transition function δ
- An output printer ✓ Correct answer
-
If δ(q, a) = (r, b, R), then when the machine is in state q reading the symbol a, it:
Topic: Turing Machines and Their Variants
- Erases a and halts
- Writes b, moves the head right, and enters state r ✓ Correct answer
- Writes b, moves the head left, and stays in state q
- Moves the head right without writing anything
-
A Turing machine that halts on every input is called a:
Topic: Turing Machines and Their Variants
- Recognizer
- Enumerator
- Decider ✓ Correct answer
- Universal machine
-
A language L is Turing-recognizable if:
Topic: Turing Machines and Their Variants
- L is a finite language
- Some Turing machine accepts every string in L and halts on every input
- Some Turing machine accepts exactly the strings of L and may loop forever on strings not in L ✓ Correct answer
- L is generated by a context-free grammar
-
Which of the following variants has exactly the same computational power as an ordinary Turing machine?
Topic: Turing Machines and Their Variants
- A Turing machine whose head can move only right or stay put
- A multitape Turing machine ✓ Correct answer
- A Turing machine that is never allowed to write on its tape
- A finite automaton
-
A Turing machine variant with stay put instead of left, whose transition function has the form δ : Q × Γ → Q × Γ × {R, S}, recognizes exactly the class of:
Topic: Turing Machines and Their Variants
- Turing-recognizable languages
- Context-free languages
- Decidable languages
- Regular languages ✓ Correct answer
-
Every t(n)-time multitape (k-tape) Turing machine has an equivalent single-tape Turing machine that runs in time:
Topic: Turing Machines and Their Variants
- O(t(n))
- O(t(n) log t(n))
- O(t²(n)) ✓ Correct answer
- 2^O(t(n))
-
Every t(n)-time nondeterministic Turing machine has an equivalent deterministic Turing machine that runs in time:
Topic: Turing Machines and Their Variants
- O(t(n))
- O(t²(n))
- O(t(n) log t(n))
- 2^O(t(n)) ✓ Correct answer
-
An enumerator for a language L is a Turing machine that:
Topic: Turing Machines and Their Variants
- Decides L
- Prints out exactly the strings of L ✓ Correct answer
- Prints out exactly the strings not in L
- Counts the number of strings in L
-
The language A_TM = {⟨M, w⟩ | M is a Turing machine and M accepts w} is:
Topic: Decidability and the Halting Problem
- Decidable
- Turing-recognizable but not decidable ✓ Correct answer
- Not Turing-recognizable
- A regular language
-
The universal Turing machine U is significant because it:
Topic: Decidability and the Halting Problem
- Decides A_TM
- Halts on every input
- Simulates any Turing machine on any input, which shows that A_TM is Turing-recognizable ✓ Correct answer
- Enumerates all languages over an alphabet
-
In the diagonalization proof that A_TM is undecidable, the machine D is constructed so that on input ⟨M⟩ it:
Topic: Decidability and the Halting Problem
- Simulates M on the empty string
- Runs the assumed decider H on ⟨M, ⟨M⟩⟩ and then does the opposite of what H predicts ✓ Correct answer
- Enumerates all Turing machines in order
- Decides whether M halts on ⟨M⟩ by simulation
-
A language L is decidable if and only if:
Topic: Decidability and the Halting Problem
- L is Turing-recognizable
- L is a finite language
- Both L and its complement are Turing-recognizable ✓ Correct answer
- L is context-free
-
The language E_TM = {⟨M⟩ | M is a Turing machine and L(M) = ∅} is:
Topic: Decidability and the Halting Problem
- Decidable
- Turing-recognizable but not decidable
- Undecidable, and not Turing-recognizable ✓ Correct answer
- The same language as A_TM
-
Rice's theorem states that every nontrivial property of ______ is undecidable.
Topic: Decidability and the Halting Problem
- The set of states of a Turing machine
- The language recognized by a Turing machine ✓ Correct answer
- The length of a Turing machine's description
- The tape alphabet of a Turing machine
-
The emptiness problem for linear bounded automata (E_LBA) is decidable.
Topic: Decidability and the Halting Problem
- True ✓ Correct answer
- False
-
A linear bounded automaton with q states and g tape-alphabet symbols, running on an input of length n, has at most how many different configurations?
Topic: Decidability and the Halting Problem
- q × g × n
- q × n × g^n ✓ Correct answer
- g^n
- q^n × g
-
The set Σ* of all strings over a finite alphabet Σ is:
Topic: Countability and Diagonalization
- Finite
- Countably infinite ✓ Correct answer
- Uncountable
- Empty for every alphabet
-
The set of all Turing machines is countable because:
Topic: Countability and Diagonalization
- There are only finitely many Turing machines
- Every Turing machine has a finite encoding as a string over a finite alphabet ✓ Correct answer
- Every Turing machine runs in polynomial time
- Every Turing machine is a decider
-
There exist languages that are not Turing-recognizable. The counting argument for this is that:
Topic: Countability and Diagonalization
- There are more Turing machines than languages
- The set of all languages is uncountable, while the set of all Turing machines is countable ✓ Correct answer
- Some languages are infinite
- The set Σ* is uncountable
-
Let B be the set of all infinite sequences over {0, 1}. Then B is:
Topic: Countability and Diagonalization
- Countable
- Finite
- Uncountable ✓ Correct answer
- Turing-recognizable
-
To prove that T = {(i, j, k) | i, j, k ∈ N} is countable, it is enough to give the one-to-one function f : T → N defined by:
Topic: Countability and Diagonalization
- f((i, j, k)) = i + j + k
- f((i, j, k)) = 2^i · 3^j · 5^k ✓ Correct answer
- f((i, j, k)) = i × j × k
- f((i, j, k)) = max(i, j, k)
-
A correspondence (one-to-one correspondence) is a function that is:
Topic: Countability and Diagonalization
- One-to-one but not onto
- Onto but not one-to-one
- Both one-to-one and onto ✓ Correct answer
- Neither one-to-one nor onto
-
Let X = {1, 2, 3, 4, 5} and Y = {6, 7, 8, 9, 10}, and let f : X → Y be given by f(1) = 6, f(2) = 7, f(3) = 6, f(4) = 7, f(5) = 6. Then f is:
Topic: Countability and Diagonalization
- One-to-one and onto
- One-to-one but not onto
- Onto but not one-to-one
- Neither one-to-one nor onto ✓ Correct answer
-
Let X = {1, 2, 3, 4, 5} and Y = {6, 7, 8, 9, 10}, and let g : X → Y be given by g(1) = 10, g(2) = 9, g(3) = 8, g(4) = 7, g(5) = 6. Then g is:
Topic: Countability and Diagonalization
- A correspondence ✓ Correct answer
- One-to-one but not onto
- Onto but not one-to-one
- Not a function
-
A ≤m B (A is mapping reducible to B) means that there is a computable function f such that for every string w:
Topic: Mapping Reducibility and Undecidable Problems
- w ∈ A implies f(w) ∈ B, but not conversely
- w ∈ A if and only if f(w) ∈ B ✓ Correct answer
- f maps the set B onto the set A
- w ∈ B if and only if f(w) ∈ A
-
If A ≤m B and B is Turing-recognizable, then A is:
Topic: Mapping Reducibility and Undecidable Problems
- Decidable
- Turing-recognizable ✓ Correct answer
- Not Turing-recognizable
- Uncountable
-
If A ≤m B and A is undecidable, then:
Topic: Mapping Reducibility and Undecidable Problems
- B is decidable
- B is undecidable ✓ Correct answer
- A is decidable
- B is a finite language
-
A_TM is not mapping reducible to E_TM. If such a reduction existed, it would follow that:
Topic: Mapping Reducibility and Undecidable Problems
- E_TM is decidable
- The complement of A_TM is Turing-recognizable, which is false ✓ Correct answer
- A_TM is decidable
- E_TM is Turing-recognizable
-
USELESS_TM = {⟨M⟩ | M is a Turing machine with one or more useless states} is:
Topic: Mapping Reducibility and Undecidable Problems
- Decidable
- Undecidable ✓ Correct answer
- A regular language
- The same language as E_TM
-
In the modified Post correspondence problem (MPCP), a match is required to:
Topic: Mapping Reducibility and Undecidable Problems
- Use every domino at least once
- Begin with the first domino ✓ Correct answer
- Use each domino at most once
- Have top and bottom strings of equal length in every domino
-
The undecidability of the Post correspondence problem (PCP) is proved by reducing A_TM first to ______ and then reducing that problem to PCP.
Topic: Mapping Reducibility and Undecidable Problems
- HALT_TM
- E_TM
- MPCP ✓ Correct answer
- EQ_TM
-
In the silly Post correspondence problem (SPCP), in each domino the top string has the same length as the bottom string. SPCP is:
Topic: Mapping Reducibility and Undecidable Problems
- Undecidable
- Decidable ✓ Correct answer
- NP-complete
- Not Turing-recognizable
-
The Post correspondence problem restricted to a unary alphabet (an alphabet containing only one symbol) is:
Topic: Mapping Reducibility and Undecidable Problems
- Undecidable
- Decidable ✓ Correct answer
- NP-complete
- Equivalent to A_TM
-
Let L = {a^i b^j c^k | i, j, k ≥ 0 and i + j = k}. Which of the following strings belongs to L?
Topic: Mapping Reducibility and Undecidable Problems
- aabb
- aabbcccc ✓ Correct answer
- aaabbcc
- aabbbcc
-
The class of Turing-recognizable languages is closed under union, concatenation, Kleene star, and intersection, but it is NOT closed under:
Topic: Mapping Reducibility and Undecidable Problems
- Union
- Concatenation
- Complementation ✓ Correct answer
- Intersection
-
The class P is the class of all languages that are:
Topic: Time Complexity and the Class P
- Decidable by a nondeterministic Turing machine in polynomial time
- Decidable in polynomial time on a deterministic single-tape Turing machine ✓ Correct answer
- Decidable in polynomial space
- Recognizable in polynomial time
-
The marking algorithm (a breadth-first search) decides PATH = {⟨G, s, t⟩ | G is a directed graph that has a path from s to t}. On a graph with m nodes, this algorithm runs in time at most:
Topic: Time Complexity and the Class P
- O(m)
- O(m²)
- O(m³) ✓ Correct answer
- 2^O(m)
-
Using the Euclidean algorithm, gcd(10505, 1274) is equal to:
Topic: Time Complexity and the Class P
- 1 ✓ Correct answer
- 11
- 37
- 313
-
The greatest common divisor of 8029 and 7289 is 37. Therefore the pair (8029, 7289) is:
Topic: Time Complexity and the Class P
- Relatively prime
- Not relatively prime, because their gcd is 37 ✓ Correct answer
- Not relatively prime, because their gcd is 111
- A pair of prime numbers
-
f(n) = O(g(n)) means that for all sufficiently large n:
Topic: Time Complexity and the Class P
- f(n) ≥ c · g(n) for some constant c
- f(n) ≤ c · g(n) for some constant c ✓ Correct answer
- f(n) = g(n)
- f(n) < g(n) for every n
-
f(n) = o(g(n)) means that:
Topic: Time Complexity and the Class P
- lim (f(n) / g(n)) = 0 as n → ∞ ✓ Correct answer
- lim (f(n) / g(n)) = 1 as n → ∞
- f(n) grows faster than g(n)
- f(n) = Θ(g(n))
-
On a single-tape Turing machine, the language {0^n 1^n | n ≥ 0} can be decided in time:
Topic: Time Complexity and the Class P
- O(n)
- O(n log n) ✓ Correct answer
- O(2^n)
- It cannot be decided at all
-
The Kolmogorov complexity K(x) of a string x is:
Topic: Kolmogorov Complexity and the Recursion Theorem
- The length of x
- The length of the shortest description (program) of x ✓ Correct answer
- The running time of the fastest machine that prints x
- The number of 1s in x
-
A string x is called incompressible if:
Topic: Kolmogorov Complexity and the Recursion Theorem
- K(x) = 0
- K(x) < |x|
- K(x) ≥ |x| ✓ Correct answer
- x contains no repeated symbol
-
A string is b-incompressible if it is not b-compressible.
Topic: Kolmogorov Complexity and the Recursion Theorem
- True ✓ Correct answer
- False
-
If δ(q5, a) = {(q3, b, R), (q4, c, L), (q3, a, R)}, then the nondeterministic machine has seven possible ways to proceed from this configuration.
Topic: Kolmogorov Complexity and the Recursion Theorem
- True
- False ✓ Correct answer
-
By the recursion theorem, a Turing machine can obtain its own description ⟨M⟩ and then go on to compute with that description.
Topic: Kolmogorov Complexity and the Recursion Theorem
- True ✓ Correct answer
- False
-
The Kolmogorov complexity function K is:
Topic: Kolmogorov Complexity and the Recursion Theorem
- A computable function
- Not a computable function ✓ Correct answer
- A polynomial function
- Equal to |x| for every string x
-
For every length n, the number of strings of length n that are incompressible is at least:
Topic: Kolmogorov Complexity and the Recursion Theorem
- 0
- 1 ✓ Correct answer
- n
- 2^n