Chapter 2
Chapter 2
• The term ‘deterministic’ refers to the fact that the various inputs
applied to the automaton correspond to only one state, and the
outputs obtained by transitions from the state of the automaton. The
deterministic model is defined as a quintuple as follows :
𝑀 =< 𝑄, 𝛴, 𝛿, 𝑞0 , 𝐹 >
𝛿 𝑞𝑖 , 𝑎 = 𝑞𝑗 , 𝑞𝑗 ∈ 𝑄
• As understood from the above definition, the basic FA model is a
deterministic model. This model is called DFA (deterministic finite
automata) for short. Therefore, when FA (finite automaton) is called,
the DFA model is understood. According to this model, FA starts from
state 𝑞0 and moves to a new state with each input symbol applied. At
any moment, the state of FA is clearly defined.
• For example, if
𝛿 𝑞0 , 𝑎 = 𝑞1
then if the dfa is in state 𝑞0 and the current input symbol is a, the dfa
will go into state 𝑞1 .
Example 2.1
𝑀1 =< 𝑄, 𝛴, 𝛿, 𝑞0 , 𝐹 >
𝑄 = 𝑞0 , 𝑞1 , 𝑞2
𝛴 = {0,1}
𝐹 = {𝑞2 }
𝛿 𝑞0 , 0 = {𝑞0 }
𝛿 𝑞0 , 1 = {𝑞1 }
𝛿 𝑞1 , 0 = {𝑞0 }
𝛿 𝑞1 , 1 = {𝑞2 }
𝛿 𝑞2 , 0 = {𝑞2 }
𝛿 𝑞2 , 1 = {𝑞2 }
Transition Diagram
• As seen in Example 2.1, the mathematical definition of the transition
function is both long and difficult to understand. For this reason, a so-
called "transition diagram" is often used for the definition of the
transition function.
• The transition diagram, which is a directed graph, has a node for each
state. State transitions are indicated by directional arcs and the input
symbol that causes the transition is written on the arcs. In the
transition graph, the initial state is indicated by “→” and the final
states are indicated by a double circle. The transition diagram created
for the FA in Example 2.1 is shown in Figure 2.1.
Figure 2.1 Transition graph for DFA model of 𝑀1
Languages and DFA’s
𝐿 𝑀 = {𝑤 ∈ 𝛴: 𝛿 𝑞0 , 𝑤 ∈ 𝐹}
• The set of strings applied to DFA is divided into accepted and not accepted
by DFA.
• The language accepted by the DFA is the set of strings that take the DFA
from its initial state to a final state.
• If we examine the DFA described in Example 2.1, the string 0101 is not
accepted by 𝑀1 . Because after reading 0101, it will be in state 𝑞1 and 𝑞1
is not a final state. However the string 0110 take 𝑀1 from initial state
𝑞0 𝑡𝑜 final state 𝑞2 . The set of strings that 𝑀1 accepts is an infinite set.
𝐿 𝑀1 = 11,011,110,0110,01011, …
2.2 Nondeterministic Finite Automata
from (𝑄𝑥𝛴) to 𝑄
while in the non-deterministic model the transition function is a maping;
Figure 2.2
Example 2.2
𝑀2 =< 𝑄, 𝛴, 𝛿, 𝑞0 , 𝐹 >
𝑄 = 𝑞0 , 𝑞1 , 𝑞2 , 𝑞3
𝛴 = {0,1}
𝐹 = {𝑞3 }
𝛿 𝑞0 , 0 = {𝑞0 , 𝑞1 }
𝛿 𝑞0 , 1 = {𝑞0 , 𝑞2 }
𝛿 𝑞1 , 0 = {𝑞3 }
𝛿 𝑞1 , 1 = =𝜙
𝛿 𝑞2 , 0 = 𝜙
𝛿 𝑞2 , 1 = {𝑞3 }
𝛿 𝑞3 , 0 = {𝑞3 }
𝛿 𝑞3 , 1 = {𝑞3 }
• As seen in the definition of 𝑀2 , in the non-deterministic model, it is
possible to switch from some states to more than one state with
some input symbols. From some states, it is not possible to switch to
any state with some input symbols. Therefore, in the deterministic
model, it is precisely known what state the machine will be in when
the initial state and the applied input string are known. Conversely, in
a non-deterministic model, the initial state and the final state of the
machine whose applied input string is known may be uncertain. For
example, when the input string w=000 is applied to machine 𝑀2 with
initial state 𝑞0 , the final state of the machine can be any of 𝑞0 , 𝑞1 and
𝑞3 .
Figure 2.2 Transition graph for NFA model of 𝑀2
• For a non-deterministic finite automaton (NFA) to recognize an input
string, a path must be found in the transition graph starting from the
initial state and reaching a final state with that input string. For
example, 𝑀3 recognizes the input string w=10001. Because this is a
path corresponding to the input string, starting from 𝑞0 and ending in
the only final state 𝑞3 .
𝛿 𝑞1 , 𝜆 = 𝑞2
𝛿 𝐴, 0 = 𝐴
𝛿 𝐴, 1 = 𝐵𝐶
𝛿 𝐵𝐶, 0 = 𝐴𝐵
𝛿 𝐴𝐵, 0 = 𝐴𝐵
𝛿 𝐴𝐵, 1 = 𝐴𝐵𝐶
𝛿 𝐴𝐶, 0 = 𝐴𝐵
𝛿 𝐴𝐶, 1 = 𝐵𝐶
𝛿 𝐴𝐵𝐶, 0 = 𝐴𝐵
𝛿 𝐴𝐵𝐶, 1 = 𝐴𝐵𝐶
Figure 2.5d