Skip to content

2620 Notes 1.2 (8/29)

Published: at 01:21 PM

Encoding Problems

Before we can define mathematical computation models(like Turing machines) that correspond to machines, we need a way to encode these problems.

We can observe that an instance of any problem can always be encoded by a sequence of 0s and 1s. Rather, we can use a combination of symbols to encode a problem.

Operations Over Strings

Many operations can be performed on strings to modify them:

Finite State Automata

Automaton $M$ has a finite number of states. It begins with an initial state, and based on the symbol currently being processed.

Let’s construct an automaton for the language $A = { w$ | $w$ contains an even number of a’s$}$, where $\Sigma = {a, b}$.

Let us define two states, $q_1, q_2$. Start with the initial state, $q_1$. On a given character, if it is $a$, we transition from $q_1 \to q_2$, or $q_2 \to q_1$. Otherwise, we stay in the current state.

Gated D Latch

If by the end of the string, we are in state $q_1$, then $w$ has an even number of a’s and belongs in $A$. This type of machine is called a deterministic finite automaton, or DFA.

The transitions of this state is represented by a transition function $\delta$. If $M$ reads the symbol $x$ on current state $y$, then the next state will be $\delta(y, x)$.

A language $A$ is called a regular language if it can be solved by a DFA.