views:

90

answers:

3

Hello all

I got this question which asks me to figure out why is it foolish to write a regular expression for the language that consists of strings of 0's and 1's that are palindromes( they read the same backwards and forwards).

part 2 of the question says using any formal mechanism of your choice, show how it is possible to express the language that consists of strings of 0's and 1's that are palindromes?

+1  A: 

Hint: what kind of language are regular expressions designed to parse?

Since it's a homework question, I'm not going to give you a full answer - you'll learn more by working out the complete answer yourself, not to mention probably comply with whatever academic code of ethics your learning institution has. ;)

Amber
+1  A: 

You need to prove the nonregularity of the language you described. There are many ways to do this, but here's a link to one method.

Scroll down to pumping lemma. This is pretty straightforward using that proof technique.

Hint: If a language can recognize binary palindromes, it can recognize 101, 11011, 1110111, ....

Stefan Kendall
+2  A: 

I'm just going to link to reading materials on Wikipedia:

polygenelubricants