Algorithmic presentation machines. Turing machine

"Modern Party Systems" - Definition of a modern party. Party. Ideological function. English parties. Party signs. Small number of members. The parties in power. A special position in society. Approaches to the definition of the concept of "party". Essence and fundamental difference between ideologies. Conservative and Liberal Parties.

"Social Protection" - Labor has become the foundation of social recognition and the foundation for protection from various dangers and misfortunes. Question: Which of the two factors caused the extremely low rate of layoffs? The crisis of the welfare state. 3. The contradictory nature of the social protection system. When the conjuncture changes, the unexpected legacy turns out to be debts that can upset the situation of the working people.

"Unified State Exam in Social Studies C8" - Offense. Detailed answer on the topic. The essence of the plan. A socially dangerous offense. The nominative form of the plan. Overcoming the ecological crisis. What is an offense. Misconduct. Semantic elements. Detailed plan. The environmental crisis is linked to others global problems... Deformations in the minds of people.

"Gothic" - Nowadays, Gothic has spread to almost all styles of music. Among the Goths there are atheists, Christians and Satanists. What is it? Monks, sado-masochists, fetishists. Dispute about Light and Darkness. Why exactly black? Performed by Batina Julia. Joy and sadness, like light and darkness, are two dimensions. Then there was the Gothic novel and poetry - Byron, Volpole, Anna Rice.

"Russian Constitution" - What is the Constitution. President of the Russian Federation. What are national values. Name the people whose deeds Russia is proud of. The expression "united by a common destiny on one land." 20 years of the Constitution Russian Federation... What does it mean to accept the fate of the fatherland as your own. Preamble. The constitution and its role. Preamble of the Constitution of the Russian Federation.

"Teachings about society and man" - Post-Marxism. Teachings about society and man. Functions. G.V.F. Hegel. Aristotle. Forms of government. Ancient India. Human. Revival. Ancient China... Representatives. Technicism. Existentialism. Materialistic understanding of society. Myths. Value-based approach. Adam Smith. Middle Ages. The essence of the theory of social contract.

The methodological development of the lesson, which will be discussed in this publication, is intended for study in grade 10 when considering the thematic block " Algorithm. Algorithm executors».

In the lesson on the topic " »Accompanied by a multimedia presentation, the children will get acquainted with its structure, study the principle of operation and learn how to build a program for a Turing machine. The material of the lesson allows to develop the algorithmic thinking of high school students, the ability to formalize.

By type, this lesson is combined, in which the study of new material is consolidated in the process of solving problems on the topic. The author of the development proposes to use a partial search method of teaching, when the thinking process becomes productive with the consistent direction and control of the teacher.

Description of the course of the lesson about the Turing machine

At the stage of organizing the class, the teacher sets the children up for work, formulates the topic of the lesson and talks about the English Alan Turing, who significantly influenced the development of computer science as a science.

As a warm-up at the next stage of the lesson, students solve a logical problem, followed by a check at the blackboard. It is important to pay attention to the ability to draw up a reasoning algorithm.

Having dealt with the problem in the warm-up, we update the previously covered theoretical material about the algorithm and the performers of the algorithms. To do this, the author of the development proposes to conduct a frontal survey on the following questions:

What is called an algorithm and who is it intended for?

What properties does the algorithm have?

Who is able to appear as the executor of the algorithm?

What are the basic concepts of the Turing machine?

Demonstrate the main properties of algorithms using an example of a Turing machine.

Examples of Turing machines - theoretical part

Before proceeding with the solution of problems on the topic, in the theoretical part we give a description of the Turing machine. We draw the attention of the class to two components of any of these machines:

1) the tape is unlimited and divided into cells;
2) a program-controlled head that reads information and called an automaton.

Replace one letter of the alphabet contained in the visible memory cell with another;

Shift to the right or left with an interval of one cell, or stay in the same place;

Change your own inner state.

Solving problems using Turing machines

The next stage of the lesson involves immersion in the practical part of the lesson and solving problems on the topic. The teacher says that with the help of a Turing machine, it is necessary to try to simulate a device similar to a calculator. In total, two tasks are proposed, the analysis of which takes place accompanied by presentation slides:


Objective 1.
The Turing machine tape contains some decimal number. It is necessary to add to this number 1 ( unit). Automatic in this case looks over a certain digit corresponding to the input number.

One of the first and very successful attempts to give an accurate
mathematical equivalent of intuitive understanding of the algorithm
was the introduction of the concept of a Turing machine in 1937, 9 years before
the appearance of the first computer.
A Turing machine is an abstract machine. This is mathematical
model of an idealized computing device.
The Turing machine consists of a tape and a control device with
reading and writing heads (carriages) (Fig. 5.1).
Rice. 5.1
The tape is rigidly fixed on the left and infinite on the right. Sometimes
consider that the tape is not limited to the right and left. The tape is divided into
cells numbered with natural numbers 1, 2,….
The symbols of the external alphabet are entered into each cell of the tape
Turing machines
A = (a0, a1, ... an).
(5.1)
One of the characters (space) matches a blank, empty
cell.
The head can move along the tape to the left and right. When
it is motionless, then it stands against a certain cell of the tape; they say that
the head views this cell.

For a unit of time, which is called a step, the head can
move one cell to the left or right. In addition, the head
can also recognize the contents of the viewed cell, can
put a character of the external alphabet into the current cell and can erase
the contents of the current cell or, which is the same, write there
space.
The control device can be in one of the many
discrete states:
Q = (q0, q1, ... qm).
(5.2)
The set Q is called the internal alphabet of the machine
Turing or the alphabet of internal states.
A word is a sequence W = ai1, ai2, ..., ais symbols,
recorded in the cells of the tape, where ai1 is the character located in the
the left nonblank cell, and ais is the character in the rightmost
non-empty cell. The number of characters s in a word is called the length
the words.
Let a word W be written on the tape at some moment of time t,
the control device is in the qi state, and the carriage is
opposite the aim symbol of the word W. The configuration of the machine at the moment
time t is a sequence K = ai1, ..., ai (m - 1), qi, aim ...,
ais. The configurations at the beginning and at the end of the work are called respectively.
initial and final.

Example 5.4.
Let the word abcde be written on the tape, the control device
is in the qi state and the caret is opposite the d character.
The configuration in this case will be written as follows:
abcqide.
Since the Turing machine has a finite alphabet and a finite
the number of internal states, it is obvious that it can perform
a finite number of actions.
If the control device at some point in time
is in the state qi, the symbol aj is monitored, the next moment
time, the symbol ar is written, the control device goes to
state qk, and the carriage is shifted, then the machine is said to perform
command
ajqi arSqk,
(5.3)
where S - shift, S = L, if shift to the left, S = R, if shift to the right, S = C,
if the carriage remains in place.
The collection of all commands that a machine can execute,
called her program. The uniqueness condition requires that for
for any j and any i, there is only one command of the form (5.3).

Each Turing machine is completely determined by its own
alphabet, internal states and program.
So, the Turing machine is a collection
M = ,
(5.4)
where A is the outer alphabet (5.1),
Q - alphabet of internal
states (5.2), P is program (5.3).
Example 5.5.
Machine with external alphabet A = (1, a), alphabet of internal
states Q = (q1, q2) and the program
1q1 1Rq1,
aq1 1R q1,
from any initial configuration will run indefinitely,
filling the entire tape with units to the right of the starting point.

The order of operation of a Turing machine is often given in the form of a table.
In each column of the top line, the characters of the inner
alphabet, in each line of the first column - symbols of the external
alphabet. In cells at the intersection of other columns and lines
commands are placed.
If at the intersection of any row and any column we
we get an empty cell, this means that in this internal
state, this symbol cannot be encountered.
A / Q
a0
a1
q0
q1

qi
qn

aj
ajKqi

am
Command format: aKq, where:
a - the new content of the current cell (new character of the outer
the alphabet that is entered into the current cell);
K - Turing machine tape drive command
(left, right, stop);
q is the new internal state of the Turing machine.

The operation of the machine on the basis of a given program occurs
in the following way.
Suppose that in this moment time Turing machine
is in the internal state qi, and in the monitored carriage
the cell of the tape contains the symbol aj.
Then the machine proceeds to the execution of the command ajKqi in the cell, on
intersection of column qi and row aj:
1) a new symbol aj is entered into the current cell of the tape (possibly,
the same).
2) there is a shift of the head to the left (K = left), or a shift of the head
to the right (K = right), or the head remains in place, i.e.
stopping the machine (K = stop).
3) the machine goes over to a new internal state qi.
Possible cases of stopping the Turing machine:
1) during the execution of the program, the machine will come to execution
stop commands; the program is considered executed in this case,
the car stops - an effective stop occurs.
2) the car never stops, there is a loop.

Example 5.6.
Let the outer alphabet A = (0, 1, 2), and the set of inner
states consists of only one state Q = (q0). Necessary
construct an MT, which, in an arbitrary notation, starting from any
cell, moving to the right, finds the first zero and stops.
Such a machine can be given by the table:
a
q0
0 0Cq0
1 1Rq0
2 2Rq0
Indeed, let, at first, the machine is in the state
1 1 2 0 1 2 2
The head is looking at symbol 1. According to tab. performed
command 1Rq0, that is, the same
character 1 and the head moves to the right.
1
1
2
0
1
2
2
Now the head is scanning character 1 again and according to
tab. 5.2 the command 1Rq0 is executed, that is, to the monitored cell
the same character 1 is written and the head is shifted to the right
1 1 2 0 1 2 2
Now the head is looking at symbol 2 and in accordance with the table. 5.2
the command 2Rq0 is executed, that is,
the same character 2 and the head is shifted to the right.
1 1 2 0 1 2 2
Now the head looks at the character 0 and in accordance with the table. 5.2
the command 0Cq0 is executed, that is, the observed cell is written
the same 0 and the car stops.

Example 5.7.
We construct a Turing machine that transforms the word AVB) into
word A & B, and word A & B) transforms into word A V B, which
complies with de Morgan's laws. Such a machine can be specified
Table 5.2.
Outer alphabet A = (А, B, V, &, (,), _) (symbol _ matches
empty cell), and the set of internal states consists only of
one state Q = (q0).
A
A
B
V
&
)
_
q0
_Rq0
ARq0
Rq0
& Rq0
VRq0
Rq0
BRq0
_Cq0

Turing machine data are words in the tape's outer alphabet.
The tape records both the original data and final result... On
the tape can contain words as well as sequences of words. V
In the latter case, a special separator character is placed between words, it can be a space or a symbol. Natural number a
a
is represented by the word 1 ... 1 = 1, consisting of a ones. For example,
the number 3 corresponds to the word 111.
Example 5.8.
Let's build a Turing machine that adds two
a
natural numbers a and b. Adding two numbers a and b means word 1
b
a + b
1 convert to word 1.
This can be done by removing the separator character from the a b entry and
shifting the first term to the second. Such a machine can be
given by the table. External alphabet A = (1, _), where is the symbol
delimiter, and _ is an empty cell character (space). Lots of
internal states consists of three states Q = (q0, q1, q2).
a
q0
q1
q2
1 _Rq1 1Rq1 1Lq2
* _Rq1 1Lq2
_
_Cq1
__Rq1
Initial and final states of the tape for the case a = 2, b = 3
shown in Fig. a) and b)
a)
1 1 1 1 1
b)
1 1 1 1 1

Turing-computed functions
We will consider functions f of one or more
variables defined on the set N = (0, 1, 2, ..., n, ...)
natural numbers or subsets thereof (partial functions) and
taking values ​​on the set N.
Definition 5.8. The function f (x1, x2, ..., xn) is called computable,
if there is an algorithm that allows you to calculate its values ​​for
those variables for which it is defined, and the working
is infinite if the function for a given set of variables is not
defined.
Definition 5.9. The function f (x1, x2,…, xn) is called computable
by Turing, if there is a Turing machine calculating this
function.
Variables can be positioned as delimited words
11…1 11…1 …… 11…1
Example 5.9.
Entry 111 11 1 matches
equal to 3, 2 and 1, respectively.
three variables x1, x2, x3,
The function is also written in a word consisting of ones.
Example 5.8 presents a two-variable function f (a, b) = a + b.

Turing's thesis. Any algorithm can be implemented by a machine
Turing.
Turing's thesis cannot be proven. This statement means that
the mathematical concept of a Turing computable function is
an ideal model of the intuitive concept of an algorithm. This thesis
confirmed by experience.
By its nature, Turing's thesis resembles mathematical
the laws of mechanics, which in the same way cannot be proved, but,
discovered by Newton, have been repeatedly confirmed by experience.
By virtue of Turing's thesis, the impossibility of constructing a machine
Turing means there is no algorithm for solving this problem.
The study
machines
Turing
lays down
foundation
algorithmic thinking, the essence of which is that
you need to be able to divide the calculation process into simple components
Steps.
In a Turing machine, this separation is brought to the limit
you just. In modern computers, the algorithmic process is divided
not into such small components as in the Turing machine. Vice versa,
there is a desire to enlarge the procedures performed by the machine.
For example, the addition operation in a Turing machine is a whole program,
and in a computer it is the simplest function.

"The mind is a mirror and on
the mirror of the mind is going
dust of desires ... erase
dust and Truth will appear
before you ... "

Slide 2

Introduction

The concept of an algorithm. An algorithm is an exact prescription that determines the computational process going from variable initial data to the desired result (Markov A.A.) Algorithm properties: 1) Discreteness. 2) Certainty. 3) Effectiveness. 4) Mass character.

Slide 3

Turing machine mathematical model

A Turing Machine (MT) is a mathematical model of an idealized digital computing machine. The device of the Turing machine. Ribbon. Reading head. Control device. Inner memory.

Slide 4

ribbon

Only one symbol (letter) from the external alphabet A = (˄, a1, a2,…, an-1), 2≥n can be written into cells at a discrete moment in time. An empty cell is denoted by the symbol ˄, and the symbol ˄ itself is called empty, while the rest of the characters are said to be non-empty.

Slide 5

Reading head

The head can read the contents of a cell and write into it a new character from the alphabet A. In one cycle of work, it can move only one cell to the right (P), left (L) or remain in place (H).

Slide 6

Inner memory

The internal memory of the machine is a certain finite set of internal states Q = (q0, q1,…, qm), m≥ 1. We assume that the cardinality | Q | ≥2. Two states of the machine are of particular importance: q1 is the initial internal state (there can be several initial internal states), q0 is the final state or stop state (the final state is always one). At each moment of time, the MT is characterized by the position of the head and the internal state.

Slide 7

Control device

Performs the following actions: Changes the character ai read at time t to a new character aj (in particular, leaves it unchanged, that is, ai = aj); Moves the head in one of the following directions: N, L, R; Changes the internal state of the machine qi existing at time t to the new qj, in which the machine will be at time t +1. Such actions of the control device are called a command, which can be written in the form: qiaiajDqj

Slide 8

Turing machine operation

The operation of the machine is completely determined by the task at the first (initial) moment: Words on the tape, that is, the sequence of characters written in the cells of the tape (a word is obtained by reading these characters along the cells of the tape from left to right); Head positions; The internal state of the machine.

Slide 9

If at the initial moment the words a1, a2, ˄, a1, a1 are written on the tape, then the initial configuration will be as follows: The operation of the Turing machine consists in the sequential application of commands, moreover, the use of one or the command is determined by the current configuration. So in the example above, the command with the left side q1a1 should be applied. The result of the machine's operation is the word that will be recorded on the tape in the final configuration, that is, in the configuration in which the internal state of the machine is q0.

Slide 10

Examples of Turing machines

Example 1. Construct a Turing machine T1 that is applicable to all words with an outer alphabet (a, b) and does the following: any word x1, x2 ... xn, where xi = a or xi = b (i = 1, 2 ... n) transforms into a word x2, ... xn, x1, i.e., starting to work with the word x1, x2 ... xn on the tape in the initial configuration, the machine will stop, and in the final configuration, on some section of the tape, the word x2, ... xn, x1 will be written, and all other cells of the tape (if any) will be empty.

Slide 11

Solution: For the outer alphabet of the machine T1 we take the set A = (˄, a, b), and for the inner alphabet - Q = (q0, q1, q2, q3). The commands are defined as follows: q1a ˄Пq2, q1b ˄Пq3, qiy ˄PPi, where yϵ (a, b), i = 2, 3; q2˄ aHq0, q3˄ bHq0 Consider the operation of the machine T1 on the word ba. In the operation of the machine on the word ba, the initial configuration is as follows:

A shorter record of this sequence of configurations, that is, the process of the machine's operation, will be: Thus, the word bbabb is transformed by the machine into the word babbb.

View all slides

Alan Turing

Alan Mathison Turing Alan Mathison Turing (English Alan Mathison Turing; June 23, 1912 - June 7, 1954) - English mathematician, logician, cryptographer, who had a significant impact on the development of computer science. Commander of the Order of the British Empire (1945), Fellow of the Royal Society of London (1951). The abstract computing "Turing Machine" proposed by him in 1936, which can be considered a general-purpose computer model, made it possible to formalize the concept of an algorithm and is still used in many theoretical and practical studies. Scientific works A. Turing is a recognized contribution to the foundations of computer science (and, in particular, the theory of artificial intelligence).

Time of War During World War II, Alan Turing worked at the Government Codes and Ciphers School located in Bletchley Park, where the work on cracking ciphers and Axis codes was concentrated. He led the group Hut 8, responsible for cryptanalysis of messages. navy Germany. Turing developed a number of hacking techniques, including the theoretical basis for the Bombe, the machine used to hack the German Enigma encryption device.

Turing Machine Within weeks of arriving at Blatchley Park, Turing wrote specifications for an electromechanical machine that could help break the Enigma more effectively than the Polish cryptological bomb. The Turing machine, with improvements proposed by the mathematician Gordon Welchman, has become an essential tool for deciphering Enigma messages. The car was named Bombe. The machine searched for possible settings used to encrypt messages (rotor order, rotor position, patch panel connections) based on known plaintext. For each possible rotor setting (which had 1019 states or 1022 in the modification used on submarines), the machine made a series of logical assumptions based on the plain text (its content and structure). Then the machine identified the contradiction, discarded the set of parameters and moved on to the next one. Thus, most of the possible sets were eliminated and only a few options remained for careful analysis. The first vehicle entered service on March 18, 1940. Enumeration of keys was performed due to the rotation of mechanical drums, accompanied by a sound similar to the ticking of a clock.

Colossus In July 1942, Turing took part in deciphering the Lorenz code used by the Germans to transmit messages to high command. "Lorenz" was much more complex than "Enigma" and could not be deciphered by existing methods. Turing proposed the use of vacuum tubes in the design of the decoder and brought in the team T. Flowers, an experienced electronic engineer. As a result of the joint efforts of mathematicians and engineers, "Colossus" was developed - one of the first computers in the world. By 1944, with the help of the Colossus, the Lorenz code had been cracked, which allowed the Allies to read all the correspondence of the highest German leadership. According to some estimates, this brought the defeat of Germany closer by several years.

Early Computers and the Turing Test From 1945 to 1947, Turing lived in Richmond and worked on the ACE (Automatic Computing Engine) at the National Physics Laboratory. On February 19, 1946, he presented what could be called the first detailed description of a computer with a program stored in memory. Von Neumann's unfinished work "First Draft EDVAC Report" (1945), preceded it, but was much less detailed, and according to the head of the mathematics department of the National Physics Laboratory - John Wurmsley: it contains a number of ideas that belong to Dr. Turing. Although the construction of the ACE was feasible, the secrecy surrounding Blatchley Park led to delays in the start of work, which disappointed Turing. Towards the end of 1947, he returned to Cambridge for a year's leave during which he productively worked on Intelligent Machinery, which had not been published during his lifetime. While Alan Turing was at Cambridge, the ACE Pilot was built in his absence. He performed his first program on May 10, 1950. Though full version ACE was never built, some computers had a lot in common with it, for example DEUCE and Bendix G-15

In 1948, Alan Turing received the title of Reader from the Mathematics Department of the University of Manchester. There, in 1949, he became director of the Computer Laboratory, where the programming of the Manchester Mark I was concentrated. At the same time, Turing continued to work on more abstract mathematical problems, and in his work "Computing Machinery and Intelligence" Mind ", October 1950) he turned to the problem of artificial intelligence and proposed an experiment that later became known as the Turing test. His idea was that a computer can be considered to "think" if the person interacting with it cannot distinguish the computer from another person in the process of communication. In this work, Turing suggested that instead of trying to create a program that simulates the mind of an adult, it would be much easier to start with the mind of a child and then teach it. CAPTCHA based on the reverse Turing test is widespread on the Internet. In 1948, Alan, together with his former colleague David Champernovn (English), began writing a chess program for a computer that did not yet exist. In 1952, without a suitable device for its execution, Turing played a game in which he simulated the actions of a machine, making one move every half an hour. The game was recorded and, as a result, the program lost to Turing's colleague Alec Glini, but won the game over Champernovna's wife. Turing also invented the LU expansion method in 1948, which is used today to solve equations.