Is the following problem χ-decidable?
is-pow ∈ CExp → Bool
is-pow p = if ∀ m ∈ ℕ. ∀ n ∈ ℕ. p ⌜(m, n)⌝ ⇓ ⌜mn⌝ then true else false
You can assume that 00 = 1.
Is the following problem χ-decidable?
is-pow ∈ { (f, e) | f ∈ ℕ × ℕ → ℕ, e ∈ CExp, e implements f } → Bool
is-pow (f, _) = if ∀ m ∈ ℕ. ∀ n ∈ ℕ. f (m, n) = mn then true else false
You can assume that 00 = 1.
Show how one can, for an arbitrary n ∈ ℕ, construct a Turing machine that, if started on an empty tape (containing nothing but blanks), terminates with n contiguous ones on the tape, and the head at the tape's left end.
You may wish to use Anthony Morphett's Turing machine simulator. (If you go to "Advanced options", then you can choose to use semi-infinite tapes.)
Implement a Turing machine that adds one natural number to another. If the input consists of 1m01n0 (for m, n ∈ ℕ), i.e. m ones followed by a zero, n ones, and a final zero, then the machine should terminate with 1m + n0.
Bonus exercise: Implement truncated subtraction (λ m n. max 0 (m - n)).
What does the following Turing machine do?
Input alphabet: {0, 1}.
Tape alphabet: {0, 1, #, ␣}.
States: {s₀, s₁, s₂, s₃}.
Initial state: s₀.
Transition function:
What does the following Turing machine do when given input of the form 111…1#111…1?
Input alphabet: {1, #}.
Tape alphabet: {1, #, ., ␣}.
States: {s₀, s₁, s₂, s₃, s₄, s₅, s₆, s₇, s₈, s₉}.
Initial state: s₀.
Transition function:
Suggest a method for representing χ programs as strings suitable for manipulation by a Turing machine.
What properties does your method have?