31 Jan 09:30 AM
CSCI 5100
States \[ q_n \]
Transitions \[ \overset{\{1\}}{\longrightarrow} \]
Start state \(q_1\)
Accept state \(q_3\)
States \[ q_n \]
Transitions \[ \overset{\{1\}}{\longrightarrow} \]
Start state \(q_1\)
Accept state \(q_3\)
0
out of \(q_1\).1
out of \(q_1\).1
out of \(q_2\).0
out of \(q_3\).1
out of \(q_3\).[0, 1, 1, 0, 1]
by ending in \(q_3\)[0, 0, 1, 0, 1]
?A finite automaton (FA), also known as a finite state machine (FSM), is a mathematical model of computation used to recognize patterns in a sequence of symbols.
A finite automaton is formally defined as a 5-tuple:
\(\delta=\) | \(0\) | \(1\) |
---|---|---|
\(q_1\)| | \(q_1\) | \(q_2\) |
\(q_2\)| | \(q_1\) | \(q_3\) |
\(q_3\)| | \(q_3\) | \(q_3\) |
# define q_n as a convenience
q_1, q_2, q_3 = "q_1", "q_2", "q_3"
# define M_1
Q = {q_1, q_2, q_3}
S = {0, 1}
d = {
q_1 : { 0:q_1, 1:q_2 },
q_2 : { 0:q_1, 1:q_3 },
q_3 : { 0:q_3, 1:q_3 }
}
M_1 = (Q,S,d,q_1,{q_3})
print(M_1)
({'q_3', 'q_1', 'q_2'}, {0, 1}, {'q_1': {0: 'q_1', 1: 'q_2'}, 'q_2': {0: 'q_1', 1: 'q_3'}, 'q_3': {0: 'q_3', 1: 'q_3'}}, 'q_1', {'q_3'})
We note that the empty string is not in or related to the empty language
\[ \forall w_i \in \Sigma : \exists r_0r_1\ldots r_n : \]
\[ r_0 = q_0 \land \]
\[ r_n \in F \land \]
\[ \forall i : r_i = \delta(r_{i-1},w_i) \]