FORMAL LANGUAGE & AUTOMATA THEORY

100406
Back to FORMAL LANGUAGE & AUTOMATA THEORY

Module 4: Turing Machines (TM)

  1. Q1a. A language is said to be recursively enumerable if it is accepted by a (i) DFA (ii) Turing Machine (iii) PDA (iv) Linear Bounded Automaton20252m

    Module 4: Turing Machines (TM)

    A language is said to be recursively enumerable if it is accepted by a

    (i) DFA
    (ii) Turing Machine
    (iii) PDA
    (iv) Linear Bounded Automaton

    View this question on its own page →
    Worked Solution

    Answer

    Correct Option: (ii) Turing Machine

    Explanation

    A language LL is called Recursively Enumerable (RE) iff there exists a Turing Machine MM such that L=L(M)L = L(M), i.e., MM halts and accepts exactly the strings in LL. On strings not in LL, MM may either reject or loop forever. This is the most general language class in the Chomsky hierarchy (Type-0).

    Why other options are incorrect

    • (i) DFA : Accepts Regular languages (Type-3), strictly smaller than RE.
    • (iii) PDA : Accepts Context-Free Languages (Type-2), also properly contained in RE.
    • (iv) Linear Bounded Automaton (LBA) : Accepts Context-Sensitive Languages (Type-1), also a proper subset of RE.

    Hierarchy recall

    REG⊂CFL⊂CSL⊂RE⊂ALL \text{REG} \subset \text{CFL} \subset \text{CSL} \subset \text{RE} \subset \text{ALL}

    • REG → DFA
    • CFL → PDA
    • CSL → LBA
    • RE → Turing Machine
    • Recursive → Decidable TM (always halts)

    Final Answer

    Hence, Recursively Enumerable Languages are exactly those accepted by Turing Machines. Correct answer is (ii) Turing Machine.

  2. Q1a. If an infinite language is passed to Machine M, the subsidiary which gives a finite solution to the infinite input tape is: (i) Compiler (ii) Interpreter (iii) Loader and Linkers (iv) None of the mentioned20242m

    Module 4: Turing Machines (TM)

    If an infinite language is passed to Machine MM, the subsidiary which gives a finite solution to the infinite input tape is:

    (i) Compiler
    (ii) Interpreter
    (iii) Loader and Linkers
    (iv) None of the mentioned

    View this question on its own page →
    Worked Solution

    Answer

    Correct Option: (iv) None of the mentioned

    Explanation

    An infinite language requires a machine with unbounded memory. In the Turing Machine model M=(Q,Σ,Γ,δ,q0,B,F)M = (Q, \Sigma, \Gamma, \delta, q_0, B, F) the tape is infinite, but the finite control itself is finite.

    • Compiler: Translates a high-level program to target code before execution. It does not provide run-time handling of an infinite input tape; it assumes input is finite source text.
    • Interpreter: Executes source line-by-line, still requires entire input to be presented finitely; it does not make an infinite tape finite.
    • Loader and Linkers: Perform loading / relocation of object code into memory. They handle finite modules, not an infinite language / infinite tape.

    The subsidiary that actually gives a finite description of an infinite computation is the finite control (finite automaton) + the Turing Machine’s transition function or, in language theory, the finite representation (regular expression / grammar / TM description) itself. None of the three listed system softwares fulfills this role.

    The theoretical concept is:

    • Infinite language L⊆Σ∗L \subseteq \Sigma^* is described finitely by a grammar / regular expression / TM encoding ⟨M⟩\langle M \rangle, not by compiler/interpreter/loader.

    Hence none of (i)-(iii) is correct.

    Final Answer

    None of the mentioned. The finite solution is provided by the finite control / finite encoding ⟨M⟩\langle M\rangle of the machine, not by compiler / interpreter / loader.

  3. Q1b. Enumerator in a Turing machine is a TM with: (i) an output printer (ii) 5 input tapes (iii) a stack (iv) None of the above20212m

    Module 4: Turing Machines (TM)

    Enumerator in a Turing machine is a TM with:

    (i) an output printer
    (ii) 5 input tapes
    (iii) a stack
    (iv) None of the above

    View this question on its own page →
    Worked Solution

    Answer

    Correct Option: (i) an output printer

    Explanation

    An Enumerator EE is a variant of Turing Machine that enumerates a language.

    Formal definition (Sipser):

    Enumerator is a TM with a work tape and a write-only output tape (printer). The printer head moves only right and cannot read. Whenever EE wants to output a string, it writes it on the printer and the string is considered enumerated.

    • Enumerator has no input; it starts from blank tape.
    • Language enumerated is L(E)={w∣E eventually prints w}L(E) = \{ w \mid E \text{ eventually prints } w \}.
    • Theorem: LL is Turing-recognizable iff some enumerator enumerates LL.

    Options:

    • (ii) 5 tapes — multi-tape TM, not enumerator.
    • (iii) stack — PDA, not enumerator.
    • Hence (i) is correct.

    Final Answer

    Enumerator = TM with an output printer → Option (i).

  4. Q1f. A Turing Machine that prints strings of a language is called (i) Acceptor (ii) Transducer (iii) Generator (iv) Enumerator20252m

    Module 4: Turing Machines (TM)

    A Turing Machine that prints strings of a language is called

    (i) Acceptor
    (ii) Transducer
    (iii) Generator
    (iv) Enumerator

    View this question on its own page →
    Worked Solution

    Answer

    Correct Option: (iii) Generator (also enumerated as Transducer/Enumerator in some texts — “Generator” is the term for printing strings)

    Explanation

    TM views:

    Mode Description
    Acceptor / Recognizer Decides w∈Lw\in L by accepting/rejecting (yes/no).
    Transducer Computes function f(w)f(w) on output tape.
    Generator / Enumerator Prints (generates) strings of LL one after another on output tape (printer).
    Decider Acceptor that always halts.

    A TM that prints strings of a language is called Generator (or Enumerator if it lists all). Many textbooks list (iii) Generator and (iv) Enumerator as synonyms; exam key typically Generator.

    Final Answer

    Generator (prints strings) → Option (iii). Enumerator is equivalent variant.

  5. Q1g. A Turing machine that is able to simulate other Turing machines is called: (i) nested Turing machine (ii) universal Turing machine (iii) counter machine (iv) None of the above20222m

    Module 4: Turing Machines (TM)

    A Turing machine that is able to simulate other Turing machines is called:

    (i) nested Turing machine
    (ii) universal Turing machine
    (iii) counter machine
    (iv) None of the above

    View this question on its own page →
    Worked Solution

    Answer

    Correct Option: (ii) universal Turing machine

    Explanation

    Universal Turing Machine UU: A TM that takes as input encoding of any TM MM and input ww: U(⟨M,w⟩)=M(w)U(\langle M, w\rangle) = M(w).

    • Can simulate any other TM (stored-program concept).
    • Basis for von Neumann architecture, stored-program computers.
    • Exists by Church-Turing thesis; constructed by Turing (1936).
    • Leads to undecidability of halting problem.

    Other options:

    • Nested TM — not standard.
    • Counter machine — weaker (but Turing-equivalent with 2 counters).

    Final Answer

    Universal TM → Option (ii).

  6. Q1g. A Turing Machine has: (i) A finite tape (ii) An infinite tape (iii) A stack (iv) A queue20242m

    Module 4: Turing Machines (TM)

    A Turing Machine has:

    (i) A finite tape
    (ii) An infinite tape
    (iii) A stack
    (iv) A queue

    View this question on its own page →
    Worked Solution

    Answer

    Correct Option: (ii) An infinite tape

    Explanation

    Turing Machine model: M=(Q,Σ,Γ,δ,q0,B,F)M = (Q,\Sigma,\Gamma,\delta,q_0,B,F) with

    • Finite control (states QQ),
    • One infinite tape divided into cells, each holds symbol from Γ\Gamma (Σ⊂Γ\Sigma \subset \Gamma), extends infinitely in one direction (or both in some definitions), with a read/write head.
    • Initially tape contains input ww + blanks BB to the right (infinite blanks).

    It does not have a stack (that's PDA) or queue as primary memory, nor finite tape (that would be LBA / finite automaton).

    Final Answer

    TM has an infinite tape → Option (ii).

  7. Q1h. From the options, the pair having different expressive powers is: (i) DPDA and NPDA (ii) DFA and NFA (iii) single-tape TM and multi-tape TM (iv) deterministic single-tape TM and nondeterministic single-tape TM20232m

    Module 4: Turing Machines (TM)

    From the options, the pair having different expressive powers is:

    (i) DPDA and NPDA
    (ii) DFA and NFA
    (iii) single-tape TM and multi-tape TM
    (iv) deterministic single-tape TM and nondeterministic single-tape TM

    View this question on its own page →
    Worked Solution

    Answer

    Correct Option: (i) DPDA and NPDA

    Explanation

    Expressive power comparison:

    Pair Power Same?
    DPDA vs NPDA Different — NPDA = CFL, DPDA = DCFL ⊂ CFL. Example {anbn}∪{anb2n}\{a^n b^n\}\cup\{a^n b^{2n}\} is CFL but not DCFL.
    DFA vs NFA Same — both = Regular
    Single-tape TM vs Multi-tape TM Same — both = RE, polytime difference only
    Deterministic single-tape TM vs Nondeterministic single-tape TM Same — DTM=NTMDTM = NTM in power

    Hence different expressive powers is DPDA vs NPDA.

    Final Answer

    DPDA and NPDA have different power → Option (i).

  8. Q1i. RASP stands for: (i) Random Access Storage Program (ii) Random Access Stored Program (iii) Randomly Accessed Stored Program (iv) Random Access Storage Programming20222m

    Module 4: Turing Machines (TM)

    RASP stands for:

    (i) Random Access Storage Program
    (ii) Random Access Stored Program
    (iii) Randomly Accessed Stored Program
    (iv) Random Access Storage Programming

    View this question on its own page →
    Worked Solution

    Answer

    Correct Option: (ii) Random Access Stored Program

    Explanation

    RASP = Random Access Stored Program machine.

    • Model by Elgot–Robinson, Hartmanis.
    • Like RAM but program stored in memory like data (von Neumann).
    • Has registers and memory with random access, program counter.
    • Turing-equivalent, but more realistic cost model.

    Other expansions are incorrect variations.

    Final Answer

    Random Access Stored Program → Option (ii).

  9. Q1i. Recursive languages are: (i) a proper superset of CFLs (ii) always recognizable (iii) also called type-0 languages (iv) recognizable by Turing machines20232m

    Module 4: Turing Machines (TM)

    Recursive languages are:

    (i) a proper superset of CFLs
    (ii) always recognizable
    (iii) also called type-0 languages
    (iv) recognizable by Turing machines

    View this question on its own page →
    Worked Solution

    Answer

    Correct Option: (i) a proper superset of CFLs (and (ii)/(iv) also true depending on option set)

    Explanation

    Recursive languages = Decidable languages = LL decided by TM that always halts.

    Hierarchy:
    Regular⊂DCFL⊂CFL⊂CSL⊂Recursive⊂RE \text{Regular} \subset \text{DCFL} \subset \text{CFL} \subset \text{CSL} \subset \text{Recursive} \subset \text{RE}

    • (i) Proper superset of CFLs → True. Every CFL is recursive (PDA can be simulated by halting TM), but not vice versa (e.g., anbncna^n b^n c^n is recursive not CFL).
    • (ii) Always recognizable (RE) → True, recursive ⊂ RE, so yes.
    • (iv) Recognizable by TM → True (RE definition).
    • (iii) also called Type-0 → False, Type-0 = RE, not Recursive (Type-1 is CSL, not Recursive either; Recursive is not a Chomsky type but decidable).

    If single choice, (i) proper superset of CFLs is the intended answer. If multiple, (i),(ii),(iv) are true.

    Final Answer

    Recursive languages are proper superset of CFLs → Option (i) (also RE).

  10. Q1j. A language L is Turing decidable if: (i) recursive (ii) TM recognizes L (iii) TM accepts L (iv) None of the above20222m

    Module 4: Turing Machines (TM)

    A language LL is Turing decidable if:

    (i) recursive
    (ii) TM recognizes LL
    (iii) TM accepts LL
    (iv) None of the above

    View this question on its own page →
    Worked Solution

    Answer

    Correct Option: (i) recursive (Turing decidable = recursive)

    Explanation

    Turing decidable ≡ Recursive language ≡ Decided by a TM that always halts (decider).

    Definitions:

    • Recursively Enumerable (RE): TM recognizes LL (accepts if w∈Lw\in L, may loop if $w
      otin L$). Options (ii) “TM recognizes” and (iii) “TM accepts” describe RE, not decidable.
    • Recursive: TM decides LL : for every ww, TM halts and says accept/reject.

    So LL is Turing decidable iff LL is recursive.

    Decider vs Recognizer distinction is key: recognizer may not halt on rejection.

    Final Answer

    Decidable = recursive → Option (i).

  11. Budget App•POCKETLY

    Pocketly on Android

    Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.

    Install Pocketly
  12. Q1j. Multi-tape TM is (i) More powerful than single-tape TM (ii) Less powerful (iii) Equivalent in power (iv) Not equivalent20252m

    Module 4: Turing Machines (TM)

    Multi-tape TM is

    (i) More powerful than single-tape TM
    (ii) Less powerful
    (iii) Equivalent in power
    (iv) Not equivalent

    View this question on its own page →
    Worked Solution

    Answer

    Correct Option: (iii) Equivalent in power

    Explanation

    Multi-tape TM vs Single-tape TM:

    • Power: Equivalent. Any kk-tape TM can be simulated by single-tape TM with at most quadratic slowdown (or O(t2)O(t^2)). Both accept exactly RE languages; deciders both accept Recursive languages.
    • Efficiency: Multi-tape can be faster (e.g., palindrome O(n)O(n) vs O(n2)O(n^2) on single tape), but not more powerful in computability.
    • Construction: Single tape encodes kk tapes via tracks (kk-track tape) + markers for heads.

    Therefore they are equally powerful (Turing-equivalent).

    Final Answer

    Equivalent in power → Option (iii).

  13. Q4a. Design a Turing Machine to compute n \bmod 2.20217m

    Module 4: Turing Machines (TM)

    Design a Turing Machine to compute n mod 2n \bmod 2.

    View this question on its own page →
  14. Q5a. Design a Turing Machine that increments a binary number by 1.20247m

    Module 4: Turing Machines (TM)

    Design a Turing Machine that increments a binary number by 11.

    View this question on its own page →
  15. Q5b. Design a Turing machine that recognizes strings containing equal number of 0’s and 1’s.20237m

    Module 4: Turing Machines (TM)

    Design a Turing machine that recognizes strings containing equal number of 00’s and 11’s.

    View this question on its own page →
  16. Q6b. Explain the various types of Turing Machines.20247m

    Module 4: Turing Machines (TM)

    Explain the various types of Turing Machines.

    View this question on its own page →
  17. Q7a. Design a Turing machine that accepts all palindromes over: \Sigma = \{ a, b \}20227m

    Module 4: Turing Machines (TM)

    Design a Turing machine that accepts all palindromes over:

    Σ={a,b} \Sigma = \{ a, b \}

    View this question on its own page →
  18. Q7b. Design a Turing Machine that enumerates all strings over {a, b} in lexicographic order. Explain the working of the machine.20257m

    Module 4: Turing Machines (TM)

    Design a Turing Machine that enumerates all strings over {a, b} in lexicographic order. Explain the working of the machine.

    View this question on its own page →
  19. Q8a. Design a single-tape Turing Machine that multiplies two unary numbers, where the input is of the form 1^m 0 1^n and the output is 1^{m \times n}. Clearly define the input alphabet, tape alphabet, and halting condition. Simulate the working of the Turing Machine on the input string 1101.20257m

    Module 4: Turing Machines (TM)

    Design a single-tape Turing Machine that multiplies two unary numbers, where the input is of the form 1m01n1^m 0 1^n and the output is 1m×n1^{m \times n}. Clearly define the input alphabet, tape alphabet, and halting condition. Simulate the working of the Turing Machine on the input string 11011101.

    View this question on its own page →
  20. Q9b. Write short notes on: Multi-tape Turing Machine.20237m

    Module 4: Turing Machines (TM)

    Write short notes on: Multi-tape Turing Machine.

    View this question on its own page →
  21. Q9b(iii). Write a short note on Multi-stack Turing Machine.20227m

    Module 4: Turing Machines (TM)

    Write a short note on Multi-stack Turing Machine.

    View this question on its own page →