On the Subject of Finite Automata
Hope you've studied state machines, or this bomb's state may transition to "exploded"
For this module, you will select one or more regexes based on the serial number, convert the regexes to finite automata, and apply operations to them. The first five screens display five regexes, and the last is the submission panel.
Terminology
- Regular expression (AKA regex): A string of text, consisting of the symbols a, b, ε (epsilon, representing a lack of text), and the operators listed below.
- Finite Automaton (plural: Finite Automata): A set of states and transitions between them, which can be converted to and from regexes. Each transition has an associated letter, which here must be either "a" or "b", used to control what input that transition is followed for.
- Transition Graph: A similar structure to a finite automaton, but the transitions can have any regex associated with them, not just "a" and "b". Used here as a step in the process of producing the finite automaton.
Order of operations for regular expressions, and syntax:
R
and S
represent any regexes
- Parentheses:
(R)
. Example:(a)
,(b)
- Kleene star:
R*
. Example:a*
,(ab)*
- Concatenation:
RS
. Example:ab
,ab*
,b*a
- Alternation:
R|S
. Example:a|b
,a*|ab
Note that, in the last example for alternation, the operands are a*
and ab
, due to the order of operations. Similarly, in the last example for concatenation, the right operand is b*
, and in the second Kleene star example, the operand is (ab)
. Also, note that, being a unary operator, *
does not have a right operand, so b*a
is a concatenation between b*
and a
In the following algorithms, "outermost operation" means the last operation in the order of operations within the regex that is not inside parentheses. For instance, in the regex ab|a(ab*|a)b
, the outermost operator is the alternation outside the parentheses, and the second-outermost operators are the concatenations outside the parethenses. In the case of a tie for lowest, either operation in the tie can be selected for the algorithm described on the next page.