Computer Science Fundamentals - Turing Machines
-
Upload
jasondew -
Category
Technology
-
view
1.048 -
download
3
Transcript of Computer Science Fundamentals - Turing Machines
![Page 1: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/1.jpg)
Computer Science FoundationsTuring Machine Edition
Jason DewGeezeo / Catamorphic Labs
![Page 2: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/2.jpg)
AlanTuring
![Page 3: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/3.jpg)
Entscheidungsproblem
DavidHilbert
![Page 4: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/4.jpg)
Alphabetany set of symbols examples:● {a, b, c, d, ..., z}
● {0, 1, 2, 3, ..., 9}
● {0, 1}
![Page 5: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/5.jpg)
Stringsequence of symbols from the alphabet examples:● foobar
● 0101001
● (empty string)
![Page 6: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/6.jpg)
Formal Languageany set of strings over an alphabet examples:● {foo, bar, baz}
● {00, 01, 10, 11}
● {b, ab, aab, aaab, aaaab, ... }
![Page 7: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/7.jpg)
DeterministicFinite Automata
http://15mmvsf.bagofmice.com/vsf/prev_robot.htm
![Page 8: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/8.jpg)
Formal Definition● an alphabet
● a set of states○ one denoted as a "starting state"○ one or more denoted as "accepting states"
● a transition function○ takes a symbol and a state and returns a new state
![Page 9: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/9.jpg)
DFA acceptingmultiples of 3
![Page 10: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/10.jpg)
NondeterministicFinite Automata
![Page 11: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/11.jpg)
Formal Definition● an alphabet
● a set of states○ one denoted as a "starting state"○ one or more denoted as "accepting states"
● a transition function○ takes a symbol and a state and returns
zero or more states
![Page 12: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/12.jpg)
Example NFA
![Page 13: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/13.jpg)
Theorem
Any NFA can be convertedinto an equivalent DFA.
![Page 14: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/14.jpg)
Regular Language
Any language whichcan be recognized by
some finite automaton.
![Page 15: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/15.jpg)
Regular Expressions
![Page 16: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/16.jpg)
Theorem
A language is regularif and only if
some regular expression describes it.
![Page 17: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/17.jpg)
Turing machines
![Page 18: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/18.jpg)
Formal Definition (slightly simplified)
● two alphabets○ one for reading, the input alphabet○ one for writing, the output (or tape) alphabet
● a set of states○ one starting state○ one accepting state○ one rejecting state
● a transition functiontakes a symbol and a state and returns
a new state, a symbol to write, and Left or Right
![Page 19: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/19.jpg)
Example TMLet's call it M It accepts strings whose length is a power of 2 Accepted strings: "0", "00", "0000" Rejected strings: "", "000", "000000"
![Page 20: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/20.jpg)
A description of M
Attribution: Sipser, Figure 3.8
![Page 21: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/21.jpg)
Running on "00"tape state
.00_ q1
_.0_ q2
_x._ q3
_.x_ q5
._x_ q5
_.x_ q2
_x._ q2
_x_. qaccept
![Page 22: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/22.jpg)
Running on "0000"tape state
.0000_ q1
_.000_ q2
_x.00_ q3
_x0.0_ q4
_x0x._ q3
_x0.x_ q5
_x.0x_ q5
_.x0x_ q5
._x0x_ q5
tape state
_.x0x_ q2
_x.0x_ q2
_xx.x_ q3
_xxx._ q3
_xx.x_ q5
_x.xx_ q5
_.xxx_ q5
._xxx_ q5
tape state
_.xxx_ q2
_x.xx_ q2
_xx.x_ q2
_xxx._ q2
_xxx_. qaccept
![Page 23: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/23.jpg)
Wrapping up
Why do we care about Turing machines?
![Page 24: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/24.jpg)
ReferencesDeterministic finite automaton. (2012, March 11). Retrieved from http://en.wikipedia.org/wiki/Deterministic_finite_automaton Nondeterministic finite automaton. (2012, April 20). Retrieved from http://en.wikipedia.org/wiki/Nondeterministic_finite_automaton Petzold, C. (2008). The annotated turing. Indianapolis: Wiley Publishing, Inc. Sipser, M. (2006). Introduction to the theory of computation. (2nd ed.). Boston: Thompson Course Technology. Turing machine. (2012, April 17). Retrieved from http://en.wikipedia.org/wiki/Turing_machine
![Page 25: Computer Science Fundamentals - Turing Machines](https://reader033.fdocuments.in/reader033/viewer/2022052310/55504808b4c9058f768b4eeb/html5/thumbnails/25.jpg)
Come work with me!