This practical is based on our lecture: Lecture 1: Finite State Automata & Regular Expressions
Exercise 1: Mathematical notions & terminology
Propose definitions for the following concepts:
- (a) Sets and set operations (union, intersection, difference, Cartesian product)
- (b) Sequences and tuples
- (c) Functions and relations
- (d) Graphs
Exercise 2: Strings and languages
Answer the following items in connection with strings and languages:
- (a) What is an alphabet? Give 2 examples of alphabets.
- (b) What is a string? Give 3 examples of strings for each alphabet of your previous item.
- (c) Is the statement "if an alphabet has only one symbol, then there can only be a finite number of strings" true or false? Justify your answer.
- (d) Propose definitions for the following:
- Length of a string
- Empty string
- Substring of a string
- Concatenation of strings
- Lexicographic ordering of strings
- (e) Is the statement "the empty string is a substring of any string" true or false? Justify your answer.
Exercise 3: Finite-State Automata
Answer the items below, in connection with FSAs:
- (a) Given the FSA $M_1$ below, shown in its graphical format, provide its formal definition as a tuple $M_1=(Q, \Sigma,\delta,q_0,F)$:

FSA $M_1$
- (b) Provide a graphical representation of $M_2=(\{A,B,C,D\}, \{\mathtt{a},\mathtt{b}\},\delta,A,\{A,C\})$, where $\delta$ is defined as:
$$
\begin{array}{c|cc}
& \mathtt{a} & \mathtt{b} \\ \hline
A & B & D \\
B & C & D \\
C & A & D \\
D & D & D
\end{array}
$$