- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Design Turing machine for multiplication
A Turing machine is a seven tuples
(Q, Σ, Γ, δ, q0, qacc, qrej)
Where,
Q is a finite set of states;
Σ is the input alphabet does not contain the blank symbol t;
Γ is the tape alphabet, where t ∈ Γ and Σ ⊆ Γ;
δ: (Q × Γ) → (Q × Γ × {L, R}) is the transition function;
q0 ∈ Q is the start state;
qacc ∈ Q is the accept state;
qrej ∈ Q is the reject state, where qrej ≠ qacc.
Problem
Construct Turing machine (TM) for multiplication of two unary integers.
Solution
Multiplication of two unary integers 3*2=6 In Turing Machine 3 represents − 111 2 represents − 11
Let ‘M’ be a symbol used to separate two integers
B | 1 | 1 | 1 | M | 1 | 1 | B |
Here B= blank
M= Symbol used two separate two integers
⇑= Head
After performing multiplication, the output is as follows −
B | 1 | 1 | 1 | 1 | 1 | 1 | B |
The TM for multiplication is given below −
Explanation
q0 − Looking at the first unused symbol in input.
q0 − Looking at the first unused symbol in input.
q1 − Found a 1 in the first factor; skipping to the x symbol
q2 − Found x
q4 − Found a 1 in the second factor; changed it to Y; skipping to the =
q3 − Used all the 1s in the second factor; convert the Ys back to 1s
q5 − Skipping to end of tape
q6 − Skipping back to =
q7 − Skipping back over second factor
q8 − Found Y marking previously used 1 from second factor
q9 − Skip back over 1ʼs in first factor
q12 − Consumed the entire first factor; convert xs back to 1s
q11 − Found ⊔
- Related Articles
- Construct Turing machine for addition
- Construct Turing machine for subtraction
- Design Turing Machine to reverse string consisting of a’s and b’s
- Construct a Turing Machine for language L = {0n1n2n | n≥1}
- Construct a Turing Machine for language L = {ww | w ∈ {0,1}}
- What is Turing Machine in TOC?
- Construct a Turing Machine for language L = {wwr | w ∈ {0, 1}}
- Explain the universal Turing machine in TOC
- Distinguish between Finite Automata and Turing Machine
- Explain about a non-deterministic Turing Machine?
- Explain Turing Machine variant Two Stack PDA?
- Explain Multi tape Turing Machine in TOC?
- Construct a Turing machine for L = {aibjck | i< j< k; i ≥ 1}
- Construct a Turing machine for L = {aibjck | i>j>k; k ≥ 1}
- Construct a Turing Machine for L = {a^n b^n | n>=1}
