Question #1.

1. Say that L is regular over 0, 1. Is the set, {x|x = 0y,y ∈L } also regular?

2. For two regular languages
(a) Is M*L=L*M for any alphabet?
(b) Is it true if the alphabet is only {0,1}?
(c) Is it true if the alphabet is only {0}?

3. If L is regular, is the language of all prefixes of L regular? How about all the suffixes of L?
Example: If L={abc,d} then the prefix language of L is {abc,ab,a,e,d}. The suffix language of L is {e,c,cb,cba,d}.

Answer #1.

To determine whether the set {x | x = 0y, y ∈ L} is regular, we can follow these steps:

Step 1: Recall that L is regular over the alphabet {0, 1}. This means that there exists a regular expression, finite automaton, or regular grammar that recognizes L.

Step 2: Consider the set {x | x = 0y, y ∈ L}. This set consists of all strings x that start with a 0 and are followed by a string y that belongs to L.

Step 3: We can observe that the set {x | x = 0y, y ∈ L} can be recognized by modifying the existing regular expression, finite automaton, or regular grammar for L. We can add a transition from the initial state that consumes a 0 in the input, and then follow the existing transitions for L. This modification ensures that the string x starts with a 0, as required.

Step 4: Since we can modify the existing recognition mechanism for L to recognize the set {x | x = 0y, y ∈ L}, it follows that the set {x | x = 0y, y ∈ L} is regular.

Therefore, if L is a regular language over the alphabet {0, 1}, the set {x | x = 0y, y ∈ L} is also regular.

Answer #2.

(a) To determine whether M*L = L*M for two regular languages, we need to understand the definition of M*L and L*M. Here, M*L denotes the concatenation of zero or more strings from M, and L*M denotes the concatenation of zero or more strings from L.

If M and L are regular languages over any alphabet, it is NOT guaranteed that M*L = L*M. These two expressions represent different sets of strings, and their equality would depend on the specific languages M and L.

(b) If the alphabet is {0, 1}, the answer remains the same as mentioned in part (a). The alphabet does not affect the equality of M*L and L*M for regular languages.

(c) If the alphabet is {0}, there is a specific case where M*L = L*M. This happens when M = L = {0}, meaning both M and L consist only of the string "0". In this case, M*L = L*M = {ε, 0}, where ε represents the empty string.

Answer #3.

To determine whether the language of all prefixes of L is regular, we can follow these steps:

Step 1: Recall that L is regular. This means that there exists a regular expression, finite automaton, or regular grammar that recognizes L.

Step 2: The language of all prefixes of L consists of all strings that can be obtained by taking any prefix of a string in L. In other words, if w is a string in L, then any prefix of w is also in the language of all prefixes of L.

Step 3: We can observe that the language of all prefixes of L can be recognized by modifying the existing regular expression, finite automaton, or regular grammar for L. We can add transitions to the initial state and other states to accept any prefixes of strings that are recognized by the original mechanism.

Step 4: Since we can modify the existing recognition mechanism for L to recognize the language of all prefixes of L, it follows that the language of all prefixes of L is regular.

Therefore, if L is a regular language, the language of all prefixes of L is also regular.

Similarly, to determine whether the language of all suffixes of L is regular, we can follow a similar approach by modifying the existing mechanism for L to recognize the language of all suffixes. If we can modify the mechanism, the language of all suffixes of L will also be regular.