combinatorics question: binary string

199 Views Asked by At

I am looking for an expression that uniquely determines the following set

  1. $S$ consists of binary strings starting with $0$, and the each block $0$'s has odd length and each block of $1$ has even length

  2. $S$ contains binary strings where each block of $1$'s is at most $3$ or at least $7$.

My attempt: For the first one, I get $(00)^*0\big((11)^*11(00)^*0\big)^*1^*$, does this looks good? For the second, I was trying $$0^*\left((1+11+111+(1111111)1^*)0^*0\right)^*(1+11+111+(1111111)1^*+e)$$But I am not quite sure if this is correct or not...does this uniquely determine the set?

Thanks!!

1

There are 1 best solutions below

1
On

There is still a slight error in the first one, since the last block of $1$'s could have odd length. Thus I suggest $$ (00)^*0\left((11)^*11(00)^*0\right)^*(11)^* $$