Lecture 8 - Turing Machines Flashcards
What does a Turing Machine consist of?
- finite alphabet (includes blank symbols)
- unbounded tape of squares, each square can hold one single symbol
- tape is unbounded in both directions
- we can read and write to the squares
- a start state
- two halt states Sy and Sn - depending on output
- the transition function / program
What does the transition relation in a Turing Machine do?
in state s , we can read a symbol on the tape , move to another state , overwrite the symbol and move left or right on the tape
What happens if we don’t want to overwrite the symbol we read?
we simply write it back to the square before moving onto the next state (
What happens if T halts in Sy?
The answer is yes
What happens if T halts in Sn?
The answer is no.
Main way of answering TM questions
pseudocode
What does a turing machine actually compute?
accepts a language that actually computes a functions f(x)
What does a function computed by turing return?
1 if the input is in the language or 0 otherwise
What needs to be added if our TM if we are computing a function?
- we need a set of halting states
- a function f(x) = y
where x is the input , y is the tape on output
How can we output 1 or 0 from the TM?
instead of entering Sy we wrie 1 on the tape and enter a halt state
instead of entering Sn we write 0 on the tape and enter a halt state
How should you go about designing a turing machine for functions?
Try a couple of examples, work out pattern
When is a language Turing-recognizable?
If some TM recognises it with the given input x. The turing machine will halt in Sy.
Non-recognisable means halts in Sn or fails to halt.
When is a language Turing-decidable?
When the tm decides it given an input string. The turing machine will halt in Sy - with a yes.
Non decidable means No is returned or fails to halt.
decidable is recognisable , but with a decision problem
Is every decidable language recognisable?
Yes, but not every recognisable language is decidable.
When is something Turing Computable?
There is a turing machine M such that for any input the machine M halts with the output f(x).