Recall warm-up
- 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.
- 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.
- 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.
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.
The table
D = decidable, U = undecidable. Columns are language classes (given by their machines or grammars).
| question | Regular | DCFL | CFL | CSL | REC | RE |
|---|---|---|---|---|---|---|
| membership w ∈ L | D | D | D | D | D | U |
| emptiness L = ∅ | D | D | D | U | U | U |
| finiteness | D | D | D | U | U | U |
| equivalence L₁ = L₂ | D | D | U | U | U | U |
| universality L = Σ* | D | D | U | U | U | U |
| containment L₁ ⊆ L₂ | D | U | U | U | U | U |
| disjointness L₁ ∩ L₂ = ∅ | D | U | U | U | U | U |
| is L regular? | D | D | U | U | U | U |
| is the grammar/machine ambiguous? | D | D | U | U | U | U |
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).
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.
| problem | decidable? |
|---|---|
| DFA accepts w | yes |
| DFA M₁ ≡ DFA M₂ | yes |
| PDA accepts w | yes |
| CFG generates Σ* | no |
| CFG ∩ regular = ∅ | yes |
| CFG₁ ∩ CFG₂ = ∅ | no |
| TM accepts w | no (RE) |
| TM halts within k steps | yes |
The full picture
Everything in one 3D view: every class, the named undecidable languages, and the non-RE region outside.
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
Is finiteness decidable for CFLs?
Show the full solution
Yes — the cycle test on the cleaned variable graph.
Is equivalence decidable for DCFLs? For CFLs?
Show the full solution
DCFL: yes (deep result). CFL: no.
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
- MSQ
Which are decidable for CFLs?
- membership
- emptiness
- equivalence
- finiteness
- MCQ
For CSLs, which is decidable?
- emptiness
- membership
- equivalence
- finiteness
- MCQ
For RE languages, membership is:
- decidable
- undecidable (but semi-decidable)
- trivial
- not RE
- MSQ
Which are undecidable?
- CFG universality
- DFA equivalence
- CFG ambiguity
- DCFL containment
- MCQ
Equivalence of DCFLs is:
- decidable
- undecidable
- decidable only for regular DCFLs
- 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
- Every non-trivial property of L(M) is undecidable.
- Membership, emptiness, finiteness.
- Yes (minimize or symmetric difference).
Self-test answers
- ABD — Equivalence is U.
- C: Undecidable.
- B — LBA membership is decidable.
- A: U.
- C: U.
- D: U.
- B — A_TM.
- A: No.
- C: No.
- D: It is RE.
- ACD — Table.
- B: Decidable.
- A — Decidable (Sénizergues).
- B: No.
- C: No.
- D: It is defined.
Flashcards
- Where does emptiness become undecidable?
Reveal answer
At CSL (LBA emptiness). - Is CSL membership decidable?
Reveal answer
Yes. - Is DCFL equivalence decidable?
Reveal answer
Yes. - Is DCFL containment decidable?
Reveal answer
No. - Is CFG universality decidable?
Reveal answer
No.