Professional Documents
Culture Documents
Ans: Let us consider 2+3. It can be represented on type in unary format as,
q0
To add these two unary numbers, we replace + with 1 and then, we remove
last 1.
Therefore, the corresponding transitions are:
(q0 , ) ( q1 , , L)
( q1 ,1) ( qa , , )
qa
where
is the final
state.
Construct a TM for subtraction of two unary numbers. ie. f(a-b)=c where a >b.
(q3 , ) (q3 , , R)
is the final