FACTOID # 12: Americans and Icelanders go to the cinema 5 times a year, on average. The average Japanese person goes only once.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > Nondeterministic finite automaton

In the theory of computation, a nondeterministic finite state machine or nondeterministic finite automaton (NFA) is a finite state machine where for each pair of state and input symbol there may be several possible next states.


Formal definition

A NFA is a 5-tuple, (S, Σ, T, s, A), consisting of

  • a finite set called the alphabet (Σ)
  • a finite set of states (S)
  • a transition function (T : S × (Σ ∪{ε}) → P(S)).
  • a start state (sS)
  • a set of accept states (AS)

where P(S) is the power set of S and ε is the empty string.


Let M be an NFA such that M = (S, Σ, T, s, A), and X be a string over the alphabet Σ. M accepts the string X if there exist both a representation of X of the form x1x2 ... xn , xi ∈ (Σ ∪{ε}), and a sequence of states r0,r1, ..., rn, riS, meeting the following conditions:

  1. r0 = s
  2. riT(ri-1, xi), for i = 1, ..., n
  3. rnA.

The machine starts in the start state and reads in a string of symbols from its alphabet. It uses the transition relation T to determine the next state(s) using the current state and the symbol just read or the empty string. If, when it has finished reading, it is in an accepting state, it is said to accept the string, otherwise it is said to reject the string. The set of all strings accepted by an NFA is the language the NFA accepts.


The language accepted by a NFA is a regular language.


Every NFA has an equivalent deterministic finite state machine (DFA). Therefore it is possible to convert an existing NFA into a DFA for the purpose of implementing a simpler machine. This can be performed using the powerset construction which may lead to an exponential raise in the number of necessary states. Such determinization however is necessary to build a complement automaton.


Example

The following example explains a NFA M, with a binary alphabet, which determines if the input contains an even number of 0s or an even number of 1s.


M = (S, Σ, T, s, A) where

  • Σ = {0, 1},
  • S = {S0, S1, S2, S3, S4},
  • s = S0,
  • A = {S1, S3}, and
  • The transition function T can be defined by this state transition table:
0
1
ε
S0
{}
{}
{S1, S3}
S1
{S2}
{S1}
{}
S2
{S1}
{S2}
{}
S3
{S3}
{S4}
{}
S4
{S4}
{S3}
{}


The state diagram for M is:

Image:NFAexample.png

M can be viewed as the union of two DFAs: one with states {S1, S2} and the other with states {S3, S4}.


The language of M can be described by the regular language given by this regular expression:


  Results from FactBites:
 
Nondeterministic finite state machine - Wikipedia, the free encyclopedia (883 words)
In the theory of computation, a nondeterministic finite state machine or nondeterministic finite automaton (NFA) is a finite state machine where for each pair of state and input symbol there may be several possible next states.
If, when the automaton has finished reading, it is in an accepting state, the NFA is said to accept the string, otherwise it is said to reject the string.
Therefore it is possible to convert an existing NFA into a DFA for the purpose of implementing a (perhaps) simpler machine.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.