Professional Documents
Culture Documents
1.1 Example. Check if a binary number is divisible by 3. While processing the input, we need to
remember not the entire processed portion x of the input, but only the remainder of x when divided
by 3. This remainder can be updated one input symbol at a time:
x ≡ 0 mod 3 → x0 ≡ 0 mod 3 x ≡ 0 mod 3 → x1 ≡ 1 mod 3
x ≡ 1 mod 3 → x0 ≡ 2 mod 3 x ≡ 1 mod 3 → x1 ≡ 0 mod 3
x ≡ 2 mod 3 → x0 ≡ 1 mod 3 x ≡ 2 mod 3 → x1 ≡ 2 mod 3
We remember “x ≡ 0 mod 3” in state a, and “x ≡ 1 mod 3” in state b, and “x ≡ 2 mod 3” in state c:
0 1
+ +
1 0
/ A k B k C
1 0
1.4 Regular language. A language L is called a regular language if L is the language of some finite
automaton (i.e., there exists a finite automaton M such that L(M ) = L).
1
c T.A. Henzinger, G. Théoduloz