CS Atlas GATE 2027
TOC course
0 / 91 complete

TOC/Phase 6 · Integration & Final Test

Revision 6.2.1 · Item 87 of 91

Mixed practice set 1

Read at your own pace. Try the questions before opening the answers.

On this page

Notes

15 interleaved GATE-style questions spanning Phases 0–5. Do not look at the topic tags until after you answer — part of the exam skill is recognizing which phase a question belongs to.

Practice questions

  1. NAT · 1 mark

    Over Σ = {a, b}, what is the number of states in the minimal DFA that accepts all strings starting with ab and having length at least 2?

    Write your answer before opening the key.

  2. MCQ · 1 mark

    Let w = gate27 (6 distinct characters). How many distinct substrings (including ε and w itself) does w have?

    1. 21
    2. 22
    3. 64
    4. 36
  3. MSQ · 2 marks

    Which of the following regular expressions over {a, b} are equivalent to (a + b)*?

    1. (a*b*)*
    2. a*(ba*)*
    3. (a* + b*)*
    4. a* + b*
  4. MCQ · 2 marks

    Consider L₁ = { w x wR | w, x ∈ {a, b}+ } and L₂ = { w wR | w ∈ {a, b}+ }. Which statement is correct?

    1. Both L₁ and L₂ are regular
    2. L₁ is regular, and L₂ is a CFL but not a DCFL
    3. L₁ is a DCFL (not regular), and L₂ is a CFL
    4. Neither L₁ nor L₂ is regular
  5. NAT · 1 mark

    A context-free grammar G is in Chomsky Normal Form (CNF). To derive a terminal string w of length 25, how many production steps are used in any derivation of w?

    Write your answer before opening the key.

  6. MCQ · 2 marks

    In a DFA with start state P and sole accepting state Q, the incoming state equations are P = ε + Pa + Qb and Q = Pb + Qa. Which regular expression represents the accepted language Q?

    1. a*b(a + ba*b)*
    2. (a + bb)*b
    3. a*b(a + bb)*
    4. b(a + ba*b)*
  7. MSQ · 2 marks

    Let L be a Deterministic Context-Free Language (DCFL) and R be a Regular language. Which of the following languages are GUARANTEED to be DCFLs?

    1. L̅ (complement of L)
    2. L ∩ R
    3. L ∪ R
    4. L* (Kleene star of L)
  8. MCQ · 1 mark

    Which class of languages is accepted by Deterministic Push-Down Automata (DPDAs) that accept by empty stack?

    1. All Context-Free Languages
    2. All Deterministic Context-Free Languages
    3. Exactly the prefix-free DCFLs
    4. Exactly the Regular Languages
  9. NAT · 2 marks

    When running the CYK membership algorithm on a string of length n = 9, how many table cells (substring spans) are computed in total?

    Write your answer before opening the key.

  10. MCQ · 2 marks

    Which of the following machines is strictly LESS powerful than a standard single-tape deterministic Turing machine?

    1. A Turing machine whose head can only move Left or Right (no Stay move)
    2. A Nondeterministic Turing Machine
    3. A Linear Bounded Automaton (LBA)
    4. A Push-Down Automaton with two independent stacks
  11. MSQ · 2 marks

    Which of the following statements about Recursive (REC) and Recursively Enumerable (RE) languages are TRUE?

    1. REC is closed under complement, union, and intersection
    2. RE is closed under union, intersection, and Kleene star
    3. RE is closed under complement
    4. If L ∈ RE and L̅ ∈ RE, then L ∈ REC
  12. MCQ · 1 mark

    Over Σ = {0, 1}, let S₁ be the set of all strings Σ*, S₂ be the set of all Turing machines, and S₃ be the set of all languages over Σ. Which statement is true?

    1. S₁, S₂, and S₃ are all countably infinite
    2. S₁ and S₂ are countably infinite, while S₃ is uncountable
    3. Only S₁ is countable; S₂ and S₃ are uncountable
    4. S₁ is finite, S₂ is countable, S₃ is uncountable
  13. MCQ · 2 marks

    Which of the following problems about a Turing machine M is DECIDABLE?

    1. Whether L(M) contains at least 10 strings
    2. Whether L(M) is a regular language
    3. Whether M visits more than 5 states when run on the empty string ε within 100 steps
    4. Whether L(M) = Σ*
  14. MCQ · 2 marks

    Suppose L₁ ≤m L₂ (L₁ is mapping-reducible to L₂). Which implication is ALWAYS valid?

    1. If L₁ is undecidable, then L₂ is undecidable
    2. If L₂ is undecidable, then L₁ is undecidable
    3. If L₁ is decidable, then L₂ is decidable
    4. If L₂ is not RE, then L₁ is not RE
  15. MSQ · 2 marks

    Which of the following decision problems are DECIDABLE?

    1. Equivalence of two DFAs M₁ and M₂
    2. Emptiness of a Context-Free Grammar G
    3. Membership of a string w in a Context-Sensitive Grammar G
    4. Emptiness of a Linear Bounded Automaton (LBA)

Answer key

Reveal answers when you’re ready
  1. 4 — States: q₀ (start, ε), q₁ (read a), q₂ (read ab, accepting sink looping on a,b), and D (dead state for starting with b or reading aa). Total = 4 states.

    Review lesson 1.1.3

  2. B — All 6 characters are distinct, so there are n(n+1)/2 = 6·7/2 = 21 non-empty substrings plus 1 for the empty string ε = 22.
    • A: 21 is the count of non-empty substrings; it forgets ε.
    • C: 2⁶ = 64 is the number of subsequences, not substrings.
    • D: n² = 36 overcounts.

    Review lesson 0.3.2

  3. ABC — (a*b*)*, a*(ba*)*, and (a* + b*)* are all standard identities for (a + b)*. Option D only generates strings of all a’s or all b’s (misses "ab").
    • D: a* + b* does not contain "ab".

    Review lesson 2.1.2

  4. B — In L₁, taking |w| = 1 lets x absorb everything between the first and last symbol, so L₁ = a(a+b)⁺a + b(a+b)⁺b (regular). L₂ is the language of non-empty even-length palindromes, which is a CFL but not a DCFL.
    • A: L₂ requires unbounded memory with an unmarked midpoint, so it is not regular.
    • C: L₁ is regular because w can be chosen of length 1.
    • D: L₁ is regular.

    Review lesson 2.4.4

  5. 49 — In CNF, deriving a string of length n ≥ 1 always takes 2n − 1 = 2(25) − 1 = 49 steps.

    Review lesson 3.2.2

  6. A — From P = ε + Pa + Qb = (ε + Qb) + Pa, Arden gives P = (ε + Qb)a* = a* + Qba*. Substitute into Q: Q = (a* + Qba*)b + Qa = a*b + Q(a + ba*b). Apply Arden to Q: Q = a*b(a + ba*b)*.
    • B: Ignores the loop on P with a and on Q with a.
    • C: Misses a* between b and b in the return loop.
    • D: Requires the first symbol to be b, missing strings starting with a.

    Review lesson 2.2.2

  7. ABC — DCFLs are closed under complement, intersection with regular languages, and union with regular languages (by product of DPDA and DFA). DCFLs are NOT closed under Kleene star.
    • D: DCFLs are not closed under Kleene star (nor concatenation or general union).

    Review lesson 3.4.1

  8. C — Once an empty-stack DPDA empties its stack to accept u, it cannot continue on any extension uv, so it can only accept prefix-free DCFLs.
    • A: Even final-state DPDAs cannot accept all CFLs.
    • B: Non-prefix-free DCFLs like a* cannot be accepted by empty stack deterministically.
    • D: aⁿbⁿ (n ≥ 1) is accepted by an empty-stack DPDA and is not regular.

    Review lesson 3.3.2

  9. 45 — The triangular CYK table has n(n + 1)/2 = 9 × 10 / 2 = 45 cells.

    Review lesson 3.4.2

  10. C — An LBA restricts the tape head to the cells occupied by the input (linear space) and recognizes Context-Sensitive Languages (CSLs), which is a strict subset of RE. All other options are equivalent to a standard TM.
    • A: Stay can be simulated by moving Right then Left.
    • B: NTM and DTM recognize the exact same class (RE).
    • D: A 2-stack PDA simulates a TM tape (left of head in stack 1, right in stack 2).

    Review lesson 4.2

  11. ABD — REC is closed under complement, ∪, ∩. RE is closed under ∪, ∩, *, concatenation, but NOT complement. If both L and L̅ are RE, running their recognizers in parallel decides L.
    • C: RE is not closed under complement; A_TM is RE but its complement is not.

    Review lesson 4.3.3

  12. B — Strings in Σ* can be listed in canonical order (countable), every TM has a finite encoding string (countable), and P(Σ*) has cardinality 2^ℵ₀ (uncountable by Cantor’s diagonalization).
    • A: P(Σ*) is uncountable.
    • C: Every TM is encoded by a finite string, so S₂ is countable.
    • D: Σ* is countably infinite, not finite.

    Review lesson 5.1

  13. C — Simulating M on ε for at most 100 steps and counting visited states always terminates in 100 steps (a bounded syntactic/step-execution property, not a semantic property of L(M)). A, B, D are non-trivial semantic properties of L(M) and are undecidable by Rice’s theorem.
    • A: Non-trivial property of L(M) → undecidable by Rice.
    • B: Non-trivial property of L(M) → undecidable by Rice.
    • D: Universality of TMs → undecidable by Rice.

    Review lesson 5.4

  14. A — If L₂ were decidable, then composing the reduction f with L₂’s decider would decide L₁. By contrapositive, L₁ undecidable ⇒ L₂ undecidable.
    • B: A trivial decidable L₁ (like {0}) can reduce to an undecidable L₂.
    • C: Knowing the easier side is decidable says nothing about L₂.
    • D: Backwards: L₂ ∈ RE ⇒ L₁ ∈ RE, so L₁ ∉ RE ⇒ L₂ ∉ RE.

    Review lesson 5.3

  15. ABC — DFA equivalence, CFG emptiness, and CSL/LBA membership are all decidable. Emptiness of an LBA (CSL) is undecidable.
    • D: LBA emptiness is undecidable (proven via accepting computation histories of a TM).

    Review lesson 5.5

Ready for the next idea?

Mark this item complete when you’ve finished reading and working through it.