Open In App

Construct a Turing machine for L = {a<sup>i</sup>b<sup>j</sup>c<sup>k</sup> | i< j< k; i ≥ 1}

Prerequisite – Turing Machine
In given language L = {aibjck | i< j< k; i≥ 1}, every string of ‘a’, ‘b’ and ‘c’ have certain number of a’s, then certain number of b’s and then certain number of c’s. The condition is that count of 1st symbols should be atleast 1. ‘b’ and ‘c’ can have thereafter be as many but count of a is less than count of ‘b’ and count of ‘b’ is less than count of ‘c’. Assume that string is ending with ‘$’.
Examples:

Input: a a a b b c  
       Here a = 3, b = 2, c = 1 but |a|<|b|<|c|
Output: NOT ACCEPTED
          
Input: a b b c c c
       Here a = 1, b = 2, c = 3 
Output:ACCEPTED 

Tape Representation:



Approach:



  1. Comparing two elements by making D & C as a single element.
  2. After that Comparing D & C.
  3. If |A| is greater than |(D, C)|, then it is not accepted.
  4. If |C| is greater than |D|, then it is not accepted.
  5. Else it is accepted.

Steps:

State transition diagram :

Here, Q0 shows the initial state and Q1, Q2, Q3, Q4, Q5, Q6 shows the transition state and Q7 shows the final state. A, C, D are the variables used and R, L shows right and left.

Explanation:

Note: For comparison of |A|, |D|, |C|, the concept of Turing Machine as Comparator is used.

Article Tags :