Question

Given the following language:

L1 = { (ab)n | n ≥ 0 }

That is, L1 = { ε ab, abab, ababab, abababab, ... }

The question is to find what language L12 is.

My guess is that it's equal to { (ab)2n | n ≥ 0 }. Is that correct? If so, how do I prove it? If not, why not?

Thanks!

Was it helpful?

Solution

The language L12 is the language of all strings of the form xy, where x ∈ L1 and y ∈ L1. Note that x and y don't have to be the same strings; they can be chosen independently.

In fact, one option is that y = ε, since ε = (ab)0. Therefore, any string in L1 must also belong to L12, because we can always concatenate that string with ε.

Moreover, we can show that any string in L12 is also in L1. Take any string w ∈ L12. It must have the form xy for some strings x, y ∈ L1. This means that we can write w = xy = (ab)n(ab)m for some natural numbers n and m. Accordingly, w = (ab)n+m, and so w in L1.

We just proved that L1 ⊆ L12 and that L12 ⊆ L1, from which we get that L1 = L12. This means that L12 is the same language as L1.

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top