All Exams Test series for 1 year @ ₹349 only
Question

Which of the following represents the output of the transition function(δ)

δ (q0 , a) = (q1 , x, R)
δ (q1 , a) = (q1 , a, R)
δ (q1 , y) = (q1 , y, R)
δ (q1 , b) = (q2 , y, L)
δ (q2 , y) = (q2 , y, L)
δ (q2 , a) = (q2 , a, L)
δ (q2 , x) = (q0 , x, R)
δ (q0 , y) = (q3 , y, R)
δ (q3 , y) = (q3 , y, R)
δ (q3 , □) = (qf , □, R)

This question was previously asked in
UGC NET 2024 Computer Science and Applications Question Paper (23-Aug-2024) (Shift 1)
The correct answer is

L={anbn|n≥1}

This is the classic Turing machine that matches a's against b's: it marks the leftmost unmatched a as x, runs right to the first unmatched b and marks it as y, returns left to the last x, and repeats. When no a is left it checks that only y's remain before the blank.

Step 1 — In q0 on a, write x and move right to q1. q1 skips a's and y's moving right; on the first b it writes y, moves left and enters q2.

Step 2 — q2 moves left over y's and a's until it meets x, then moves right into q0, now positioned on the next unmatched a.

Step 3 — When q0 reads y, all a's have been matched; it enters q3, which skips the y's and accepts (qf) only on reaching the blank □. A leftover b, or a leftover a with no b, leaves the machine without a move, so it halts and rejects.

InputRunResult
abq0: a→x, q1: b→y, q2 back to x, q0 reads y → q3 → □accepted
aabbtwo match rounds, then q3 over yy → □accepted
aabsecond a finds no b; q1 reaches □ with no rulerejected
ε (empty)q0 reads □; no rule for (q0, □)rejected

Because the empty string is rejected, the language is not {anbn | n ≥ 0}; because ab is accepted, it is not restricted to n > 1. It is not {anb2n | n > 0} either: ab, with one b per a, is accepted, while abb is rejected because after the single match q3 meets the second b and has no rule. The accepted language is exactly the strings anbn with at least one a.

L={anbn|n≥1} option is correct.

Was this answer helpful?

Similar Questions

  1. Given a Turing Machine

    M = ({q0, q1, q2, q3}, {a, b}, {a, b, B}, δ, B, {q3})

    Where δ is a transition function defined as

    δ(q0, a) = (q1, a, R)

    δ(q1, b) = (q2, b, R)

    δ(q2, a) = (q2, a, R)

    δ(q2, b) = (q3, b, R)

    The language L(M) accepted by the Turing Machine is given as :

  2. Consider the following statements:

    (A) For every regular language, we can design Turing Machine

    (B) For every context free language, we can design Turing Machine

    Which of the following is correct?

  3. Arrange the following stages of a Turing Machine (TM) operation in the correct order as they occur during computation.

    (A) Writing a symbol on the tape

    (B) Moving the tape head left to right

    (C) Reading a symbol from the tape

    (D) Transitioning to a new state based on the current state and symbol read

    (E) Halting and accepting or rejecting the input

    Choose the correct answer from the options given below :


Important Questions from Turing Machines

  1. Given a Turing Machine, M to determine whether M ever moves its head to the left when started with input W is:
  2. Which one of the following statements is equivalent to the following assertion?
    Turing machine $M$ decides the language $L \subseteq \{0,1\}^*$
  3. Given a Turing Machine

    M = ({q0, q1, q2, q3}, {a, b}, {a, b, B}, δ, B, {q3})

    Where δ is a transition function defined as

    δ(q0, a) = (q1, a, R)

    δ(q1, b) = (q2, b, R)

    δ(q2, a) = (q2, a, R)

    δ(q2, b) = (q3, b, R)

    The language L(M) accepted by the Turing Machine is given as :

  4. Consider the following statements:

    (A) For every regular language, we can design Turing Machine

    (B) For every context free language, we can design Turing Machine

    Which of the following is correct?

  5. Given below are two statements: one is labelled as Assertion A and the other is labelled as Reason R 

    Assertion A: $L = \{a^n b^n c^n : n \ge 0\}$ is accepted by a linear bounded automata. 

    Reason R: Linear bounded automata's recognize exactly the class of context sensitive languages. 

    In the light of the above statements, choose the most appropriate answer from the options given below

Need Expert Advice?
Upcoming Exams
CTET
December 12, 2026
WB SET
December 13, 2026
CBSE UGC NET
December 14, 2026
CSIR UGC NET
December 19, 2026
Test Series
UGC NET img
Teaching
UGC NET (Paper 2) December 2026 Mock Test Series
799 Tests 2 Tests Free
300 Attempts
4.4(45)
English, Hindi
More Questions from UGC NET

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App