HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Find a linear bounded automaton that accepts the language $L = \{ a^{n!} : n \geq 0 \}$

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
linearacceptsthegeqlanguagethatfindboundedautomaton

Problem

I need to construct linear bounded automaton for the language $L = \{ a^{n!} : n \geq 0 \}$. I know how LBA functions, however, I don't have a thought how it can check the n! that to in the power of a. I might want to hear a few suggestions, as I am experiencing difficulty in developing the specific LBA for it.

Solution

The LBA maintains a counter $c$, initialized by $1$, which is stored on a parallel track. It thinks of the rest of the tape as an integer $m$. It then repeatedly executes the following instructions: divide $m$ by $c$, and increment $c$. The algorithm terminates when one of the following happens: $m = 1$, in which case you can declare success; or $m$ is not divisible by $c$, in which case you can declare failure.

Context

StackExchange Computer Science Q#134103, answer score: 3

Revisions (0)

No revisions yet.