Exercise 3.1.1 in the text (3 parts)

Write a regular expression for all strings of 0’s and 1’s having an odd number of 1’s.

Write a regular expression for all strings of 0’s and 1’s that are of odd length.

Write a regular expression for all strings of 0’s and 1’s in which the total number of zeros to the left of each 1 is even.

Write a regular expression for all strings of 0’s and 1’s in which at least one copy of the substring 00 occurs before any copy of the substring 11 occurs in the string. If there is no occurrence of the substring 11 then there need not be any copy of the substring 00.

Write a regular expression for all strings of 0’s and 1’s in which there is an odd number of 0’s between any two 1’s.

Write

__either__a regular expression or an e-NFA for the language consisting of all strings of 0’s and 1’s such that at every point in the string the number of 1’s minus the number of 0’s is zero, one, or two. (One of these is easier than the other one.)