CS Atlas GATE 2027
TOC course
0 / 91 complete

TOC/Phase 5 · Undecidability

Lesson 5.5 · Item 82 of 91

The master decidability table

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

On this page

Recall warm-up

  1. Rice’s theorem in one line?
    Stuck? Peek at 5.4 Rice’s theorem and the Post Correspondence Problem
    • Rice: non-trivial property of L(M) ⇒ undecidable. Not for code/bounded-behaviour properties or trivial ones.
    • ≠ ∅, contains w: RE. = ∅, finite, = Σ*, regular, CFL: not RE.
    • PCP: undecidable (|Σ| ≥ 2), RE; unary decidable. Used for CFG ambiguity, CFL ∩ emptiness, CFG universality.

    Read lesson 5.4

  2. Which CFG questions have algorithms?
    Stuck? Peek at 3.4.2 Algorithms for CFLs: emptiness, finiteness, membership (CYK)
    • Emptiness: is S generating? Finiteness: cycle in the cleaned variable graph. Membership: CYK O(n³|G|), CNF required.
    • No algorithm for general CFGs: equivalence, universality, ambiguity, regularity, emptiness of intersection.

    Read lesson 3.4.2

  3. Is equivalence of two DFAs decidable?
    Stuck? Peek at 2.4.2 Algorithms for regular languages
    • Membership: run. Emptiness: reachable F? Finiteness: trim + cycle (or lengths n..2n−1). Universality: complement + emptiness. Equivalence: minimize & compare, or symmetric difference empty. Containment: L₁ ∩ L̅₂ = ∅.
    • All these have always-terminating algorithms for regular languages.

    Read lesson 2.4.2

The Hook

GATE’s favourite decidability question is a grid: “Which of these problems is decidable?” with a mix of machine types. Instead of reasoning from scratch each time, you will carry one table in your head — and the three reasons that generate it.

Predict First

Is emptiness decidable for context-sensitive languages? (Hint: CSLs sit between CFLs and recursive languages.)

Core Concept

Prediction check

No. Membership is decidable for CSLs (LBAs have finitely many configurations), but emptiness for LBAs is undecidable. CSL is where emptiness flips from D to U.

Regular
emptiness D
DCFL
D
CFL
D
CSL
U
REC
U
RE
U
Emptiness flips at CSL.

The table

D = decidable, U = undecidable. Columns are language classes (given by their machines or grammars).

questionRegularDCFLCFLCSLRECRE
membership w ∈ LDDDDDU
emptiness L = ∅DDDUUU
finitenessDDDUUU
equivalence L₁ = L₂DDUUUU
universality L = Σ*DDUUUU
containment L₁ ⊆ L₂DUUUUU
disjointness L₁ ∩ L₂ = ∅DUUUUU
is L regular?DDUUUU
is the grammar/machine ambiguous?DDUUUU
The master decidability table. Read it column by column: each class keeps fewer D’s.

Where the boundaries come from

  • Membership: decidable up to REC (by definition of REC); for RE only semi-decidable (A_TM).
  • Emptiness / finiteness: graph/reachability for FA and CFG; for LBA and TM, Rice/reduction ⇒ U.
  • Equivalence / universality: DFA minimization; DCFL via complement (equivalence of DPDAs is decidable — a deep 1997 result); for CFGs, PCP ⇒ U.
  • Containment / disjointness for DCFLs: U (intersection of two DCFLs is not controllable).
  • Regularity: trivial for regular; decidable for DCFL; U for CFL and above.
  • Ambiguity: regular grammars via DFAs, DCFLs have unambiguous grammars ⇒ D; CFG ambiguity ⇒ U (PCP).
reachability arguments
emptiness, finiteness up to CFL
complement trick
DCFL universality / equivalence
PCP
CFG equivalence, universality, ambiguity, disjointness
Rice / A_TM
almost everything for REC and RE
Four sources of every entry.

Other frequently asked cases

  • “Does DFA M accept w / accept anything / accept Σ*?” — all decidable (the inputs are DFAs).
  • “Does PDA P accept w?” — decidable (CYK). “Is L(P) = Σ*?” — undecidable.
  • “Does TM M accept w?” — undecidable (but RE). “Does M halt on w within k steps?” — decidable.
  • “Is L(G₁) ∩ L(G₂) = ∅ for CFGs?” — undecidable. “Is L(G) ∩ R = ∅ for regular R?” — decidable (product is a CFL).
  • “Is the complement of a CFL empty?” = universality — undecidable.
problemdecidable?
DFA accepts wyes
DFA M₁ ≡ DFA M₂yes
PDA accepts wyes
CFG generates Σ*no
CFG ∩ regular = ∅yes
CFG₁ ∩ CFG₂ = ∅no
TM accepts wno (RE)
TM halts within k stepsyes
Machine-specific questions that GATE mixes into the same list.

The full picture

Everything in one 3D view: every class, the named undecidable languages, and the non-RE region outside.

Phase 5 language hierarchy
The complete Language Universe. Tap A_TM, L_d and the complement of A_TM to see where undecidability lives.

Putting it together

  • Membership fails only at RE; emptiness and finiteness fail at CSL; equivalence, universality, regularity, ambiguity fail at CFL.
  • Containment and disjointness fail already at DCFL.
  • Bounded questions and questions about DFAs/PDA membership stay decidable.

Visual

           Reg  DCFL  CFL  CSL  REC  RE
member      D    D     D    D    D    U
empty       D    D     D    U    U    U
finite      D    D     D    U    U    U
equal       D    D     U    U    U    U
= Σ*        D    D     U    U    U    U
⊆           D    U     U    U    U    U
∩ = ∅       D    U     U    U    U    U
regular?    D    D     U    U    U    U
ambiguous?  D    D     U    U    U    U
mnemonic: membership falls last (only RE), emptiness at CSL, equality/universality at CFL, ⊆ and ∩ already at DCFL.

Worked Examples

Easy

Is finiteness decidable for CFLs?

Show the full solution

Yes — the cycle test on the cleaned variable graph.

Medium

Is equivalence decidable for DCFLs? For CFLs?

Show the full solution

DCFL: yes (deep result). CFL: no.

GATE-level

Which are decidable? (i) Is L(G) = ∅ for a CFG G? (ii) Is L(G) = Σ* for a CFG G? (iii) Is L(A) = ∅ for an LBA A? (iv) Does TM M halt on ε within 1000 steps?

Show the full solution

(i) D. (ii) U. (iii) U. (iv) D. Answer: (i) and (iv).

GATE Traps

  • Membership is decidable for everything up to REC; only RE fails.
  • CSL: membership D, emptiness U — a frequent trick.
  • DCFL: equivalence D, but containment and disjointness U.
  • Questions about bounded runs (within k steps) are decidable even for TMs.

Memory Hook

Walk the classes left to right and the D’s fall like dominoes: ⊆ and ∩ first (at DCFL), then = and Σ* (at CFL), then empty and finite (at CSL), and membership last (at RE).

Connect the Dots

Phase 5 complete — and with it, the whole syllabus. Phase 6 merges every rule card into one master sheet, mixes questions from all phases, drills the recurring GATE patterns, and ends with the 30-question final test.

Self-Test

  1. MSQ

    Which are decidable for CFLs?

    1. membership
    2. emptiness
    3. equivalence
    4. finiteness
  2. MCQ

    For CSLs, which is decidable?

    1. emptiness
    2. membership
    3. equivalence
    4. finiteness
  3. MCQ

    For RE languages, membership is:

    1. decidable
    2. undecidable (but semi-decidable)
    3. trivial
    4. not RE
  4. MSQ

    Which are undecidable?

    1. CFG universality
    2. DFA equivalence
    3. CFG ambiguity
    4. DCFL containment
  5. MCQ

    Equivalence of DCFLs is:

    1. decidable
    2. undecidable
    3. decidable only for regular DCFLs
    4. not well-defined

Rule Card

  • Membership: D up to REC, U for RE. Emptiness/finiteness: D up to CFL, U from CSL. Equivalence/universality/regularity/ambiguity: D up to DCFL, U from CFL.
  • Containment/disjointness: D only for regular.
  • CFG ∩ regular = ∅: D. CFG ∩ CFG = ∅: U. Bounded TM runs: D.

Concept Ledger

  • master decidability table
  • decidability boundary by class

Answer Vault

Reveal answers when you’re ready

Warm-up answers

  1. Every non-trivial property of L(M) is undecidable.
  2. Membership, emptiness, finiteness.
  3. Yes (minimize or symmetric difference).

Self-test answers

  1. ABD — Equivalence is U.
    • C: Undecidable.
  2. B — LBA membership is decidable.
    • A: U.
    • C: U.
    • D: U.
  3. B — A_TM.
    • A: No.
    • C: No.
    • D: It is RE.
  4. ACD — Table.
    • B: Decidable.
  5. A — Decidable (Sénizergues).
    • B: No.
    • C: No.
    • D: It is defined.

Flashcards

  1. Where does emptiness become undecidable?
    Reveal answerAt CSL (LBA emptiness).
  2. Is CSL membership decidable?
    Reveal answerYes.
  3. Is DCFL equivalence decidable?
    Reveal answerYes.
  4. Is DCFL containment decidable?
    Reveal answerNo.
  5. Is CFG universality decidable?
    Reveal answerNo.

Ready for the next idea?

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