Give an example of two languages that are not recognisable such that their union is recognisable?

94 Views Asked by At

I have this question:

Give an example of two languages that are not recognisable such that their union is recognisable. Justify your answer (you are allowed to use any properties of the class Rec $A^∗$ of recognisable languages over an alphabet $A$).

i.e. $A \notin Rec A^*$ and $B \notin Rec A^*$ but $A \cup B \in Rec A^*$

Not quite sure how to answer it. I know I should provide my workings so far, but as it's simply "state an example", and I don't know an example, I find it hard to provide any workings...

Although I imagine it is something simple, like $A = {\phi}$ and $B = \{a\}$ or something?

Thanks for any help.

1

There are 1 best solutions below

0
On

I found a great example elsewhere on this website HERE, but it took me a while to find it as it used different language to how I have studied it.

Let there be two languages, neither recognisable:

$$L_1 = [a^i b^j : j \leq i]$$ and $$L_2 = [a^i b^j : i < j]$$

Their union is:

$$L_1 \cup L_2 = [a^* b^*]$$ This is rational, therefore recognisable (by Kleene's Theorem).