User:Wythagoras/Rado's sigma function/Analysis of LittlePeng9's work/Color reduction

General reduction method for 3 colors with 7 states
The original reduction gives eight states for each new state. We can always do it with seven, as we don't need a reading state for the third symbol; we know that there will be a space. The exact construction is below:

State one: read whether there is a one in the first cell or not. Don't change any symbol. When space, go to state two. When one, go to state five.

State two: read whether there is a one in the second cell or not. Change symbol to new coding. When space, go to state three, when one, go to state four.

States three and four: Writing states for the space and second symbol.

State five: We know we only need a space here, so we change it to the new coding. Then go left and use the one: change it, if needed and go to the 'next state' state.

States six and seven: The 'next state' states, as described in LittlePeng9's blog post.

Special case I.
When the 'next symbol' for the third symbol is either a space or the third symbol itself, we only need six states.

State one: read whether there is a one in the first cell or not. When space, go to state two. When one, change it to the new coding. (space will remain space). Go to the 'next state' state.

State two: read whether there is a one in the second cell or not. Change symbol to new coding. When space, go to state three, when one, go to state four.

States three and four: Writing states for the space and second symbol.

States five and six: The 'next state' states, as described in LittlePeng9's blog post.

Special case II.
When all symbols stay the same and all directions are 'move right', we need only four states. This seems a very rare case, but it appears ferquently in the hydra machine. In fact, it also works when '''State one. '''Read whether there is a one in the first cell or not. When space, go to state two, when one, go to the 'next state' state. Change eventually. (read above).
 * Both the space and second symbol change to two, or
 * The space changes to the second symbol and/or the second symbol changes to a space.

State two: read whether there is a one in the second cell or not. Change eventually. Go directly to the next state.

States three and four: The 'next state' states.

Special case III.
If there is only one of space and second symbol and special case I. also applies, we can do it in four:

'''State one. '''Read whether there is a one in the first cell or not. When space, go to state two, when one, go to the 'next state' state. Change symbols when needed.

'''State two. '''Change symbol, and go directly to the new state.

States three and four: The 'next state' states.

Special case IV.
If special case III. applies and change in the second macro cell is not needed, we can do it in just three states.

'''State one. '''Read whether there is a one in the first cell or not. Go to the 'next state' state. Change symbols when needed.

States two and three: The 'next state' states.

Another trick
If there is no left or right transition, we don't need that 'next state' state.