You are on page 1of 2

Problem

For any string w = w1w2 · · ·wn, the reverse of w, written wR, is the string w in reverse order, wn · · ·w2w1. For any language A, let AR = {wR| w

A}. Show that if A is regular, so is AR.

Step-by-step solution

Step 1 of 3

Let be the DFA that recognizes A,

Now we build a NFA for as follows:

• Reverse all the arrows of M

• Convert the start state for M as the only accept state for .

• Add a new start state for , and from , add transitions to each state of corresponding to accept states of M.

Comment

Step 2 of 3
Comment

Step 3 of 3

Here

• For any , there is a path following w from the start state to an accept sate in M iff there is a path following from to in

• That means that iff .

Comments (1)

You might also like