-
Notifications
You must be signed in to change notification settings - Fork 0
/
lec1.tex
125 lines (107 loc) · 3.87 KB
/
lec1.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
\section{Deterministic Finite Automaton (DFA)}
% ==================================================
A machine consists of different states drawn in circles with names. Often a state drawn as
a double circle is an ``acceptive state,'' and a plain circle indicates a ``rejective
state.'' A machine receives a string consisted of `1's and `0's as input and the states
change as the machine reads through input digits. An arrow is used to indicate which state
is to start with. See \autoref{exa:a_DFA} for detailed information.
\subsection{Expressions of DFA's}
% --------------------------------------------------
\begin{example}[A DFA]
\label{exa:a_DFA}
Let's first look at the DFA below which starts at state $A$.
\centgraph{mp/dfa-0.pdf}
If the string ``010110'' is input to the machine, will it result in true or false?
Will the state be acceptive or rejective?
\[
\xrightarrow{010110}
\fbox{M}
\xrightarrow{1/0 \text{ (True / False, Accept / Reject)}}
\]
There are two arrows leaving state $A$: one with a label reading `1' which points to
state $B$ and one reading `0' which goes back to state $A$ itself. That means, if an
input digit reads `1,' the state changes to $B$, and if `0' the state stays in $A$.
Now step through the procedure:
\begin{compactenum}
\item
The machine starts off at state $A$ with input `0,' which, as explained above,
changes the state to $A$ itself.
\item
Next, the second digit `1' is read so the state is changed to $B$.
\item
The next digit `0' makes state $B$ to switch to state $C$.
\item
Then state $C$ reads `1' so no state change occurs.
\item
The next digit is `1' again so the state remains still on $C$.
\item
Last, the digit `0' switches the state from $C$ to $B$.
\end{compactenum}
Thus the input string ``010110'' changes the machine to state $B$, which is an
acceptive state.
\end{example}
\begin{definition}[DFA]
\label{def:DFA}
A DFA is a $5$-tuple
\[ \DFA \]
where
\begin{compactdesc}
\item[$Q$] is a finite set, for states
\item[$\Sigma$] is a finite set, for input alphabet
\item[$s$] $\in Q$, for start states
\item[$F$] $\subseteq Q$, for accepting states
\item[$\delta$]
$Q \times \Sigma \mapsto Q$,
a function that specifies the transition between states
\end{compactdesc}
\end{definition}
\begin{example}[Denoting machine in \autoref{exa:a_DFA}]
According to definition \autoref{def:DFA},
the machine in \autoref{exa:a_DFA} can be denoted by
\[ \DFA \]
where
\begin{compactitem}
\item $Q = \set{ A,B,C }$
\item $\Sigma = \set{ 0,1 }$
\item $s = \set{ A }$
\item $F = \set{ B,C }$
\end{compactitem}
And function $\delta$ can be described by the table below.
\begin{center} \begin{tabular}{Mc Mc Mc}
\hline
\delta & 0 & 1 \\
\hline
A & A & B \\
B & C & A \\
C & B & C \\
\hline
\end{tabular} \end{center}
\end{example}
\begin{definition}[$f_M$]
For any DFA $\DFA$,
let
\[
f_M : \Sigma^* \mapsto \set{ \true, \false }
\]
where $\Sigma^*$ is a set of strings over $\Sigma$.
\[
f_M(w)
= \begin{cases}
\true, &\delta^*(s,w) \in F \\
\false, &\text{else}
\end{cases}
\]
\end{definition}
\begin{definition}[$\delta^*$]
\[
\delta^* : Q \times \Sigma^* \mapsto Q
\]
which is an inductive function defined as
\[
\begin{cases}
\delta^*(q, \varepsilon) = q \\
\delta^*(q, aw) = \delta^*\( \delta(q,a), w \)
\end{cases}
\]
where $varepsilon$ is an empty string and $q \in Q, a \in \Sigma, w \in \Sigma^*)$.
\end{definition}