0

$ L = \{ww^{R} \in \{a, b\}^{*} : |w|_{a} \equiv |w|_{b} \equiv 0$ $ (mod$ $13) \} $

Exercises: If the language L is regular (build a DFA or regular expression) else if the language L is context-free (build a grammar or PDA) else if the language L is not context-free (Prove)

so

We know that $ww ^ {R}$ without any restrictions isn't regular, but it is context-free. but with additional above restrictions $ L = \{ww^{R} \in \{a, b\}^{*} : |w|_{a} \equiv |w|_{b} \equiv 0$ $ (mod$ $13) \} $ I have no idea how to prove this. I think this language still isn't regular :

Let's take $n, m > p$ where $p$ is from pumping lemma and $n mod 13 = 0$ and $m mod 13 = 0$ and chose word $s = a^{m}b^{n}b^{n}a^{m}$ and use the pumping lemma that is not regular. Well?

Any idea?

PoliteMan
  • 53
  • 6

1 Answers1

0

Let $$ P = \{ww^{R} : w\in \{a, b\}^{*} \} $$ $$R_a=\{u\in \{a, b\}^{*} : |u|_{a}\equiv 0\ (\text{mod}13) \} $$ $$R_b=\{u\in \{a, b\}^{*} : |u|_{b}\equiv 0\ (\text{mod}13) \} $$

We know $P$ is context-free.

We know $R_a$ is regular and $R_b$ is regular. So $R_a\cap R_b$ is regular.

So, $L=P\cap (R_a\cap R_b)$ is context-free.


Exercise 1. (One minute or less) Verify that $L=P\cap (R_a\cap R_b)$.

Exercise 2. Show that $R_a$ is regular.

John L.
  • 39,205
  • 4
  • 34
  • 93