Sie sind auf Seite 1von 3

International Journal on Recent and Innovation Trends in Computing and Communication

Volume: 3 Issue: 2

ISSN: 2321-8169
613 - 615

_______________________________________________________________________________________________

On the Coding of a Turing Machines and Non - Recursive Languages


B. P. Tanana

B. Cassy

Higher Institute for Science and Technology of Mozambique


Maputo, Mozambique
btanana@mail.ru

Eduardo Mondlane University


Maputo, Mozambique
bhangycassy@yahoo.com.br

Abstract: In this paper we present one type of problems not previously encountered in the academic literature to validate the
actual students' understanding, not memorization formal, definitions of certain non-recursive languages.
Keywords - Turing Machine, accepted language, recursive language, recursively enumerable language, diagonalization language, universal
language

__________________________________________________*****_________________________________________________
I.

INTRODUCTION

Students in Mozambique, who enroll the Computer Science


Engineering Program, at some subjects they have to be taught
some concepts of Discrete Mathematics that are related to
Turing Machines, recursive and recursively enumerable
languages.
In this paper we present one type of problems not
previously founded in the available scientific literature to
validate the actual students' understanding, rather than
memorizing formal, definitions of some non-recursive
languages.
Here, at first, we will give the necessary definitions and
concepts.
II.

TURING MACHINE

Turing Machine consists of a finite control (any non-empty


finite set of states), from the infinite to the right tape divided
into cells (each cell can contain one of a finite set of symbols)
and the cursor that can read a character from the scan cell to
record the new symbol there and move on one cell to the right
or left.
More formally, (p. 319 [1]), the Turing Machine is a system
of seven elements M (Q, , T , , q0 , B, F ) where,
Q - a finite set of states;
- finite set of input symbols;
T - a finite set of tape symbols ( proper subset of T);
- transition function, : Q T Q T {L, R} ( partial function, L means moving the cursor left, R - right);
q0 - the initial state ( q0 Q , in this state of a Turing
machine is at the beginning of the work);
B - the tape symbol denoting an empty cell ( B T \ ) ;
F - set of final or accepting states (F subset of Q).
Starting working, the Turing Machine is in the initial state
q0, the cursor scans the first left cell in which character B is

always in the (beginning) and, then located on the tape input


word w over the alphabet , in all the remaining cells (to
infinity) of B characters written. Therefore, the machine, step
by step, begins to execute commands (if possible) given by the
transition function . For example, (in this case), the machine
to be started must satisfy the equality (q0 , B) (q1, B, R) . For
this command, the machine goes into the state q1, the first cell
on the left and leaves the character B, while, the cursor moves
the cell to the right.
In general, the team

(qi , x) (q j , y, L) is performed as

follow: - before executing the command the Turing Machine is


in state qi, and a scan cell recorded an x. After running this
command, the machine goes to the state qj a scan cell replaces
x by y and the cursor moves to the cell at the left, which is
getting scanned.
If doing so the commands given by the transition function,
Turing Machine M is stopped (no commands that it could
perform) and is in the final state, the Turing Machine M
accepts a word w, written at the beginning of the work on the
tape, otherwise, does not accept w. All words w, which Turing
Machine M accepts form a language recognized by a Turing
Machine M. This language is denoted by L(M ) .
Recall the notion of recursive and recursively enumerable
languages (p. 263 [2]). Formal language L is recursive if and
only if there exists a Turing Machine M such that L L(M )
and M stops for any input word w. Formal language L is
recursively enumerable if and only if there exists a Turing
Machine M such that L L(M ) .
To determine the specific non-recursive languages use
encoding of Turing Machines. Without loss of generality, in
matters related to the encoding of Turing Machines, we can
613

IJRITCC | February 2015, Available @ http://www.ijritcc.org

_______________________________________________________________________________________

International Journal on Recent and Innovation Trends in Computing and Communication


Volume: 3 Issue: 2

ISSN: 2321-8169
613 - 615

_______________________________________________________________________________________________
assume that T {0,1, B} , the set of states Q {q0 , q1,, qn }
(p. 324 [2]), also agreed that, F {q1} . We need to encode
commands given by transition function, which have the
following form, (qi , x) (q j , y, D) , where
qi , q j Q ;
x, y {0,1, B} ; D{L, R} . Initially, encodes all of the

characters included in the command (p. 324 [2]).


Symbol

q0

Code

11

111

q1
11

qn

1n1

11

Let be c(z ) the code of character z. The command code,

(qi , x) (q j , y, D)
is a binary word

c(qi )0c( x)0c(q j )0c( y)0c( D) .


The code of a Turing Machine M is a binary word, denoted
R (M ) which begins and ends with three zeros between which
command codes are written separated by two zeros.
Consider a practical example
Example 1: Find the code R (M ) of a Turing Machine M,
defined
function

by
(q0 , B) (q1, B, R)

the
;

transition
;

(q1,0) (q1,0, R)

(q1,1) (q1,1, R) .

the element f (i, j ) is equal to 1 if the Turing machine Mi


whose code has a binary word wi having number i the
canonical ordering accepts the word wj; and f (i, j) is equal to 0
otherwise. We believe that any binary word is the code of a
Turing Machine, just when encoding some machines mistakes
and those of the Turing Machine does not work (pp. 370-371
[1]).
As diagonal language Ld take all the words wi for which f
(i, i) is equal to 0. Thus, Ld = {wi: wi L (Mi)}.
III.

Solution: - Note that the transition function defines all the


7 elements of a Turing Machine M (Q, , T , , q0 , B, F ) ;
Q {q0 , q1} , {0,1} , F {0,1, B} , is given in the text of

Example 1,

stops in the final state q1. Hence L(M), in this case, the set of
all words over the alphabet {0, 1}, including the empty word
.
To determine the so-called diagonal language Ld introduce
the canonical order of the binary words: big long word more;
words of equal length are ordered lexicographically.
Thus, the initial elements of the ordered set will be
received words , 0, 1, 00, 01, 10, 11, 000, ... .
If these words to the left add 1, we get the binary numbers
1, 10, 11, 100, 101, 110, 111, 1000, ... in decimal or 1, 2, 3, 4,
5, 6, 7, 8 ... that specifies the number of binary words under
the canonical ordering (p. 369 [1]).
So, sometimes instead of a binary word wi (words having a
number i the canonical ordering) is convenient to use his
number i. To find a wi enough to write i in the binary system
and discard the first 1 on the left. Let N be the set of natural
numbers.
Consider the following function f : N N {0,1} where

q0 q0 , B B , F {q1} (remembering our

agreement). We find R (M ) .
Command
(q0 , B) (q1, B, R)

Code
101110110111011

(q1,0) (q1,0, R)

110101101011

(q1,1) (q1,1, R)

11011011011011

Thus, R(M) = 000101110110111011001101011010


110011011011011011000.
Changing the order of the commands, as a result, it is
possible to obtain 3! = 6 different codes R(M) for the Turing
Machine M, given in Example 1.
Thus, it is easy to understand that a Turing Machine M of
Example 1 accepts any word in the alphabet {0, 1} as always

USING THE ENCODING OF TURING MACHINES

Using the encoding of Turing Machines, we define a few


more languages:
The universal language of LU = {R(M) w: wL (M)},
R(M)w is the word attribution w to a word R (M). Language
LH, corresponding to the well-known Halting Problem for
Turing Machines, LH = {R (M)w: R (M) code for real Turing
Machine, which stops when the input word w}.
There are many more such specific languages that can be
defined using the Rices Theorem (p. 332 [2]). Note that all
these languages are not recursive, and Ld is not a recursively
enumerable language.
Finally, the promised in the beginning of this article verify
the validity of students' understanding of the material covered.
Students were encouraged to complete the following problem
on the following example 2.
Example 2: Define the universal language of LU. Specify a
particular binary word v LU.
Solution. It is clear that almost all the students respond to
the first part of the problem and write (note that the control of
knowledge in universities in Mozambique, mostly
written) LU {R( M ) w : w L( M )} .
614

IJRITCC | February 2015, Available @ http://www.ijritcc.org

_______________________________________________________________________________________

International Journal on Recent and Innovation Trends in Computing and Communication


Volume: 3 Issue: 2

ISSN: 2321-8169
613 - 615

_______________________________________________________________________________________________
To answer the second part of the problem is necessary to
know the encoding of Turing Machines and real understanding
of the issue. So you need to find a particular Turing Machine
M and a specific binary word w, which is the machine M
accepts. Find R(M) and write the answer v R(M )w LU .
The Turing Machine discussed in Example 1, accepts any
word w, for example, w . Thus, using a solution of the
Example 1, we conclude that,
v = 0001011101101110110011010110101100110110110
11011000 LU.

IV.

CONCLUSION

In conclusion, we note that, instead of the universal


language of LU in Example 2 can be any other language in the
definition of which includes the encoding of a Turing Machine.

REFERENCES
[1]

John E. Hopcroft, Rajeev Motwani, Jeffrey D. Ullman. Introduction to


Automata Theory, Languages, and Computation. 2nd ed, Addison
Wesley, 2001.

[2]

Thomas A. Sudkamp. Languages and Machines. 2nd ed, Addison


Wesley, 1997.

(It is clear that the word found is entirely dependent on the


entered our encoding).

615
IJRITCC | February 2015, Available @ http://www.ijritcc.org

_______________________________________________________________________________________