使用图灵机指定给定序列的成员

时间:2015-04-27 22:12:54

标签: algorithm math turing-machines

我遇到的一个问题是,给定二进制序列a_0,...,a_ {n-1}需要多少转换,以便当给定非负整数i时,如果i

使用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,-

由此我猜测,指定序列n long需要大致O(n)个状态。你能证明这一点吗?

0 个答案:

没有答案