Turing Machine
by:ArwaWshear& Exllass Fread
1
What is Turing Machine?
So what is Turing Machine ?
Is it some physical machine ?
Or some sort of imaginary machine ?
2
The answer:
The answer is it’s both logical and
physical device!!!
The Turing machine can be logical device then we
convert it to physical device one example we
can create a TM that reverse a string
3
A physical Turing Machine
Here I will show you an actual Turing machine
4
Lets get started
Every machine have an input and an output between the input and
output there is process
The input to any TM is just a String
The process here we will create it according to our need later we will
see how to design it
The Output is also a string 5
Our goal ?
Our goal in designing any Turing machine is to implement our idea
in term of states and transitions so we need to know about our
recourses but before that
State State
Transitions
6
Our recourses
The only recourse that we have is long tape its exactly like an array
But how we can use this tape ?
For every game we have set of rules here also just like a gameI tells you ,
you can use this tape so design this for me
7
The rules
1- you can read cell by cell
2- you can change the content of the cell
3- you can move to the right or to the left
4- you can use as much as you want from the tape its like infinite storage
store as elements as you wish
Here is what you can do with this tape
8
You cannot do this
You can not do this things in our game
1- you cannot jump form a cell to a far cell just cells next to each other
2- we will give you set of thing you can use them only as
input to our machine
9
Structure of Turing Machine
Finite state control
Read/Write head
We can read or write any symbol
that we like
10
TM= {Q,┌,b, ∑,δ ,q_0, F}
Q : is a finite, non-empty set of states
┌ : is a finite, non-empty set of the tape alphabet/symbols
∑ : is the set of input symbols
q_0 : is the initial state
F : is the set of final or accepting states.
δ : called the transition function, where L is left shift, R is right shift.
B : is the blank symbol (the only symbol allowed to occur on the tape
infinitely often at any step during the computation)
Formal Definition of Turing Machine
11
Some Examples
Ex/ Design a TM to that output is a 1's complement of a binary
number
Solution:
12
The Solution δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 1 = δ 𝑞0, 0, 𝑅
δ 𝑞0, 𝐵 = δ 𝑞0, 𝐵, 𝐻
13
Some Examples
Ex2: design the Turing Machine to accept the palindrome string ex:
aaa , abba , abaaba .........
Solution :
14
The Solution
15
δ 𝑞0, a = δ 𝑞1, A, 𝑅
δ 𝑞1, 𝑎 = δ 𝑞1, a, 𝑅
δ 𝑞1, b = δ 𝑞1, b, 𝑅
δ 𝑞1, b = δ 𝑞3, b, 𝑅
δ 𝑞3, = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
Some Examples
Ex3/ create a turing machine for (a ∪ b) ∗aa
Solution:
16
The Solution δ 𝑞0, 𝐵 = δ(𝑞1, 𝐵, 𝑅)
δ 𝑞1, 𝑏 = δ(𝑞1, 𝑏, 𝑅)
δ 𝑞1, 𝑎 = δ(𝑞2, 𝑎, 𝑅)
δ 𝑞2, 𝑏 = δ(𝑞1, 𝑏, 𝑅)
δ 𝑞2, 𝑎 = δ(𝑞3, 𝑎, 𝑅)
17
Some Examples
EX4 /create a turing machine to Swap all a’s to b’s and all b’s to a’s in a string of a’s and b’s
TM= {{𝑞0,𝑞1,𝑞2,𝑞3},{a,b},{a,b,B,x,y},δ ,𝑞2}
18
The Solution
δ 𝑞0, 𝐵 = δ(𝑞1, 𝐵, 𝑅)
δ 𝑞1, 𝑏 = δ(𝑞1, 𝑎, 𝑅)
δ 𝑞1, 𝑎 = δ(𝑞1, 𝑏, 𝑅)
δ 𝑞1, 𝐵 = δ(𝑞2, 𝐵, 𝐿)
δ 𝑞2, 𝑎 = δ(𝑞2, 𝑎, 𝐿)
19
Conclusion
TM is important term or idea in computer science or computer
technology it’s about idea and mind TM is used in our computer phones
or at least its idea, When Alan Turing invite this new (Idea or Device) his
idea was to create something capable of solving everything that can be
solved on this idea universal TM appeared if we have something that
can compute everything computable
Logically we must have something that can simulate TM itself and this
thing is UTM
20
References
1.princeton.2013 http://www.princeton.edu/~achaney/tmve/wiki100k/docs/Non-deterministic_Turing_machine.html
2.Ed Gonzales .2013 http://stackoverflow.com/questions/236000/whats-a-turing-machine
3.Brunfiel , Geoff, Student snags maths prize, Nature, October 24. 2007.
4.Alasdair Urquhart, 2007 "Smallest universal machine", FOM email list. October 26, 2007.
5.A. Salomaa , "Formal languages" , Acad. Press (1973)
6.T. Pajor , "A Deterministic Turing Machine that Accepts Primes", Universität Karlsruhe (2004)
7.S. Eilenberg , "Automata, languages and machines" , A , Acad. Press (1974)
8.A. Salomaa, M. Soittola , "Automata-theoretic aspects of formal power series" , Springer (1978)
* including our lecture and several lectures from other universities
21
That is all …….
Thanks for You
Arwa…Exllass…
22

Turing Machine

  • 1.
  • 2.
    What is TuringMachine? So what is Turing Machine ? Is it some physical machine ? Or some sort of imaginary machine ? 2
  • 3.
    The answer: The answeris it’s both logical and physical device!!! The Turing machine can be logical device then we convert it to physical device one example we can create a TM that reverse a string 3
  • 4.
    A physical TuringMachine Here I will show you an actual Turing machine 4
  • 5.
    Lets get started Everymachine have an input and an output between the input and output there is process The input to any TM is just a String The process here we will create it according to our need later we will see how to design it The Output is also a string 5
  • 6.
    Our goal ? Ourgoal in designing any Turing machine is to implement our idea in term of states and transitions so we need to know about our recourses but before that State State Transitions 6
  • 7.
    Our recourses The onlyrecourse that we have is long tape its exactly like an array But how we can use this tape ? For every game we have set of rules here also just like a gameI tells you , you can use this tape so design this for me 7
  • 8.
    The rules 1- youcan read cell by cell 2- you can change the content of the cell 3- you can move to the right or to the left 4- you can use as much as you want from the tape its like infinite storage store as elements as you wish Here is what you can do with this tape 8
  • 9.
    You cannot dothis You can not do this things in our game 1- you cannot jump form a cell to a far cell just cells next to each other 2- we will give you set of thing you can use them only as input to our machine 9
  • 10.
    Structure of TuringMachine Finite state control Read/Write head We can read or write any symbol that we like 10
  • 11.
    TM= {Q,┌,b, ∑,δ,q_0, F} Q : is a finite, non-empty set of states ┌ : is a finite, non-empty set of the tape alphabet/symbols ∑ : is the set of input symbols q_0 : is the initial state F : is the set of final or accepting states. δ : called the transition function, where L is left shift, R is right shift. B : is the blank symbol (the only symbol allowed to occur on the tape infinitely often at any step during the computation) Formal Definition of Turing Machine 11
  • 12.
    Some Examples Ex/ Designa TM to that output is a 1's complement of a binary number Solution: 12
  • 13.
    The Solution δ𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 1 = δ 𝑞0, 0, 𝑅 δ 𝑞0, 𝐵 = δ 𝑞0, 𝐵, 𝐻 13
  • 14.
    Some Examples Ex2: designthe Turing Machine to accept the palindrome string ex: aaa , abba , abaaba ......... Solution : 14
  • 15.
    The Solution 15 δ 𝑞0,a = δ 𝑞1, A, 𝑅 δ 𝑞1, 𝑎 = δ 𝑞1, a, 𝑅 δ 𝑞1, b = δ 𝑞1, b, 𝑅 δ 𝑞1, b = δ 𝑞3, b, 𝑅 δ 𝑞3, = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅 δ 𝑞0, 0 = δ 𝑞0, 1, 𝑅
  • 16.
    Some Examples Ex3/ createa turing machine for (a ∪ b) ∗aa Solution: 16
  • 17.
    The Solution δ𝑞0, 𝐵 = δ(𝑞1, 𝐵, 𝑅) δ 𝑞1, 𝑏 = δ(𝑞1, 𝑏, 𝑅) δ 𝑞1, 𝑎 = δ(𝑞2, 𝑎, 𝑅) δ 𝑞2, 𝑏 = δ(𝑞1, 𝑏, 𝑅) δ 𝑞2, 𝑎 = δ(𝑞3, 𝑎, 𝑅) 17
  • 18.
    Some Examples EX4 /createa turing machine to Swap all a’s to b’s and all b’s to a’s in a string of a’s and b’s TM= {{𝑞0,𝑞1,𝑞2,𝑞3},{a,b},{a,b,B,x,y},δ ,𝑞2} 18
  • 19.
    The Solution δ 𝑞0,𝐵 = δ(𝑞1, 𝐵, 𝑅) δ 𝑞1, 𝑏 = δ(𝑞1, 𝑎, 𝑅) δ 𝑞1, 𝑎 = δ(𝑞1, 𝑏, 𝑅) δ 𝑞1, 𝐵 = δ(𝑞2, 𝐵, 𝐿) δ 𝑞2, 𝑎 = δ(𝑞2, 𝑎, 𝐿) 19
  • 20.
    Conclusion TM is importantterm or idea in computer science or computer technology it’s about idea and mind TM is used in our computer phones or at least its idea, When Alan Turing invite this new (Idea or Device) his idea was to create something capable of solving everything that can be solved on this idea universal TM appeared if we have something that can compute everything computable Logically we must have something that can simulate TM itself and this thing is UTM 20
  • 21.
    References 1.princeton.2013 http://www.princeton.edu/~achaney/tmve/wiki100k/docs/Non-deterministic_Turing_machine.html 2.Ed Gonzales.2013 http://stackoverflow.com/questions/236000/whats-a-turing-machine 3.Brunfiel , Geoff, Student snags maths prize, Nature, October 24. 2007. 4.Alasdair Urquhart, 2007 "Smallest universal machine", FOM email list. October 26, 2007. 5.A. Salomaa , "Formal languages" , Acad. Press (1973) 6.T. Pajor , "A Deterministic Turing Machine that Accepts Primes", Universität Karlsruhe (2004) 7.S. Eilenberg , "Automata, languages and machines" , A , Acad. Press (1974) 8.A. Salomaa, M. Soittola , "Automata-theoretic aspects of formal power series" , Springer (1978) * including our lecture and several lectures from other universities 21
  • 22.
    That is all……. Thanks for You Arwa…Exllass… 22