- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Our aim is to design a Turing machine (TM) to reverse a string consisting of a’s and b’s over an alphabet {a,b}.

**Input** − aabbab

**Output** − babbaa

Step 1: Move to the last symbol, replace x for a or x for b and move right to convert the corresponding B to „aâ€Ÿ or „bâ€Ÿ accordingly. Step 2: Move left until the symbol left to x is reached. Step 3: Perform step 1 and step 2 until „Bâ€Ÿ is reached while traversing left. Step 4: Replace every x to B to make the cells empty since the reverse of the string is performed by the previous steps.

The transition diagram for Turing Machine (TM) is as follows −

**Let us consider an example to check whether the given input is getting reverse or not **−

**Input string -** abb.

**Expected output -** {bba}

Therefore, the TM is as follows −

- Related Questions & Answers
- Design a TM for equal number of a’s and b’s
- Design a DFA machine accepting odd numbers of 0’s or even numbers of 1’s
- Draw a Turing machine to find 1’s complement of a binary number
- Draw a Turing machine to find 2’s complement of a binary number
- Count subarrays consisting of only 0’s and only 1’s in a binary array in C++
- Design a DFA of a string with at least two 0’s and at least two 1’s
- 1’s and 2’s complement of a Binary Number?
- Sort an arrays of 0’s, 1’s and 2’s using C++
- Sort an arrays of 0’s, 1’s and 2’s using Java
- Find yesterday’s, today’s and tomorrow’s date in Python
- Construct DFA of alternate 0’s and 1’s
- Difference Between Prim’s and Kruskal’s Algorithm
- Faraday’s Laws and Lenz’s Law of Electromagnetic Induction
- Maximum length of segments of 0’s and 1’s in C++
- Design DFA for language over {0,1} accepting strings with odd number of 1’s and even number of 0’s

Advertisements