Busy beaver
Informally, in theoretical computer science, the busy beaver game aims at finding a terminating program of a given size that produces the most output possible.
More precisely, the busy beaver game consists of designing a halting, binary-alphabet Turing machine which writes the most 1s on the tape, using only a given set of states. The rules for the 2-state game are as follows:
- the machine must have two states in addition to the halting state, and
- the tape initially contains 0s only.
An nth busy beaver, BB-n or simply "busy beaver" is a Turing machine that wins the n-state Busy Beaver Game. That is, it attains the largest number of 1s among all other possible n-state competing Turing Machines. The [|BB-2 Turing machine], for instance, achieves four 1s in six steps.
The Busy Beaver Game has implications in computability theory, the halting problem, and complexity theory. The concept was first introduced by Tibor Radó in his 1962 paper, "On Non-Computable Functions".
The game
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:- 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.
- The machine uses a single two-way infinite tape.
- The tape alphabet is, with 0 serving as the blank symbol.
- The machine's transition function takes two inputs:
The n-state busy beaver game is a contest to find such an n-state Turing machine having the largest possible score — the largest number of 1s on its tape after halting. A machine that attains the largest possible score among all n-state Turing machines is called an n-state busy beaver, and a machine whose score is merely the highest so far attained is called a champion n-state machine.
Radó required that each machine entered in the contest be accompanied by a statement of the exact number of steps it takes to reach the Halt state, thus allowing the score of each entry to be verified by running the machine for the stated number of steps.
Related functions
The busy beaver function Σ
The busy beaver function quantifies the maximum score attainable by a Busy Beaver on a given measure. This is a noncomputable function. Also, a busy beaver function can be shown to grow faster asymptotically than any computable function.The busy beaver function, Σ: N → N, is defined such that Σ is the maximum attainable score among all halting 2-symbol n-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.
This infinite sequence Σ is the busy beaver function, and any n-state 2-symbol Turing machine M for which σ = Σ is called a busy beaver. Note that for each n, there exist at least four n-state busy beavers.
Non-computability
Radó's 1962 paper proved that if f: ℕ → ℕ 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 and Σ = 13. Σ has not yet been determined for any instance of n > 4, although lower bounds have been established.
In 2016, Adam Yedidia and Scott Aaronson obtained the first upper bound on the minimum n for which Σ 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. This was later reduced to 1919 states, with the dependency on the stationary Ramsey property eliminated, and later to 748 states.
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 proved 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. = n", and there are infinitely many true-but-unprovable sentences of the form "ΣMaximum shifts function ''S''
In addition to the function Σ, Radó introduced another extreme function for the BB-class of Turing machines, the maximum shifts function, S, defined as follows:- s = the number of shifts M makes before halting, for any M in En,
- S = max = 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 hadn't 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: 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 hasn't 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. 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, thus proving the conjecture that S = 21, and determining that Σ = 6 by the procedure just described.
Inequalities relating Σ and S include the following, which are valid for all n ≥ 1:
and an asymptotically improved bound : there exists a constant c, such that for all n ≥ 2,
There is tendency S to be near square of Σ, and in fact many machines give S less than Σ 2.
[|Known values] for Σ and ''S''
The function values for Σ and S are only known exactly for n < 5.The current 5-state busy beaver champion produces 1s, using steps, but there remain 18 or 19 machines with non-regular behavior which are believed to never halt, but which have not yet been proven to run infinitely. Skelet lists 42 or 43 unproven machines, but 24 are already proven. The remaining machines have been simulated to 81.8 billion steps, but none halted. Daniel Briggs also proved some machines. Another source says 98 machines remain unproven. There is an analysis of holdouts. So, it is very likely that Σ = 4098 and S = 47176870, but this remains unproven, and it is unknown if there are any holdouts left. At the moment the record 6-state champion produces over , using over . As noted above, these are 2-symbol Turing machines.
A simple extension of the 6-state machine leads to a 7-state machine which will write more than 10101010 1s to the tape, but there are undoubtedly much busier 7-state machines. However, other busy beaver hunters have different sets of machines.
Milton Green, in his 1964 paper "A Lower Bound on Rado's Sigma Function for Binary Turing Machines", constructed a set of Turing machines demonstrating that
where ↑ is Knuth up-arrow notation and A is Ackermann's function.
Thus
, and
where the number g1 is the enormous starting value in the sequence that defines Graham's number.
In 1964 Milton Green developed a lower bound for the Busy Beaver function that was published in the proceedings of the 1964 IEEE symposium on switching circuit theory and logical design. Heiner Marxen and Jürgen Buntrock described it as "a non-trivial lower bound". This lower bound can be calculated but is too complex to state as a single expression in terms of n. When n=8 the method gives
Σ ≥ 3 × / 2 ≈ 8.248×1044.
It can be derived from current lower bounds that:
In contrast, the best current lower bound on Σ is, which is greater than the lower bound given by Green's formula, 33 = 27. In fact, it is much greater than the lower bound: 3 ↑↑ 3 = 333 =, which is Green's first lower bound for Σ, and also much greater than the second lower bound: 3*/2.
Σ is by the same way much, much greater than current common lower bound 331, so the second lower bound is also very, very weak.
Proof for uncomputability of ''S''(''n'') and Σ(''n'')
Suppose that S is a computable function and let EvalS denote a TM, evaluating S. Given a tape with n 1s it will produce S 1s on the tape and then halt. Let Clean denote a Turing machine cleaning the sequence of 1s initially written on the tape. Let Double denote a Turing machine evaluating function n + n. Given a tape with n 1s it will produce 2n 1s on the tape and then halt.Let us create the composition Double | EvalS | Clean and let n0 be the number of states of this machine. Let Create_n0 denote a Turing machine creating n0 1s on an initially blank tape. This machine may be constructed in a trivial manner to have n0 states. Let N denote the sum n0 + n0.
Let BadS denote the composition Create_n0 | Double | EvalS | Clean. Notice that this machine has N states. Starting with an initially blank tape it first creates a sequence of n0 1s and then doubles it, producing a sequence of N 1s. Then BadS will produce S 1s on tape, and at last it will clear all 1s and then halt. But the phase of cleaning will continue at least S steps, so the time of working of BadS is strictly greater than S, which contradicts to the definition of the function S.
The uncomputability of Σ may be proved in a similar way. In the above proof, one must exchange the machine EvalS with EvalΣ and Clean with Increment — a simple TM, searching for a first 0 on the tape and replacing it with 1.
The uncomputability of S can also be established by reference to the blank tape halting problem. The blank tape halting problem is the problem of deciding for any Turing machine whether or not it will halt when started on an empty tape. The blank tape halting problem is equivalent to the standard halting problem and so it is also uncomputable. If S was computable, then we could solve the blank tape halting problem simply by running any given Turing machine with n states for S steps; if it has still not halted, it never will. So, since the blank tape halting problem is not computable, it follows that S must likewise be uncomputable.
Generalizations
For any model of computation there exist simple analogs of the busy beaver. For example, the generalization to Turing machines with n states and m symbols defines the following generalized busy beaver functions:- Σ: the largest number of non-zeros printable by an n-state, m-symbol machine started on an initially blank tape before halting, and
- S: the largest number of steps taken by an n-state, m-symbol machine started on an initially blank tape before halting.
It is possible to further generalize the busy beaver function by extending to more than one dimension.
Likewise we could define an analog to the Σ function for register machines as the largest number which can be present in any register on halting, for a given number of instructions.
Exact values and lower bounds
The following table lists the exact values and some known lower bounds for S and Σ for the generalized busy beaver problems. Note: entries listed as "???" are bounded from below by the maximum of all entries to left and above. These machines either haven't been investigated or were subsequently surpassed by a smaller machine.The Turing machines that achieve these values are available on webpage. Each of these websites also contains some analysis of the Turing machines and references to the proofs of the exact values.
Applications
In addition to posing a rather challenging mathematical game, the busy beaver functions offer an entirely new approach to solving pure mathematics problems. Many open problems in mathematics could in theory, but not in practice, be solved in a systematic way given the value of S for a sufficiently large n.Consider any conjecture that could be disproven via a counterexample among a countable number of cases. Write a computer program that sequentially tests this conjecture for increasing values. In the case of Goldbach's conjecture, we would consider every even number ≥ 4 sequentially and test whether or not it is the sum of two prime numbers. Suppose this program is simulated on an n-state Turing machine. If it finds a counterexample, it halts and notifies us. However, if the conjecture is true, then our program will never halt.
Now, this program is simulated by an n-state Turing machine, so if we know S we can decide whether or not it will ever halt by simply running the machine that many steps. And if, after S steps, the machine does not halt, we know that it never will and thus that there are no counterexamples to the given conjecture. This would prove the conjecture to be true.
Thus specific values for S could be used to systematically solve many open problems in mathematics. However, current results on the busy beaver problem suggest that this will not be practical for two reasons:
- It is extremely hard to prove values for the busy beaver function. It has only been proven for extremely small machines with fewer than 5 states, while one would presumably need at least 20-50 states to make a useful machine. Furthermore, every known exact value of S was proven by enumerating every n-state Turing machine and proving whether or not each halts. One would have to calculate S by some less direct method for it to actually be useful.
- But even if one did find a better way to calculate S, the values of the busy beaver function get very large, very fast. S > 10 already requires special pattern-based acceleration to be able to simulate to completion. Likewise, we know that S > Σ > 3 ↑↑↑ 3 is a gigantic number and S > Σ > G, where G is Graham's number - an enormous number. Thus, even if we knew, say, S, it is completely unreasonable to run any machine that number of steps. There is not enough computational capacity in the known part of the universe to have performed even S operations directly.
Notable instances
Examples
These are tables of rules for the Turing machines that generate Σ and S, Σ and S, Σ, Σ and S, and the best known lower bound for Σ and S, and Σ and S.In the tables, columns represent the current state and rows represent the current symbol read from the tape. Each table entry is a string of three characters, indicating the symbol to write onto the tape, the direction to move, and the new state. The halt state is shown as H.
Each machine begins in state A with an infinite tape that contains all 0s. Thus, the initial symbol read from the tape is a 0.
Result key:
Result: 0 0 0
Result: 0 0 1 1 1 0 0
Result: 0 0 1 1 1 1 0 0.
Unlike the previous machines, this one is a busy beaver only for Σ, but not for S.
Result: 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0
Result: 4098 "1"s with 8191 "0"s interspersed in 47,176,870 steps.
Result: ≈3.515 × 1018267 "1"s in ≈7.412 × 1036534 steps.