I have a small task, part of my homework, which tends to confuse me because of its simplicity. It makes me think that I am missing something.
I have to find the number of elements in the set {w | w ∈ L(R) and |w| = 10}. I have the regular expression R = (0 ∪ 1)∗0101∗.
My intuitive answer would be that the cardinality of this set is 10, because |w| = 10.
Is this correct and what am I missing if it is not?
thanks
The string is any pattern of length $n$ followed by $010$ followed by $10-n-3$ $1$'s, for $n$ in $(0,7)$.
This amounts to $1+2+4+8+16+32+64+128=255$ strings.
They are all different as for a given suffix ($0101*$) all prefixes are different, and all allowed suffixes are different.