Determining what a regular expression does

56 Views Asked by At

I am given the regular expression

$(\lambda|a)(\lambda|bb)(\lambda|ccc)$

and I'm trying to describe what this set does in the form $\{x|\text{x begins and ends with a}\}$ or something similar. This set is giving me trouble. I am trying to split this up into sets, so like this:

$(\{\lambda,a\})(\{\lambda,bb\})(\{\lambda,ccc\})$

From there I concatenate to get:

$\{\lambda, a, bb, ccc, abb, accc, bbccc, abbccc\}$

But from here I can't really tell what this set is doing in terms of set-builder notation. Can anyone help me figure out what the description of this set would be?

1

There are 1 best solutions below

0
On

To be honest, the description as a product of three languages looks like the simplest description. If you really insist to have a different description, you could do the following. Let $$ L = \{u \in \{a,b,c\}^* \mid \text{the letters of $u$ occur in strict alphabetic order} \} $$ Thus $L = \{\lambda, a, b, c, ab, ac, bc, abc\}$. Now your language is $f(L)$ where $f: \{a,b,c\}^* \to \{a,b,c\}^*$ is the homomorphism defined by $f(a) = a$, $f(b) = bb$ and $f(c) = ccc$.