Regular expressions with empty set/empty string

7.6k Views Asked by At

I was wondering if expressions such as:

$λ*$

$∅*$

$λ+∅$

$∅λ$

are considered valid expressions. If so, how can I explain them?

also if $∅λ$ is valid, does that imply $∅λ∅λ∅λ∅λ∅λ∅λ$ is valid, or $∅∅∅∅∅∅∅∅∅λ$ is also valid for example.

1

There are 1 best solutions below

2
On BEST ANSWER

Yes. One has

$$\begin{align} \lambda\ast & = \lambda\\ \emptyset\ast &= \lambda \\ X + \emptyset &= X\text{ for all $X$ } \\ \emptyset X &= \emptyset\text{ for all $X$} \\ \lambda X &= X\text{ for all $X$ } \\ \end{align}$$

These all follow directly from the definitions of the various operations. For example, $A+B$ is defined as the set of strings that are in $A$ or in $B$. When $B=\emptyset$, there are no strings in $B$, so $A+\emptyset = A$ for any $A$.

Similarly $AB$ is defined to be the set of all strings of the form $ab$ where $a\in A$ and $b\in B$. When $B=\emptyset$, there are no such strings, because there is no possible choice of $b\in \emptyset$, so $A\emptyset = \emptyset$. In particular, $\emptyset\emptyset\emptyset\emptyset\emptyset\emptyset\emptyset\emptyset\emptyset\lambda = \emptyset$.