How can this be? I don't think it is actually possible for a non-regular language to be a subset of a regular language. What examples are there where this is true?
Asked
Active
Viewed 2,389 times
0
-
@Choirbean What context do you think might be required? – David Richerby May 08 '17 at 21:56
-
In fact, any infinite (regular) language has a non-regular subset. This can be obtained by forcing "growing gaps" between the length the strings in the chosen subset. – Hendrik Jan May 08 '17 at 22:03
-
Don't we have like a dozen duplicates of this? – Raphael May 08 '17 at 22:32
-
1@Raphael The right column is always helpful: Show that every infinite language has a non-regular subset. – Hendrik Jan May 09 '17 at 00:12
1 Answers
5
Every language over an alphabet $\Sigma$ is, by definition, a subset of $\Sigma^*$, which is regular. If you want a less trivial example,
$$\{a^nb^n\mid n\geq 0\}\subseteq L(a^*b^*)\,.$$

Raphael
- 72,336
- 29
- 179
- 389

David Richerby
- 81,689
- 26
- 141
- 235