This is the fifth part of the Turing Machine series. For your convenience you can find other parts in the table of contents in Part 1 – Addition

Today we check whether a string has exactly twice as many ones as zeroes.

States:

The input looks like this:

Transition table: