Open In App

Turing Machine for L = {a^n b^n | n>=1}

Prerequisite – Turing Machine

Task :



We have to design a Turing machine for anbn where n>=1.

Analysis :



We can analyze that we have equal no of a’s and b’s and in some order i.e., first all a’s will come and then all b’s will come.

Example :

Input-1:aabb
Output-1:YES

Input-2:aabbbb
Output-2:NO

Input-3:abab
Output-3:NO

Approach :

Let us understand the approach by taking the example “aabb”.

Article Tags :