Turing machine for receiving strings of simple lengths

I have a home problem that asks me to describe a program for a non-deterministic Turing machine that accepts L = {a^n: n is prime}. I am not sure how to do this. I know? use aas unary digits and count them? can i just ignore the string and just check basically n? or are the basic values ​​known, and thus only those cells that take state, and I can just read the data, as usual?

How should I do it?

+3
source share
2 answers

At first you could use a memory cell somewhere to indicate whether the string was found to be the main length or not, and then do more or less what Ness suggested (although I don't quite understand his answer in general).

. 2 , , , . , , . 3 . , . DOES , , . , , , .

, , , . , , , , .

. ( - ), . , .

P.S. Drineas is evil

+4

.

. , n, a. n; b. n.

(, , , , a ): a. 2 b. (, , ), a , , .

, , ........aaaaaaa........., - .c.ccccc.ccc.c.ccc.c.ccc[p]cpcpp.OaaaaaaaA...x.y.z... ( [], ).

+2

All Articles