Question:
Show that every finite language (including the empty language) is accepted by some finite automaton with exactly one final state
How would I go about solving this? I tried my own approach (below) but didn't get far because I don't understand how I am supposed to approach this proof.
My Approach:
Consider a finite automata M
($\delta$* denotes $\delta$ hat(^) which means all states w travels to until empty)
$M=(Q,\Sigma,\delta,q_0,F)$
if w is a string and w $\in$L* (any finite language)
=> $\delta$*($q_0$, w)$\in$F (then i make a logic statement that says for all w this is true?)
and if w$ \in$$\epsilon$
=> $\delta$*($q_0$, $\epsilon$ )$\in$F
Let $L$ be an arbitrary finite language, and let $w = w_1w_2\dots w_n \in L$ be an arbitrary string in this language. We now construct a nondeterministic finite automaton $M = (Q, \Sigma, \delta, q_0, F)$ that accepts this string, where $Q$ is the set of states, $\Sigma$ is the alphabet, $\delta$ is the transition function, $q_0$ is the start state, and $F$ are the accept states.
First, we fix a start state $q_0$ and accept state $q_{accept}$. Now, for any $w_k$ in the string $w$, if $w_k$ is not already in $\Sigma$, we add this symbol to the alphabet $\Sigma$. Then we add the states $q_{w_1}, q_{w_2}, \dots, q_{w_n}$ to the set of states $Q$, and we add the following transition rules: $\delta(q_0,\varepsilon) = \{q_{w_1}\}$, $\delta(q_{w_i}, w_i) = \{q_{w_{i + 1}}\}$ for $1 \leq i < n$, and $\delta(q_{w_n}, w_n) = q_{accept}$.
The automaton now accepts the string $w$, and a similar construction can be made to expand the automaton for each $w \in L$. Since there are only finitely many such $w$, this process stops at some point, and the resulting automaton will recognise the language $L$.