SlideShare a Scribd company logo
1 of 26
THEORY OF AUTOMATAAND
FORMAL LANGUAGES
UNIT-V
ABHIMANYU MISHRA
ASSISTANT PROF.(CSE)
JETGI
Abhimanyu Mishra(CSE) JETGI12/31/2016
Turing Machine Introduction
A Turing Machine is an acquiescent device which admits the languages
(recursively enumerable set) generated by type 0 grammars. It was invented
in 1936 by Alan Turing
A Turing Machine (TM) is a mathematical model which consists of an infinite
length tape divided into cells on which input is given. It consists of a head
which reads the input tape. A state register stores the state of the Turing
machine. After reading an input symbol, it is replaced with another symbol,
its internal state is changed, and it moves from one cell to the right or left. If
the TM reaches the final state, the input string is accepted, otherwise
rejected
12/31/2016 Abhimanyu Mishra(CSE) JETGI
A TM can be formally described as a 7-tuple (Q, X, ∑, δ, q0, B, F) where −
(i) Q is a finite set of states
(ii) X is the tape alphabet
(iii) ∑ is the input alphabet
(iv) δ is a transition function; δ : Q × X → Q × X × {Left_shift, Right_shift}.
(v) q0 is the initial state
(vi) B is the blank symbol
(vii) F is the set of final states
12/31/2016 Abhimanyu Mishra(CSE) JETGI
Time and Space Complexity of a Turing Machine
For a Turing machine, the time complexity refers to the measure of the number
of times the tape moves when the machine is initialized for some input
symbols and the space complexity is the number of cells of the tape written.
Time complexity all reasonable functions −
T(n) = O(n log n)
TM's space complexity −
S(n) = O(n)
12/31/2016 Abhimanyu Mishra(CSE) JETGI
A TM accepts a language if it enters into a final state for any input string w. A
language is recursively enumerable (generated by Type-0 grammar) if it is
accepted by a Turing machine.
A TM decides a language if it accepts it and enters into a rejecting state for
any input not in the language. A language is recursive if it is decided by a
Turing machine.
There may be some cases where a TM does not stop. Such TM accepts the
language, but it does not decide it
12/31/2016 Abhimanyu Mishra(CSE) JETGI
Designing a Turing Machine
The basic guidelines of designing a Turing machine have been explained
below with the help of a couple of examples.
Design a TM to recognize all strings consisting of an odd number of α’s.
Solution
The Turing machine M can be constructed by the following moves −
Let q1 be the initial state.
If M is in q1; on scanning α, it enters the state q2 and writes B (blank).
If M is in q2; on scanning α, it enters the state q1 and writes B (blank).
From the above moves, we can see that M enters the state q1 if it scans an
even number of α’s, and it enters the state q2 if it scans an odd number of α’s.
Hence q2 is the only accepting state.
12/31/2016 Abhimanyu Mishra(CSE) JETGI
Hence,
M = {{q1, q2}, {1}, {1, B}, δ, q1, B, {q2}}
Tape alphabet symbol Present State ‘q1’ Present State ‘q2’
a BRq2 BRq1
12/31/2016 Abhimanyu Mishra(CSE) JETGI
Non-Deterministic Turing Machine
In a Non-Deterministic Turing Machine, for every state and symbol, there are a
group of actions the TM can have. So, here the transitions are not
deterministic. The computation of a non-deterministic Turing Machine is a tree
of configurations that can be reached from the start configuration.
An input is accepted if there is at least one node of the tree which is an accept
configuration, otherwise it is not accepted. If all branches of the computational
tree halt on all inputs, the non-deterministic Turing Machine is called
a Decider and if for some input, all branches are rejected, the input is also
rejected.
12/31/2016 Abhimanyu Mishra(CSE) JETGI
A non-deterministic Turing machine can be formally defined as a 6-tuple (Q,
X, ∑, δ, q0, B, F) where −
(i) Q is a finite set of states
(ii) X is the tape alphabet
(iii) ∑ is the input alphabet
(iv) δ is a transition function;
(v) δ : Q × X → P(Q × X × {Left_shift, Right_shift}).
(vi) q0 is the initial state
(vii) B is the blank symbol
(viii) F is the set of final states
12/31/2016 Abhimanyu Mishra(CSE) JETGI
A Turing Machine with a semi-infinite tape has a left end but no right end. The
left end is limited with an end marker.
En
12/31/2016 Abhimanyu Mishra(CSE) JETGI
HEAD
It is a two-track tape −
Upper track − It represents the cells to the right of the initial head position.
Lower track − It represents the cells to the left of the initial head position in
reverse order.
The infinite length input string is initially written on the tape in contiguous
tape cells.
The machine starts from the initial state q0 and the head scans from the left end
marker ‘End’. In each step, it reads the symbol on the tape under its head. It
writes a new symbol on that tape cell and then it moves the head either into left
or right one tape cell. A transition function determines the actions to be taken.
12/31/2016 Abhimanyu Mishra(CSE) JETGI
The infinite length input string is initially written on the tape in contiguous tape cells.
The machine starts from the initial state q0 and the head scans from the left end marker
‘End’. In each step, it reads the symbol on the tape under its head. It writes a new
symbol on that tape cell and then it moves the head either into left or right one tape cell.
A transition function determines the actions to be taken.
It has two special states called accept state and reject state. If at any point of time it
enters into the accepted state, the input is accepted and if it enters into the reject state,
the input is rejected by the TM. In some cases, it continues to run infinitely without
being accepted or rejected for some certain input symbols.
12/31/2016 Abhimanyu Mishra(CSE) JETGI
A linear bounded automaton is a multi-track non-deterministic Turing machine
with a tape of some bounded finite length.
Length = function (Length of the initial input string, constant c)
Here,
Memory information ≤ c × Input information
The computation is restricted to the constant bounded area. The input alphabet
contains two special symbols which serve as left end markers and right end
markers which mean the transitions neither move to the left of the left end
marker nor to the right of the right end marker of the tape.
12/31/2016 Abhimanyu Mishra(CSE) JETGI
A linear bounded automaton can be defined as an 8-tuple (Q, X, ∑, q0, ML,
MR, δ, F) where −
(i) Q is a finite set of states
(ii) X is the tape alphabet
(iii) ∑ is the input alphabet
(iv) q0 is the initial state
(v) ML is the left end marker
(vi) MR is the right end marker where MR≠ ML
(vii) δ is a transition function which maps each pair (state, tape symbol) to
(state, tape symbol, Constant ‘c’) where c can be 0 or +1 or -1
(viii) F is the set of final states
12/31/2016 Abhimanyu Mishra(CSE) JETGI
RECURSIVELY ENUMERABLE AND RECURSIVE
LANGUAGES
When a Turing machine executes an input, there are four possible outcomes of
execution. Then TM
(i) Halts and accepts the input
(ii) Halts and rejects the input
(iii) Never halts(fall into loop)
(iv) Crash
12/31/2016 Abhimanyu Mishra(CSE) JETGI
Theorem: If a language L is recursive, then it is recursively
enumerable languages
• Proof: A language is recursively enumerable if there exists a Turing
machine that accepts every string of the language and a language is
recursive if there is a TM that accepts every string of the language and does
accept strings that are not in the language.
• So, every recursive language is also recursively enumerable. Hence,
statement of the theorem is true.
12/31/2016 Abhimanyu Mishra(CSE) JETGI
Turing Machine as Enumerators
A TURING MACHINE(TM) is said to be generating or enumerating if we are
able to produce each word of any language L separated by blank symbol. The
order of the strings is not important and any string may be repeated indefinitely
12/31/2016 Abhimanyu Mishra(CSE) JETGI
Theorem: If any language L is generated by TURING MACHINE,
then L is accepted by some other Turing machine
Proof:
Let Tm1 be a Turing machine which generates L. Now let us construct another
Turing machine Tm2 which accepts L and Tm2 is having two tapes. The Tm2
saves any input on the extra tape before beginning its generation process. The
Tm2 simulates Tm1,except that every time# is written on output tape the
simulation on Tm1 pauses while Tm2 compare its input string with the string
listed just before #.
L(Tm2) = L(Tm1)
12/31/2016 Abhimanyu Mishra(CSE) JETGI
12/31/2016 Abhimanyu Mishra(CSE) JETGI
Recursively Enumerable Languages
Recursive
Languages
NON RECURSIVELY ENUMERABLE LANGUAGES
CHURCH’ S Thesis
“Church’s thesis can not be a theorem in mathematics because ideas such as
“can ever be defined by humans” and “algorithm that people can taught to
perform” are not part of any known mathematics. There are no axioms that
deal with “PEOPLE””
12/31/2016 Abhimanyu Mishra(CSE) JETGI
UNIVERSAL TURING MACHINES
Universal Turing machines “U” takes arguments, a description of a machine
Tm, “Tm” and a description of an input string w,”w’. We want U to have the
following property : U halts on input “Tm” “w” if and only if Tm halts on
input w.
U(“m” “w”) = “m(w)”
If is the functional notation of universal Turing machine
12/31/2016 Abhimanyu Mishra(CSE) JETGI
Example: Consider the Turing machine m = (Q,∑, δ,S) where
Q = { S, q,h}
∑={ #,b,a}, and δ is given in following table
States Symbol δ
S a (q,#)
S # (h,#)
S b (S,R)
q a (S,a)
q # (S,R)
q b (q,R)
12/31/2016 Abhimanyu Mishra(CSE) JETGI
Solution:
Since there are three states, three symbols in ∑, we have k=2 and l=3. these are
the smallest integers, the states and symbols are represented as follows:
12/31/2016 Abhimanyu Mishra(CSE) JETGI
State/Symbol Representation
S q00
q q01
h q11
# a000
b a001
L a010
R a011
a a100
Thus representation of baa#a is
“baa#a” = a001a100a100a000a100
The representing “ Tm” of the Turing machine Tm is the following strings:
“Tm” =
(q00,a100,q01,a000),(q000,q11,a000),(q00,a001,q00,a011)(q01,a100,q00,q00,
a011),(q01,a000,a000,q00,q00,a011),(q01,a001,q01,011)
Graphical representation
Tm Input W
Universal Turing Machine
12/31/2016 Abhimanyu Mishra(CSE) JETGI
THE HALTING PROBLEM
“ To determine for an arbitrary given Turing machine Tm and input w,
Whether Tm will eventually halt on input w”.
UNDECIDABILITY/DECIDABILITY
“ A problem whose language is recursive is said to be decidable” Otherwise
problem is undecidable. That is, a problem is undecidable if there exist no
algorithm that takes as input an instance of the problem and determine whether
the answer to that instance is “YES” or “NO”.
12/31/2016 Abhimanyu Mishra(CSE) JETGI
THANKS
12/31/2016 Abhimanyu Mishra(CSE) JETGI

More Related Content

What's hot (20)

Lec 01 basic concepts
Lec 01 basic conceptsLec 01 basic concepts
Lec 01 basic concepts
 
Turing machine
Turing machineTuring machine
Turing machine
 
AUTOMATA THEORY - SHORT NOTES
AUTOMATA THEORY - SHORT NOTESAUTOMATA THEORY - SHORT NOTES
AUTOMATA THEORY - SHORT NOTES
 
Lecture: Automata
Lecture: AutomataLecture: Automata
Lecture: Automata
 
Greedy Algorithm - Huffman coding
Greedy Algorithm - Huffman codingGreedy Algorithm - Huffman coding
Greedy Algorithm - Huffman coding
 
Multi Head, Multi Tape Turing Machine
Multi Head, Multi Tape Turing MachineMulti Head, Multi Tape Turing Machine
Multi Head, Multi Tape Turing Machine
 
push down automata
push down automatapush down automata
push down automata
 
Turing machine
Turing machineTuring machine
Turing machine
 
Turing machines
Turing machinesTuring machines
Turing machines
 
Ch2 finite automaton
Ch2 finite automatonCh2 finite automaton
Ch2 finite automaton
 
Context free grammar
Context free grammar Context free grammar
Context free grammar
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Logic
LogicLogic
Logic
 
Operating System: Deadlock
Operating System: DeadlockOperating System: Deadlock
Operating System: Deadlock
 
Pumping lemma
Pumping lemmaPumping lemma
Pumping lemma
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
pushdown automata
pushdown automatapushdown automata
pushdown automata
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Working principle of Turing machine
Working principle of Turing machineWorking principle of Turing machine
Working principle of Turing machine
 

Viewers also liked

Os5 2
Os5 2Os5 2
Os5 2issbp
 
Ch11 input output systems
Ch11 input output systemsCh11 input output systems
Ch11 input output systemsissbp
 
Os4 2
Os4 2Os4 2
Os4 2issbp
 
Os6 2
Os6 2Os6 2
Os6 2issbp
 
Class5
 Class5 Class5
Class5issbp
 
Lecture 7: Definite Clause Grammars
Lecture 7: Definite Clause GrammarsLecture 7: Definite Clause Grammars
Lecture 7: Definite Clause GrammarsCS, NcState
 
Class9
 Class9 Class9
Class9issbp
 
Os2 2
Os2 2Os2 2
Os2 2issbp
 
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...Animesh Chaturvedi
 
Pattern detection in mealy machine
Pattern detection in mealy machinePattern detection in mealy machine
Pattern detection in mealy machineAnimesh Chaturvedi
 
Os10 2
Os10 2Os10 2
Os10 2issbp
 
Class6
 Class6 Class6
Class6issbp
 
Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1Abhimanyu Mishra
 

Viewers also liked (20)

Os5 2
Os5 2Os5 2
Os5 2
 
Ch11 input output systems
Ch11 input output systemsCh11 input output systems
Ch11 input output systems
 
Os6
Os6Os6
Os6
 
Os4
Os4Os4
Os4
 
Os4 2
Os4 2Os4 2
Os4 2
 
Os6 2
Os6 2Os6 2
Os6 2
 
Class5
 Class5 Class5
Class5
 
Lecture 7: Definite Clause Grammars
Lecture 7: Definite Clause GrammarsLecture 7: Definite Clause Grammars
Lecture 7: Definite Clause Grammars
 
Os2
Os2Os2
Os2
 
Class9
 Class9 Class9
Class9
 
Os2 2
Os2 2Os2 2
Os2 2
 
Design1
Design1Design1
Design1
 
Os5
Os5Os5
Os5
 
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...
Automated Web Service Change Management (AWSCM) A tool published at IEEE Clou...
 
Pattern detection in mealy machine
Pattern detection in mealy machinePattern detection in mealy machine
Pattern detection in mealy machine
 
Os10 2
Os10 2Os10 2
Os10 2
 
Cspc final
Cspc finalCspc final
Cspc final
 
Class6
 Class6 Class6
Class6
 
Os3
Os3Os3
Os3
 
Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1Theory of Automata and formal languages unit 1
Theory of Automata and formal languages unit 1
 

Similar to Theory of Automata and formal languages Unit 5

Similar to Theory of Automata and formal languages Unit 5 (20)

Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207
 
Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207
 
Turing machine by_deep
Turing machine by_deepTuring machine by_deep
Turing machine by_deep
 
Winter 8 TM.pptx
Winter 8 TM.pptxWinter 8 TM.pptx
Winter 8 TM.pptx
 
TuringMachines.pdf
TuringMachines.pdfTuringMachines.pdf
TuringMachines.pdf
 
4.1 turing machines
4.1 turing machines4.1 turing machines
4.1 turing machines
 
Turing machine and Halting Introduction
Turing machine and Halting IntroductionTuring machine and Halting Introduction
Turing machine and Halting Introduction
 
Turing machine
Turing machineTuring machine
Turing machine
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
1LECTURE 9TuringMachines.ppt
1LECTURE 9TuringMachines.ppt1LECTURE 9TuringMachines.ppt
1LECTURE 9TuringMachines.ppt
 
Automata Theory - Turing machine
Automata Theory - Turing machineAutomata Theory - Turing machine
Automata Theory - Turing machine
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
TOA.docx
TOA.docxTOA.docx
TOA.docx
 
TOA.docx
TOA.docxTOA.docx
TOA.docx
 
Turing machine - theory of computation
Turing machine - theory of computationTuring machine - theory of computation
Turing machine - theory of computation
 
souraj Toc.pptx
souraj Toc.pptxsouraj Toc.pptx
souraj Toc.pptx
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
 
lect_23.pdf
lect_23.pdflect_23.pdf
lect_23.pdf
 
Turing machine
Turing machineTuring machine
Turing machine
 

More from Abhimanyu Mishra

More from Abhimanyu Mishra (20)

Cd unit i
Cd unit iCd unit i
Cd unit i
 
Presentation1(JIT gnomio)
Presentation1(JIT gnomio)Presentation1(JIT gnomio)
Presentation1(JIT gnomio)
 
Sta unit 5(abimanyu)
Sta unit 5(abimanyu)Sta unit 5(abimanyu)
Sta unit 5(abimanyu)
 
Sta unit 3(abimanyu)
Sta unit 3(abimanyu)Sta unit 3(abimanyu)
Sta unit 3(abimanyu)
 
Sta unit 4(abimanyu)
Sta unit 4(abimanyu)Sta unit 4(abimanyu)
Sta unit 4(abimanyu)
 
Sta unit 3(abimanyu)
Sta unit 3(abimanyu)Sta unit 3(abimanyu)
Sta unit 3(abimanyu)
 
Sta unit 2(abimanyu)
Sta unit 2(abimanyu)Sta unit 2(abimanyu)
Sta unit 2(abimanyu)
 
Unit1
Unit1Unit1
Unit1
 
Daa unit 5
Daa unit 5Daa unit 5
Daa unit 5
 
Daa unit 4
Daa unit 4Daa unit 4
Daa unit 4
 
Daa unit 3
Daa unit 3Daa unit 3
Daa unit 3
 
Daa unit 2
Daa unit 2Daa unit 2
Daa unit 2
 
Software Engineering unit 5
Software Engineering unit 5Software Engineering unit 5
Software Engineering unit 5
 
Software Engineering unit 4
Software Engineering unit 4Software Engineering unit 4
Software Engineering unit 4
 
Software Engineering unit 3
Software Engineering unit 3Software Engineering unit 3
Software Engineering unit 3
 
Software Engineering unit 2
Software Engineering unit 2Software Engineering unit 2
Software Engineering unit 2
 
Software Engineering Unit 1
Software Engineering Unit 1Software Engineering Unit 1
Software Engineering Unit 1
 
Theory of automata and formal languages Unit 4
Theory of automata and formal languages Unit 4Theory of automata and formal languages Unit 4
Theory of automata and formal languages Unit 4
 
Theory of Automata and formal languages Unit 3
Theory of Automata and formal languages Unit 3Theory of Automata and formal languages Unit 3
Theory of Automata and formal languages Unit 3
 
Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2Theory of Automata and formal languages unit 2
Theory of Automata and formal languages unit 2
 

Recently uploaded

Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 

Recently uploaded (20)

Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 

Theory of Automata and formal languages Unit 5

  • 1. THEORY OF AUTOMATAAND FORMAL LANGUAGES UNIT-V ABHIMANYU MISHRA ASSISTANT PROF.(CSE) JETGI Abhimanyu Mishra(CSE) JETGI12/31/2016
  • 2. Turing Machine Introduction A Turing Machine is an acquiescent device which admits the languages (recursively enumerable set) generated by type 0 grammars. It was invented in 1936 by Alan Turing A Turing Machine (TM) is a mathematical model which consists of an infinite length tape divided into cells on which input is given. It consists of a head which reads the input tape. A state register stores the state of the Turing machine. After reading an input symbol, it is replaced with another symbol, its internal state is changed, and it moves from one cell to the right or left. If the TM reaches the final state, the input string is accepted, otherwise rejected 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 3. A TM can be formally described as a 7-tuple (Q, X, ∑, δ, q0, B, F) where − (i) Q is a finite set of states (ii) X is the tape alphabet (iii) ∑ is the input alphabet (iv) δ is a transition function; δ : Q × X → Q × X × {Left_shift, Right_shift}. (v) q0 is the initial state (vi) B is the blank symbol (vii) F is the set of final states 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 4. Time and Space Complexity of a Turing Machine For a Turing machine, the time complexity refers to the measure of the number of times the tape moves when the machine is initialized for some input symbols and the space complexity is the number of cells of the tape written. Time complexity all reasonable functions − T(n) = O(n log n) TM's space complexity − S(n) = O(n) 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 5. A TM accepts a language if it enters into a final state for any input string w. A language is recursively enumerable (generated by Type-0 grammar) if it is accepted by a Turing machine. A TM decides a language if it accepts it and enters into a rejecting state for any input not in the language. A language is recursive if it is decided by a Turing machine. There may be some cases where a TM does not stop. Such TM accepts the language, but it does not decide it 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 6. Designing a Turing Machine The basic guidelines of designing a Turing machine have been explained below with the help of a couple of examples. Design a TM to recognize all strings consisting of an odd number of α’s. Solution The Turing machine M can be constructed by the following moves − Let q1 be the initial state. If M is in q1; on scanning α, it enters the state q2 and writes B (blank). If M is in q2; on scanning α, it enters the state q1 and writes B (blank). From the above moves, we can see that M enters the state q1 if it scans an even number of α’s, and it enters the state q2 if it scans an odd number of α’s. Hence q2 is the only accepting state. 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 7. Hence, M = {{q1, q2}, {1}, {1, B}, δ, q1, B, {q2}} Tape alphabet symbol Present State ‘q1’ Present State ‘q2’ a BRq2 BRq1 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 8. Non-Deterministic Turing Machine In a Non-Deterministic Turing Machine, for every state and symbol, there are a group of actions the TM can have. So, here the transitions are not deterministic. The computation of a non-deterministic Turing Machine is a tree of configurations that can be reached from the start configuration. An input is accepted if there is at least one node of the tree which is an accept configuration, otherwise it is not accepted. If all branches of the computational tree halt on all inputs, the non-deterministic Turing Machine is called a Decider and if for some input, all branches are rejected, the input is also rejected. 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 9. A non-deterministic Turing machine can be formally defined as a 6-tuple (Q, X, ∑, δ, q0, B, F) where − (i) Q is a finite set of states (ii) X is the tape alphabet (iii) ∑ is the input alphabet (iv) δ is a transition function; (v) δ : Q × X → P(Q × X × {Left_shift, Right_shift}). (vi) q0 is the initial state (vii) B is the blank symbol (viii) F is the set of final states 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 10. A Turing Machine with a semi-infinite tape has a left end but no right end. The left end is limited with an end marker. En 12/31/2016 Abhimanyu Mishra(CSE) JETGI HEAD
  • 11. It is a two-track tape − Upper track − It represents the cells to the right of the initial head position. Lower track − It represents the cells to the left of the initial head position in reverse order. The infinite length input string is initially written on the tape in contiguous tape cells. The machine starts from the initial state q0 and the head scans from the left end marker ‘End’. In each step, it reads the symbol on the tape under its head. It writes a new symbol on that tape cell and then it moves the head either into left or right one tape cell. A transition function determines the actions to be taken. 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 12. The infinite length input string is initially written on the tape in contiguous tape cells. The machine starts from the initial state q0 and the head scans from the left end marker ‘End’. In each step, it reads the symbol on the tape under its head. It writes a new symbol on that tape cell and then it moves the head either into left or right one tape cell. A transition function determines the actions to be taken. It has two special states called accept state and reject state. If at any point of time it enters into the accepted state, the input is accepted and if it enters into the reject state, the input is rejected by the TM. In some cases, it continues to run infinitely without being accepted or rejected for some certain input symbols. 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 13. A linear bounded automaton is a multi-track non-deterministic Turing machine with a tape of some bounded finite length. Length = function (Length of the initial input string, constant c) Here, Memory information ≤ c × Input information The computation is restricted to the constant bounded area. The input alphabet contains two special symbols which serve as left end markers and right end markers which mean the transitions neither move to the left of the left end marker nor to the right of the right end marker of the tape. 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 14. A linear bounded automaton can be defined as an 8-tuple (Q, X, ∑, q0, ML, MR, δ, F) where − (i) Q is a finite set of states (ii) X is the tape alphabet (iii) ∑ is the input alphabet (iv) q0 is the initial state (v) ML is the left end marker (vi) MR is the right end marker where MR≠ ML (vii) δ is a transition function which maps each pair (state, tape symbol) to (state, tape symbol, Constant ‘c’) where c can be 0 or +1 or -1 (viii) F is the set of final states 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 15. RECURSIVELY ENUMERABLE AND RECURSIVE LANGUAGES When a Turing machine executes an input, there are four possible outcomes of execution. Then TM (i) Halts and accepts the input (ii) Halts and rejects the input (iii) Never halts(fall into loop) (iv) Crash 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 16. Theorem: If a language L is recursive, then it is recursively enumerable languages • Proof: A language is recursively enumerable if there exists a Turing machine that accepts every string of the language and a language is recursive if there is a TM that accepts every string of the language and does accept strings that are not in the language. • So, every recursive language is also recursively enumerable. Hence, statement of the theorem is true. 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 17. Turing Machine as Enumerators A TURING MACHINE(TM) is said to be generating or enumerating if we are able to produce each word of any language L separated by blank symbol. The order of the strings is not important and any string may be repeated indefinitely 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 18. Theorem: If any language L is generated by TURING MACHINE, then L is accepted by some other Turing machine Proof: Let Tm1 be a Turing machine which generates L. Now let us construct another Turing machine Tm2 which accepts L and Tm2 is having two tapes. The Tm2 saves any input on the extra tape before beginning its generation process. The Tm2 simulates Tm1,except that every time# is written on output tape the simulation on Tm1 pauses while Tm2 compare its input string with the string listed just before #. L(Tm2) = L(Tm1) 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 19. 12/31/2016 Abhimanyu Mishra(CSE) JETGI Recursively Enumerable Languages Recursive Languages
  • 20. NON RECURSIVELY ENUMERABLE LANGUAGES CHURCH’ S Thesis “Church’s thesis can not be a theorem in mathematics because ideas such as “can ever be defined by humans” and “algorithm that people can taught to perform” are not part of any known mathematics. There are no axioms that deal with “PEOPLE”” 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 21. UNIVERSAL TURING MACHINES Universal Turing machines “U” takes arguments, a description of a machine Tm, “Tm” and a description of an input string w,”w’. We want U to have the following property : U halts on input “Tm” “w” if and only if Tm halts on input w. U(“m” “w”) = “m(w)” If is the functional notation of universal Turing machine 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 22. Example: Consider the Turing machine m = (Q,∑, δ,S) where Q = { S, q,h} ∑={ #,b,a}, and δ is given in following table States Symbol δ S a (q,#) S # (h,#) S b (S,R) q a (S,a) q # (S,R) q b (q,R) 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 23. Solution: Since there are three states, three symbols in ∑, we have k=2 and l=3. these are the smallest integers, the states and symbols are represented as follows: 12/31/2016 Abhimanyu Mishra(CSE) JETGI State/Symbol Representation S q00 q q01 h q11 # a000 b a001 L a010 R a011 a a100
  • 24. Thus representation of baa#a is “baa#a” = a001a100a100a000a100 The representing “ Tm” of the Turing machine Tm is the following strings: “Tm” = (q00,a100,q01,a000),(q000,q11,a000),(q00,a001,q00,a011)(q01,a100,q00,q00, a011),(q01,a000,a000,q00,q00,a011),(q01,a001,q01,011) Graphical representation Tm Input W Universal Turing Machine 12/31/2016 Abhimanyu Mishra(CSE) JETGI
  • 25. THE HALTING PROBLEM “ To determine for an arbitrary given Turing machine Tm and input w, Whether Tm will eventually halt on input w”. UNDECIDABILITY/DECIDABILITY “ A problem whose language is recursive is said to be decidable” Otherwise problem is undecidable. That is, a problem is undecidable if there exist no algorithm that takes as input an instance of the problem and determine whether the answer to that instance is “YES” or “NO”. 12/31/2016 Abhimanyu Mishra(CSE) JETGI