# Checking whether union of two languages is regular

How to check if

$$L = \{c^ka^nb^n \mid k>0 \wedge n\geqslant0\} \cup \{a, b\}^*$$

is regular ,where

$$L_1 = \{c^ka^nb^n \mid k > 0 \wedge n\geqslant0\}$$ is clearly not regular and $$L_2 = \{a, b\}^*$$ is... ?

• Closure under union – VimForLife May 2 '20 at 8:21
• so when L1 is not regular, and L is the union of L1 and L2 , automaticly L isn't regular ? – Stukata May 2 '20 at 8:24
• Correct! You cannot build (e.g. DFA) the union of a regular and non-regular language. – VimForLife May 2 '20 at 8:28
• Wrong. For example, $\{a^nb^n \mid n \geq 0\} \cup a^*b^*$ is regular. – Yuval Filmus May 2 '20 at 9:18
• Look for a sub-language easy to prove non-regular. – greybeard May 2 '20 at 18:32

## 1 Answer

If $$L$$ were regular than so would the following language be: $$L \cap ca^*b^* = \{ ca^nb^n \mid n \geq 0 \}.$$ You can show that the latter language is not regular in various ways.

• Thank you for editing the post, ill learn to use the website so i can make better posts! And thanks for the suggestion! – Stukata May 2 '20 at 11:22