So I need to find the explicit formula for the number of the non empty 0-1 strings that have an even number of blocks. 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∗
And have found that,
If we collapse blocks to a single character we are asking for strings having even length and runs of length 1 1 only. These are (01)∗∪(10)∗={ε,01,10,0101,1010,010101,101010,…} call this (1)
Expanding each character in (1) by one or more occurrences of it 0⟶0+and1⟶1+
generates strings with an even number of blocks:
(0+1+)∗∪(1+0+)∗
so far it makes sense, but now how would I go about finding an explicit formula?
I am currently stuck trying to find the generating function,
if the generating function of (0+ 1+)* = 1 / (1-x)^2 and then similarly the generating function of (1+ 0+)* is also 1 / (1-x)^2
then the complete generating function of (0+1+)* ∪(1+0+)* would be [ 1 / (1- (1-x)^2) ]^2 ?