There is a question about the following language is finite or not in my class
{w : w is a regular expression for {ambn:m+n≤k}} where k is a specific natural number.
I think it is finite, because there can be at most (K+1)*k/2
words in the language, but the reference answer is w is infinite
can anybody explain it
ps: is there only one regular expression for a particular regular language?
If I interpret your question correctly, then yeah, it's infinite. We're looking for the number of different regular expression that match, let's say, 3 character strings 'a' and 'b' where all the 'a's come first. Different regexp languages can vary in their allowed syntax but all of them have some kind of union operator. We could be really pathological and change an 'a' in your pattern to ('a' | 'a'), which reduces to 'a' of course but it's a new way to write it. There are then an infinite number of ways to write that pattern by continuing to expand in the same way.