UNIT 4
Turing machines
A information processing system is associate acceptive device that accepts the languages (recursively calculable set) generated by sort zero grammars. it had been fancied in 1936 by Alan Turing.
Definition
A information processing system (TM) may be a mathematical model that consists of associate infinite length tape divided into cells on that input is given. It consists of a head that reads the input tape. A state register stores the state of the information processing system. once reading associate input image, it's replaced with another image, its internal state is modified, and it moves from one cell to the proper or left. If the metal reaches the ultimate state, the input string is accepted, otherwise rejected.
A metal will be formally delineate as a 7-tuple (Q, X, ∑, δ, q0, B, F) where −
• Q may be a finite set of states
• X is that the tape alphabet
• ∑ is that the input alphabet
• δ may be a transition function; δ : alphabetic character × X → alphabetic character × X × .
• q0 is that the initial state
• B is that the blank image
• F is that the set of ultimate states
Comparison with the previous automaton
The following table shows a comparison of however a information processing system differs from Finite Automaton and Pushdown Automaton.
Machine Stack knowledge Structure Deterministic?
Finite Automaton N.A Yes
Pushdown Automaton Last In initial Out(LIFO) No
Turing Machine Infinite tape Yes
Example of information processing system
Turing machine M = (Q, X, ∑, δ, q0, B, F) with
• Q =
• X =
• ∑ =
• q0 =
• B = blank image
• F =
δ is given by −
Tape alphabet symbol Present State ‘q0’ Present State ‘q1’ Present State ‘q2’
a 1Rq1 1Lq0 1Lqf
b 1Lq2 1Rq1 1Rqf
Here the transition oneRq1 implies that the write image is 1, the tape moves right, and therefore the next state is q1. Similarly, the transition oneLq2 implies that the write image is 1, the tape moves left, and therefore the next state is q2.
Time and area quality of a information processing system
For a information processing system, the time quality refers to the live of variety|the amount|the quantity} of times the tape moves once the machine is initialized for a few input symbols and therefore the area quality is that the number of cells of the tape written.
Time quality all affordable functions −
T(n) = O(n log n)
TM's area quality quality
S(n) = O(n)
A language is termed Decidable or algorithmic if there's a data processor that accepts and halts on each input string w. each decidable language is Turing-Acceptable.
A decision downside P is decidable if the language L of all affirmative instances to P is decidable.
For a decidable language, for every input string, the thulium halts either at the settle for or the reject state as pictured within the following diagram –
Example 1
Find out whether or not the subsequent downside is decidable or not −
Is a range ‘m’ prime?
Solution
Prime numbers =
Divide the amount ‘m’ by all the numbers between ‘2’ and ‘√m’ ranging from ‘2’.
If any of those numbers turn out a remainder zero, then it goes to the “Rejected state”, otherwise it goes to the “Accepted state”. So, here the solution may well be created by ‘Yes’ or ‘No’.
Hence, it's a decidable downside.
Example 2
Given an everyday language L and string w, however will we have a tendency to check if w ∈ L?
Solution
Take the DFA that accepts L and check if w is accepted
Some additional decidable issues ar ar
• Does DFA settle for the empty language?
• Is L1 ∩ L2 = ∅ for normal sets?
Note −
• If a language L is decidable, then its complement L' is additionally decidable
• If a language is decidable, then there's AN functionary for it.
1. Multiple tracks Alan Turing Machine:
• A k-tack Alan Turing machine(for some k>0) has k-tracks and one R/W head that reads and writes all of them one by one.
• A k-track information processing system may be simulated by one track information processing system
2. Two-way infinite Tape Alan Turing Machine:
• Infinite tape of two-way infinite tape information processing system is boundless in each directions left and right.
• Two-way infinite tape information processing system may be simulated by unidirectional infinite {turing|Turing|Alan Alan Turing|Alan Mathison Turing|mathematician} machine(standard Turing machine).
3. Multi-tape Alan Turing Machine:
• It has multiple tapes and controlled by one head.
• The Multi-tape information processing system is completely different from k-track information processing system however communicative power is same.
• Multi-tape information processing system may be simulated by single-tape information processing system.
4. Multi-tape Multi-head Alan Turing Machine:
• The multi-tape information processing system has multiple tapes and multiple heads
• Each tape controlled by separate head
• Multi-Tape Multi-head information processing system may be simulated by normal information processing system.
5. Multi-dimensional Tape Alan Turing Machine:
• It has multi-dimensional tape wherever head will move any direction that's left, right, up or down.
• Multi-dimensional tape information processing system may be simulated by one-dimensional information processing system
6. Multi-head Alan Turing Machine:
• A multi-head information processing system contain 2 or additional heads to scan the symbols on constant tape.
• In one step all the heads sense the scanned symbols and move or write severally.
• Multi-head information processing system may be simulated by single head information processing system.
7. Non-deterministic Alan Turing Machine:
• A non-deterministic information processing system encompasses a single, a method infinite tape.
• For a given state and input image has atleast one option to move (finite range of decisions for consecutive move), every selection many decisions of path that it'd follow for a given input string.
• A non-deterministic information processing system is adore settled information processing system.
In a Non-Deterministic computing device, for each state and image, there area unit a bunch of actions the thulium will have. So, here the transitions don't seem to be settled. The computation of a non-deterministic computing device could be a tree of configurations which will be reached from the beginning configuration.
An input is settle fored if there's a minimum of one node of the tree that is associate degree accept configuration, otherwise it's not accepted. If all branches of the machine tree halt on all inputs, the non-deterministic computing device is named a Decider and if for a few input, all branches area unit rejected, the input is additionally rejected.
A non-deterministic computing device are often formally outlined as a 6-tuple (Q, X, ∑, δ, q0, B, F) where −
• Q could be a finite set of states
• X is that the tape alphabet
• ∑ is that the input alphabet
• δ could be a transition function;
δ : letter × X → P(Q × X × ).
• q0 is that the initial state
• B is that the blank image
• F is that the set of ultimate states
Unrestricted Grammars
Recall, a descriptive linguistics is Associate in Nursing abstract entity that makes an attempt to explain the "strings" [aka sentences] of a language. As a proper extension of a context-free grammar:
Definition: Associate in Nursing unrestricted descriptive linguistics could be a 4-tuple (T,N,P,S), consisting of:
1. T = set of terminals (the legal "tokens" of the language)
2. N = set of nonterminals (aka variables)
3. P = as set of productions, every of the form:
v -> w (what will this mean?)
where v and w area unit strings consisting of nonterminals and terminals.
4. S = a special nonterminal referred to as the beginning image.
This type of descriptive linguistics is additionally referred to as a sort zero descriptive linguistics. it's such as a computing device. [What will this mean? Given a sort zero descriptive linguistics, there exists a metallic element which will "recognize" identical language as that descriptive linguistics. And, conversely, a sort zero descriptive linguistics will continuously be found for the language recognized or generated by any metallic element.]
It is conjointly such as a recursively calculable language. [What will this mean?]
E.g.: G with set of productions:
P =
L(G) (language generated or recognized by G) =
w = ai {and i = 2k, k > 0}
Note: traditional methodology of specifying repetition of strings.
Definition: context-sensitive descriptive linguistics [aka kind one grammar]
All productions area unit of kind
v -> w wherever |v| < |w|
Note: one special traditional kind [what will this mean?] of this sort of descriptive linguistics needs productions of form:
uAv -> uwv with w != letter of the alphabet,
I.e., A -> w however solely within the context of u nine v.
A context-sensitive descriptive linguistics is such as a linear finite automaton (LBA) and to a context-sensitive language.
Almost all languages area unit context-sensitive. [What will this mean exactly? - they'll really be less complicated than context-sensitive.]
Definition: context-free descriptive linguistics [aka kind a pair of grammar]
All productions area unit of the form:
A -> x — wherever A is nonterminal, x could be a string of nonterminals and terminals
A context-free descriptive linguistics is such as a pushdown automaton (PDA) and to context-free languages.
Definition: Regular descriptive linguistics [aka kind three descriptive linguistics, aka linear grammar]
All productions area unit of the form:
A -> wB
A -> w wherever A, B area unit nonterminals,
w could be a string of terminals
Regular grammars area unit such as regular sets [what will such as mean here?]
And they are such as finite automata.
Description
Use Enumeration attribute if you have got fields or properties of enumerated sorts and you wish to save lots of them within the info. victimization functionary you outline however the enumerated values are saved and loaded from the info. The functionary attribute should be declared right higher than the enumerated sort.
creator
constructor Create(MappedType: TEnumMappingType); overload;
constructor Create(MappedType: TEnumMappingType; MappedValues: string); overload;
Parameters
MappedType Indicated the kind of the enumerated worth within the info. Valid values square measure (prefixed by TEnumMappingType):
emChar Enumerated values are saved as single-chars within the info
emInteger Enumerated values are saved as number values. {the worth|the worth} used is that the ordinal value of the enumerated sort, i.e, the primary worth within the functionary are saved as zero, the second as one, etc..
emString Enumerated values are saved as strings within the info
MappedValues If MappedType is char or string, then you need to use this parameter to specify the char/string worths reminiscent of every enumerated value. The values should be comma-separated and should be within the same order because the values within the enumerated sort.
Books
John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman, Introduction to Automata Theory, Languages, and Computation, Pearson Education Asia.
Reference books
1. Harry R. Lewis and Christos H. Papadimitriou, Elements of the Theory of Computation, Pearson EducationAsia.
2. Dexter C. Kozen, Automata and Computability, Undergraduate Texts in Computer Science, Springer.
3. Michael Sipser, Introduction to the Theory of Computation, PWS Publishing.
4. John Martin, Introduction to Languages and the Theory of Computation, Tata McGraw Hill.