Here is a solution of puzzle 51 with 18 parts. The requested outcome is first 8 red balls and then 8 blue balls. When looking at the initial set-up with mixed balls, the steps to achieve this outcome could be:

• Push red lever to let 5 red balls run on right side,

• then switch to all 8 balls (first 3 red, then 5 blue) on left side and

• then switch again for the remaining 3 blue balls on right side.

Joshua and I had the idea to use only one countdown register in order to reduce the number of parts. A single register of 3 bits can be used for both countdowns of 5 and 8 balls:

- Set the register initially to 4 such that there will be a first register overflow with the fifth red ball from the right side.
- After this first register overflow, the register shows 7. Now all 8 balls on the left side should run down throught the same countdown register such that there will be a second register overflow with the 8th ball.
- After this second register overflow, the remaining 3 blue balls from the right side should run down.

The pink draw gear bits combination below the register provides for the switch of sides after each register overflow:

- At initiation, the pink draw gear bits point to the right to make the balls run on the right side first.
- After the first overflow it switches the balls to run on the left side.
- After the second overflow it switches from left to right again.

Please note that the linked online turing tumble does not allow to have combinations of red and blue balls on the right or left side as requested by the book’s puzzle description. So the outcome when pushing the red lever is a mix of red and blue balls, but it illustrates how it works and how it should look like when you want to build it with your physical turing tumble. https://lodev.org/jstumble/?board=rlerlflfelferfee0fer0fer1feblfbgbeex_8_8

You can use the same TT parts set-up in case you prefer to start with the blue lever and balls on the left: Set the register to 2, point the pink draw gear bits to left and hit blue lever to first run the 3 red balls from the left side, then the 8 balls (5 red, then 3 blue balls) from the right and then the remaining 5 blue balls from the left. https://lodev.org/jstumble/?board=rlerlflfelferfee0fer1fer0fealfagaeex_8_8