M HYPE SPLASH
// general

Context free grammar: Meaning of notation ww^R

By Abigail Rogers
$\begingroup$

A common example in CFG is the palindrome example. These examples often contain the $\ ww^R$ notation for the string.

An example from my class could be:

Strings $\ ww^R$ over the alphabet $\ \Sigma = \{0,1 \} $ (a subset of palindromes over $\ \Sigma $), or

$$\ L=\{ww^R | w = (a + b)^+ \}$$

My confusion lies in the notation $\ w^R $, i don't understand what the purpose of this is.

$\endgroup$ 2

1 Answer

$\begingroup$

$w^R$ is simply the string $w$ reversed. For example, if $w = abb$, then $w^R = bba$. It is easy to see then that the strings of the form $ww^R$ are exactly the palindromes, such as $abbbba$.

$\endgroup$ 1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy