Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

BCSE304L:Theory of Computation

Turing Machine as Transducer

Jyothimon C
Assistant Professor
School of Computer Science and Engineering
Vellore Institute of Technology

March 23, 2023

JYOTHIMON C BCSE304L-TOC March 23, 2023 1 / 12


Contents

1 Turing Machine as Transducer

2 Design of Turing Machine

JYOTHIMON C BCSE304L-TOC March 23, 2023 2 / 12


Turing Machine (TM)

JYOTHIMON C BCSE304L-TOC March 23, 2023 3 / 12


Turing Machine

A Turing Machine can be represented as:


M = (Q, Σ, Γ, δ, q0 , B, F )

Q : A finite set of states


Σ : A finite set of input symbols
Γ : A finite set of tape symbols
δ : Transition function
Q × Γ → Q × Γ × {L, R}
q0 : Start state, q0 ∈ Q
B : special tape symbol represents Blank cell
F : A set of final or accepting states, F ⊆ Q

JYOTHIMON C BCSE304L-TOC March 23, 2023 4 / 12


Turing Machine as Transducer

A TM can function as a transducer.

That is, a string is given as input to TM, it produces some output.

Input to the computation is a set of symbols on the tape.

At the end of computation, whatever remains on the tape is the output.

A TM can be viewed as a transducer for the implementation of function f


defined as,
ŵ = f (w )

JYOTHIMON C BCSE304L-TOC March 23, 2023 5 / 12


Design of Turing Machines

Design a Turing machine that computes the following function

f (m, n) = m + n

JYOTHIMON C BCSE304L-TOC March 23, 2023 6 / 12


Design of Turing Machines

Design a Turing machine that computes the following function

f (m, n) = m + n

0, 0, R 0, 0, R

$, 0, R B, B, L 0, B, L
start q0 q1 q2 q3

JYOTHIMON C BCSE304L-TOC March 23, 2023 7 / 12


Design of Turing Machines

Design a Turing machine that computes the following function

f (m, n) = m × n

JYOTHIMON C BCSE304L-TOC March 23, 2023 8 / 12


Transition Table representation of f (m, n) = m × n

Current
0 $ X Y B
State
→ q0 (q1 , X, R) (q9, $, L) - - -
q1 (q1 , 0, R) (q2 , $, R) - - -
q2 (q3 , Y, R) (q7, $, L) - - -
q3 (q3 , 0, R) (q4, $, R) - - -
q4 (q4 , 0, R) - - - (q5 , 0, L)
q5 (q5 , 0, L) (q6 , $, L) - - -
q6 (q6 , 0, L) - - (q2 , Y, R) -
q7 (q8 , $, L) (q7 , 0, L)
q8 (q8 , 0, L) - (q0 , X, R) - -
q9 - - (q9 , 0, L) - (q10 ,B,R)
⋆q10 - - - - -

JYOTHIMON C BCSE304L-TOC March 23, 2023 9 / 12


Design of Turing Machines

Design a Turing machine that computes the following function

f (m, n) = m − n

JYOTHIMON C BCSE304L-TOC March 23, 2023 10 / 12


Design of Turing Machines

Design a Turing machine that computes the following function

f (m, n) = m ÷ n

JYOTHIMON C BCSE304L-TOC March 23, 2023 11 / 12


Design of Turing Machines

Design a Turing machine that computes the following function

f (m) = 2 × m

JYOTHIMON C BCSE304L-TOC March 23, 2023 12 / 12

You might also like