我遇到的一個問題是,給定二進制序列a_0,...,a_ {n-1}需要多少次過渡,以便在給出非負數整數我輸出a_i如果我< n和否則爲0。你可以假設輸入與1開始,除非我是0用圖靈機指定給定序列的成員
使用https://martinugarte.com/turingmachine/我模擬下列圖靈機,試圖得到多少國家的想法應該採取
序列,其中n = 2,5過渡
//Sequence is 0,1
name: Sequence
init: one
accept: end
one,0
end,0,-
one,1
two,_,>
two,_
end,1,-
two,0
end,0,-
two,1
end,0,-
,其中n = 3,8轉變測序的
//Sequence is 0,1,0
name: Sequence
init: one
accept: end
one,0
end,0,-
one,1
two,_,>
two,_
end,1,-
two,0
three,_,>
two,1
end,0,-
three,_
end,0,-
three,0
end,0,-
three,1
end,0,-
序列,其中n = 4,11個過渡
//Sequence is 0,1,0,1
name: Sequence
init: one
accept: end
one,0
end,0,-
one,1
two,_,>
two,_
end,1,-
two,0
three0,_,>
two,1
three1,_,>
three0,_
end,0,-
three0,0
end,0,-
three0,1
end,0,-
three1,_
end,1,-
three1,0
end,0,-
three1,1
end,0,-
從這我猜想它大致是O(n)狀態指定一個序列n長。你能證明這一點嗎?
在n = 3的例子中,你不可能有'two,0:end,0,-'和完全沒有「三」嗎?當你說「國家」時,你的意思是「過渡」嗎? – Beta
@貝塔,謝謝。雖然不會爲基因序列工作,但我會保留原樣。我被告知,一個國家基本上和過渡一樣。在現代文學中這是錯誤的嗎? – ruler501