0
$\begingroup$

I'm trying to understand a point in my textbook:

We let $R^k$ be the shorthand for the concatenation of k R's with each other.

From my understanding then, $R^2$ would be the set containing all strings over R of length 2. There was a problem at the back of the book that asked to write a regular expression for the language: $ \{w|$ the length of w is at most 5 $\}$

I guessed this would be: $\epsilon \cup \Sigma^5 \cup \Sigma^4 \cup \Sigma^3 \cup \Sigma^2 \cup \Sigma $

However, I found online the answer to be listed as: $ (\epsilon \cup \Sigma)^5 $

Therefore, does $\Sigma^5$ include $\Sigma^{5}, \Sigma^{4}...,\Sigma$? Or was their answer incorrect?

1 Answers 1

0

The answer you found online is correct as well as your answer. By the way this is another argument to prefer an algebraic notation. If you denote the language reduced to the empty word by $1$ and you write $+$ for union, and observing that $L + L = L$, the formula becomes $$ (1 + \Sigma)^5 = 1 + \Sigma + \Sigma^2 + \Sigma^3 + \Sigma^4 + \Sigma^5 $$