Why every regular language is in $\text{TIME}(n)$?

136 Views Asked by At

How can I prove that every regular language $R$ has linear time complexity, i.e. every regular language satisfies $$R \in \text{TIME}(n)$$

1

There are 1 best solutions below

0
On

If $R$ is a regular language, then $R$ is recognized by some deterministic finite state machine. A finite state machine processes a string $x$ by reading each character and transitioning to the appropriate state—it takes exactly $|x|$ steps.

Every deterministic finite state machine $M$ is equivalent to a Turing machine that just reads its input in order and has the same finite control (states and transition rule) as $M$. Hence every regular language is recognized by a linear-time Turing machine.