If I want a language where the entries are in the form of $\gamma A^{n+2}\gamma A^{n+2}...\gamma A^{n+2}$, is it possible to write a regular expression as $(\gamma A^{n+2})^*$, or is it weird to have that '$n+2$? The languages are different for each case on $n$; for example when $n=1$, the language can be expressed by $(\gamma AAA)^*$ and when $n=3$, the language can be expressed by $(\gamma AAAAA)^*$. I don't want to write as $(\gamma AAAA^*)^*$ since I want the number of $A$s in every interval be exactly $n+2$ for each case of $n$. Thank you for the help.
2026-03-26 19:14:24.1774552464
Superscript in regular expression
117 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
I think the notation is fine as long as you make it clear that the $n$ is fixed for each language. Something like $L_n = (\gamma A^{n + 2})^*$ would be fine. And it's probably good to have an example like $n = 3$ as in the question.
You seem to be confused about how a DFA/NFA can keep track of the count $n$. It is not that finite automata cannot count, it's more that they can only count constrained by a finite memory, in terms of the states. As long as you fix $n$, you only need finite memory to count up to $n$. But if you allow $n$ to vary, the language $\bigcup_n L_n$ is not regular.