简体   繁体   中英

Regular Languages and Concatenation

Regular languages are closed under concatenation - this is demonstrable by having the accepting state(s) of one language with an epsilon transition to the start state of the next language.

If we consider the language L = {a^n | n >=0}, this language is regular (it is simply a*). If we concatenate it with another language L = {b^n | n >=0}, which is also regular, we end up with a^nb^n, but we obviously know this isn't regular.

Where am I going wrong with my logic here?

The definition of the concatenation of two languages L 1 and L 2 is the set of all strings wx where w ∈ L 1 and x ∈ L 2 . This means that L 1 L 2 consists of all possible strings formed by pairing one string from L 1 and one string from L 2 , which isn't necessarily the same as pairing up matching strings from each language.

As a result, as @Oli Charlesworth pointed out, the language you get back here isn't actually { a n b n | n in N }. Instead, it's the language { a n b m | n in N and m in N }, which is the language a*b*. This language is regular, since it's given by the regular languages.

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM