Open In App

Construct a Turing Machine for language L = {0<sup>2n</sup>1<sup>n</sup> | n>=0}

Prerequisite – Turing Machine The language L = {02n1n | n >= 0} represents a kind of language where we use only 2 symbols, i.e., 0 and 1. In the beginning language has some number of 0’s followed by exactly half number of 1’s . Any such string which falls in this category will be accepted by this language. Examples :
Input : 001
Output : YES

Input : 00001
Output : NO 

Input :  or empty string
Output : YES 
Basic Representation –
Start of Computation : The tape contains the input string w, the tape head is on the leftmost symbol of w, and the Turing machine is in the start state Q0. Basic Idea : The tape head reads the leftmost symbol of w, which is 0 and makes is blank then the next left most 0 is made blank after this we traverse to the rightmost 1 of the string and make it blank. In nth is way we have reduced the string to 02n-21n-1.If the string belongs to language L then at end empty string will be left and hence gets accepted by the machine.
Meanings of symbols used: R, L – direction of movement of one unit on either side. B-Blank. 0, 1 – symbols whose combination string is to be tested. Working Procedure :
Article Tags :