A finite automaton (FA) is a mathematical description of an algorithm capable of parsing regular languages. FAs have no external memory, and as such can only take into account a fixed number of previous symbols when processing strings. A deterministic FA (DFAs) is one for which there is only ever one legal transition between states; nondeterministic FAs can be transformed into equivalent DFAs. FAs are the weakest of the commonly-defined automata.
Questions tagged [finite-automata]
585 questions
13
votes
4 answers
Can a DFA have epsilon/lambda transitions?
Can´t find anything affirmative about it. And a NFA with any epsilon transition is a epsilon-NFA ?
Thanks.

liwing
- 211
- 2
- 3
- 8
12
votes
6 answers
How should one proceed to prove (or find) if two regular expressions are same or equivalent?
For example, in an assignment given to me, we were asked to find out if two regular expressions are equal or not.
(a+b+c)* and ((ab)**c*)*
My question is how is one supposed to do that? If I draw the transition graphs for both and then run a few…

finitenessofinfinity
- 989
- 5
- 13
- 24
12
votes
2 answers
NFA minimization without determinization
It is well-known how one gets from an NFA for a regular language to a minimal DFA. However, the DFA might have an exponentially larger number of states.
What I need is a way to reduce an NFA, giving again an NFA but with a smaller number of states.…

jkff
- 17,623
- 5
- 53
- 85
12
votes
1 answer
Regex (a?)* not exponential?
I am currently looking into the problem of regular expressions which can end up running in exponential time when matched against a certain input, for example both (a*)* and (a|a)* potentially exhibit 'catastrophic backtracking' when matched against…

Jarmex
- 679
- 4
- 14
11
votes
4 answers
NFA to DFA question
First, this is not a question asking for the algorithm to convert a NFA to DFA.
It's known (and proved) that the equivalent DFA of a NFA has at most 2n states, even though most of the times it will have more or less the same number of states as the…

nunos
- 20,479
- 50
- 119
- 154
11
votes
4 answers
An infinite language can't be regular? What is a finite language?
I read this in a book on computability:
(Kleene's Theorem) A language is regular if and only if it can be
obtained from finite languages by applying the three operations union,
concatenation, repetition a finite number of times.
I am…

Roger Costello
- 3,007
- 1
- 22
- 43
10
votes
3 answers
Equivalence between two automata
Which is the best or easiest method for determining equivalence between two automata?
I.e., if given two finite automata A and B, how can I determine whether both recognize the same language?
They are both deterministic or both nondeterministic.

franvergara66
- 10,524
- 20
- 59
- 101
10
votes
1 answer
How do you construct the union of two DFA's?
Does anyone have a straightforward description of the algorithm for constructing the union of two given DFA's? For example, say we have two DFA's over {0,1} where
{w|w has an odd number of characters}
w has states A and B
delta | 0 |…

Old McStopher
- 6,295
- 10
- 60
- 89
10
votes
2 answers
Capture groups using DFA-based (linear-time) regular expressions: possible?
Is it possible to implement capture groups with DFA-based regular expressions while maintaining a linear time complexity with respect to the input length?
Intuitively I think not, because the subset construction procedure does not know which capture…

user541686
- 205,094
- 128
- 528
- 886
10
votes
3 answers
How to perform FST (Finite State Transducer) composition
Consider the following FSTs :
T1
0 1 a : b
0 2 b : b
2 3 b : b
0 0 a : a
1 3 b : a
T2
0 1 b : a
1 2 b : a
1 1 a : d
1 2 a : c
How do I perform the composition operation on these two FSTs (i.e. T1 o T2)
I saw some algorithms but couldn't…

Tasbeer
- 408
- 10
- 17
10
votes
5 answers
Should a Finite State Machine have a "nested" Finite State Machine?
You can read this question where I ask about the best architecture for a machine application for a little back story, although it's not entirely necessary for helping me with this question.
My understanding (especially for implementation) of Finite…

Max Schmeling
- 12,363
- 14
- 66
- 109
10
votes
2 answers
Shortest bitstring whose infinite repetition is different after reversal
Marvin Minsky asked me the following question during my oral exam:
As an ant walks it prints a binary number (e.g., 101) every time it takes a step. What is the minimum length, in digits, the binary number can be for it to be possible to tell…

user128807
- 10,447
- 17
- 53
- 72
8
votes
1 answer
Equation from "Programming Pearls" - can somebody explain me?
It's feel like I'm stuck, my friends. Can somebody explain me pick equations from "Pearls of Functional Algorithm Design", chapter 11 ("Not the maximum segment sum").
Here is the problem (a little bit simplified)
Let us have some states with given…

shabunc
- 23,119
- 19
- 77
- 102
8
votes
3 answers
A succinct description of NFA to DFA conversion?
Can someone much brighter than I succinctly describe to the SO community the NFA to DFA conversion algorithm? (Preferably in 500 words or less.) I've seen diagrams and lectures that have only served to confuse what I thought I once knew. I'm mostly…

Old McStopher
- 6,295
- 10
- 60
- 89
8
votes
3 answers
Can anyone please explain difference between finite state machine and finite automata?
Can anyone please explain with example what is the difference between finite state machine and finite automata?

mohan.t
- 257
- 5
- 12