(a) To prove that there does not exist a DFA that accepts L, we will use the Pumping Lemma for regular languages. Assume that there exists a DFA for L and let p be the pumping length of L. Consider the string s = 0^(p+1)1^p which is in L as it has more 0s than 1s. According to the Pumping Lemma, s can be divided into three parts, s = xyz, such that |y| > 0, |xy| <= p, and for all i >= 0, xy^iz is in L.
Since |xy| <= p, the string y consists only of 0s (let's say y has k 0s). Now, consider the string xy^2z. This string has (p+1+k) 0s and p 1s, and the number of 0s is (p+1+k) - p = 1+k, which is greater than the number of 1s. Thus, xy^2z is in L. However, if we increase the number of occurrences of y by adding more 0s, eventually, we will have an equal number of 0s and 1s in the string. This string is not in L, which contradicts the Pumping Lemma. Therefore, there does not exist a DFA that accepts L.
NFAs are not more powerful than DFAs in terms of the languages they can recognize. An NFA can always be converted to an equivalent DFA. Thus, if a DFA does not exist for L, neither does an NFA.
(b) We will now design a Turing Machine (TM) to accept L. Here is a brief description of the TM and a high-level overview of the states and transition functions.
-
Start state (q0): Read the input tape from left to right. If a 0 is encountered, move to state q1. Else, if the 1 is encountered, move to the reject state (qR).
-
State q1: Move right until a 1 is encountered. Replace the 1 with a ∗, and move back to the left-most 0 to start matching again.
-
State q2: After encountering a ∗, move left until a 0 is encountered. Replace the 0 with a #, and move right to the next unmatched 1.
-
State q3: Move right until an unmatched 1 is encountered. Replace the 1 with a ∗ and move back to the left-most 0 to start matching again.
-
State q4: If there are no 0s left to match, move right until a blank is encountered. If a 1 is encountered before the blank, move to the accept state (qA). If an unmatched 1 is encountered after a blank, move to the reject state (qR).
-
Accept state (qA): Erase the remaining input and leave the tape as blank.
-
Reject state (qR): Erase the input, leaving a single 1 on an otherwise blank tape.
The Turing Machine operates as follows:
q0 - On input 0, replace with #, move Right, and go to q1
q1 - On input 0, move Right
q1 - On input 1, replace with a ∗, move Left, go to q2
q2 - On input 0, replace with #, move Right, go to q3
q2 - On input ∗, move Left
q2 - On input #, move Left
q3 - On input 0, move Left, and return to q1
q3 - On input 1, replace with a ∗, move Left, go to q2
q4 - On input ∗, move Right
q4 - On input Blank, go to qA
qA - On input ∗, replace with Blank, move Left, go to qR
qA - On input 1, replace with Blank, move Left
qR - On input Blank, move Right
qR - On input 1, stay, and halt