Questions tagged [nfa]

An NFA is a nondeterministic finite automaton, a mathematical model of computation that decides membership in regular languages.

An NFA is a nondeterministic finite automaton, a mathematical model of computation that decides membership in regular languages.

It is similar to a DFA except that it is nondeterministic, and the machine can be in multiple states simultaneously. Some definitions of NFAs also allow for e-moves, in which the automaton can transition between states on no input at all.

It is known that for every NFA there is also DFA that expect the same language, thus their computation streangh is identical.

310 questions
5
votes
3 answers

DFA minimization

I have a question about DFA minimization. So I've used very well known techniques to convert regular expression into NFA and then construct DFA from it, using goto / closure algorithm. Now the question is how do I minimize it? I've watched lections…
Ruslan
  • 313
  • 1
  • 3
  • 16
4
votes
1 answer

How do we know that an NFA has a minimum amount of states?

Is there some kind of proof for this? How can we know that the current NFA has the minimum amount?
Brian
  • 199
  • 4
  • 9
4
votes
2 answers

How to figure out if a regex implementation uses DFA or NFA?

I'm facing the question, whether a certain regex implementation is based on a DFA or NFA. What are the starting points for me to figure this out. One could also ask: What am I looking for? What are the basic patterns and / or characteristics? A good…
Jan
  • 1,594
  • 1
  • 20
  • 30
4
votes
3 answers

DFA Minimization Brzozowski algorithm

I am trying to implement Brzozowski's algorithm for minimizing my DFA Following is the algorithm for the same. DFA = d(r(d(r(NFA)))) where r() is reversal of NFA and D() converts NFA to DFA. But I do not understand what is the meaning of r()…
Avinash
  • 12,851
  • 32
  • 116
  • 186
4
votes
1 answer

Difference between Transducer and NFA

Can someone tell me how a Transducer differs from a NFA?
samsamara
  • 4,630
  • 7
  • 36
  • 66
4
votes
2 answers

Has anyone used RE2 in a C# application?

I started my search a for a decent Regular Expression engine. It landed me to this page Benchmark of Regex Libraries. I decided to use RE2 because it seems to be the best FSA engine in this list. My final application will be built using WPF in…
Pranav Shah
  • 3,233
  • 3
  • 30
  • 47
4
votes
1 answer

Syntax for Describing DFA or NFA

Do there exists any Standard Syntax for Describing the Transition Table for an NFA or DFA ?
Neel Basu
  • 12,638
  • 12
  • 82
  • 146
4
votes
1 answer

Can you skip epsilon transitions in union expression (Thompson's construction algorithm)

In the picture below can I use both NFA interchangeably? If not then why?
Dennis Grinch
  • 353
  • 3
  • 13
4
votes
2 answers

NFA for (a+b)?c

I need NFA for regex (a+b)?c As far as I understand, it should contains epsilon from zero node to node before last one (to match string "c", for example). To check my NFA I use "Regular Expression to NFA Visializaton web service", but graph for my…
Vitaly
  • 2,552
  • 2
  • 18
  • 21
4
votes
6 answers

Confused on a basic operation of regular expressions

I have a rather basic question about regexes. I use the expression .* without thinking about it match expecting to match e.g. up to the end of the line. This works. But for some reason I started thinking about this expression. Checking Wikipedia (my…
Jim
  • 18,826
  • 34
  • 135
  • 254
4
votes
1 answer

how to intuitively think while Designing an NFA

I don't know whether this question is right to be asked, But I definitely felt that it should be asked. I did see a lot of nice and informative questions, articles on inter-net and on StackOverflow itself, of-course. But I found all the questions…
neerajDorle
  • 540
  • 7
  • 21
4
votes
3 answers

Show that the following set over {a,b} is regular

Given the alphabet {a, b} we define Na(w) as the number of occurrences of a in the word w and similarly for Nb(w). Show that the following set over {a, b} is regular. A = {xy | Na(x) = Nb(y)} I'm having a hard time figuring out where to start…
4
votes
2 answers

Ambiguity in transition: How to process string in NFA?

I have made DFA from a given regular expression to match the test string. There are some cases in which .* occurs. ( for example .*ab ) . Let say now the machine is in state 1. In the DFA, .* refers to the transition for all the characters to…
Tejas Joshi
  • 197
  • 3
  • 12
3
votes
3 answers

library for converting regular expressions to NFAs?

Is there a good library for converting Regular Expressions into NFAs? I see lots of academic papers on the subject, which are helpful, but not much in the way of working code. My question is due partially to curiosity, and partially to an actual…
Limbic System
  • 6,820
  • 7
  • 29
  • 37
3
votes
1 answer

Inserting a regular language into other regular language

Let L1 and L2 be the regular languages over the alphabet {a,b}. We define the language L3 as follows: L3 = {pqr | pr ∈ L1, q ∈ L2} L3 is obtained by inserting a string from L2 inside a string from L1. Is language L3 is still regular or not? I am…
1 2
3
20 21