Open essepuntato opened 2 weeks ago
I haven't checked all the possible combinations for this but I am pretty sure it should work
input: '11011' blank: ' ' start state: step table: step: 0 : R 1 : {R: yes1} ' ': {L: result0}
yes1: 0 : R 1 : {R: yes2} ' ': {L: result0}
yes2: 0 : R 1 : {L: result1} ' ': {L: result0}
result0: [0,1] : L ' ' : {write: 0, L: done}
result1: [0,1] : L ' ' : {write: 1, L: done} done:
Thanks for Regina's example. Now I know what is the meaning of ' ': {L: done}.
input: 'x11111' #or whatever sequence of 0 and 1 with "x" as starting position blank: ' ' start state: start
table: start: 'x': {R: q1} q0:
'x': {write: 0, L:}
q1: '1': {R: q2} '0': {R: q1} ' ': {L: q0} q2: '1': {R: q3} '0': {R: q2} ' ': {L: q0} q3: '1': {L: q4} '0': {R: q3} ' ': {L: q0} q4:
'x': {write: 1, L:}
done:
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
Current State | Current Symbol | Write Symbol | Move Direction | Next State -- | -- | -- | -- | -- A | 0 | 0 | Right | A A | 1 | 1 | Right | B B | 0 | 0 | Right | B B | 1 | 1 | Right | C C | 0 | 0 | Right | C C | 1 | 1 | Right | D D | 0 | 0 | End | End D | 1 | 1 | End | End D | 0 | 0 | End | End
Consider an algorithm that takes as input a 0-1 sequence of exactly five symbols and returns 1 if the sequence contains at least three 1s in any order, while it returns 0 otherwise. Implement the algorithm with a Turing machine, where the cell corresponding to the starting position of the head is where the final result must be stored. Also, the five cells following the starting position of the head are initialised with the 0-1 sequence of five symbols used as input of the algorithm.