%% The TM halts when it is given an initial tape with
%% a string with equal number of a's and b's
%%
start_state(1).
delta(1,1,b,b,r).
delta(1,1,x,x,r).
delta(1,2,a,x,l).
delta(1,5,#,#,l).
delta(2,2,x,x,l).
delta(2,2,b,b,l).
delta(2,3,#,#,r).
delta(3,3,a,a,r).
delta(3,3,x,x,r).
delta(3,4,b,x,l).
delta(4,4,a,a,l).
delta(4,4,x,x,l).
delta(4,1,#,#,r).
delta(5,5,x,x,l).
delta(5,h,#,#,r).