User blog:Googology Noob/Simulating Sigma(2) with a Turing Machine

On the Turing golf page I saw an interesting challenge: compute BB(2) with a Turing machine. I believe it is quite possible to do and shouldn't take more than 1000 states (probably much, much less), and that's what I'm planning to do here.

Stage 1: Reading Instructions
The first stage is obviously letting a Turing machine having its input as a set of instructions for a smaller TM (namely, for two states and two symbols). It so happens that I tried to do this a while ago with bigger TMs (5 states and 5 symbols took me 369 lines of instructions on this simulator), so this was the easy part for me. Full code as follows: 0 * * r 0 0 x x r 1 1 x x r 1 1 _ s l pp0b 1 1 s l pp01 pp0b * * l pp0b pp0b n n r ps0b pp01 * * l pp01 pp01 n n r ps01 pp1b * * l pp1b pp1b n n r ps1b pp11 * * l pp11 pp11 n n r ps11 ps0b * * r ps0b ps0b | | r s0b ps0b x ? r error ps01 * * r ps01 ps01 | | r s01 ps01 x ? r error ps1b * * r ps1b ps1b | | r s1b ps1b x ? r error ps11 * * r ps11 ps11 | | r s11 ps11 x ? r error s0b 0 0 r r0b s0b * * r ps0b s01 0 0 r r01 s01 * * r ps01 s1b 1 1 r r1b s1b * * r ps1b s11 1 1 r r11 s11 * * r ps11 r0b b b r pc r0b * * r ps0b r01 1 1 r pc r01 * * r ps01 r1b b b r pc r1b * * r ps1b r11 1 1 r pc r11 * * r ps11 pc b d r chb pc 1 i r ch1 chb * * r chb chb s d l ppm ch1 * * r ch1 ch1 s i l ppm ppm * * l ppm ppm i 1 r pm ppm d b r pm pm r v r mr pm p q r m* pm l i r ml mr * * r mr mr i 1 r m mr d _ r m m* * * r m* m* i 1 * m m* d _ * m ml * * r ml ml i 1 l m ml d _ l m m 1 s l psb1 m * s l psbb psb1 * * l psb1 psb1 v r r ppb1 psb1 q p r ppb1 psb1 i l r ppb1 psbb * * l psbb psbb v r r ppbb psbb q p r ppbb psbb i l r ppbb ppb1 0 0 l pp01 ppb1 1 1 l pp11 ppb1 h h r end1 ppbb 0 0 l pp0b ppbb 1 1 l pp1b ppbb h h r endb end1 * * r end1 end1 s 1 * halt endb * * r endb endb s _ * halt The input must start with "n|" and follow with lines of instructions that are built like this: ), all consecutive. An example of an instruction would be "0b1rh". In the normal code, this would be: "0 _ 1 r halt".

Each instruction is separated by a vertical line "|". To mark the end of the instructions, type 1 or more consecutive "x"'s (not neccesarily straight after the last instruction), and after them the input. If the input moves on the x's, it will regard them as blank.

Here is an example for a valid input: "n|0b1l1|011r1|1b1r0|111lh xx". This is equivalent to: 0 _ 1 l 1 0 1 1 r 1 1 _ 1 r 0 1 1 1 l halt

That's the two state busy beaver. If you want to see the program working, click here.

I will soon post an explanation of what each part does.