Busy beaver
In theoretical computer science, the busy beaver game aims to find a terminating program of a given size that either produces the most output possible, or runs for the longest number of steps. Since an endlessly looping program producing infinite output or running for infinite time is easily conceived, such programs are excluded from the game. Rather than traditional programming languages, the programs used in the game are n-state Turing machines, one of the first mathematical models of computation.
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. 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.
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, or runs for the longest time, among all other possible n-state competing Turing machines.
Deciding the running time or score of the nth busy beaver is noncomputable. In fact, both the functions Σ and S 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".
One of the most consequential aspects of the busy beaver game is that, if it were possible to compute the functions Σ and S for all n, then this would resolve all mathematical conjectures which can be encoded in the form "does 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 steps, then it must run forever, resolving the conjecture. Many other problems, including the Riemann hypothesis and the consistency of ZF set theory, 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, 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:"Running" the machine consists of starting in the starting state, with the current tape cell being any cell of a blank tape, and then iterating the transition function until the Halt state is entered. If and only if the machine eventually halts, then the number of 1s finally remaining on the tape is called the machine's score. The n-state busy beaver game is therefore a contest, depending on definition to find such an n-state Turing machine having the largest possible score or running time.
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
Functions
In his original 1962 paper, Radó defined two functions related to the busy beaver game: the score function Σ and the shifts function S. Both take a number of Turing machine states and output the maximum score attainable by a Turing machine of that number of states by some measure. The score function Σ gives the maximum number of 1s an -state Turing machine can output before halting, while the shifts function S gives the maximum number of shifts that an -state Turing machine can undergo before halting. He proved that both of these functions were noncomputable, because they each grew faster than any computable function. The function BB has been defined to be either of these functions, so that notation is not used in this article.A number of other uncomputable functions can also be defined based on measuring the performance of Turing machines in other ways than time or maximal number of ones. For example:
- The function is defined to be the maximum number of contiguous ones a halting Turing machine can write on a blank tape. In other words, this is the largest unary number a Turing machine of n states can write on a tape.
- The function is defined to be the maximal number of tape squares a halting Turing machine can read before halting. This includes the starting square, but not a square that the machine only reaches after the halt transition, because that square does not influence the machine's behaviour. This is the maximal space complexity of an n-state Turing machine.
Score function Σ
The score function quantifies the maximum score attainable by a busy beaver on a given measure. This is a noncomputable function, because it grows asymptotically faster than any computable function.The score function,, is defined so that is the maximum attainable score among all halting 2-symbol -state Turing machines of the above-described type, when started on a blank tape.
It is clear that is a well-defined function: for every n, there are at most finitely many n-state Turing machines as above, up to isomorphism, hence at most finitely many possible running times.p. 880
According to the score-based definition, any n-state 2-symbol Turing machine M for which is called a busy beaver. For each n, there exist at least 4! n-state busy beavers.
Non-computability
Radó's 1962 paper proved that if is any computable function, then Σ > f for all sufficiently large n, and hence that Σ is not a computable function.Moreover, this implies that it is undecidable by a general algorithm whether an arbitrary Turing machine is a busy beaver.
Even though Σ is an uncomputable function, there are some small n for which it is possible to obtain its values and prove that they are correct. It is not hard to show that Σ = 0, Σ = 1, Σ = 4, and with progressively more difficulty it can be shown that Σ = 6, Σ = 13 and Σ = 4098. Σ has not yet been determined for any instance of n > 5, although lower bounds have been established.
Complexity and unprovability of Σ
A variant of Kolmogorov complexity is defined as follows: The complexity of a number n is the smallest number of states needed for a BB-class Turing machine that halts with a single block of n consecutive 1s on an initially blank tape. The corresponding variant of Chaitin's incompleteness theorem states that, in the context of a given axiomatic system for the natural numbers, there exists a number k such that no specific number can be proven to have complexity greater than k, and hence that no specific upper bound can be proven for Σ. As mentioned in the cited reference, for any axiomatic system of "ordinary mathematics" the least value k for which this is true is far less than 10⇈10; consequently, in the context of ordinary mathematics, neither the value nor any upper-bound of Σ can be proven.Maximum shifts function ''S''
In addition to the function Σ, Radó introduced another extreme function for Turing machines, the maximum shifts function, S, defined as follows:- = the number of shifts M makes before halting, for any,
- = the largest number of shifts made by any halting n-state 2-symbol Turing machine.
Radó showed that S is noncomputable for the same reason that Σ is noncomputable – it grows faster than any computable function. He proved this simply by noting that for each n, S ≥ Σ. Each shift may write a 0 or a 1 on the tape, while Σ counts a subset of the shifts that wrote a 1, namely the ones that had not been overwritten by the time the Turing machine halted; consequently, S grows at least as fast as Σ, which had already been proved to grow faster than any computable function.
The following connection between Σ and S was used by Lin & Radó to prove that Σ = 6 and that S=21: For a given n, if S is known then all n-state Turing machines can be run for up to S steps, at which point any machine that has not yet halted will never halt. At that point, by observing which machines have halted with the most 1s on the tape, one obtains from their tapes the value of Σ. The approach used by Lin & Radó for the case of n = 3 was to conjecture that S = 21, then to simulate all the essentially different 3-state machines for up to 21 steps. They found 26,073 machines that halted, including one that halted only after 21 steps. By analyzing the behavior of the machines that had not halted within 21 steps, they succeeded in showing that none of those machines would ever halt, most of them following a certain pattern. This proved the conjecture that S = 21, and also determined that Σ = 6, which was attained by several machines, all halting after 11 to 14 steps.
In 2016, Adam Yedidia and Scott Aaronson obtained the first upper bound on the minimum n for which S is unprovable in ZFC. To do so they constructed a 7910-state Turing machine whose behavior cannot be proven based on the usual axioms of set theory, under reasonable consistency hypotheses. Stefan O'Rear then reduced it to 1919 states, with the dependency on the stationary Ramsey property eliminated, and later to 748 states. In July 2023, Riebel reduced it to 745 states. Further improvements are reported on the .