CS 461 / COMPUTABILITY LAB

A machine that reads a machine.

Load a seven-tuple and a word. Watch a fixed five-tape universal Turing machine interpret its encoding.

The input describes a Turing machine M and the word w you want it to process. Enter the machine’s seven-tuple, followed by a comma and the word:

(Q, Σ, Γ, δ, q0, qaccept, qreject),w

Reading a transition

Sipser’s transition function has the form δ: Q × Γ → Q × Γ × {L,R}. It takes a state and a tape symbol and returns a new state, a symbol to write, and a direction.

δ(q0,1) = (q1,1,R)

This means: while in state q0, if the head reads 1, enter q1, write 1, and move one cell right.

In this textbox, write the same rule as:

((q0,1),(q1,1,R))

The outer ordered pair contains an input pair (q0,1) and an output triple (q1,1,R). The surrounding braces collect all these rules into a set. This nested-pair syntax is the application’s text encoding of the function; Sipser’s Section 3.1, Definition 3.3 supplies the mathematical transition-function definition.

Blank symbols and the input word

_ means a blank tape symbol, not a space character. It is an easy-to-type substitute for Sipser’s ⊔. For example, ((q0,_),(qr,_,R)) means: in state q0, read a blank, write a blank, move right, and enter qr.

Write only the word after the tuple, for example ...,q0,qa,qr),11011. The remaining tape cells are automatically blank; do not append blank markers. Use eps for the empty word. Spaces and line breaks in the description are formatting, not tape symbols.

The example machine accepts binary strings ending in 1, so 11011 is accepted. Changing the word to 11010 produces rejection.

(Q, Σ, Γ, δ, q0, qaccept, qreject),w
Transition: ((q0,0),(q1,1,R)). Blank: _, □, or <blank>. Empty word: eps.

Ready

How this implementation works

The front end validates Sipser-style set notation and encodes the finite description in unary over a fixed alphabet. Initially only Tape 1 is populated. U initializes its other tapes and scans the encoded rules. Its finite control never reads the JavaScript representation of M.

Tapes 4 and 5 are stacks representing the cells left and right of the simulated head. Tape 3 contains the current symbol. A left move at the leftmost simulated cell stays there. Symbols and ordinary states have positive unary codes; A and R encode the accept and reject states. The blank has code 1.

Every displayed U step is a current-cell branch, a write, a one-cell head movement, or a control transfer. These are multitape TM transitions with stationary moves allowed. U uses a finite, fixed control graph; changing M changes only the initial tape. Acceptance and rejection are distinct. A budget stop is inconclusive and can be resumed.

In this web demonstration the tapes grow as needed within available computer memory. The mathematical machine has unbounded tapes. There is no arbitrary limit of 26 simulated states.