# Turing machine: what it is and how it works

We cannot conceive of the historical moment in which we live without considering the importance of information technology. In just a few years it has gone from being used in specific fields to being a ubiquitous entity, and not only in computers, but also in mobile phones and in almost all commonly used technologies (such as the so-called “wearables”).

In fact, the computer or mobile phone you use to read this article has such technology that just a few decades ago it would have needed a huge space to work (or it would have been totally unfeasible). The fact is that today we are moving towards an extraordinary miniaturisation of computer components, which will extend their use and facilitate their expansion to all areas of life.

The advance to which technology subjects us is unstoppable, to the point that without it we could no longer live optimally. Our species depends on computers, because today’s society is so complex that the naked cognitive functions no longer allow it to be managed successfully, requiring external help to compensate for our shortcomings.

In this text we will see **what the concept of Turing’s machine** consists of, created in the middle of the 30th century. Its contribution to computing as we know it today is evident, considering it to be the model on which the logic and architecture of today’s computers are based. That is: the mother of a technology that has changed not only the world, but also the horizon of humanity.

## What is Turing’s machine?

Turing’s machine is a device created in 1936, which represents **an idealized model of computing capable of storing/processing virtually infinite information** . The system is a mathematical abstraction that is constructed in an extraordinarily simple way, but that facilitates the empiricist verification of a wide range of questions about the theories of computability and/or complexity. Its conception marked a great milestone in the history of computing, to the point that it is considered to be the origin of today’s computers (and related technologies such as tablets or mobile phones).

**The architect of this one was Alan M. Turing, an English mathematician and logician** who sought all his life to conceive a theoretical model with which to answer the unknowns of his discipline, in an automatic way and accessible to all.

This British genius, whose historical importance cannot be questioned, also contributed (along with several Polish scientists) to unraveling the cryptographic codes that the Nazi military used to communicate secretly with each other during the sad Second World War (through what became known as the enigma machine). To this end, he devised an electromagnetic cut-off device (pump), the use of which shortened the duration of the conflict and saved countless human lives by allowing the regime’s plans to be revealed during the time the hostilities continued.

Turing’s machine **is the historical precursor of the modern “stored program computers”** , which allow both the storage of data and the algorithms on which they are built. Its advantage, and one of the factors by which it generates fascination in the theoreticians of the calculation, is its simplicity and its enormous possibilities of configuration at technical level; and it is that it makes possible the experimentation through how its physical elements are arranged and the “question” with which its use is programmed (by means of algorithms, that are translated in a “succession” of codes that are inspired by the logical language). This versatile capacity is due to the very nature of the data with which it operates, subject to an enormous level of abstraction.

In this way, Turing’s machine **can be programmed to execute instructions of a specific character, which answer more or less complex questions** . All this implies that it is necessary to know its particular language, with the aim of adapting the algorithm to it for its operation, aware that there is no universal code to clarify all the mathematical unknowns that lie dormant in nature itself (as indicated by Church-Turing’s law). Therefore, the system requires a human mind behind, that asks itself the doubt to formulate and that knows how to “address” the device to solve it.

**The raw material of Turing’s machine are the computable numbers** , that is, those that can be calculated in an objective way by means of a mathematical formula, and at the threshold of a reasonable time. In this context, it is basic that it be adapted to two specific “problems”: that of decision (each answer is preceded by a series of previous calculation elements that can be answered dichotomously as yes/no) and that of stop (recognizing if the final answers are really possible, or if the system will be “condemned” to process the order in an infinite/unsolvable cycle). That is, that there is a specific algorithm for what you want to know and that your technology can respond with the necessary precision to “stop” and offer a solution.

Up to this point the theoretical logics of a Turing machine have been discussed in detail. In the following lines we will go deeper into the core of its physical and/or functional features, with which the algorithm or operating rule that the user has set up can be executed (and which can range from simple equations to the very core of the law of mathematical abstraction).

## Description of the Turing machine

In addition to the logical/mathematical basis described above, the Turing machine requires a number of physical elements, which have the function of executing the previously entered commands. The arrangement of these can be diverse, as there would be almost an infinite number of designs of this system, but the following are necessarily required: a paper tape or similar material, a mobile head whose end is capable of performing traces (symbols or numbers) and a central processor in which to code the algorithms that are required or that facilitate the analysis.

The tape is the most essential element of all of them. It is only a longitudinal strip, which is divided into a succession of squares of equal size (or boxes), and whose length will depend largely on the “effort” that must be made to solve the question posed by the user (it can be as short or as long as deemed relevant). **The boxes are reserved for the head to draw different symbols (such as 0-1 in the binary code) in each one** , and constitute the calculation product to be checked after its stop. In computer terms, these tapes could be the memory of a modern computer. The first cells usually have a content already established (input), leaving the rest empty and ready to be occupied after the computing process.

Turing’s machine **also consists of a spindle, a mechanical (mobile) appendage that moves to the left or to the right following the command that the system provides for it** . At its end it has an elongation capable of recording a line on the tape, giving its shape to the corresponding numbers or figures according to the code that determines the movement. The original model had a rudimentary technology head, but the advance in the fields of robotics has allowed the irruption of new more advanced and precise designs. The head “reads” the contents of the cells and moves a single box to either side (depending on its specific state) to continue executing the instruction.

Thirdly, there is **a central processor to which is assigned the function of storing code and algorithms containing instructions** for the activity of the device, expressed in mathematical and logical terms. This language has a universal nuance, although it allows a certain degree of manoeuvrability to introduce operational expressions formulated by the user (provided that he has operationalized the meaning). In this way, its head would facilitate the execution of instructions stored in the processor, which would be equivalent to what is known today as programs or applications (app). This system would allow any possible calculation to be reproduced and would stand out as the predecessor of any of today’s computers.

## Operation of this device

A Turing machine is designed for the engraving of a specific sample of symbols or numbers, whose possible universe is often called “alphabet”. When it works with binary code, its total alphabet is two (0 or 1), but it can be as wide as it is considered suitable for the function to be performed. The head will only be able to reproduce in the cells of the tape what has been previously indicated in such a system, so a calculation (“pi” number, for example) will require the full spectrum of numbers (from 0 to 9).

In addition to this, what is known in practice as **states (Q) are also often contemplated, which are also programmed by the user during the description of the code** (and which are labelled as q1, q2, q3, q4… qn). The total range depends on abstract mathematical hypotheses, and outlines the conditional shades of the logical formula of the code, in order for the head to move in the appropriate direction and perform the relevant action (“if you are at position q2, type “0” and don’t move”, e.g.).

Finally, there would be a “transition” (delta) function, which summarizes the total sequence (step by step) of the mathematical processing, and which expresses the complete instruction: cell reading, symbol rewriting, state changes (or not) and head movement; in a recurring cycle that stops when the answer to the initial question is found, or also when the user has foreseen it within his code (often by means of an exclamation, which is read as “stop”). As soon as the machine stops moving, the tape is retrieved and it is analyzed in detail what answer it has provided.

As can be seen, **there is a clear similarity between Turing’s machine and the computers we use today** . His contribution has been key to advancing exponentially in all subsequent computer design, to the extent that its spirit lies at the very heart of a technology that allows us to remain interconnected.

#### Bibliographic references:

- Khan, S. and Khiyal, M. (2006). Turing Model for Distributed Computing. Information Technology Journal. 5, 305-313.
- Qu, P., Yan, J., Zhang, Y. and Gao, G. (2017). Parallel Turing Machine, a Proposal. Journal of Computer Science and Technology, 32, 269-285.