Take the 2-minute tour ×
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It's 100% free, no registration required.

I'm trying to study for an exam and having difficulty with the following practice questions. Any help would be appreciated.

  1. Give a language $L$ such that $L$ is not recursive but $\text{prefix}(L)$ is regular.
  2. Give two languages $L_1$ and $L_2$, such that $L_1$ and $L_2$ are not recursive, but $L_1\cap L_2$ is recursive.
  3. Give a language $L$ such that $L$ is regular but $\text{unary}(L)$ is not context-free.
share|improve this question
add comment

1 Answer

Tips.

  1. Any (infinite) unary language has regular prefix language.

  2. $L_1 = a \cdot K$ and similary $L_2 = b \cdot K$ where $K$ is a well-chosen horrible language.

Question.

What is unary($L$)? If it is what I think, there is an easy example. Powers of two are not context-free: $\{ a^{2^n} \mid n\ge 1\}$.

share|improve this answer
    
The tips were helpful. Thanks –  San Nov 28 '12 at 1:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.