a) all string contain substring 00
regular expression = Anything 00 Anything = (0+1)*00(0+1)*
b)all string contain atmost two 0's
regular expression = only 2 zeros + only 1 zero + No zero = Anthing 0 Anything 0 Anything + Anything 0 Anything + Anything = 1*01*01* + 1*01* + 1*
here anything means that is made of only 1's bcoz we have to restrict 0 (only two or less) so anything cannot include 0.
c) all string contain atleast two 0's
regular expression = Anything 0 Anything 0 Anything = (0+1)*0(0+1)*0(0+1)*
d) all strings that begin and end with either 0 or 1
regular expression = either 0 or 1 Anything either 0 or 1 = (0+1)(0+1)*(0+1)