How to construct a pushdown automata for L= { w ∈ {a, b}* | w does not equal xx^R for some x ∈ {a, b}* }?

172 Views Asked by At

How to construct a pushdown automata for L= { w ∈ {a, b}* | w does not equal xx^R for some x ∈ {a, b}* }

1

There are 1 best solutions below

0
Frank Yellin On

I'm assuming you want a non-deterministic push-down automaton. I don't think this is doable with a deterministic PDA.

This sounds like a homework problem, so I'm only going to give a general outline:

You essentially guess where the center of the string is. You push elements onto the stack, until at some point you guess that you've reached the center of the string. You then start comparing your input to elements that you're popping off the stack. You fail if they don't match. You succeed if you reach the end of the input exactly as the stack is empty.