CS Atlas GATE 2027
TOC course
0 / 91 complete

TOC/Phase 4 · Turing Machines

Lesson 4.3.1 · Item 70 of 91

Recursive vs recursively enumerable; deciders and recognizers

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

On this page

Recall warm-up

  1. Is a nondeterministic TM more powerful than a deterministic one?
    Stuck? Peek at 4.2 TM variants, linear bounded automata and context-sensitive languages
    • Multi-tape (O(t²)), nondeterministic (BFS, exponential), two-way tape, 2-stack PDA, 2 counters: all = TM.
    • LBA: nondeterministic TM within the input ⇔ CSG (|α| ≤ |β|) ⇔ CSL.
    • CFL ⊊ CSL (aⁿbⁿcⁿ). Every CSL is decided by an always-halting TM.

    Read lesson 4.2

  2. What are the three outcomes of a TM run?
    Stuck? Peek at 4.1.1 The Turing machine: tape, head, states, halting
    • TM (Q, Σ, Γ, δ, q₀, □, F), δ : Q × Γ → Q × Γ × {L,R} (partial).
    • ID α q β (head on first of β). Outcomes: accept, reject (or stuck), loop.
    • Tape: read/write anywhere, unbounded. L(M) = accepted strings.

    Read lesson 4.1.1

  3. Do all standard questions about regular languages have always-terminating algorithms?
    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

Two programs both answer “is this input in L?”. Program A always finishes. Program B finishes with “yes” on every yes-input, but on some no-inputs it runs forever. In practice A is a tool you can trust; B is a search that may never end. TOC gives them names, and the gap between them is the subject of Phase 5.

Predict First

Program B never prints a wrong answer. Why is it still less useful than A?

Core Concept

Prediction check

Because when B has been running for an hour, you can’t tell whether the answer is “no” or “not yet”. A always gives a verdict.

decider (A)
halts on every input: yes or no
recognizer (B)
halts with yes on members; on non-members it may loop
Two kinds of TM.

Recognizers and RE languages

A TM M recognizes L if L(M) = L (accepts exactly L; on strings outside L it rejects or loops). L is recursively enumerable (RE), also called Turing-recognizable or semi-decidable, if some TM recognizes it.
w ∈ L
M halts and accepts
w ∉ L
M rejects OR runs forever
Recognizer behaviour.

Deciders and recursive languages

A TM is a decider if it halts on every input. L is recursive (also decidable, Turing-decidable) if some decider accepts exactly L.

“Decidable problem” = its language is recursive. Every recursive language is RE (a decider is a recognizer).

RE recognizable (semi-decidable)
REC decidable (recursive)
REC ⊆ RE. Phase 5 shows the inclusion is strict.

Why the name “enumerable”

L is RE iff some TM (an enumerator) can print a list containing exactly the strings of L, in some order, possibly forever. Recognizer → enumerator: run the recognizer on all strings in a dovetailed way (step 1 on string 1; steps 1–2 on strings 1–2; …) and print a string when it is accepted. Enumerator → recognizer: wait for w to appear in the list.

L is recursive iff it can be enumerated in shortlex order (0.3.2).

roundrun string 1run string 2run string 3…
11 step
22 steps2 steps
33 steps3 steps3 steps
……………
Dovetailing: every string gets ever more steps, so no single looping run blocks the others.

Terminology map

GATE uses all of these interchangeably:

decider siderecognizer side
recursiverecursively enumerable (RE)
decidablesemi-decidable / partially decidable
Turing-decidableTuring-recognizable / Turing-acceptable
total TM (always halts)any TM
Same two classes, many names.

Putting it together

  • Deciders always halt; recognizers may loop on non-members.
  • Recursive = decidable; RE = recognizable = enumerable.
  • Every recursive language is RE.

Visual

          input w
             │
      ┌──────▼───────┐        decider:     always reaches ACCEPT or REJECT
      │      M       │
      └──┬───┬───┬───┘        recognizer:  ACCEPT on w ∈ L; on w ∉ L maybe REJECT, maybe ∞
       ACC  REJ  ∞ (loops)

Worked Examples

Easy

Is every regular language recursive?

Show the full solution

Yes — a DFA always halts, and a TM can simulate it.

Medium

Is every CFL recursive?

Show the full solution

Yes: the CYK algorithm always halts. (Even every CSL is recursive.)

GATE-level

M accepts every string in L and loops on every string not in L. Which are true? (i) L is RE. (ii) L is recursive. (iii) M is a decider. (iv) L could still be recursive via another machine.

Show the full solution

(i) true. (ii) not necessarily. (iii) false. (iv) true — one machine looping does not stop another machine from deciding L. Answer: (i) and (iv).

GATE Traps

  • A language is recursive if SOME TM decides it; one looping TM proves nothing.
  • “Decidable” = recursive; “semi-decidable / recognizable” = RE.
  • REC ⊆ RE always.
  • Rejecting and looping are both “not accepting”; only deciders guarantee rejection.

Memory Hook

Decider = a judge who always rules. Recognizer = a detective who announces when guilt is proven, but on the innocent may search forever.

Connect the Dots

Now place every class you know on one ladder: Regular ⊂ DCFL ⊂ CFL ⊂ CSL ⊂ REC ⊂ RE — the Chomsky hierarchy.

Self-Test

  1. MCQ

    L is recursive iff:

    1. some TM accepts L
    2. some TM accepts L and halts on every input
    3. every TM for L halts
    4. L is finite
  2. MSQ

    Which mean the same as “recursively enumerable”?

    1. Turing-recognizable
    2. semi-decidable
    3. decidable
    4. listable by an enumerator
  3. MCQ

    Every CFL is:

    1. RE but maybe not recursive
    2. recursive
    3. regular
    4. not RE
  4. MCQ

    Why is dovetailing needed to enumerate an RE language?

    1. to sort strings
    2. so a looping run on one string doesn’t block the others
    3. to save tape
    4. to make the TM deterministic

Rule Card

  • Recognizer: accepts L, may loop outside. RE = recognizable = semi-decidable = enumerable.
  • Decider: halts always. Recursive = decidable.
  • REC ⊆ RE. Enumerator ⇔ recognizer (dovetailing). Shortlex enumeration ⇔ recursive.

Concept Ledger

  • recognizer
  • recursively enumerable (RE) / semi-decidable
  • decider (total TM)
  • recursive / decidable
  • enumerator
  • dovetailing

Answer Vault

Reveal answers when you’re ready

Warm-up answers

  1. No.
  2. Accept, reject, loop.
  3. Yes.

Self-test answers

  1. B — A decider exists.
    • A: That is RE.
    • C: Too strong.
    • D: No.
  2. ABD — All are RE.
    • C: That is recursive.
  3. B — CYK decides it.
    • A: It is recursive.
    • C: No.
    • D: No.
  4. B — Interleave runs.
    • A: Not the purpose.
    • C: No.
    • D: No.

Flashcards

  1. Recursive vs RE?
    Reveal answerRecursive: some TM halts on all inputs and accepts L. RE: some TM accepts exactly L (may loop outside).
  2. Other names for RE?
    Reveal answerTuring-recognizable, semi-decidable, enumerable.
  3. Is every CFL recursive?
    Reveal answerYes.

Ready for the next idea?

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