Lecture 22: finite automata [00OC]
- February 9, 2024
- Jon Sterling, with contributions from Andrew Pitts, Ian Leslie, Frank Stajano
These lecture notes were prepared by Jon Sterling by adapting prior notes created by Andrew Pitts that I inherited from Frank Stajano.
In this lecture, we introduce our a fundamental mathematical model of computatation: the finite automaton.
Kinds of finite automata [017J]
- February 11, 2025
- Jon Sterling
The most basic form of automaton is the non-deterministic finite automaton as defined below.
Definition Non-deterministic finite automaton [017H]
- February 11, 2025
- Jon Sterling
A non-deterministic finite automaton or NFA for short is defined to be a tuple M = {\mathopen {}\left (Q,\Sigma ,\Delta ,s,F\right )\mathclose {}} where:
- Q is a finite set (of “states”).
- \Sigma is an alphabet, i.e. a finite set.
- \Delta is a ternary relation \Delta \colon Q\times \Sigma \mathbin {\nrightarrow } Q called the transition relation: we write q\xrightarrow {a}{q'} to mean that (q,a,q')\in \Delta .
- s is an element of Q, the “starting state”.
- F is a subset of Q, the “accepting states”.
The idea of an NFA is that you “feed” it a string after initialising it to its starting state, and then you explore the transitions it makes by biting off characters from the string until it is consumed. If the automaton ends up in an accepting state then the string is accepted; otherwise, the string is considered rejected. More formally:
Definition The formal language accepted by an NFA [017K]
- February 11, 2025
- Jon Sterling
Let M=(Q,\Sigma ,\Delta ,s,F) be a non-deterministic finite automaton over an alphabet \Sigma . Then the formal language accepted by M is defined to be the subset \mathcal {L}{\mathopen {}\left (M\right )\mathclose {}}\subseteq \Sigma ^\star specified as follows:
\mathcal {L}{\mathopen {}\left (M\right )\mathclose {}} = {\mathopen {}\left \{ u:\Sigma ^\star \mid \exists q\in F\mathpunct {.} s\mathrel {\vphantom {\xrightarrow {u}}\smash {\xrightarrow {u}}^*} q \right \}\mathclose {}}For the above, we define the relation q\mathrel {\vphantom {\xrightarrow {u}}\smash {\xrightarrow {u}}^*} q' by induction on the string u:
\begin {aligned} q\mathrel {\vphantom {\xrightarrow {\epsilon }}\smash {\xrightarrow {\epsilon }}^*} q' &\Leftrightarrow q=q' \\ q\mathrel {\vphantom {\xrightarrow {au}}\smash {\xrightarrow {au}}^*} q' &\Leftrightarrow \exists q''\in Q\mathpunct {.} q\mathrel {\xrightarrow {a}}q''\land q''\mathrel {\vphantom {\xrightarrow {u}}\smash {\xrightarrow {u}}^*} q' \end {aligned}This is similar to reflexive-transitive closure in a directed graph, except that the edges of our graph are labelled by symbols from the alphabet \Sigma .
NFAs represent an extremely limited but nonetheless useful form of computational power; intuitively, this is because they don’t have any memory. It is therefore an interesting theorem when a language can be recognised by an NFA. In this lecture we will show that (1) NFAs can be given some more capabilities without changing the class of languages they recognise, and (2) the non-determinism of the transition relation is not necessary. Having more capabilities is helpful when constructing an automaton, but having fewer capabilities is helpful when investigating the class of all automata.
Example Graphical depiction of an NFA [017I]
- February 11, 2025
- Jon Sterling
NFAs are usually drawn in a graphical notation that depicts the states as circled nodes, with possible transitions given by arrows between the nodes. The starting state is drawn with an arrow pointing from it out of nowhere, and the accepting states are drawn in double-struck circles. For example, consider the following picture:
The picture above depicts an NFA accepting the following formal language over the alphabet \Sigma ={\mathopen {}\left \{a,b\right \}\mathclose {}}:
{\mathopen {}\left \{ u\in {\mathopen {}\left \{a,b\right \}\mathclose {}}^\star \mid \text {$u$ contains three consecutive $a$s} \right \}\mathclose {}}Indeed, from the initial state we can consume as many as and bs as we like but at some point we must transition along an a to q_1 after which we have no choice but to consume two as until we reach an accepting state q_3. At this point, we can continue with as many as and bs as we like (an accepting state does not have to be a terminal state!).
Definition Deterministic finite automaton [017L]
- February 11, 2025
- Jon Sterling
A deterministic finite automaton or DFA for short is an NFA for which the transition relation \Delta \colon Q\times \Sigma \mathbin {\nrightarrow } Q is a function, i.e. a total and functional relation. This states, in other words, that to each state each state q\in Q can transition along each symbol a:\Sigma to one and only one state, which we conventionally write \delta {\mathopen {}\left (q,a\right )\mathclose {}}. Indeed, we will often write M = (Q,\Sigma ,\delta ,s,F) for a DFA. In this case, we have q \mathrel {\xrightarrow {a}}q' if and only if \delta {\mathopen {}\left (q,a\right )\mathclose {}}=q'.
Aside Non-exclusive privatives in mathematical English [017M]
- February 11, 2025
- Jon Sterling
As an aside, it might feel strange to speak of “deterministic non-deterministic finite automata”. This is OK but can take some getting used to: mathematicians have discovered over the past several centuries that it is better for negations in terminology to mean “not necessarily” rather than “definitely not”; this is similar to the way that mathematicians often say “greater than” to mean “greater than or equal to”, reserving “strictly greater than” for the notion that excludes equality.
Example NFAs versus DFAs [017N]
- February 11, 2025
- Jon Sterling
An NFA can fail to be deterministic in just two ways:
- There could be a pair (q,a) for which there exists no transition q\mathrel {\xrightarrow {a}}q'.
- There could be a pair (q,a) such that q\mathrel {\xrightarrow {a}}q' and q\mathrel {\xrightarrow {a}}q'' for distinct states q',q''\in Q.
We recall our sample NFA over \Sigma ={\mathopen {}\left \{a,b\right \}\mathclose {}} from Example [017I] fails to be deterministic in both ways: we have both q_0\mathrel {\xrightarrow {a}}q_0 and q_0\mathrel {\xrightarrow {a}}q_1, and moreover there is no transition along b from state q_1 and q_2.
We could make the automaton deterministic by removing some transitions and adding others, while still accepting the same language:
So the above is a DFA over \Sigma . But if were to view it as an NFA over the extended alphabet \Sigma ' = {\mathopen {}\left \{a,b,c\right \}\mathclose {}}, then it would again fail to be deterministic because there would be no transitions along c!
We will ultimately show that every NFA can be transformed into a more complicated DFA that accepts the same language. But before we do so, we introduce a further strengthening of the features of NFAs that can be reduced directly to DFAs in one go.
Definition Non-deterministic finite automaton with \varepsilon -transitions [017O]
- February 12, 2025
- Jon Sterling
A non-deterministic finite automaton with \varepsilon -transitions or NFA\varepsilon for short is an NFA M = {\mathopen {}\left (Q,\Sigma ,\Delta ,s,F\right )\mathclose {}} together with an additional relation T\colon Q\mathbin {\nrightarrow } Q called the \varepsilon -transition relation.
We will write q\mathrel {\xrightarrow {\varepsilon }}q' to mean that q\mathrel {T}q'. This notation is a little confusing! Note that this \varepsilon is not the same as the \epsilon denoting the empty string, and that therefore q\mathrel {\xrightarrow {\varepsilon }}q' means something very different from q\mathrel {\vphantom {\xrightarrow {\epsilon }}\smash {\xrightarrow {\epsilon }}^*} q'.
The purpose of the \varepsilon -transition relation in an NFA\varepsilon is to allow the automaton to transition to states without consuming a symbol.
Example Graphical depiction of an NFA\varepsilon [017P]
- February 12, 2025
- Jon Sterling
The graphical notation of NFAs that we introduced in Example [017I] can be extended to handle \varepsilon -transitions in a straightforward way. For example:
In Definition [017K] we described the formal language accepted by an NFA in terms of a labelled path relation q\mathrel {\vphantom {\xrightarrow {u}}\smash {\xrightarrow {u}}^*} q'. Below, we give an analogous definition that accounts for \varepsilon -transitions.
Definition The formal language accepted by an NFA\varepsilon [017Q]
- February 12, 2025
- Jon Sterling
Let M=(Q,\Sigma ,\Delta ,s,F,T) be an NFA\varepsilon . The formal lanuage accepted by M is defined to be the subset \mathcal {L}{\mathopen {}\left (M\right )\mathclose {}}\subseteq \Sigma ^\star specified as follows:
\mathcal {L}{\mathopen {}\left (M\right )\mathclose {}} = {\mathopen {}\left \{ u:\Sigma ^\star \mid \exists q\in F\mathpunct {.} s \mathrel {\xRightarrow {u}} q \right \}\mathclose {}}Above we define the relation q\mathrel {\xRightarrow {u}} q' to mean that there exists a path through M from q to q' whose non-\varepsilon -transitions consume the string u. In more formal terms, we can define the relation inductively by rules:
\begin {gathered} \displaystyle \frac {\displaystyle }{\displaystyle \quad q\mathrel {\xRightarrow {\epsilon }}q\quad } \quad \displaystyle \frac {\displaystyle q\mathrel {\xrightarrow {a}}q'' \quad q''\mathrel {\xRightarrow {u}}q' }{\displaystyle \quad q\mathrel {\xRightarrow {au}}q'\quad } \qquad \displaystyle \frac {\displaystyle q\mathrel {\xrightarrow {\varepsilon }}q'' \quad q''\mathrel {\xRightarrow {u}}q' }{\displaystyle \quad q\mathrel {\xRightarrow {u}}q'\quad } \end {gathered}Example The formal language depicted in Example [017P] [017R]
- February 12, 2025
- Jon Sterling
Returning to the NFA\varepsilon depicted in Example [017P] in light of Definition [017Q], we see for example that we have paths q_0\mathrel {\xRightarrow {aa}}q_2, q_0\mathrel {\xRightarrow {aa}}q_3, and q_0\mathrel {\xRightarrow {bb}}q_7. Overall, the formal language of this NFA\varepsilon is that of the regular expression (a\vert b){*}(aa\vert bb)(a\vert b){*}.
We see from Example [017R] that the possibility of \varepsilon -transitions makes it much easier to design an automaton that corresponds to a given regular expression. This is one of the motivations adding this feature to NFAs, as we shall see in a subsequent lecture.
The subset construction: equivalence of NFA\varepsilon s with DFAs [017G]
- February 11, 2025
- Jon Sterling, with contributions from Andrew Pitts, Frank Stajano
Although very few NFA\varepsilon s are NFAs and very few of those are DFAs, all these kinds of automata nonetheless generate the same classes of formal languages. In the upward direction, it is easy to see that any DFA is also an NFA with a deterministic and total transition relation, and moreover any NFA is an NFA\varepsilon with an empty \varepsilon -transition relation, and that the formal languages induced by all these agree. Conversely, it is much less obvious that we can go the other direction, i.e. that we can associate to a given NFA\varepsilon an NFA or a DFA that accepts the same formal language. That is the purpose of the subset construction which we shall study in this section.
Definition Subset construction [017T]
- February 12, 2025
- Jon Sterling
Let M be an NFA\varepsilon over an alphabet \Sigma ; we define an DFA \mathcal {P}{\mathopen {}\left (M\right )\mathclose {}} over \Sigma called the subset construction of M as follows:
- We define the set of states of \mathcal {P}{\mathopen {}\left (M\right )\mathclose {}} to be the powerset of the set of states of M. Q_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}} = \mathcal {P}{\mathopen {}\left (Q_{M}\right )\mathclose {}} = {\mathopen {}\left \{S\,\middle \vert \,S\subseteq Q_{M}\right \}\mathclose {}}
- The transition function \delta _{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}\colon \mathcal {P}{\mathopen {}\left (Q_{M}\right )\mathclose {}} \times \Sigma \to \mathcal {P}{\mathopen {}\left (Q_{M}\right )\mathclose {}} is so that a set of states S transitions along the symbol a\in \Sigma to the set of states reachable via a from some element of S: \delta _{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}{\mathopen {}\left (S,a\right )\mathclose {}} = {\mathopen {}\left \{ q':Q_{M} \,\middle \vert \, \exists q\in S\mathpunct {.} q\mathrel {\xRightarrow {a}} q' \text { in } M \right \}\mathclose {}} (Optional observation: this is a relational direct image.)
- The starting state of \mathcal {P}{\mathopen {}\left (M\right )\mathclose {}} is the set of states reachable by any number of \varepsilon -transitions from the starting state of M, i.e. the set of states reachable from s_{M} via the empty string: s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}} = {\mathopen {}\left \{q: Q\,\middle \vert \,s_{M}\mathrel {\xRightarrow {\epsilon }}q\right \}\mathclose {}}
- An accepting set of states is one that contains an accepting state from M: F_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}} = {\mathopen {}\left \{S\subseteq Q_{M}\,\middle \vert \, \exists q\in S\mathpunct {.} q\in F_{M} \right \}\mathclose {}}
Example Example of the subset construction [017V]
- February 12, 2025
- Jon Sterling
In order to get a thorough intuition for the subset construction we will see how it acts on a sample NFA\varepsilon M over \Sigma ={\mathopen {}\left \{a,b\right \}\mathclose {}} which we draw below:
The states of \mathcal {P}{\mathopen {}\left (M\right )\mathclose {}} are all the subsets of Q_{M}:
Q_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}} = {\mathopen {}\left \{ \varnothing , {\mathopen {}\left \{q_0\right \}\mathclose {}}, {\mathopen {}\left \{q_1\right \}\mathclose {}}, {\mathopen {}\left \{q_2\right \}\mathclose {}}, {\mathopen {}\left \{q_0,q_1\right \}\mathclose {}}, {\mathopen {}\left \{q_0,q_2\right \}\mathclose {}}, {\mathopen {}\left \{q_1,q_2\right \}\mathclose {}}, {\mathopen {}\left \{q_0,q_1,q_2\right \}\mathclose {}} \right \}\mathclose {}}The starting state of \mathcal {P}{\mathopen {}\left (M\right )\mathclose {}} is the set of states reachable from q_0 via the empty string:
s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}} = {\mathopen {}\left \{q_0,q_1,q_2\right \}\mathclose {}}The accepting states of \mathcal {P}{\mathopen {}\left (M\right )\mathclose {}} are all the sets of states containing an accepting state of M:
F_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}} = {\mathopen {}\left \{ {\mathopen {}\left \{q_2\right \}\mathclose {}}, {\mathopen {}\left \{q_2,q_0\right \}\mathclose {}}, {\mathopen {}\left \{q_2,q_1\right \}\mathclose {}}, {\mathopen {}\left \{q_2,q_1,q_0\right \}\mathclose {}} \right \}\mathclose {}}We then describe the transition function of \mathcal {P}{\mathopen {}\left (M\right )\mathclose {}} by means of a table:
| S | \delta _{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}{\mathopen {}\left (S,a\right )\mathclose {}} | \delta _{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}{\mathopen {}\left (S,b\right )\mathclose {}} |
|---|---|---|
| \varnothing | \varnothing | \varnothing |
| {\mathopen {}\left \{q_0\right \}\mathclose {}} | {\mathopen {}\left \{q_0,q_1,q_2\right \}\mathclose {}} | {\mathopen {}\left \{q_2\right \}\mathclose {}} |
| {\mathopen {}\left \{q_1\right \}\mathclose {}} | {\mathopen {}\left \{q_1\right \}\mathclose {}} | \varnothing |
| {\mathopen {}\left \{q_2\right \}\mathclose {}} | \varnothing | {\mathopen {}\left \{q_2\right \}\mathclose {}} |
| {\mathopen {}\left \{q_0,q_1\right \}\mathclose {}} | {\mathopen {}\left \{q_0,q_1,q_2\right \}\mathclose {}} | {\mathopen {}\left \{q_2\right \}\mathclose {}} |
| {\mathopen {}\left \{q_0,q_2\right \}\mathclose {}} | {\mathopen {}\left \{q_0,q_1,q_2\right \}\mathclose {}} | {\mathopen {}\left \{q_2\right \}\mathclose {}} |
| {\mathopen {}\left \{q_1,q_2\right \}\mathclose {}} | {\mathopen {}\left \{q_1\right \}\mathclose {}} | {\mathopen {}\left \{q_2\right \}\mathclose {}} |
| {\mathopen {}\left \{q_0,q_1,q_2\right \}\mathclose {}} | {\mathopen {}\left \{q_0,q_1,q_2\right \}\mathclose {}} | {\mathopen {}\left \{q_2\right \}\mathclose {}} |
All in all, we have the following DFA:
As you can see, the resulting DFA is kind of strange and has many redundant states. But it does accept the desired language.
The goal of Definition [017T] is to transform an NFA\varepsilon M into a DFA \mathcal {P}{\mathopen {}\left (M\right )\mathclose {}} that accepts the same language, i.e. that \mathcal {L}{\mathopen {}\left (\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}\right )\mathclose {}}=\mathcal {L}{\mathopen {}\left (M\right )\mathclose {}}. We prove this in two steps below.
Lemma Soundness of the subset construction [00OD]
- February 9, 2024
- Jon Sterling, with contributions from Frank Stajano, Andrew Pitts
Let M be an NFA\varepsilon ; then \mathcal {L}{\mathopen {}\left (\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}\right )\mathclose {}}\subseteq \mathcal {L}{\mathopen {}\left (M\right )\mathclose {}}.
Proof.
- February 9, 2024
- Jon Sterling
We must show that any string u\in \mathcal {L}{\mathopen {}\left (\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}\right )\mathclose {}} lies in \mathcal {L}{\mathopen {}\left (M\right )\mathclose {}}.
Case. Empty string
- February 9, 2024
- Jon Sterling
If u=\epsilon , then by definition we have s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}\in F_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}} and so by definition, there exists q\in s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}} such that q\in F_{M}. By definition of s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}, we therefore have s\mathrel {\xRightarrow {\epsilon }}q; because q\in F_{M}, we have \epsilon \in \mathcal {L}{\mathopen {}\left (M\right )\mathclose {}}.
Case. Non-empty string
- February 9, 2024
- Jon Sterling
Suppose on the other hand that u=a_1\cdots a_n, and so we therefore have transitions s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}\mathrel {\xrightarrow {a_1}}S_1\mathrel {\xrightarrow {\ldots }}S_{n-1}\mathrel {\xrightarrow {a_n}}S_n with S_n\in F_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}, and so there exists some q_n\in S_n\cap F_{M}. Define S_0 = s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}.
By definition of \mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}, from the transition S_{n-1}\mathrel {\xrightarrow {a_n}}S_n we may find some q_{n-1}\in S_{n-1} such that q_{n-1}\mathrel {\xRightarrow {a_n}}q_n. Iterating this process, we may find states q_i\in S_{i} such that we have a sequence of transitions q_{i-1}\mathrel {\xRightarrow {a_i}}q_i in M; thus we have a sequence of transitions q_0\mathrel {\xRightarrow {u}}q_n. Because q_0\in S_0=s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}, we have s_{M}\mathrel {\xRightarrow {\epsilon }}q_0 and thus s_{M}\mathrel {\xRightarrow {\epsilon }}q_0\mathrel {\xRightarrow {u}}q_n and therefore s_{M}\mathrel {\xRightarrow {u}} q_n. Because q_n\in F_{M}, we are done.
Lemma Completeness of the subset construction [00OE]
- February 9, 2024
- Jon Sterling
Let M be an NFA\varepsilon ; then \mathcal {L}{\mathopen {}\left (M\right )\mathclose {}}\subseteq \mathcal {L}{\mathopen {}\left (\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}\right )\mathclose {}}.
Proof.
- February 9, 2024
- Jon Sterling
We must show that any string u\in \mathcal {L}{\mathopen {}\left (M\right )\mathclose {}} lies in \mathcal {L}{\mathopen {}\left (\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}\right )\mathclose {}}.
Case. Empty string
- February 9, 2024
- Jon Sterling
If u=\epsilon , then we have assumed that s_{M}\xRightarrow {\epsilon }q such that q\in F_{M}; therefore, by definition, we have q\in s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}. Thus we have q\in s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}\cap F_{M} and so it follows by definition that s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}\in F_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}.
Case. Non-empty string
- February 9, 2024
- Jon Sterling
Suppose that u=a_1\cdots a_n, and so we have transitions s_{M}\xRightarrow {a_1}q_1\xRightarrow {\cdots } q_{n-1}\xRightarrow {a_n}q_n with q_n\in F_{M}.
We inductively define a sequence of states S_i in \mathcal {P}{\mathopen {}\left (M\right )\mathclose {}} as follows:
\begin {aligned} S_0 &= s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}\\ S_{k+1} &= \delta _{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}{\mathopen {}\left (S_k,a_{k+1}\right )\mathclose {}} \end {aligned}Define q_0=s_{M}. Then for all 0\leq i \leq n, we observe that we have q_i\in S_i.
Subproof.
- February 9, 2024
- Jon Sterling
We proceed by induction on i. For i=0, we need s_{M}\in s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}; but this holds by definition. Next, assuming q_i\in S_i we must show that q_{i+1}\in S_{i+1} = \delta _{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}{\mathopen {}\left (S_i,a_{i+1}\right )\mathclose {}}. Unfolding definitions, this follows from the transition q_i\xRightarrow {a_{i+1}} q_{i+1} that we have assumed, as our inductive hypothesis ensures q_i\in S_i.
It follows from the above that we have transitions S_0=s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}\xrightarrow {a_1}S_1\xrightarrow {\cdots }S_{n-1}\xrightarrow {a_n}S_n. Because we have shown q_n\in S_n and we have assumed q_n\in F_{M}, we have S_n\in F_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}. Thus it follows that \mathcal {P}{\mathopen {}\left (M\right )\mathclose {}} accepts u.
Corollary Equivalence between NFA\varepsilon s, NFAs, and DFAs [017U]
- February 12, 2025
- Jon Sterling
NFA\varepsilon s, NFAs, and DFAs all generate the same class of languages.
Proof.
- February 12, 2025
- Jon Sterling
In Lemma [00OD] and Lemma [00OE], we have proved that NFA\varepsilon s and DFAs generate the same class of language as any NFA\varepsilon can be converted into a DFA recognising the same language. As any NFA is in particular an NFA\varepsilon , we see that NFAs are equivalent to DFAs in the same sense.
Optional material [017S]
- February 9, 2024
- Jon Sterling
Question Alternative definition of F_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}? [00OG]
- February 9, 2024
- Jon Sterling
Why can’t we define F_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}} to be the set of singletons {\mathopen {}\left \{q\right \}\mathclose {}} such that q\in F_{M}?
Answer.
- February 9, 2024
- Jon Sterling
Because if we did, then Lemma [00OE] would fail already in the case of the empty string. We would have s_{M}\xRightarrow {\epsilon }{q} with q\in F_{M} and thus q\in s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}; we would need s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}}\in F_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}} and with the proposed definition, this would need to be a singleton. There is, however, nothing about our assumptions that allows us to deduce that and, indeed, we can certainly come up with examples where s_{\mathcal {P}{\mathopen {}\left (M\right )\mathclose {}}} is not a singleton (e.g. if we have \epsilon -transitions of the form s_{M}\xRightarrow {\epsilon }q for q\not = s_{M}).