Help understanding Non-determinate Finite Automaton

In summary, the conversation discussed the understanding and evaluation of a string against a non-deterministic finite automaton with epsilon transitions. The diagram provided represents the regular expression a*b*c* and the question arose whether the string "cb" should match. It was concluded that epsilon transitions activate states for the purpose of accepting symbols, and in this case, the string "cb" would not match the regular expression. The interpretation of the diagram was also discussed, stating that epsilon transitions can only go back one state.
  • #1
Trentonx
39
0

Homework Statement


There's not a particular problem, per se, just that I seem to be missing something with my understanding of how to evaluate a string against a non-deterministic finite automaton with epsilon transitions. But one I've been working with is shown below

y7UHAWX.png


Homework Equations


NA

The Attempt at a Solution


I'm told by my professor this represents the regular expression a*b*c*. As such, I wouldn't expect the machine to match on an input string of "cb". But from my understanding, it does. You can see in the image my attempt at the states the machine would enter, given each input token. And after, the machine is in at least one goal state, so it matches. But I wouldn't expect the string "cb" to match a*b*c*

It's pretty clear I don't understand how to handle the epsilon transitions. Do I follow them to all the way, as I did above? Only follow epsilons from the current state to at most one "hop" away? Should I somehow evaluate epsilons before hand, then token and more epsilons? Are epsilons filtered somehow?
 
Physics news on Phys.org
  • #2
Your interpretation seems to be that if a state cannot accept a symbol then an epsilon transition occurs. I think epsilon transitions occur without any symbol being accepted. An epsilon transition "activates" a state for the purpose of accepting symbols. Initially, the automata has states 1,2,3 active. Only state 3 can accept the "c". The "c" "blocks" states 1 and 2 so they become inactive. So after "c" is accepted, the only active state is state 3. State 3 cannot accept the "b".

If state 3 had a epsilon transistion going back to state 2 then the "b" could be accepted by state 2. However I interpret the diagram to say that epsilon transition from 2 to 3 is one-way.
 

What is a non-determinate finite automaton (NFA)?

A non-determinate finite automaton, also known as an NFA, is a type of abstract machine used to recognize patterns in a string of symbols or characters. It is commonly used in the field of computer science, particularly in the study of formal languages and automata theory.

How is an NFA different from a determinate finite automaton (DFA)?

The main difference between an NFA and a DFA is that an NFA can have multiple possible paths for a given input symbol, while a DFA has only one unique path for each input symbol. This means that an NFA can be in multiple states at the same time, while a DFA can only be in one state at a time.

What are the components of an NFA?

An NFA is made up of five main components: a finite set of states, a set of input symbols, a transition function, a start state, and a set of accept states. These components work together to define the behavior and recognition capabilities of the NFA.

How does an NFA recognize a string?

An NFA recognizes a string by starting at the start state and reading each input symbol one at a time. With each input symbol, the NFA follows its transition function to determine which state to move to next. If the NFA reaches an accept state after reading the entire string, it accepts the string as a valid input for the given pattern.

What are the applications of NFAs?

NFAs have various applications in computer science, such as in the design and analysis of algorithms, natural language processing, and lexical analysis in compilers. They are also used in fields like artificial intelligence, where pattern recognition is important.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Programming and Computer Science
Replies
2
Views
779
  • Set Theory, Logic, Probability, Statistics
Replies
5
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
13K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Programming and Computer Science
Replies
1
Views
4K
  • Atomic and Condensed Matter
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • Atomic and Condensed Matter
Replies
0
Views
490
Back
Top