Question 4
1. Here is a question on regular languages just to get you in shape for the final exam.
Suppose that $L$ is a regular language and $w$ is any word, not necessarily in $L$. We
define the set
$L/w = \{ x \in \Sigma^* | xw \in L \}$ .
Show that $L/w$ is regular.
2. Suppose that $G$ is a context-free grammar. Show that the question \"Is $L(G)$ regular?\"
is undecidable. Here is a possible approach. Let $N$ be some language that is known to
be context-free but not regular (for example, $\{a^nb^n | n \ge 0\}$). Now consider the language
$L = (N#\Sigma^*) \cup (\Sigma^*#L(G))$, where # is some symbol that is not in $L(G)$ or $N$. Prove
that $L$ is always context-free but is regular if and only if $L(G) = \Sigma^*$. This, by itself,
does not complete the question, so you have to complete all the remaining steps as well
as proving the claim. Also, you should think about why I put part (1) together with
this question? You are free to ignore this hint, but if you do so, I will mark you just
as rigorously as the people who used the hint.