Lably
Skip to content

Busy beaver

Concept in theoretical computer science

  • 23 min read
  • 6 chapters

Related on Lably

Through Computer program, Turing machine and Binary number

Turing machines consist of an infinite tape, and a finite set of states which serve as the program's "source code". Producing the most output is defined as writing the largest number of 1s on the tape, also referred to as achieving the highest score, and running for the longest time is defined as taking the longest number of steps to halt. The n-state busy beaver game consists of finding the longest-running or highest-scoring Turing machine which has n states and eventually halts. Such machines are assumed to start on a blank tape, and the tape is assumed to contain only zeros and ones (a binary Turing machine). The objective of the game is to program a set of transitions between states aiming for the highest score or longest running time while making sure the machine will halt eventually.

Deciding the running time or score of the nth busy beaver is noncomputable. In fact, both the functions Σ(n) and S(n) eventually become larger than any computable function. This has implications in computability theory, the halting problem, and complexity theory. The concept of a busy beaver was first introduced by Tibor Radó in his 1962 paper, "On Non-Computable Functions".

An implication of the busy beaver game is that, if it were possible to compute the functions Σ(n) and S(n) for all n, then this would resolve all mathematical conjectures that can be reduced to a halting problem, e.g., into a form of "does ⟨this Turing machine⟩ halt". For example, there is a 25-state Turing machine that checks Goldbach's conjecture for each number and halts on a counterexample; if this machine did not halt after running for S(25) steps, then it must run forever, resolving the conjecture. Many other problems, including the Riemann hypothesis (120 states) and the consistency of ZF set theory (745 states), can be expressed in a similar form, where at most a countably infinite number of cases need to be checked.

Technical definition

The n-state busy beaver game (or BB-n game), introduced in Tibor Radó's 1962 paper, involves a class of Turing machines, each member of which is required to meet the following design specifications:

  • The machine has n "operational" states plus a Halt state, where n is a positive integer, and one of the n states is distinguished as the starting state. (Typically, the states are labelled by 1, 2, ..., n, with state 1 as the starting state, or by A, B, C, ..., with state A as the starting state.)
  • The machine uses a single two-way infinite (or unbounded) tape.
  • The tape alphabet is {0, 1}, with 0 serving as the blank symbol.
  • The machine's transition function takes two inputs:
    • the current non-Halt state,
    • the symbol in the current tape cell,
    and produces three outputs:
    • a symbol to write over the symbol in the current tape cell (it may be the same symbol as the symbol overwritten),
    • a direction to move (left or right; that is, shift to the tape cell one place to the left or right of the current cell), and
    • a state to transition into (which may be the Halt state).

"Running" the machine consists of starting in the starting state, with the current tape cell being any cell of a blank (all-0) tape, and then iterating the transition function until the Halt state is entered (if ever). If and only if the machine eventually halts, then the number of 1s finally remaining on the tape is called the machine's score. An n-th busy beaver, BB-n or simply "busy beaver" is a Turing machine that wins the n-state busy beaver game. Depending on definition, it either attains the highest score (denoted by Σ(n)), or runs for the longest time (S(n)), among all other possible n-state competing Turing machines.

Example

The rules for one 1-state Turing machine might be:

  • In state 1, if the current symbol is 0, write a 1, move one space to the right, and transition to state 1
  • In state 1, if the current symbol is 1, write a 0, move one space to the right, and transition to HALT

This Turing machine would move to the right, swapping the value of all the bits it passes. Since the starting tape is all 0s, it would make an unending string of ones. This machine would not be a busy beaver contender because it runs forever on a blank tape.

Sign in to keep reading

5 more chapters are free with a Lably account.

More in Topics in mathematics