Beruflich Dokumente
Kultur Dokumente
Main focusState
What is a state? Current State decides what a system does next To and Extend every machine made by human is finite
So FSA is characterized by
Finite set of states Transition Function
Figure above shows an automaton with input alphabet {0,1} Automaton stops when input string is completely processed
Note: is not defined for every possible pair If machine is in q2 state and input symbol is 1 automata stops in error
Accept states with even no of ones Since initial state itself is accepting accepts empty strings
Accepts {0,1}+ but not empty string E.g in Linguistics gerund form
Accepts strings with equal number of 0s and 1s Trapforms the rejecting state
of
possible
Branches possible transitions available to the machine at that stage of computation. Computations eventually terminates (after exactly n transitions, if there are n input symbols) at a leaf of the computation tree.
The machine may accept reject the same input in different cases
If all leaves correspond to accepting statesthe input can be defined as accepted If all leaves correspond to rejecting statesthe input can be defined as rejected.
When some computation paths lead to acceptance and others to rejection Accept input
This change allows transition functions that map state/character pairs to zero, one, or more next states. So a finite automaton is deterministic whenever we have I (q, a) l less than or equal to 1 for all q Q and a E.
Non determinism
The strength of a nondeterministic finite automaton resides in its ability to choose the right path with perfect accuracy under the rules of nondeterminism.
The nondeterministic automaton just "gobbles up" symbols until it guesses that there are only three symbols left, at which point it also guesses which ending the string will have and proceeds to verify that guess
Some guesses may be wrong But the input string is accepted if there is atleast one accept state
NDFSA Checking
DFSA Computing
Nondeterministic automaton only verify a simple guess to establish that the string is in the language Whereas the deterministic automaton must painstakingly process the string
Nondeterminism allows a machine to make efficient decisions whenever a series of guesses leads rapidly to a conclusion.
Depending on the context verifying can some times be simple or sometimes as hard as actual solving the answer
So the question whether NDFSA is more powerful that FSAthe answer is NO..
Whatever a nondeterministic automaton can do can also be done by a (generally much larger) deterministic finite automaton;
Thus the attraction of nondeterministic finite automata resides in their relative simplicity.
Theorem 3.1 : For every nondeterministic finite automaton, there exists an equivalent deterministic finite automaton (one that accepts same language). Proof : For the nondeterministic finite automata (, Q, F, q0, ) ,We construct an equivalent deterministic automaton, (, Q, F, q0, ) as follows: = Q=2 Q F={ s Q | s F !=} q0= {q0}
The key idea is to define one state of the deterministic machine for each possible combination of states of the nondeterministic one-hence the 2IQI possible states of the equivalent deterministic machine.
Let at some stage in computation ,the next input symbolto the machine is a. If the nondeterministic machine can be in any of states qi1, qi2, . ., qjk, at that step so that the corresponding deterministic machine is then in state {qi1, qi2 , . ., qjk, }, then it can move to any of the states contained in the sets (qi1, a), (qi2, a)... I(qik,,a)
Let at some stage in computation ,the next input symbolto the machine is a. If the nondeterministic machine can be in any of states qi, qi2, . ., qjk, at that step so that the corresponding deterministic machine is then in state {qi,, qi2 , . ., qjk, }, then it can move to any of the states contained in the sets (qi1, a), (qi2, a)... I(qik,,a)
An NFA given by
The conversion takes a NFA with n states and creates a DFA with 2' states, an exponential increase. Many of these states may be useless, because they are unreachable from the start state
An transition is a transition that does not use any input The automaton simply "decides" to change states without reading any symbol Used only in NFA
Assume that we are given a finite automaton with transitions; let its transition function be . can be reached by
1. zero or more transitions; followed by 2. one transition on a; followed by 3. zero or more transitions.
This is the set of all states reachable from state q in our machine while reading the single input symbol a; we call ' the -closure
of .
5, 6, 7, 8, 9, 10}
Theorem : For every finite automaton with transitions, there exists an equivalent finite automaton without transitions. Proof: We are given a NFA with transitions and with transition function We construct ' as defined earlier.
Our new automaton has the same set of states, the same alphabet, the same starting state, and (with one possible exception) the same set of accepting states, but its transition function is now ' rather than and so does not include any moves.
Finally, if the original automaton had any (chain of) a transitions from its start state to an accepting state, we make that start state in our new automaton an accepting state.
Design finite automata for the following languages over {O, 1}: 1. The set of all strings where no pair of adjacent Os appears in the last four characters. 2. The set of all strings where pairs of adjacent Os must be separated by at least one 1, except in the last four characters.