0% found this document useful (0 votes)
44 views19 pages

Toc L13

Uploaded by

Gaming 2.0
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)
44 views19 pages

Toc L13

Uploaded by

Gaming 2.0
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/ 19

CSC3113: THEORY OF COMPUTATION

COMPUTABILITY THEORY
COMPUTABILITY & TURING MACHINE
ì Following FA, PDA, Regular & Context-free language towards Computability
& Turing Machine (TM).
ì Computability Theory, History.
ì Turing Machine
ì Informal Description
ì Input/output convention
ì Abstraction
ì Implementation level description
ì Low level description
ìFormal Definition
ìState Diagram

CSC3113: Theory of Computation


ì Difference among FA, PDA, and TM
ì Understand Computability Theory through Turing Machine model.
ì Description of Turing Machine

CSC3113: Theory of Computation


ALL OUTCOME ARE REPRESENTED WITH EXAMPLES

ì Understand why we need TM through understanding the difference


among FA, PDA, Regular & Context-free languages with
Computability and Turing machine.
ì Basic concept of Computability Theory and its history.
ì Description of Turing Machine –
ì Informal
ì Implementation level
ì Low level
ìFormal
ìState Diagram

CSC3113: Theory of Computation


WE HAVE LEARNED SO FAR…

PushFinite
Down Automaton
Automaton (FA)
(PDA)
Computational
ComputationalModel
Model
withwith
REGULAR
additional
limited stack
memorymemory
can be
can
used
be
LANGUAGES usedtoto
compute
compute these
these
languages.
languages.
Can be decided by a DFA.
CONTEXT FREE Regular language is member of
LANGUAGES CFL.Can be decided by an NFA.

CanCan
be generated
be expressed
by CFG.
by a
regular expression.
Pushdown
Finite automata
automata
is used in text
is processing,
used in
programming
pattern matching,
languages, parity
AI tools,
checking,
Natural
Can be recognized by PDA.
Language
compilers, and
processing,
hardware design,
parsingetc.(math Regular language is closed
expressions), etc. CFGunder
can beregular
decided
operations.
by PDA.
CSC3113: Theory of Computation
NEXT: WE WILL LEARN
ì Can be decided by a Turing Machine
(TM).
ì A model of computation that is –
REGULAR
ì General purpose: Captures all
LANGUAGES algorithms that can be implemented in
any programming language.
ì Mathematically simple: We can hope to
CONTEXT FREE prove that things are not computable in
this model.
LANGUAGES
COMPUTABLE ì Turing Machine is deterministic
ì Must reach Accept/Reject state
ì Halts once it reaches Accept/Reject state
ì Might loop forever

CSC3113: Theory of Computation


COMPUTABILITY THEORY
ì A mathematical problem is computable if it can be solved in principle
by a computing device.
ì In the 1930’s, well before there were computers, Gödel, Turing, and
Church showed that not all mathematical problems are computable in
a computing device.
ì There is an extensive study and classification of
ì Which mathematical problems are computable, and which are not.
ì Computable problems into computational complexity classes according to
how much computation is needed to answer that instance, as a function
of the size of the problem instance.
ì Some common synonyms for “computable” are “solvable”,
“decidable”, and “recursive”.

CSC3113: Theory of Computation


COMPUTABILITY HISTORY
ì David Hilbert’s Tenth Problem in 1900 states that a given
Diophantine equation (polynomial equation with integral coefficients) is
solvable in rational integers using a finite number of operations.
ì Hilbert came up with the term “entscheidungsproblem” (decision problems)
which is the pre-version to the NP-problem that we currently know as SAT
(satisfiability problem) in computing science, in 1928.
ì In 1930s, various mathematicians – Alonzo Church, Kurt Gödel, Stephen
Kleene, Markov, Emil Post, and Alan Turing, independently defined what it
means to be computable.
ì They defined Lambda calculus, Recursive functions, Formal systems, Markov
algorithms, Post (abstract) machine, and Turing (abstract) machine models,
which are equivalent to each other.
ì In 1930 & 1931, Mr. Gödel gave his Completeness and Incompleteness
theorem. A few years later, Church and Turing independently proved that
the entscheidungsproblem is unsolvable.
CSC3113: Theory of Computation
ì In 1936, Turing introduced his abstract model for
TURING computation in his article “On Computable Numbers,
with an application to the Entscheidungsproblem”.
MACHINES
ì Turing machine model was used to prove the
unsolvable assuming that the intuitive notion of
"effectively calculable“ (computability) is captured by
the functions computable by a Turing machine.
ì Equivalently, Church also proved the same assumption
by those expressible in the lambda calculus.
ì This assumption is now known as the
Church–Turing thesis.
ì TM is similar to a finite automaton but with an
unlimited and unrestricted memory, a Turing machine
is a much more accurate model of a general purpose
computer. A Turing machine model can model
everything that a real computer can do.
ì Turing additionally proved many interesting theorems
ALAN M. TURING with his machine model which has become the
(1912–1954) standard model in theoretical computer science.

CSC3113: Theory of Computation


INFORMAL DESCRIPTION

TURING MACHINE (TM)

ì At every step, the head of the Turing Machine named M reads a letter
xi from the one-way infinite tape.
ì Depending on its current state and the letter xi being pointed by the
head of the TM –
ì reads/writes a letter from/on the tape,
ì moves its read/write head left or right, and
ì jumps to a new state.

CSC3113: Theory of Computation


INPUT CONVENTION

TURING MACHINE (TM)

ì Initially, the tape contains the input wÎS*, padded with blanks “_”,
and the TM is in start state q0.
ì During the computation –
ì the head moves left and right (but not beyond the leftmost point),
ì the internal state of the machine changes, and
ì the content of the tape is rewritten.

CSC3113: Theory of Computation


INPUT CONVENTION: SIMULATION
Instruction:
Read N,
Write A,
N,Move
Move right
right
left

FINITE STATE
q0 qq13 q2
CONTROL

Head

AI N N
P U T …
Infinite Tape

CSC3113: Theory of Computation


OUTPUT CONVENTION

TURING MACHINE (TM)


ì The computation completes/ends when the machines reaches one of
the two halting states –
ì Accept State
ì Reject State
ì There is also a possibility for the machine not to complete/end the
computation.
ì The computation can proceed indefinitely

CSC3113: Theory of Computation


THREE LEVELS OF ABSTRACTION
ì High-Level Description: An algorithm (already covered)
ì Implementation-Level Description:
ì Describe (in English) the instructions for a TM, example:
ìHow to move the head
ìWhat to write on the tape
ì A version of it is covered as pseudo code in programming language
courses, assembly language in “Computer Organization &
Architecture”. We will briefly cover here in terms of Turing machine.
ì Low-Level Description:
ì State diagram
ì Formal Specification
ì Next, we will look into an example for Implementation level
description by testing membership of a string for a given language.
CSC3113: Theory of Computation
TM DESIGN IDEA, B = { W#W | W Î {0,1}* }
ì The language here contains strings which has the following properties,
ì w is a binary string that contains only 0’s and/or 1’s.
ì Each string has a ‘#’ symbol in the middle
ì Both left and right side of the ‘#’ contains same string.
ì Example: 101#101 ⌴ X 1 X
0 X
1 # X
1 X
0 X
1 ⌴
ì Testing the language B in TM,
ì Put (blank ‘⌴’) marker on both (left & right) side of the input string
ì Scan, Store and Mark (‘X’) the 1st (0 or 1) symbol right to the left marker
of the string.
ìIf no (0 or 1) symbol found before ‘#’ then
ìIf no (0 or 1) symbol found after ‘#’ and before right marker then ACCEPT,
otherwise REJECT.
ì Move right to the ‘#’ symbol.
ì Scan and Mark (‘X’) the 1st (0 or 1) symbol right to the ‘#’ of the string
only of it matches with stored symbol in step 2.
ì Move right to the left marker, continue from step 2.

CSC3113: Theory of Computation


TESTING MEMBERSHIP IN B = { W#W | W Î {0,1}* }
Putting marker on both end of input ì The input always ends with a blank symbol ⌴
ì Input example: 011#011 ì The head initially points at the first input alphabet
ì Implementation level description: Common steps
ì Shift the input one space right, Put ⌴ at both left and right side of input in following steps
1. READ (store) 1st alphabet, WRITE ⌴, MOVE right
2. READ current alphabet, WRITE stored alphabet, store current alphabet, MOVE right
3. Continue step 2 until it WRITE ⌴, then MOVE to the ⌴ on the left, MOVE right to the
1st alphabet

MOVE
READREADright
0, WRITE
READ to
1,1WRITE
1, WRITE
READ
⌴, st alphabet
READ
#, MOVE
0,
MOVE WRITE
READ
0,MOVE
1, WRITE
READ
right1,1,MOVE
rightWRITE
READ
1,READ
WRITE
right
#, WRITE
right
0,
⌴,MOVE
MOVE ⌴, 1,WRITE
rightright
1, MOVE
MOVE ⌴,right
MOVEright
left to ⌴


0 01 1 1# #0 01 1 ⌴
1 ⌴
We will always consider that the given input already has a blank symbol ⌴ at both
left and right of input. So, we will ignore these steps for our computation.
CSC3113: Theory of Computation
TESTING MEMBERSHIP IN B = { W#W | W Î {0,1}* }
ì Example: 011#011 ì The input always starts and ends with a blank symbol ⌴
ì The head initially points at the first input alphabet
ì Computing steps
1. READ (store) 1st alphabet, WRITE X,
2. (find #) MOVE right until READ #, If ⌴ found REJECT
3. (skip X) MOVE right while READ X
4. if current alphabet = stored alphabet, WRITE X, MOVE left to ⌴, else REJECT
5. (skip X) MOVE right while READ X
6. READ (store) current alphabet, if alphabet is not #, then continue step 2
7. If alphabet is #, (skip X) MOVE right while READ X,
8. If current alphabet ⌴ then ACCEPT otherwise REJECT
READ 0, WRITE ´,
MOVE
READright
1READ
(store), WRITE
READ
MOVE
READ
1(store), 0´right
WRITE
READ #, 1´READ
(match), WRITE WRITE
(match),WRITE
1(match), ´ ´,
MOVE
MOVE while
MOVEright
right ´ ´ MOVE
until
while READ MOVEright while
while ´ ´ ACCEPTEDREAD ⌴
MOVE
while READ ´ right
MOVE
MOVE toUntil
#´right
while #READ
, MOVE MOVE
while ´left
´MOVE
left
toto
⌴⌴left to ⌴
#

0 ´
⌴ ´ 1 ´
1 # ´
0 ´
1 ´
1 ⌴
CSC3113: Theory of Computation
FORMAL DEFINITION: TURING MACHINE (TM)
ìA Turing machine M is defined by a 7-tuple
(Q, S, G, d, q0, qaccept, qreject)
ì Q finite set of states
ì S finite input alphabet (without blank symbol “⌴”)
ì G finite tape alphabet with {⌴} È S Í G
ì d the transition function
d: Q\{qaccept, qreject} ´ G ® Q ´ G ´ {L,R}
ì q0 start state Î Q
ì qaccept accept state Î Q
ì qreject reject state Î Q
ì qaccept ≠ qreject
CSC3113: Theory of Computation
ì Sipser-Introduction to the Theory of Computation 3E, Computability.
ì Lewis, Papadimitriou-Elements of Theory of Computation, 2ed,
Turing Machine.
ì Hopcroft, Motwani, Ullman-Introduction to Automata Theory,
Languages, and Computations, Turing Machine.

CSC3113: Theory of Computation

You might also like