*73*

# Finite state machine

- Finite state machine is used to recognize patterns.
- Finite automata machine takes the string of symbol as input and changes its state accordingly. In the input, when a desired symbol is found then the transition occurs.
- While transition, the automata can either move to the next state or stay in the same state.
- FA has two states: accept state or reject state. When the input string is successfully processed and the automata reached its final state then it will accept.

### A finite automata consists of following:

Q: finite set of states

âˆ‘: finite set of input symbol

q0: initial state

F: final state

Î´: Transition function

Transition function can be define as

### FA is characterized into two ways:

- DFA (finite automata)
- NDFA (non deterministic finite automata)

## DFA

DFA stands for Deterministic Finite Automata. Deterministic refers to the uniqueness of the computation. In DFA, the input character goes to one state only. DFA doesnâ€™t accept the null move that means the DFA cannot change state without any input character.

DFA has five tuples {Q, âˆ‘, q0, F, Î´}

Q: set of all states

âˆ‘: finite set of input symbol where Î´: Q x âˆ‘ â†’Q

q0: initial state

F: final state

Î´: Transition function

### Example

See an example of deterministic finite automata:

## NDFA

NDFA refer to the Non Deterministic Finite Automata. It is used to transit the any number of states for a particular input. NDFA accepts the NULL move that means it can change state without reading the symbols.

NDFA also has five states same as DFA. But NDFA has different transition function.

Transition function of NDFA can be defined as:

^{Q}

### Example

See an example of non deterministic finite automata: