Turing machine examples
We are excited to announce that we are moving from JavaTpoint. Stay tuned for an enhanced experience with the same great content and even more features. Thank you for your continued support! In this, some number of 0's followed by an equal number of 1's and then followed by an equal number of 2's. Any type of string which falls in this category will be accepted by this language.
Now, we will see how this Turing machine will work for Initially, state is q0 and head points to 0 as:.
Turing machine in automata
So we will move right to ensure that no 1 or 2 is present. Firstly we read the first symbol from the left and then we compare it with the first symbol from right to check whether it is the same. Again we compare the second symbol from left with the second symbol from right. We repeat this process for all the symbols.
Universal turing machine
If we found any symbol not matching, we cannot lead the machine to HALT state. Initially, state is q0 and head points to a as:. Firstly we read the first symbol from left and then we compare it with the first symbol from right to check whether it is the same. If we found any symbol not matching, we lead the machine to HALT state.