0% found this document useful (0 votes)
65 views30 pages

Automata Theory Lecture 9 Slides

This lecture describes Turing machines and their components. Turing machines are the most powerful computational models and can recognize recursively enumerable languages. The lecture provides examples of Turing machines, their formal definitions and transition functions. It also shows the acceptance of strings by example Turing machines.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views30 pages

Automata Theory Lecture 9 Slides

This lecture describes Turing machines and their components. Turing machines are the most powerful computational models and can recognize recursively enumerable languages. The lecture provides examples of Turing machines, their formal definitions and transition functions. It also shows the acceptance of strings by example Turing machines.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Course: Automata Theory

Lecture 9: Models of Computation –


Turing Machines (TMs)

Lecturer: Martha Gichuki


Course description
• The course begins with an introduction to logic and formal
grammar where learners will do a recap on sets, logic and truth
tables, sequences, relations and functions
• A coverage of finite state machines, Push Down automata and
Turing Machines (The Church’s thesis) will culminate the study of
various models of computation.
• Formal language and grammar will then follow to enable learners
differentiate regular and context free languages.
• An evaluation of the computability and complexity of practical
computational problems which are the foundations of automata
theory will then be done and the outcome will be problem
description.
Learning outcomes:

Lecture 9: Models of Computation – Turing


Machines
At the end of the lecture the learner will be able to:
• Describe Turing Machines
• Describe Turing Machines using State Diagrams
• Formally describe various Turing Machines
Introduction to Turing Machines
(TMs)
•These are the most powerful
computational machines.
•They possess an infinite memory in
the form of a tape, and a Read/Write
head which can read and change the
tape, while moving in either
direction along the tape.
Which language does a Turing Machine
(TMs) recognize/decide?
• Turing machines are equivalent to algorithms
and are the theoretical basis for modern
computers.
• Turing machines decide recursive languages
and recognize the recursively enumerable
languages.
• Recall that Finite automata recognizes regular
languages while Push Down Stack machines
recognize Context Free Languages
Turing machines decide recurve languages and
recognize the recursively enumerable languages.
Turing Machines compared to FA and PDA
• Turing Machines have the essential feature
of unrestricted access to memory,
distinguishing them from weaker models
like Finite Automata and Push Down
Automata.
• They possess an infinite memory in the
form of a tape, and a Read/Write head
which can read and change the tape.
• The Read/Write head moves in either
direction along the tape i.e. Left (L) or
Right (R ) direction.
Tape Operation
Infinite Tape
… 1 0 1 0 0 1 …

Read/Write Head

Finite Control

State: q1

Source: Introduction to the theory of computation (3rd ed.), Michael, S. Boston, Cengage Learning. ISBN-13: 978-1133187790, (2012). Page 166, 169
Formal Definition of a Turing Machine
A Turing Machine is a 7-tuple (Q, ∑, Γ, δ
, q0, qaccept, qreject), where
i. Q is a finite set of states
ii. ∑ is the input alphabet – blank
symbol (∪) not included
iii. Γ is the tape alphabet - blank
symbol (∪) included
iv. δ: Q X Γ → Q X Γ X {L, R} is the
transition function
Formal Definition of a Turing Machine...

v. q0 ∈ Q is the start state


vi. qaccept, ∈ Q is the Accept state, and
vii. qreject ∈ Q is the Reject state.
The Transition Function

• δ: Q X Γ → Q X Γ X {L, R} is the transition


function whereby while the machine is in
State Q, reads a symbol from the tape
alphabet, it moves to another state Q,
replaces the symbol with another one and
the Read/Write head moves either to the Left
(L) or to the Right(R )
• Even if the Input alphabet is exhausted, the
tape has infinite blank symbols along the
tape
Turing Machine Configuration
Infinite Tape

… ∪ ∪ qi qi+1 qi+2 qi+3 ∪ ∪ …

Read/Write Head Blank Symbols

Finite Control
State: qi
Source: Introduction to the theory of computation (3rd ed.), Michael, S. Boston, Cengage Learning. ISBN-13: 978-1133187790, (2012). Page 166, 169
Example 1:
• Given a Turing machine M6, which recognizes the
language consisting of all strings of 0s whose
length is a power of 2.
• This machine decides the language:
A = {02n | n>=0}.
• Examples of strings in this language are:
✓ 20- 0
✓21- 00
✓22- 0000
✓23 -0000000
✓…2n
Formal Definition of the Turing Machine M6
The formal definition of M6 = (Q, ∑, Γ, δ, q1,
qaccept, qreject).
Where;
1) Q is a finite set of states (seven states in
this case)
• Q = {q1, q2, q3, q4, q5, qaccept, qreject};

2) ∑ is the input alphabet with the blank


symbol (∪) not included
• ∑ = {0};
Formal Definition of the Turing Machine M6…
3) Γ is the tape alphabet with the
blank symbol (∪) included
• Γ = {0, x, U};
• The read/write head is able to read
and write(replace) symbols 0, x, U and
replace it with either 0, x, U from the
tape alphabet.
• Sometimes replacement does not
happen
4) The transition function δ: Q X Γ → Q X Γ X {L, R} of the Turing
Machine M6 is described using the state diagram below:-

Source: Introduction to the theory of computation (3rd ed.), Michael, S. Boston, Cengage Learning. ISBN-13: 978-1133187790, (2012). Page 172.
Formal Definition of the Turing Machine M6…

5) q1 ∈ Q is the Start state


6) qaccept, ∈ Q is the Accept state, and
7) qreject ∈ Q is the Reject state
Show that the language 00 is accepted by machine M6
q100∪∪∪…
∪q20∪∪∪…

∪ xq3∪∪∪…

∪ q5x∪∪∪…

∪ q5∪x∪∪∪…

∪ q2x∪∪∪…

∪ x q2∪∪∪…

∪ x∪ qaccept

Source: Introduction to the theory of computation (3rd ed.), Michael, S. Boston, Cengage Learning. ISBN-13: 978-1133187790, (2012). Page 172.
• Show that the language 000 is not accepted by machine
M6 q1000∪∪∪…
∪q200∪∪∪…

∪ xq30∪∪∪…

∪x0q4∪∪∪…

∪x0∪ qreject ∪∪…

Source: Introduction to the theory of computation (3rd ed.), Michael, S. Boston, Cengage Learning. ISBN-13: 978-1133187790, (2012). Page 172.
• Show that the language 0000 is accepted by machine M6
∪x q50x ∪∪∪… ∪ x q5 xx ∪∪∪…
q10000∪∪∪…
∪q2000∪∪∪… ∪ q5 x0x ∪∪∪… ∪ q5 xx x ∪∪∪…

∪ xq300∪∪∪… q5 ∪x0x ∪∪∪… q5 ∪ xx x ∪∪∪…

∪ x0q40∪∪∪… ∪ q2 x0x ∪∪∪… ∪ q2 xx x ∪∪∪…

∪x0x q3∪∪∪… ∪ x q2 0x ∪∪∪… ∪ xq2 x x ∪∪∪…

∪x0 q5 x ∪∪∪… ∪ xx q3 x ∪∪∪… ∪ xx q2 x ∪∪∪…

∪ xx x q3 ∪∪∪… ∪xx xq2 ∪∪∪…

∪ xx q5x ∪∪∪… ∪ xx x ∪qaccept

Source: Introduction to the theory of computation (3rd ed.), Michael, S. Boston, Cengage Learning. ISBN-13: 978-1133187790, (2012). Page 172.
Question:
• Show whether the following strings are accepted or
rejected by the Turing Machine
i). 0
uq10uu…
uuq2uu…
uuuqaccept

Source: Introduction to the theory of computation (3rd ed.), Michael, S. Boston, Cengage Learning. ISBN-13: 978-1133187790, (2012). Page 172.
ii). 00000
uq100000uu…
uuq20000uu…
uuxq3000uu…
uux0q400uu…
uuxoxq30uu…
uux0x0q4uu…
uux0x0uqreject

Source: Introduction to the theory of computation (3rd ed.), Michael, S. Boston, Cengage Learning. ISBN-13: 978-1133187790, (2012). Page 172.
uq1000000uu…
uuq200000uu…
iii). 000000 uuxq30000uu…
uux0q4000uu…
uuxoxq300uu…
uux0x0q40uu…
uux0x0xq3uu…
uux0x0q5xuu…
uux0xq50xuu…
uux0q5x0xuu…
uuxq50x0xuu…
uuq5x0x0xuu…
uq5ux0x0xuu…
uuq2x0x0xuu…
uuxq20x0xuu…
uuxxq3x0xuu…
uuxxxq30xuu…
uuxxx0q4xuu…
uuxxx0xq4uu…
uuxxx0xuqreject

Source: Introduction to the theory of computation (3rd ed.), Michael, S. Boston, Cengage Learning. ISBN-13: 978-1133187790, (2012). Page 172.
Variants of Turing Machines: -
1) Multi-tape Turing Machine – Has
several tapes, each with its own head for
reading and writing
2) Enumerator – Has a printer attached to
it.
3) Non-Deterministic Turing Machine –
At any point, the machine may proceed
according to several possibilities
1. Multi-tape Turing Machine
• As the name suggests, a multi-tape Turing machine
has several tapes (k) for reading and writing
information, instead of only one.

• The first tape is initialized with the input, and the


rest are initially empty.
• The transition function is defined as:
δ:Q×Γk→Q×Γk×{L,R} k
• We can transition based on all k current input
symbols, write a symbol to each of the k tapes, and
move each of the k tapes either left or right.
• However, multi-tape Turing machines are not more
capable than regular ones.
2. Enumerator
• This is a Turing machine with a printer
attached to it.
• At the beginning of the tape, there is no
input
• Instead of having accept or reject strings,
the enumerator prints out a set of strings
and this becomes the language of the
enumerator.
• This string on the tape can be printed any
time as decided by the enumerator
3. Non-Deterministic Turing Machine
• At each step in the computation, the machine can
take one of several actions
• The transition function is defined as:

δ:Q×Γ→P(Q×Γ×{L,R})
• Similar to the NFA, the computation of a non-
deterministic TM is a tree, where each branch is a
possible action.
• If any branch of the computation results in an accept
state, the machine accepts the input.
• In terms of powr, the Non-deterministic Turing
machines are not powerful than deterministic ones.
Equivalence with Other Models
• Researchers have proposed several models of
computation with time with all of them
exhibiting the characteristic of unrestricted
access to unlimited memory.
• Some of these models are similar to the Turing
machines, while others are different e.g. the
lambda calculus by Alonzo Church.
• This points at the fact that computational
power depends on the computer model in use.
• Whatever can be handled by a powerful super-
computer can also be handled by a basic
Turing machine.
Summary
• At the heart of every machine definition is
the transition Function
• Finite Automata can either be DFA or NFA.
• There are other extensions of Finite
Automata including the Push Down
Automata (PDA) and the Turing Machine
(TM) among others.
• Turing machines decide recursive
languages and recognize the recursively
enumerable languages.
References
• Rowan G. & John T., (2009), Discrete Mathematics:
Proofs, Structures and Applications, CRC Press, ISBN:
9781439812808.
• W. D. Wallis (2003), A Beginners Guide to Discrete
Mathematics, Springer Science & Business Media,
ISBN: 978-0817642693.
• Introduction to the theory of computation (3rd ed.),
Michael, S. Boston, Cengage Learning. ISBN-13: 978-
1133187790, (2012).
• Introduction to languages and the theory of
computation (3rd ed.), Martin, J., New York: McGraw-
Hill. ISBN-13: 978-0072322002, (2002)

You might also like