Table of contents
- 1. 4.1 The definition of a Turing machine
- 1.1.1.1. Definition 4.1.1:
- 1.1.1.2. Definition 4.1.2:
- 1.1.1.3. Defenition 4.1.3:
- 1.1.1.4. Definition 4.1.4:
- 2. 4.2 Computing with Turing machines
- 2.1.1.1. Definition 4.2.1:
- 2.1.1.2. Definition 4.2.2:
- 2.1.1.3. Definition 4.2.3:
- 2.1.1.4. Definition 4.2.4:
- 2.1.1.5. Theorem 4.2.1:
- 2.1.1.6. Theorem 4.2.2:
- 3. 4.5 Nondetermenistic Turing machines
- 3.1.1.1. Definition 4.5.1:
- 3.1.1.2. Definition 4.5.2:
- 3.1.1.3. Theorem 4.5.1:
- 4. 4.7 Numerical Functions
- 4.1.1.1. Defenition 4.7.1:
- 4.1.1.2. Definition 4.7.2:
4.1 The definition of a Turing machine
A Turing machine consists of a finite control, a tape and a head that can be used for reacting or writing on that tape
Turing machines are designed to satisfy simultaneously these three criteria:
- They should be automata; that is, their construction and function should be in the same general spirit as the devices previously studied.
- They should be as simple as possible to describe, define formally, and reason about.
- They should be as general as possible in terms of the computations they can carry out.
A Turing machine consists of a finit state control unit and a tape. Communication betwenn the two provide by a single head, which reads symbols from the tape and is also used to change the symbols on the tape. The control unit operates in discrete steps; at eacht step it performs two functions in a way that depends on the current state and the tape symbol currently scanned by the read/write head.
- Put the control unit in a new state
- Either:
- write a symbol in the tape square currently scanned, replacing the one already there, or
- move the read/write head on the tape square to the left or right
The tape has a left end but it extends indefinitely to the right. To prevent the machine from moving its head off the left end of the tape, we assume that the left most end of the tape is always marked by a special symbol denoted by ⊳; we assume further that all our Turing machines are so designed that, whenever the head reads a ⊳, it immeaditialy moves to the right. Also we shall use the distinct symbols ← and → to denote movement of the head to the left or right.
Definition 4.1.1:
A Turing machine is a quintuple (K, ∑, δ, s, H) where:
- K is a finite set of states
- ∑ is an alphabet, containing the blank symbol ⊔ and the left end symbol ⊳, but notcontaining the symbol ← and →
- s ∊ K is the initial state.
- H ⊆ K is the set of waiting states
- δ the transition function is a function from (K-H) x ∑ to K x (∑ ∪ { ←, →}) such that
- for all q ∊ K-H, if δ(q, ⊳) = (p,b) then b = →
- for all q ∊ K-H and a ∊ ∑ if δ(q, a) = (p,b) then b ≠ ⊳
Definition 4.1.2:
a configuration of a Turing machine M = (K, ∑, δ, s, H) is a member of K x ⊳ ∑* x (∑* (∑-{⊔}) ∪ {e})
That is, all configurations are assumed to start with the left end symbol, and never end with a blank - unless the blank is currently scanned. A configuration whose state component is ⊳ in H will be called a halted configuration.
Defenition 4.1.3:
let M = (K, ∑, δ, s, H) be a Turing machine and consider two configurations of M (q1, w1a1u1) and (q2, w2a2u2),where a1, a2 ∊ ∑. Then
(q1, w1a1u1) ⊢M (q2, w2a2u2)
if and only if, for some b ∊ ∑ ∪ { ←, →}, δ(q1, a1) = (q2, b), and either
- b ∊ ∑, w1 = w2, u1 = u2 and a2 = b, or
- b = ←, w1 = w2a2 and either
- u2 = a1u1, if a1 ≠ ⊔ or u1 ≠ e, or
- u2 = e, if a1 = ⊔ and u1 = e; or
- b = →, w2 = w1a1, and either
- u1 = a2u2, or
- u1 = u2 = e, and a2 = ⊔.
Definition 4.1.4:
For any Turing machine M, let ⊢*M be the reflexive, transitive closure of ⊢M, we say that configuration C1 yields configuration C2 if C1 ⊢*M C2. A computation by M is a sequence of configurations C0,C1,...,Cn for some n⪖0 such that
C0⊢MC1⊢MC2⊢M...⊢MCn
We say that the computation is of length n or that it has n steps, and we write C0⊢nMCn
If a ∊ ∑, then the a-writign machine will be denoted simply as a. The head moving machines M← and M→ will be abrevated as L and R
4.2 Computing with Turing machines
Imput is presented to Turing machines in the following way. The input string, with no blank symbol in it, is written to the right of the leftmost symbol ⊳, with a blank to its left and a blanks to its right, the head is positioned at the tape square containing the blank between the ⊳ and the input, and the machine starts operating in its initial state. If M = (K, ∑, δ, s, H) is a Turing machine and w ∊ (∑ - {⊔, ⊳})*, then the initial configuration of M on input w is (s,⊳⊔w). With this convention we can now define how Turing machines are used as language recognizers
Definition 4.2.1:
Let M = (K, ∑, δ, s, H) be a Turing machine such that H = {y, n} consists of two distinguished halting states ( y and n for yes and no). Any halting state whose state component is y is called an accepting configuration while a halting configuration whose state component is n is calles a rejecting configuration Let ∑0 ⊆ ∑ - {⊔, ⊳} be an alphabet, calles the input alphabet of M; by fixing ∑0 to be a subset of ∑ - {⊔, ⊳}, we allow out Turing machines to use extra symbols during their computation, besides those appearing in their input. We say that m decides a language L ⊆ ∑0* if for any string w ∊ ∑0* the following is true: if w ∊ L then M accepts w; and if ∉ L then M rejects w. Finally call a language : recursive if there is a Turing machine that decides it.
That is, a Turing machine decides a language L if, when started with input w, it always halts, and does so in a halt state that is correct response to the input: y if w ∊ L, n if w ∉ L. Notice that no garantuees are given about what happens if the input to the machine contains blanks or the left end symbol.
A Turing machine, even if it has only two half states y and n, always has the option of evading an answer (yes or no) by falling to halt.
Definition 4.2.2:
Let M = (K, ∑, δ, s, {h}) be a Turing machine, let ∑0 ⊆ ∑ - {⊔, ⊳} be an alphabet, and let w ∊ ∑0*. Suppose that M halts on input w, and that (s,⊳⊔w) ⊢*M (h,⊳⊔y) for some y ∊ ∑0*. Then u is calles the output of M on input w, and is denoted M(w). Notice that M(w) is defined only if M halts on input w, and in fact does so at a configuration of the form (h,⊳⊔y) with y ∊ ∑0*. Now let f be any function from ∑0* to ∑0*. We say that M computes function f if for all w ∊ ∑0*, M(w) = f(w). That is, for all w ∊ ∑0* M eventually halts on input w, and when it does halt, its tape contains the string ⊳⊔f(w). A function is calles recursive if there is a Turing machine M that computes f.
Definition 4.2.3:
Let M = (K, ∑, δ, s, {h}) be a Turing machine such that 0, 1; ∊ ∑ and let f be any function from
k to
for some k ⪖ 1. We say that M computes function f if for all w1,..., wk ∊ 0 ∪ 1 {0, 1} * (that is for any k strings that are binary encodings of integers), num (M(w1,..., wk)) = f(num(w1),..., num(wk)). That is if M is started with the binary representations of the integers n1,...,nk as input, then it eventually halts, and when it does halt, its tape contains a string that represents numbers f(n1,...,nk) - the value of the function. A function f:
k ↦
is called recursive if there is a Turing machine M that computes f
If a Turing machine decides a language or computes a function, it can be reasonably thought of as an algorithm that performs correctly and reliably some computational task. We next introduce a third subtler way in which a Turing machine can define a language:
Definition 4.2.4:
Let M = (K, ∑, δ, s, H) be a Turing machine let ∑0 ⊆ ∑ - {⊔, ⊳} be an alphabet, and let L ⊆ ∑0* be a language. We say that M semidecides L if for any string w ∊ ∑0* the following is true w ∊ L if and only if M halts on input w. A language L is recursively enumerable if and only if there is a Turing machine M that semidecides L.
Extending the "functional" notation of Turing machines that we introduced previously (which allows us to write equations such as M(w) = u), we shall write M(w) = ⤤ if M fails to halt on input w. In this notation we can restate the definition of semidecision of a language L ⊆ ∑0 by Turing machine M as follows: For all w ∊ ∑0* M(w) = ⤤ if and only if w ∉ L.
A Turing machine that semidecides a language L cannot be usefully employed for telling wheter a string w is in L, because if w ∉ L, then we will never know when we have waited enough for an answer. Turing machines that semidecide languages are no algorithms
Any recursive language is also recursively enumerable. All it takes to construct another Turing machine that semidecides instead of decides, the language is to make the rejecting state n a nonhalting state, from which the machine is guaranteed to never halt.
Theorem 4.2.1:
If a language is recursive, then it is recursively enumerable.
There are recursively enumerable languages that are not recursive.
Theorem 4.2.2:
If L is a recursive language, then its complement L is also recursive
4.5 Nondetermenistic Turing machines
A nondetermenistic Turing machine is a quintuple (K, ∑, ∆, s, H), where K, ∑, s and H as for standard Turing machines and ∆ is a subset of ((K-H) x ∑) x (K x (∑ ∪ { ←, →})) rather than a function from (K-H) x ∑) to K x (∑ ∪ { ←, →}). Configurations and the relations ⊢M and ⊢*M are defined in the netural way. But now ⊢M need not be single valued. One configuration may yield several others in one step
Definition 4.5.1:
Let M = (K, ∑, ∆, s, H) be a nondetermenistic Turing machine. We say that M accepts an input w ∊ (∑ - {⊔, ⊳})* if (s, ⊳⊔w) ⊢*M (h, uav) for some h ∊ H and a ∊ ∑,u,v ∊ ∑*. Notice that a nondetermenistic machine accepts an input even though it may have many nonhalting computations on this input - as long as at least one halting computation exists. We say that M semidecides a language L ⊆ (∑ - {⊔, ⊳})* if the following holds for all w ∊ (∑ - {⊔, ⊳})* w ∊L if and only if M accepts w.
Definition 4.5.2:
Let M = (K, ∑, ∆, s, {y,n}) be a nondetermenistic Turing machine. We say that M decides a language L ⊆ (∑ - {⊳, ⊔})* if the following two conditions hold for all w ∊ (∑ - {⊔, ⊳})*:
- There is a natural number
, dependein on M and w, such that there us no configuration C satisfying (s, ⊳⊔w) ⊢nMC - w ∊ L if and only if (s, ⊳⊔w) ⊢*M (y, uav) for some u, v ∊ ∑*, a ∊ ∑
Finally, we say that M computes a function f:(∑ - {⊔, ⊳})* ↦ (∑ - {⊔, ⊳})* if the following two conditions fold for all w ∊ (∑ - {⊔, ⊳})* :
- There is an
depending on M and w, such that there is no configuration C satisfying (s, ⊳⊔w) ⊢nMC. - (s, ⊳⊔w) ⊢*M (h, uaw if and only if ua = ⊳⊔ and v = f(w)
Theorem 4.5.1:
If a nondetermenistic Turing machine M semidecides or decides a language, or computes a function, then there is a standard Turing machine M' semideciding or deciding the same language, or computing the same function.
4.7 Numerical Functions
Defenition 4.7.1:
We start by defining certian extremely simple functions from
k to
, for various values of k ≥ 0 (a o-ary function is , of course, a constant, and it has nothing on which to depend). The basic functions are the following:
- For any k ≥ 0, the k-ary zero function is defined as zerok(n1,...,nk) = 0 for all n1,...,nk ∊

- For any k ≥ j ≥ 0, the jth k-ary identity function is simply the function idk,j(n1,...,nk) = nj for all n1,...,nk ∊

- The successor function is defined as succ(n) = n+1 for all n ∊

Next we introduce two simple ways of combining functions to get slightly more complex functions.
- Let k,l ≥ 0 let g:
k ↦
be a k-ary function, and let n1,...,nk be l-ary functions. Then the composition of g with h1,...,hk is the l-ary function defined as
f(n1,...,nl) = g(h1(n1,...,nl),...,hk(n1,...,nl)) - Let k ≥ 0 let g be a k-ary function, and let h be a (k+2)-ary function. Then the function defined recursively by g and h is the (k+1)-ary function defined as
fo) = g(n1,...,nk)
f(n1,...,nk,m+1) = h(n1,...,nk,m,f(n1,...,nk,m))
for all n1,...,nk,m ∊
The primitive recursive functions are all basic functions, and all functions that can be obtained by them by any number of successive applications of composition and recursive definition
Definition 4.7.2:
Let g be a (k+1)-ary function, for some k ≥ 0. The minimalization of g is the k-ary function defined as follows:
f(n1,...,nk)
{the least m such that g (n1,...,nk,m) = 1, if such an m exists;
0 otherwise
*** the f(n1,...,nk) should be in front of the bracket***
We shal denote the minimalization of a function g is always well-defined, there is no abvious method for computing it - even if we know how to compute g. The obvious method
m:=0
while g(n1,...,nk,m) ≠ 1 do m:= m+1;
output m
is not an algorithm, because it may fail to terminate. Let us then call a function g minimalizable if the above method always terminates. That is a (k+1)-ary function g is minimalizable if it has the following property. For every n1,...,nk ∊
, there is an m ∊
such that g (n1,...,nk,m) = 1.
Finally, call a function μ-recursive if it can be obtained from the basic functions by the operations of composition: recursive defenition, and minimalization of minimalizable functions.
Theorem 4.7.1: A function f:
k ↦
is μ-recursive if and only if it is recursive (that is, computable by a Turing machine)

Comments