## One Sample Non-Deterministic Turing Machine

A typical use of any TM is pattern recognition: it accepts a string of symbols.

This example uses two symbols {A, B}. An acceptable pattern is any substring “(A^{i}, B^{i}, A^{i}, B^{i}) for i > zero.” The TM should halt in an “accept” state when it finds a string with the same number of ‘A’s, ‘B’s, ‘A’s and ‘B’s embedded in the input tape. If it runs out of input before accepting, it will halt in a “reject” state.

The shortest acceptable string is ‘ABAB…’. This TM will also accept ‘AABBAABB…’. In either case, there could be any number of letters to the right of the strings, but the TM would stop and accept without reading them.

The difficulty comes in accepting ‘*A*AABBAABB…’. After the TM has read the second ‘B’, it might “hope” that the next symbol is another ‘B’, because that continues an acceptable string of three ‘A’s followed by three ‘B’s. When it reads that the sixth symbol is ‘A’, a deterministic TM must backtrack through the preceding ‘B’s and *the same number* of ‘A’s; then resume searching for the pattern starting with the second ‘A’.

A non-deterministic TM could avoid rewinding the tape by starting a parallel decision process as it reads each ‘A’ from left to right. This NTM runs five parallel processes, each numbered for the corresponding first ‘A’:

- The first process rejects ‘AAABBA…’
- The second accepts ‘.AABBAABB…’
- The third rejects ‘..ABB…’
- The fourth process was still working on ‘…AABB.’
- The fifth rejects ‘…ABB’ when it reads the second ‘B.’

## Do NTMs Lead to Practical Applications?

Some modern processing chips run a limited number of parallel computations. A processor might pre-fetch data to suit either path of an “if…else” branch, prior to resolving the condition.

Parallel processing is implemented in most graphics processing chips. If each pixel’s value can be determined independently of the other pixels, then all can be computed at once.

Decoding Science. One article at a time.