SlideShare a Scribd company logo
1 of 7
A TuringMachine is an acceptingdevice whichacceptsthe languages(recursivelyenumerable set)
generatedbytype 0 grammars.It was inventedin1936 by AlanTuring.
Definition
A TuringMachine (TM) is a mathematical model whichconsistsof aninfinite lengthtape dividedinto
cellsonwhichinputisgiven.Itconsistsof a headwhichreadsthe inputtape.A state registerstores
the state of the Turing machine.Afterreadinganinputsymbol,itisreplacedwithanothersymbol,
itsinternal state ischanged,andit movesfromone cell tothe right or left.If the TM reachesthe
final state,the inputstringisaccepted,otherwise rejected.
A TM can be formallydescribedasa7-tuple (Q,X,∑, δ, q0, B, F) where −
Q is a finite setof states
X isthe tape alphabet
∑ is the inputalphabet
δ isa transitionfunction;δ:Q × X → Q × X × {Left_shift,Right_shift}.
q0 is the initial state
B is the blanksymbol
F isthe setof final states
Comparisonwiththe previousautomaton
The followingtable shows acomparisonof how a Turingmachine differsfromFiniteAutomatonand
PushdownAutomaton.
Machine Stack Data Structure Deterministic?
Finite Automaton N.A Yes
PushdownAutomaton Last In FirstOut(LIFO) No
TuringMachine Infinite tape Yes
Example of Turingmachine
Turingmachine M = (Q,X, ∑, δ, q0, B, F) with
Q = {q0, q1, q2, qf}
X = {a,b}
∑ = {1}
q0 = {q0}
B = blanksymbol
F = {qf }
δ isgivenby−
Tape alphabetsymbol PresentState ‘q0’ PresentState ‘q1’ PresentState ‘q2’
a 1Rq1 1Lq0 1Lqf
b 1Lq2 1Rq1 1Rqf
Here the transition1Rq1 impliesthatthe write symbol is1,the tape movesright,and the nextstate
isq1. Similarly,the transition1Lq2 impliesthatthe write symbol is1,the tape movesleft,andthe
nextstate isq2.
Time and Space Complexityof aTuringMachine
For a Turing machine,the time complexityreferstothe measure of the numberof timesthe tape
moveswhenthe machine isinitializedforsome inputsymbolsandthe space complexityisthe
numberof cellsof the tape written.
Time complexityall reasonable functions−
T(n) = O(nlogn)
TM's space complexity−
S(n) = O(n)
AutomataTutorial
AutomataTutorialTheoryof AutomataFinite AutomataTransitionDiagramTransition
TableDFAExamplesof DFANFAExamplesof NFAEliminatingε TransitionsConversionfromNFA to
DFAConversionfromNFA withεto DFAMinimizationof DFA
RegularExpression
RegularExpressionExamplesof RegularExpressionConversionof REto FAArden'sTheoremMoore
MachineMealyMachineConversionfromMealymachine toMoore machineConversionfromMoore
machine toMealy machine
CFG
Context-free GrammarDerivationDerivationTreeAmbiguityinGrammarUnambiguous
GrammarSimplificationof CFGChomsky'sNormal Form(CNF)GreibachNormal Form(GNF)
PDA
PushdownAutomataPDA AcceptanceNon-deterministicPushdownAutomataCFGtoPDA Conversion
TuringMachine
AutomataTuringMachine openlinkBasicModel of TuringmachineLanguage acceptedbyTuring
machineExample of TMIntroductiontoUndecidabilityUndecidable ProblemaboutTMPost
Correspondence ProblemChomskyHierarchyJavaTpoint
Next→← Prev
TuringMachine
Turingmachine wasinventedin1936 byAlanTuring.It is an acceptingdevice whichaccepts
Recursive Enumerable Language generatedbytype 0grammar.
There are variousfeaturesof the Turingmachine:
It has an external memorywhichremembersarbitrarylongsequence of input.
It has unlimitedmemorycapability.
The model hasa facilitybywhichthe inputatleftor righton the tape can be readeasily.
The machine can produce a certainoutputbasedon itsinput.Sometimesitmaybe requiredthatthe
same inputhas to be usedto generate the output.Sointhismachine,the distinctionbetweeninput
and outputhas beenremoved.Thusacommon setof alphabetscanbe usedforthe Turing machine.
Formal definitionof Turingmachine
A Turingmachine can be definedasacollectionof 7 components:
Q: the finite setof states
∑: the finite setof inputsymbols
T: the tape symbol
q0: the initial state
F: a set of final states
B: a blanksymbol usedasa endmarkerfor input
δ: a transitionormappingfunction.
The mappingfunctionshowsthe mappingfromstatesof finite automataandinputsymbol onthe
tape to the nextstates,external symbolsandthe directionformovingthe tape head.Thisisknown
as a triple or a program forturingmachine.
(q0, a) → (q1, A,R)
That meansinq0 state,if we readsymbol 'a' thenit will goto state q1, replaceda byX and move
aheadright(Rstandsfor right).
Example:
ConstructTM for the language L ={0n1n} where n>=1.
Solution:
We have alreadysolvedthisproblembyPDA.InPDA,we have a stack to rememberthe previous
symbol.The mainadvantage of the Turingmachine iswe have a tape headwhichcan be moved
forwardor backward,and the inputtape can be scanned.
The simple logicwhichwe will applyisreadouteach '0' mark itby A and thenmove aheadalong
withthe inputtape and findout1 convertitto B. Now,repeatthisprocessforall a's andb's.
Nowwe will see howthisturingmachine workfor0011.
The simulationfor0011 can be shownas below:
or 0011 can be shownas below:
TuringMachine
Now,we will see howthisturingmachine will worksfor0011. Initially,state isq0and headpointsto
0 as:
TuringMachine
The move will be δ(q0,0) = δ(q1,A,R) whichmeansitwill goto state q1, replaced0 by A andhead
will move tothe rightas:
TuringMachine
The move will be δ(q1,0) = δ(q1,0, R) whichmeansitwill notchange any symbol,remaininthe
same state and move to the rightas:
TuringMachine
The move will be δ(q1,1) = δ(q2,B, L) whichmeansitwill goto state q2, replaced1 by B and head
will move toleftas:
TuringMachine
Nowmove will be δ(q2,0) = δ(q2,0, L) whichmeansitwill notchange anysymbol,remaininthe
same state and move to leftas:
TuringMachine
The move will be δ(q2,A) = δ(q0,A,R), itmeanswill goto state q0, replacedA by A andheadwill
move to the rightas:
TuringMachine
The move will be δ(q0,0) = δ(q1,A,R) whichmeansitwill goto state q1, replaced0 by A,and head
will move torightas:
TuringMachine
The move will be δ(q1,B) = δ(q1,B, R) whichmeansitwill notchange any symbol,remaininthe
same state and move to rightas:
TuringMachine
The move will be δ(q1,1) = δ(q2,B, L) whichmeansitwill goto state q2, replaced1 by B and head
will move toleftas:
TuringMachine
The move δ(q2,B) = (q2,B, L) whichmeansit will notchange anysymbol,remaininthe same state
and move toleftas:
TuringMachine
Nowimmediatelybefore BisA that meansall the 0?s are marketby A. Sowe will move rightto
ensure thatno 1 ispresent.The move will be δ(q2,A) =(q0, A,R) whichmeansitwill goto state q0,
will notchange anysymbol,andmove to rightas:
TuringMachine
The move δ(q0,B) = (q3,B, R) whichmeansitwill goto state q3, will notchange any symbol,and
move to rightas:
TuringMachine
The move δ(q3,B) = (q3,B, R) whichmeansitwill notchange any symbol,remaininthe same state
and move toright as:
TuringMachine
The move δ(q3,Δ) = (q4, Δ, R) whichmeansitwill goto state q4 whichis the HALT state and HALT
state is alwaysanaccept state for any TM.
TuringMachine
The same TM can be representedbyTransitionDiagram:

More Related Content

Similar to TOA.docx

souraj Toc.pptx
souraj Toc.pptxsouraj Toc.pptx
souraj Toc.pptxLifo4
 
Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207Editor IJARCET
 
Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207Editor IJARCET
 
Automata based programming
Automata based programmingAutomata based programming
Automata based programmingVisnuDharsini
 
03-FiniteAutomata.pptx
03-FiniteAutomata.pptx03-FiniteAutomata.pptx
03-FiniteAutomata.pptxssuser47f7f2
 
Turing machine - theory of computation
Turing machine - theory of computationTuring machine - theory of computation
Turing machine - theory of computationRubaya Mim
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdfFariyaTasneem1
 
Winter 8 TM.pptx
Winter 8 TM.pptxWinter 8 TM.pptx
Winter 8 TM.pptxHarisPrince
 
Turing Machine
Turing MachineTuring Machine
Turing MachineAyAn KhAn
 
Moore and mealy machines
Moore and mealy machinesMoore and mealy machines
Moore and mealy machinesAYESHA JAVED
 
Automata theory introduction
Automata theory introductionAutomata theory introduction
Automata theory introductionNAMRATA BORKAR
 
Theory of Automata and formal languages Unit 5
Theory of Automata and formal languages Unit 5Theory of Automata and formal languages Unit 5
Theory of Automata and formal languages Unit 5Abhimanyu Mishra
 
Theory of automata
Theory of automataTheory of automata
Theory of automataArslan905905
 
Turing machine implementation
Turing machine implementationTuring machine implementation
Turing machine implementationSinaRostami7
 

Similar to TOA.docx (20)

souraj Toc.pptx
souraj Toc.pptxsouraj Toc.pptx
souraj Toc.pptx
 
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
 
Automata based programming
Automata based programmingAutomata based programming
Automata based programming
 
03-FiniteAutomata.pptx
03-FiniteAutomata.pptx03-FiniteAutomata.pptx
03-FiniteAutomata.pptx
 
Turing machine
Turing machineTuring machine
Turing machine
 
Turing machine
Turing machineTuring machine
Turing machine
 
Turing machine - theory of computation
Turing machine - theory of computationTuring machine - theory of computation
Turing machine - theory of computation
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
 
Ch2 finite automaton
Ch2 finite automatonCh2 finite automaton
Ch2 finite automaton
 
Turing machine
Turing machineTuring machine
Turing machine
 
Winter 8 TM.pptx
Winter 8 TM.pptxWinter 8 TM.pptx
Winter 8 TM.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
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Moore and mealy machines
Moore and mealy machinesMoore and mealy machines
Moore and mealy machines
 
Automata theory introduction
Automata theory introductionAutomata theory introduction
Automata theory introduction
 
Theory of Automata and formal languages Unit 5
Theory of Automata and formal languages Unit 5Theory of Automata and formal languages Unit 5
Theory of Automata and formal languages Unit 5
 
Theory of automata
Theory of automataTheory of automata
Theory of automata
 
Turing machine implementation
Turing machine implementationTuring machine implementation
Turing machine implementation
 

Recently uploaded

Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPirithiRaju
 
Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentationtahreemzahra82
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPirithiRaju
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxEran Akiva Sinbar
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...lizamodels9
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologycaarthichand2003
 
Pests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPirithiRaju
 
Transposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptTransposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptArshadWarsi13
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real timeSatoshi NAKAHIRA
 
Solution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsSolution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsHajira Mahmood
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxSwapnil Therkar
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.aasikanpl
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRlizamodels9
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxpriyankatabhane
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationColumbia Weather Systems
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPirithiRaju
 
Microteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringMicroteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringPrajakta Shinde
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)riyaescorts54
 

Recently uploaded (20)

Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
 
Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentation
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
 
The dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptxThe dark energy paradox leads to a new structure of spacetime.pptx
The dark energy paradox leads to a new structure of spacetime.pptx
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technology
 
Pests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdfPests of castor_Binomics_Identification_Dr.UPR.pdf
Pests of castor_Binomics_Identification_Dr.UPR.pdf
 
Transposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.pptTransposable elements in prokaryotes.ppt
Transposable elements in prokaryotes.ppt
 
Grafana in space: Monitoring Japan's SLIM moon lander in real time
Grafana in space: Monitoring Japan's SLIM moon lander  in real timeGrafana in space: Monitoring Japan's SLIM moon lander  in real time
Grafana in space: Monitoring Japan's SLIM moon lander in real time
 
Solution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutionsSolution chemistry, Moral and Normal solutions
Solution chemistry, Moral and Normal solutions
 
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptxAnalytical Profile of Coleus Forskohlii | Forskolin .pptx
Analytical Profile of Coleus Forskohlii | Forskolin .pptx
 
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
Call Girls in Munirka Delhi 💯Call Us 🔝9953322196🔝 💯Escort.
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
 
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptxMicrophone- characteristics,carbon microphone, dynamic microphone.pptx
Microphone- characteristics,carbon microphone, dynamic microphone.pptx
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather Station
 
Volatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -IVolatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -I
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdf
 
Hot Sexy call girls in Moti Nagar,🔝 9953056974 🔝 escort Service
Hot Sexy call girls in  Moti Nagar,🔝 9953056974 🔝 escort ServiceHot Sexy call girls in  Moti Nagar,🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Moti Nagar,🔝 9953056974 🔝 escort Service
 
Microteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical EngineeringMicroteaching on terms used in filtration .Pharmaceutical Engineering
Microteaching on terms used in filtration .Pharmaceutical Engineering
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
 

TOA.docx

  • 1. A TuringMachine is an acceptingdevice whichacceptsthe languages(recursivelyenumerable set) generatedbytype 0 grammars.It was inventedin1936 by AlanTuring. Definition A TuringMachine (TM) is a mathematical model whichconsistsof aninfinite lengthtape dividedinto cellsonwhichinputisgiven.Itconsistsof a headwhichreadsthe inputtape.A state registerstores the state of the Turing machine.Afterreadinganinputsymbol,itisreplacedwithanothersymbol, itsinternal state ischanged,andit movesfromone cell tothe right or left.If the TM reachesthe final state,the inputstringisaccepted,otherwise rejected. A TM can be formallydescribedasa7-tuple (Q,X,∑, δ, q0, B, F) where − Q is a finite setof states X isthe tape alphabet ∑ is the inputalphabet δ isa transitionfunction;δ:Q × X → Q × X × {Left_shift,Right_shift}. q0 is the initial state B is the blanksymbol F isthe setof final states Comparisonwiththe previousautomaton The followingtable shows acomparisonof how a Turingmachine differsfromFiniteAutomatonand PushdownAutomaton.
  • 2. Machine Stack Data Structure Deterministic? Finite Automaton N.A Yes PushdownAutomaton Last In FirstOut(LIFO) No TuringMachine Infinite tape Yes Example of Turingmachine Turingmachine M = (Q,X, ∑, δ, q0, B, F) with Q = {q0, q1, q2, qf} X = {a,b} ∑ = {1} q0 = {q0} B = blanksymbol F = {qf } δ isgivenby− Tape alphabetsymbol PresentState ‘q0’ PresentState ‘q1’ PresentState ‘q2’ a 1Rq1 1Lq0 1Lqf b 1Lq2 1Rq1 1Rqf Here the transition1Rq1 impliesthatthe write symbol is1,the tape movesright,and the nextstate isq1. Similarly,the transition1Lq2 impliesthatthe write symbol is1,the tape movesleft,andthe nextstate isq2. Time and Space Complexityof aTuringMachine For a Turing machine,the time complexityreferstothe measure of the numberof timesthe tape moveswhenthe machine isinitializedforsome inputsymbolsandthe space complexityisthe numberof cellsof the tape written. Time complexityall reasonable functions−
  • 3. T(n) = O(nlogn) TM's space complexity− S(n) = O(n) AutomataTutorial AutomataTutorialTheoryof AutomataFinite AutomataTransitionDiagramTransition TableDFAExamplesof DFANFAExamplesof NFAEliminatingε TransitionsConversionfromNFA to DFAConversionfromNFA withεto DFAMinimizationof DFA RegularExpression RegularExpressionExamplesof RegularExpressionConversionof REto FAArden'sTheoremMoore MachineMealyMachineConversionfromMealymachine toMoore machineConversionfromMoore machine toMealy machine CFG Context-free GrammarDerivationDerivationTreeAmbiguityinGrammarUnambiguous GrammarSimplificationof CFGChomsky'sNormal Form(CNF)GreibachNormal Form(GNF) PDA PushdownAutomataPDA AcceptanceNon-deterministicPushdownAutomataCFGtoPDA Conversion TuringMachine AutomataTuringMachine openlinkBasicModel of TuringmachineLanguage acceptedbyTuring machineExample of TMIntroductiontoUndecidabilityUndecidable ProblemaboutTMPost Correspondence ProblemChomskyHierarchyJavaTpoint Next→← Prev TuringMachine
  • 4. Turingmachine wasinventedin1936 byAlanTuring.It is an acceptingdevice whichaccepts Recursive Enumerable Language generatedbytype 0grammar. There are variousfeaturesof the Turingmachine: It has an external memorywhichremembersarbitrarylongsequence of input. It has unlimitedmemorycapability. The model hasa facilitybywhichthe inputatleftor righton the tape can be readeasily. The machine can produce a certainoutputbasedon itsinput.Sometimesitmaybe requiredthatthe same inputhas to be usedto generate the output.Sointhismachine,the distinctionbetweeninput and outputhas beenremoved.Thusacommon setof alphabetscanbe usedforthe Turing machine. Formal definitionof Turingmachine A Turingmachine can be definedasacollectionof 7 components: Q: the finite setof states ∑: the finite setof inputsymbols T: the tape symbol q0: the initial state F: a set of final states B: a blanksymbol usedasa endmarkerfor input δ: a transitionormappingfunction. The mappingfunctionshowsthe mappingfromstatesof finite automataandinputsymbol onthe tape to the nextstates,external symbolsandthe directionformovingthe tape head.Thisisknown as a triple or a program forturingmachine. (q0, a) → (q1, A,R) That meansinq0 state,if we readsymbol 'a' thenit will goto state q1, replaceda byX and move aheadright(Rstandsfor right).
  • 5. Example: ConstructTM for the language L ={0n1n} where n>=1. Solution: We have alreadysolvedthisproblembyPDA.InPDA,we have a stack to rememberthe previous symbol.The mainadvantage of the Turingmachine iswe have a tape headwhichcan be moved forwardor backward,and the inputtape can be scanned. The simple logicwhichwe will applyisreadouteach '0' mark itby A and thenmove aheadalong withthe inputtape and findout1 convertitto B. Now,repeatthisprocessforall a's andb's. Nowwe will see howthisturingmachine workfor0011. The simulationfor0011 can be shownas below: or 0011 can be shownas below: TuringMachine Now,we will see howthisturingmachine will worksfor0011. Initially,state isq0and headpointsto 0 as: TuringMachine The move will be δ(q0,0) = δ(q1,A,R) whichmeansitwill goto state q1, replaced0 by A andhead will move tothe rightas:
  • 6. TuringMachine The move will be δ(q1,0) = δ(q1,0, R) whichmeansitwill notchange any symbol,remaininthe same state and move to the rightas: TuringMachine The move will be δ(q1,1) = δ(q2,B, L) whichmeansitwill goto state q2, replaced1 by B and head will move toleftas: TuringMachine Nowmove will be δ(q2,0) = δ(q2,0, L) whichmeansitwill notchange anysymbol,remaininthe same state and move to leftas: TuringMachine The move will be δ(q2,A) = δ(q0,A,R), itmeanswill goto state q0, replacedA by A andheadwill move to the rightas: TuringMachine The move will be δ(q0,0) = δ(q1,A,R) whichmeansitwill goto state q1, replaced0 by A,and head will move torightas: TuringMachine The move will be δ(q1,B) = δ(q1,B, R) whichmeansitwill notchange any symbol,remaininthe same state and move to rightas: TuringMachine The move will be δ(q1,1) = δ(q2,B, L) whichmeansitwill goto state q2, replaced1 by B and head will move toleftas:
  • 7. TuringMachine The move δ(q2,B) = (q2,B, L) whichmeansit will notchange anysymbol,remaininthe same state and move toleftas: TuringMachine Nowimmediatelybefore BisA that meansall the 0?s are marketby A. Sowe will move rightto ensure thatno 1 ispresent.The move will be δ(q2,A) =(q0, A,R) whichmeansitwill goto state q0, will notchange anysymbol,andmove to rightas: TuringMachine The move δ(q0,B) = (q3,B, R) whichmeansitwill goto state q3, will notchange any symbol,and move to rightas: TuringMachine The move δ(q3,B) = (q3,B, R) whichmeansitwill notchange any symbol,remaininthe same state and move toright as: TuringMachine The move δ(q3,Δ) = (q4, Δ, R) whichmeansitwill goto state q4 whichis the HALT state and HALT state is alwaysanaccept state for any TM. TuringMachine The same TM can be representedbyTransitionDiagram: