31 Jan 10:30 AM
CSCI 5100
\[ A \cup B = \{ w | w \in A \lor w \in B \} \]
{'', '0', '00', '000', '1', '11', '111'}
0
or only 1
\[ A \cdot B = \{ xy | x \in A \land y \in B \} = AB \]
{'001', '0011', '01', '011'}
0
and 1
, each, and0
before any 1
\[ A* = \{ x_1x_2\ldots x_n | x_i \in A \land n \geq 0 \} \]
('', '0', '00')
A = {'0', '10'}
itertools
or write your own.digraph finite_automata {
rankdir=LR;
node [shape=circle];
q0 [label="",shape=point];
q1 [label=<<I>q<SUB>1</SUB></I>>];
q2 [label=<<I>q<SUB>2</SUB></I>>];
q3 [label=<<I>q<SUB>3</SUB></I>>, shape=doublecircle];
q0 -> q1
q1 -> q1 [label="{0}"];
q1 -> q2 [label="{1}"];
q2 -> q1 [label="{0}"];
q2 -> q3 [label="{1}"];
q3 -> q3 [label="{0,1}"];
}
digraph finite_automata {
rankdir=LR; bgcolor="#191919";
node [fontcolor = "#ffffff", color = "#ffffff"]
edge [color = "#ffffff",fontcolor = "#ffffff"]
node [shape=circle];
q0 [label="",shape=point];
q1 [label=<<I>q<SUB>1</SUB></I>>] ;
q2 [label=<<I>q<SUB>2</SUB></I>>, shape=doublecircle];
q0 -> q1 []
q1 -> q1 [label="{0}"];
q1 -> q2 [label="{1}"];
q2 -> q1 [label="{0}"];
}
1
-terminated bit strings11
11
as [1, 1]
Show that finite automata and regular expressions are equivalently expressive.
\[ M_1 = (Q_1, \Sigma, \delta_1, q_1, F_1) \land M_2 = (Q_2, \Sigma, \delta_2, q_2, F_2) \implies \]
\[ \exists M_3 : L(M_3) = L(M_1) \cup L(M_2) \]
\[ Q_3 = Q_1 \times Q_2 = \{ (q_1, q_2) | q_1 \in Q_1 \land q_2 \in Q_2 \} \]
\[ \forall L(M_1), L(M_2): \exists M_3 : L(M_3) = L(M_1) \cup L(M_2) \]
Proof
\[ \begin{aligned} L(&Q_1, \Sigma, \delta_1, q_1, F_1) \cup L(Q_2, \Sigma, \delta_2, q_2, F_2) = \\ L(&Q_1 \times Q_2, \Sigma, \\ &(\delta_1(q,a), \delta_2(q',a)), \\ &(q_1, q_2), \\ &\{ (F_1 \times Q_2) \cup (Q_1 \times F_2) \})\blacksquare \end{aligned} \]
Build \(M_3\) for the \(M_1\) and \(M_2\) as:
\(M_1\)
\(M_2\)