# Program Examples

## A 3-State Busy Beaver

The busy beaver problem is an interesting theoretical computer science problem. The problem is to find the smallest number of states that outputs as much data as possible yet eventually halts on its own. More formally it goes something like this — given an n-state Turing machine with a two symbol alphabet {0, 1}, what is the maximum number of 1s that the machine may print on an initially blank tape before halting?

This problem turns out to be non-computable, that is, for a small number of
states an answer can be found, but in general it cannot be solved.
Theorists call such problems non-computable. The number of steps it takes to
run to completion (halt) grows very rapidly as the number of states increase.
This 3-state example takes 14 steps while the 4-state example takes
107 steps. Increasing from there, a 5-state example has been found that takes
47,176,870 steps, and a 6-state example that takes 2.584 x10^{2879} steps.
I will not be trying any of these in the near future.

### The States Used For This Example (Explanation of the Programming Syntax Used)

(0,0) -> (1,1) Right (0,1) -> (0,1) Halt (0,B) -> (1,1) Right (1,0) -> (2,0) Right (1,1) -> (1,1) Right (1,B) -> (2,0) Right (2,0) -> (2,1) Left (2,1) -> (0,1) Left (2,B) -> (2,1) Left

## The Essential Turing

The papers in this book are the key works for understanding Turing's phenomenal contribution.

## The New Turing Omnibus

Sixty-Six Excursions in Computer Science.

## Programming the Propeller Microcontroller

Get the authoritative guide to the Parallax Propeller chip.