How Can I Describe an NFA that Recognizes w*wR?

  • Thread starter JimmyK
  • Start date
In summary, M3 is an NFA that accepts the language of all strings of the form w*wR by using four states and two sub-transitions for M1 and M2, with the start state being q0 and the accept state being q2.
  • #1
JimmyK
9
0
I have an example where we have an NFA that accepts w and is of the form M1=(Q, Σ, T, s1, F1) and another that accepts wR (the reversal of w) of the form M2=(Q, Σ, T, s2, F2). This is all high level, and theory based, so we don't know what w or the containing language actually is. Now, I need to describe an NFA that accepts w*wR in the same form, M3=(Q, Σ, T, s3, F3), by formally describing each element in the tuple.

I found this old PDF: http://cs.nyu.edu/courses/fall03/V22.0453-001/hw5.pdf where problem 3 looks very similar to my question and provides a solution I don't quite get.

I'm just having trouble describing what M3 would be like. I realize that in order for a string to be accepted, the set pair when finished would need to be the same state, i.e. (q0, q0), but am lost otherwise. Any insight would be appreciated.
 
Physics news on Phys.org
  • #2
Thanks.The solution to this problem is as follows: Let M3=(Q, Σ, T, s3, F3) where Q={q0, q1, q2, q3} Σ=Σ1∪Σ2 (where Σ1 and Σ2 are the alphabets of M1 and M2 respectively) T={(q0,x,q1) | x ∈ Σ1, (q1,x,q2) | x ∈ Σ2, (q2,x,q3) | x ∈ Σ1, (q3,x,q2) | x ∈ Σ2} s3=q0 F3={q2}Basically, M3 is an NFA which consists of four states: q0, q1, q2, and q3. The transition function T has two sub-transitions, one for M1 and one for M2. The transition from q0 to q1 accepts all characters from the alphabet of M1. The transition from q1 to q2 accepts all characters from the alphabet of M2. Then, the transition from q2 to q3 accepts all characters from the alphabet of M1. Finally, the transition from q3 to q2 accepts all characters from the alphabet of M2. The start state of M3 is q0 and the accept state is q2. Therefore, M3 will accept any string which has the form w*wR, where w is a string accepted by M1 and wR is the reverse of w, accepted by M2.
 

Related to How Can I Describe an NFA that Recognizes w*wR?

1. What is an NFA for recognizing w*wR?

An NFA (nondeterministic finite automaton) for recognizing w*wR is a type of finite automaton that uses a set of states and transitions to recognize a specific pattern in a string. In this case, the NFA is designed to recognize strings that are of the form w*wR, where w is any string of symbols and wR is the reverse of w.

2. How does an NFA for recognizing w*wR work?

The NFA works by reading one symbol at a time from the input string and transitioning between states based on the current symbol and the current state. If the NFA reaches an accepting state after reading the entire string, it accepts the string as being of the form w*wR. Otherwise, it rejects the string.

3. What is the difference between an NFA and a DFA?

An NFA is a type of finite automaton that can be in multiple states at once and has the ability to transition to different states based on the current input symbol and current state. A DFA (deterministic finite automaton), on the other hand, can only be in one state at a time and has a fixed set of transitions for each input symbol and state.

4. Can an NFA for recognizing w*wR recognize other patterns?

Yes, an NFA for recognizing w*wR can be modified to recognize other patterns by changing the set of states and transitions. However, the NFA will only accept strings that match the specific pattern it is designed for, in this case, w*wR.

5. What are the applications of NFA for recognizing w*wR?

NFA for recognizing w*wR can be used in various fields, such as natural language processing, bioinformatics, and compiler design. They are particularly useful in tasks that involve recognizing and extracting patterns from strings, such as text processing and data mining.

Similar threads

  • Differential Equations
Replies
2
Views
2K
  • Introductory Physics Homework Help
Replies
7
Views
2K
Replies
4
Views
2K
Back
Top