This practical is based on the related lecture: Lecture 2: Non-Determinism
Exercise 1
Given the NFA $N_1$ below in its graphical format, provide its formal definition $N_1=(Q,\Sigma,\delta,q_0,F)$:

NFA $N_1$
Exercise 2
Provide the graphical format for the NFA $N_2=(\{q_0,q_1,q_2\},\{\mathtt{a},\mathtt{b}\},\delta,q_0,\{q_2\})$ where $\delta$ is
$$
\begin{array}{c|ccc}
& \mathtt{a} & \mathtt{b} & \epsilon \\ \hline
q_0 & \{q_0\} & \emptyset & \{q_1\} \\
q_1 & \{q_1\} & \{q_0,q_1\} & \emptyset \\
q_2 & \{q_0,q_1,q_2\} & \{q_0,q_1\} & \emptyset
\end{array}
$$
Exercise 3
Given the NFA $N_3$ below in its graphical format:

NFA $N_3$
- (a) Prove (using the definition of computation for NFAs) whether $\mathtt{0000}\in L(N_3)$
- (b) Prove (using the definition of computation for NFAs) whether $\mathtt{111}\in L(N_3)$
- (c) Provide a regular expression $R$ such that $L(R)=L(N_3)$
Exercise 4
For each regular expression $R_i$ below, provide an NFA $N_i$ such that $L(R_i)=L(N_i)$, that is, the NFA recognises the same language expressed by the RE.
- (a) $R_1=(\mathtt{ab}\cup\mathtt{ba})^*$
- (b) $R_2=\mathtt{0}((\mathtt{0}\mathtt{1})^(\mathtt{1}\mathtt{0})^)^*\mathtt{1}$
- (c) $R_3=((\mathtt{0}\cup\mathtt{1})^\mathtt{00}(\mathtt{0}\cup\mathtt{1})^)^+$
- (d) $R_4=((\mathtt{aa})^\mathtt{bb}(\mathtt{aa})^)\emptyset$
<aside>
💡
Hints
- Find 10 strings or more which belong to the language to get a "feel" for the regular expression. Check if the empty string $\epsilon$ belongs to the language.
- Try to simplify the regular expression to save you work.
</aside>