LogoLogo
1.0.0
  • Home
  • Install
  • Docs
  • Contribute
  • Journey
  • Welcome
  • The Varphi Language Standard
    • Welcome
    • State Names
    • Tallies and Blanks
    • Head Directions
    • Lines
    • Comments
    • Varphi Programs
    • Addressing Ambiguities
  • Writing Varphi Programs
    • Your First Varphi Program
    • Running Varphi Programs
    • Debugging Varphi Programs
    • The Varphi VS Code Extension
    • Good Practices
    • More Examples
      • Addition By One
      • Add Two Numbers
      • Multiplication By Two
      • Rock, Paper, Scissors
      • Coin Flip
  • Turing Machine Theory
    • The Unary Number System
    • Turing Machine Tapes
    • Turing Machine Heads
    • Turing Machine States
    • Turing Machines
    • Nondeterministic Turing Machines
Powered by GitBook
LogoLogo

© 2025 Hassan El-Sheikha

On this page
  • The Tape
  • A Note On Representation Conventions

Was this helpful?

Edit on GitHub
Export as PDF
  1. Turing Machine Theory

Turing Machine Tapes

PreviousThe Unary Number SystemNextTuring Machine Heads

Last updated 4 months ago

Was this helpful?

The Tape

In the context of a Turing machine, the tape is a component that serves as a place to store information. The tape can be thought of as as paper that is divided into squares, which we will refer to as tape cells. Each tape cell can either

  1. Be left empty

  2. Contain a tally (i.e., 111)

A special thing about the tape, and also one of the reasons why Turing machines are strictly theoretical, is that it spans infinitely. That is, there are infinitely many empty tape cells spanning in both directions.

We can use the tape as a means of representing numbers. Since tape cells can only contain the symbol 111 if they are not left blank, we will have to use the unary number system to represent numbers. For example, here's a representation of a tape containing the decimal number 777, assuming the representation convention is to repeat 111 nnn times to represent a number n∈Z+n\in\mathbb{Z}^+n∈Z+.

As you can see, we represented the decimal number 777 by writing seven 111s side-by-side. On the left and right of the number are infinite tape cells that are blank.

Since we now have access to the concept of blank tape cells on our tape, we can also use such blank tape cells in our representation conventions. For example, here's a representation convention that allows for representing multiple numbers on the tape:

To represent a multiset of positive integers [x1,x2,...,xN][x_1,x_2,...,x_N][x1​,x2​,...,xN​], write x1x_1x1​ 111s, followed by a blank, followed by x2x_2x2​ 111s, followed by a blank, and so on...

We use the terms "a blank tape cell" and "a blank" interchangeably in this text.

Here's a representation of a tape containing the two decimal numbers 222 and 333:

A Note On Representation Conventions

With Turing machines, a restriction is placed on the initial state of the tape. It must contain at least one tally initially. Therefore, when choosing your representation convention for some domain, ensure that all elements of the domain can be represented using at least one tally.

Subsection of a tape whose only contents are the decimal number 777.
Subsection of a tape containing the decimal numbers 222 and 333.