Computability
Warm-upHumanThe one-state binary incrementer of the lesson starts on the least significant bit of (twenty-three). How many steps does it take before it halts?
The one-state binary incrementer of the lesson starts on the least significant bit of (twenty-three). How many steps does it take before it halts?
A Turing machine has states and the two symbols . Each of its table entries chooses a symbol to write, a direction (L or R) and a next state, which is one of the states or halt. How many different tables are there?
Which of these sets are recursively enumerable? (Select all that apply.)
In the proof that is undecidable we assumed a machine computing the total function . Suppose instead we only had a semi-decider for : it halts with output when and runs forever otherwise. Build as before (on input : run ; if it outputs , loop forever; otherwise halt). What happens?
You want to prove that a new set is undecidable, using the undecidability of . Which do you need to show?
For which of these properties of an index does Rice's theorem show that the set of with the property is undecidable? (Select all that apply.)
In Mathlib, c.eval n is the (partial) result of running program c : Nat.Partrec.Code on input n, and (c.eval n).Dom says that it halts. Which Lean statement says that halting on input n is undecidable?
Write run(machine, max_steps) that simulates a two-symbol Turing machine started in state 0 on a blank tape. machine is a dict mapping (state, symbol) to (write, move, next_state), with move in (-1, 1) and next_state equal to None for halt. Return ("halt", steps, ones) if it halts within max_steps steps (counting the halting step) and ("running", max_steps, ones) otherwise, where ones is the number of 1s on the tape at that moment.
We want to prove for all that the incrementer, started on the binary expansion of with the head on the last bit, halts with on the tape after steps, where is the number of trailing s. Which induction works?