:输入字母表 (the input alphabet not containing the blank symbol)
:带子字母表 (the tape alphabet containing the blank symbol)
(Left, right)
Can a Turing machine contain just a single state?
No, . So, a Turing machine contains at least two states.
图灵机格局
(CS355 & CS370 两门课程对格局的画法略有不同)
🧻
The configuration of a Turing Machine captures its current state, the current tape contents, and the current position of the machine's head on the tape. A configuration essentially provides a snapshot of the machine at a particular moment in its computation.
图灵机 的格局是 的成员
: the set of halting states; is the start state.
: the tape content to the left of the tape head
: the start of the tape(虽然带有左端,但它向右无限延伸。为防止机器
把带头移出带左端, 我们假定带的最左端总是用 表示)
: a sequence (possibly empty) of symbols from the tape alphabet
: blank symbol
即除非当前正在扫描空格符,否则所有格局都用左端符开始并且永远不用空格符结束
are configurations.
are not configurations.
可以使用简化记号来描述带内容(包括带头位置),例如把 写为
Where underlined position indicates the head position.
图灵机记号
🧻
If and are Turing machines then we could combine them to have new TM.
we know that , then we can display the machine above as (simply , or even )
Zig-zag across the tape to corresponding positions on either side of the # symbolto check whether these positions contain the same symbol. If they do not, or if no # is found, reject. Cross off symbols as they are checked to keep track of which symbols correspond.
When all symbols to the left of the # have been crossed off, check for any remaining symbols to the right of the #. If any symbols remain, reject; otherwise, accept.
{w| w contains an equal number of 0s and 1s}
课本答案
“ On input string w:
Mark the first unmarked 0 by scanning the tape. If there are no unmarked 0, go to step 4. Else, move the head back to the front of the tape.
Mark the first unmarked 1 by scanning the tape. If there is no unmarked 1, then reject.
Place the head back to the front of the tapeandrepeat stage 1.
Place the head back to the front of the tape and check if any unmarked 0’s or 1’s remain by scanning the tape. If there are none, accept else it reject.”
个人版本
“ On input string w:
Scan the tape and find 0, then mark it.
Scan the tape and find 1, then mark it.
Repeat stage 1 and 2 in sequence until there is no 0 found