I need to compute the decomposition of binary strings that have an even number of blocks. I know general form of decomposition is $1^*(00^*11^*)^*0^*$. My question is How I can modify this decomposition to get what I need? Thanks
Decomposition of binary strings that have an even number of blocks
1
$\begingroup$
combinatorics
binary
-
0Could you clarify the term *block*? – 2017-02-25
-
0a block is a maximal run of 0's or 1's. For example "11100100" has 4 blocks. – 2017-02-25
1 Answers
1
If we collapse blocks to a single character we are asking for strings having even length and runs of length $1$ only. These are \begin{align*} (01)^*\cup(10)^*=\{\varepsilon,01,10,0101,1010,010101,101010,\ldots\}\tag{1} \end{align*}
Expanding each character in (1) by one or more occurrences of it $$0\longrightarrow 0^+\qquad\text{and}\qquad 1\longrightarrow 1^+$$ generates strings with an even number of blocks:
\begin{align*} (0^+1^+)^*\cup(1^+0^+)^* \end{align*}
-
0Thanks, it's exactly what I need. – 2017-02-26
-
0@scottgreen: You're welcome! :-) – 2017-02-26